Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
-
Francine Leung
- Posts: 3
- Joined: Wed Sep 07, 2022 7:47 am
Post
by Francine Leung » Wed Mar 27, 2024 7:34 am
I am trying to optimize the stiffness value for multiple Smooth Space Half Sphere forces at the same time. Both forces are components of the model. Currently I am able to optimize the stiffness for each force individually.
How would I combine these two parameters into one?
Code: Select all
problem.addParameter(MocoParameter('r_heel', '/r_heelContact', 'stiffness', ...
MocoBounds(800000, 1000000)));
problem.addParameter(MocoParameter('r_toes', '/r_toeContact', 'stiffness', ...
MocoBounds(800000, 1000000)));
Thanks.
Tags:
-
Nicholas Bianco
- Posts: 1077
- Joined: Thu Oct 04, 2012 8:09 pm
Post
by Nicholas Bianco » Thu Mar 28, 2024 3:21 pm
Hi Francine,
I can answer here, but as Nicos suggested, these questions are better suited for the Moco forum.
You can set multiple component paths for the same MocoParameter to apply one parameter to multiple properties. You can use a different constructor for MocoParameter that accepts a vector of component paths, or use appendComponentPath():
Code: Select all
parameter = MocoParameter('r_heel', '/r_heelContact', 'stiffness', MocoBounds(800000, 1000000));
parameter.appendComponentPath('/r_toeContact');
problem.addParameter(parameter);
-Nick