Elastic Foundation Parameter Optimisation

OpenSim Moco is a software toolkit to solve optimal control problems with musculoskeletal models defined in OpenSim using the direct collocation method.
POST REPLY
User avatar
Andrea Braschi
Posts: 14
Joined: Thu Mar 11, 2021 2:42 am

Elastic Foundation Parameter Optimisation

Post by Andrea Braschi » Fri May 31, 2024 10:21 am

Hi all,

I have been trying to solve a tracking problem as a MocoStudy problem.

In doing so, I am wanting to optimise the Elastic Foundation Force parameters that I have created between 2 contact geometries. However, I have met an issue that I haven't figured out yet and I was hoping to get some advice.

The problem that I'm having is defining the AbsolutePathString of the stiffness, dissipation and friction parameters.
I'll try to be more clear. this is what is given in the doxygen to register a MocoParamer to optimise muscle optimal length:

Code: Select all

study = opensim.MocoStudy();
problem = study.updProblem();
param = opensim.MocoParameter('my_param_name', '/forceset/soleus_r', 'optimal_fiber_length', opensim.MocoBounds(0.04, 0.06))
In my case, when I try to register the stiffness parameter of the force, I do the following:

Code: Select all

stiffness = osim.MocoParameter('pb1_stiffness', '/forceset/pb1_force', 'stiffness', osim.MocoBounds(250000, 800000))
However, I get an error that says that no 'stiffness' parameter is found in the provided path. This makes sense as stiffness and the other parameters (not the transition velocity) is actually under the tag `ElasticFoundationForce::ContactParametersSet` in the .osim file. I have already tried to give path strings such as `/forceset/pb1_force/contact_parameters`, but didn't work.

Any suggestion?

Thanks in advance for you help!

Andrea

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

Re: Elastic Foundation Parameter Optimisation

Post by Nicholas Bianco » Sat Jun 01, 2024 12:53 pm

Hi Andrea,

I think the issue is that the 'stiffness' property is stored inside 'contact_parameters', which is not a subcomponent of ElasticFoundationForce but rather a property of it. I don't think properties nested inside other properties will work in Moco, unfortunately.

I'll open a GitHub issue to track this bug for now. Sorry that I don't have an alternative solution for you at the moment.

Best,
Nick

User avatar
Andrea Braschi
Posts: 14
Joined: Thu Mar 11, 2021 2:42 am

Re: Elastic Foundation Parameter Optimisation

Post by Andrea Braschi » Mon Jun 03, 2024 4:06 am

Hi Nick,

many thanks for letting me know.

If you could please share the link to the GitHub issue once you create it, that'd be very appreciated. I can keep up with the developments in that case.

All the best,
Andrea

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

Re: Elastic Foundation Parameter Optimisation

Post by Nicholas Bianco » Tue Jun 04, 2024 10:40 am

Hi Andrea,

The GitHub issue is here: https://github.com/opensim-org/opensim-core/issues/3797.

Best,
Nick

User avatar
Andrea Braschi
Posts: 14
Joined: Thu Mar 11, 2021 2:42 am

Re: Elastic Foundation Parameter Optimisation

Post by Andrea Braschi » Wed Jun 12, 2024 11:03 am

Hi Nick,

many thanks for sharing it.

Best wishes,
Andrea

POST REPLY