Page 1 of 1

Elastic Foundation Parameter Optimisation

Posted: Fri May 31, 2024 10:21 am
by andreabraschi
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

Re: Elastic Foundation Parameter Optimisation

Posted: Sat Jun 01, 2024 12:53 pm
by nbianco
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

Re: Elastic Foundation Parameter Optimisation

Posted: Mon Jun 03, 2024 4:06 am
by andreabraschi
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

Re: Elastic Foundation Parameter Optimisation

Posted: Tue Jun 04, 2024 10:40 am
by nbianco
Hi Andrea,

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

Best,
Nick

Re: Elastic Foundation Parameter Optimisation

Posted: Wed Jun 12, 2024 11:03 am
by andreabraschi
Hi Nick,

many thanks for sharing it.

Best wishes,
Andrea