Page 1 of 1

MocoParameter for multiple elements

Posted: Wed Mar 27, 2024 7:34 am
by fleung
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.

Re: MocoParameter for multiple elements

Posted: Wed Mar 27, 2024 9:09 am
by nicos1993
Hello Francine,

I would suggest posting your question on the dedicated Moco forum: indexPhpbb.php?group_id=1815&pluginname=phpBB

Best wishes,

Nicos Haralabidis

Re: MocoParameter for multiple elements

Posted: Thu Mar 28, 2024 3:21 pm
by nbianco
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