MocoParameter gives a wrong stiffness for PathSpring

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
Sepehr Ramezani
Posts: 35
Joined: Tue Nov 05, 2019 2:02 pm

MocoParameter gives a wrong stiffness for PathSpring

Post by Sepehr Ramezani » Mon Feb 20, 2023 11:23 am

Hi everyone,
I'm using MOCO parameter to optimize stiffness of PathSpring() actuator.
Model is working in FD, optimization converges, parameters_require_initsystem is disable, Matlab 2022, Opensim 4.4
The problem is optimized parameter is always the average of it's boundary [min max] regardless of task. It's a same problem that I discussed before here
viewtopicPhpbb.php?f=1815&t=13982&p=430 ... t=0&view=
I also found the same problem when I was trying to optimized wrapping object. It's seems it's wide issue happens not only for Muscle() also for other actuators. I was wondering if you have considered this issue for next version.
Or specifically if you can give me some hints to solve this on my own fork for PathSpring() for <resting_length> and <stiffness>.
Best,
Sepehr

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

Re: MocoParameter gives a wrong stiffness for PathSpring

Post by Nicholas Bianco » Tue Feb 21, 2023 3:24 pm

Hi Sepehr,

It looks like this issue is different from the muscle properties issue you linked, since the force calculations in PathSpring use the rest length and stiffness properties directly.

Could you provide more information about the problem you are trying to solve?

Best,
Nick

User avatar
Sepehr Ramezani
Posts: 35
Joined: Tue Nov 05, 2019 2:02 pm

Re: MocoParameter gives a wrong stiffness for PathSpring

Post by Sepehr Ramezani » Sun Mar 19, 2023 4:06 pm

Hi Nick,
That's right. For the PathSpring() I was able to fix the problem. I had too much variables for optimization, that's why it was able to reach the desired convergence tolerance by just optimizing the few of variables while other variables were remaind at the average of theirs boundaries. So I decreased the number of parameters for optimization and it worked. Is there any way that I can check whether number of variable is not too much? If I explain it better, let's say we have the following system
Capture3.PNG
Capture3.PNG (4.79 KiB) Viewed 345 times

Then we use MOCO_track to track the desired motion and force at point A while it optimizing the k1 and k2. This obvious there are infinite solution for this problem since k_total matters and any combination of k1 and k2 which satisfies k_total=(k1+k2)/k1k2 can be optimal value for k1 and k2. Now let's say we a have more complex system that we don't know if the number of unknown parameter is too much (system is underdetermined?). Does Moco provide some information to tell us how much system is underdetermine?
Best,
Sepehr

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

Re: MocoParameter gives a wrong stiffness for PathSpring

Post by Nicholas Bianco » Mon Mar 20, 2023 2:07 pm

Hi Sepehr,

The IPOPT output will tell you how many variables and constraints exist in the problem you are trying to solve, so you can use that to tell if your problem is over- or underdetermined.

-Nick

POST REPLY