MocoParameter for multiple elements

Provide easy-to-use, extensible software for modeling, simulating, controlling, and analyzing the neuromusculoskeletal system.
POST REPLY
User avatar
Francine Leung
Posts: 3
Joined: Wed Sep 07, 2022 7:47 am

MocoParameter for multiple elements

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:

User avatar
Nicos Haralabidis
Posts: 188
Joined: Tue Aug 16, 2016 1:46 am

Re: MocoParameter for multiple elements

Post by Nicos Haralabidis » Wed Mar 27, 2024 9:09 am

Hello Francine,

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

Best wishes,

Nicos Haralabidis

User avatar
Nicholas Bianco
Posts: 972
Joined: Thu Oct 04, 2012 8:09 pm

Re: MocoParameter for multiple elements

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

POST REPLY