Hi, my simple marker tracking simulation in OpenSim Moco works and converges successfully if I set the total number of meshes to 20, 25, 35, and 40. But I'm getting this error in case of 30 (or the mesh interval of 0.01):
CasADi - 2024-07-03 03:05:50 WARNING("nlp:nlp_jac_g failed: NaN detected for output jac_g_x, at nonzero index 67 (row 67, col 0).") [D:\a\opensim-core\opensim-core\dependencies\casadi\casadi\core\oracle_function.cpp:377]
Error evaluating Jacobian of equality constraints at user provided starting point.
No scaling factors for equality constraints computed!
Any idea why this is happening?
Thank you.
MocoTrack doesn't work with a specific mesh interval
- Mohammadreza Rezaie
- Posts: 377
- Joined: Fri Nov 24, 2017 12:48 am
- Nicholas Bianco
- Posts: 972
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MocoTrack doesn't work with a specific mesh interval
Hi Mohammadreza,
Have you tried using the solution using 25 mesh intervals as the initial guess for the problem using 30? Usually this type of error has to do with the initial guess.
-Nick
Have you tried using the solution using 25 mesh intervals as the initial guess for the problem using 30? Usually this type of error has to do with the initial guess.
-Nick
- Mohammadreza Rezaie
- Posts: 377
- Joined: Fri Nov 24, 2017 12:48 am
Re: MocoTrack doesn't work with a specific mesh interval
Hi Nick, thanks for your response. I will try this. Do you mean the problem is the initial guesses? Actually, I didn't specify any initial guess; everything was default. If I adjust the time range to be 0.005s greater or lower, the 0.01 mesh interval works without any issue. Here is a test case:
-Mohammadreza
Thanks for your help,-Mohammadreza
- Nicholas Bianco
- Posts: 972
- Joined: Thu Oct 04, 2012 8:09 pm
Re: MocoTrack doesn't work with a specific mesh interval
Moco always uses an initial guess. If you don't specify one, it will create a guess using the midpoint between the variable bounds. Possibly this default guess is a problem when using 30 mesh intervals for your problem.
When using different mesh intervals, the problem is discretized differently, meaning reference data in tracking goals will be sampled at different points in the trajectory. It could be that using 30 mesh intervals leads to a sample point in the reference data that is problematic.
When using different mesh intervals, the problem is discretized differently, meaning reference data in tracking goals will be sampled at different points in the trajectory. It could be that using 30 mesh intervals leads to a sample point in the reference data that is problematic.
- Mohammadreza Rezaie
- Posts: 377
- Joined: Fri Nov 24, 2017 12:48 am
Re: MocoTrack doesn't work with a specific mesh interval
I appreciate your help. -Mohammadreza