Page 1 of 1

Trouble running MocoTrack in implicit mode?

Posted: Thu Sep 09, 2021 7:42 am
by danielfng
Hello,

I'm trying to run the MocoTrack tool for a problem in implicit mode using Matlab, but am running in to this error:
java.lang.RuntimeException: casVector should be 1-dimensional, but has size 0 x 0.
Thrown at MocoCasOCProblem.h:108 in convertToSimTKVector().
The same code when run in explicit mode seems to work fine and produces a solution in 70-100 iterations or so.

To enter implicit mode, I've been using the following:

Code: Select all

solver = MocoCasADiSolver.safeDownCast(study.updSolver());
solver.set_multibody_dynamics_mode('implicit');
Has anyone else run in to this problem, or is anyone a bit more familiar with the error message to point me in the right direction?

Cheers

Re: Trouble running MocoTrack in implicit mode?

Posted: Thu Sep 09, 2021 11:09 am
by nbianco
Hi Daniel,

How are you creating the initial guess? This type of error usually has something with the guess being incompatible, which can happen when switching between implicit and explicit mode due to missing acceleration variables. (This is technically a bug though, we should account for this during the compatibility checks we do).

You could try creating a fresh initial guess after changing the dynamics mode, that way you can ensure the guess is compatible with the problem.

-Nick