Page 1 of 1

MocoParameter gives a wrong stiffness for PathSpring

Posted: Mon Feb 20, 2023 11:23 am
by s.ramezani
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

Re: MocoParameter gives a wrong stiffness for PathSpring

Posted: Tue Feb 21, 2023 3:24 pm
by nbianco
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

Re: MocoParameter gives a wrong stiffness for PathSpring

Posted: Sun Mar 19, 2023 4:06 pm
by s.ramezani
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 347 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

Re: MocoParameter gives a wrong stiffness for PathSpring

Posted: Mon Mar 20, 2023 2:07 pm
by nbianco
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