Infeasible problem MocoPredict

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
Giorgio Davico
Posts: 9
Joined: Mon Nov 23, 2015 8:53 pm

Infeasible problem MocoPredict

Post by Giorgio Davico » Mon Dec 19, 2022 4:46 am

Dear all,

a student of mine has started working off the example2DWalking tutorial to perform some simulations with Moco Predict on data from the 6th edition of the Knee Grand Challenge. However, he incurred in the infeasible Problem error, which we seem unable to solve.

Below I will provide some context and briefly describe what he did and the data he is using:
  • Model = simplified version of the generic Rajagopal model, scaled to the size of the KGC6 patient. The model does not include the upper limbs and has a reduced number of muscles compared to the original Rajagopal model (see attached picture)
  • Experimental data = motion capture and ground reaction forces data from one trial of normal gait (level walking at self-selected speed)
The idea was to perform a simulation with MocoTrack to get the initial states for the model to be fed to a subsequent MocoPredict simulation (as outlined in the example2DWalking script).

More specifically, in MocoTrack he defined the modelled as:

Code: Select all

modelProcessor = ModelProcessor(model);

modelProcessor.append(ModOpAddExternalLoads("grf_gait_03.xml"));

modelProcessor.append(ModOpIgnoreTendonCompliance());

modelProcessor.append(ModOpReplaceMusclesWithDeGrooteFregly2016());

modelProcessor.append(ModOpIgnorePassiveFiberForcesDGF());

modelProcessor.append(ModOpAddReserves(100.0));

and provided the experimental marker trajectories.
In MocoPredict, he gave as input the same model and set the following two objective functions to solve the problem:
  • MocoControlGoal
  • MocoAverageSpeed
The bounds for the joint coordinates were based on the output from the MocoTrack simulation, i.e. he set the max and min bounds, and the initial and final values to the values that resulted from MocoTrack (only exception being the pelvis_tx and pelvis_ty, for which initial and final values were not set).

The bounds for the (joint) speed were taken as is from the example2DWalking. Same for the solver.

The simulation starts, but stops throwing the following error:
MocoCasADiSolver did NOT succeed: Infeasible_Problem_Detected
I attached a video of the simulation for reference, which is not that bad even when compared to the actual inverse kinematics results associated with the trial in use (see attached picture and video).

We tried to look for an explanation of the error, and what we found was:
EXIT: Converged to a point of local infeasibility. Problem may be infeasible. The restoration phase converged to a point that is a minimizer for the constraint violation (in the l1 -norm) but is not feasible for the original problem. This indicates that the problem may be infeasible (or at least that the algorithm is stuck at a locally infeasible point). The returned point (the minimizer of the constraint violation) might help you to find which constraint is causing the problem. If you believe that the NLP is feasible, it might help to start the optimization from a different point.
For completeness, the out log file reported the following (which we are not sure how to interpret):
EXIT: Converged to a point of local infeasibility. Problem may be infeasible.
t_proc [s] t_wall [s] n_eval
callback_fun 0.008 0.00882 46
nlp 273 273 1
nlp_f 1.29 1.29 57
nlp_g 3.87 3.87 57
nlp_grad_f 17 17 28
nlp_jac_g 232 232 48

Breakdown of objective (including weights):
control_effort: 13.816

Active or violated continuous variable bounds
L and U indicate which bound is active; '*' indicates a bound is violated.
The case of lower==upper==value is ignored.

State bounds: some bounds active but no bounds violated
time lower value upper
/jointset/ground_pelvis/pelvis_tx/value 2.433 -7.00e-01 <= -7.00e-01 <= 6.50e-01 L
/jointset/ground_pelvis/pelvis_tx/value 3.775 -7.00e-01 <= 6.50e-01 <= 6.50e-01 U
/jointset/ground_pelvis/pelvis_tz/value 2.433 1.91e-01 <= 1.91e-01 <= 2.74e-01 L
/jointset/ground_pelvis/pelvis_tz/value 3.775 1.91e-01 <= 2.74e-01 <= 2.74e-01 U

Control bounds: no bounds active or violated

Multiplier bounds: no bounds active or violated

Derivative bounds: no bounds active or violated
We did not manage to understand what caused the problem and how to possibly solve it to move on.

Could you please help us out? If needed we can share model, data and code.

Any help is really appreciated.

Cheers,

Giorgio
Attachments
out_MocoPredict.log
(73.79 KiB) Downloaded 3 times
Sim_result_afterError.gif
Sim_result_afterError.gif (437.03 KiB) Viewed 239 times
KneeAngle_afterError.png
KneeAngle_afterError.png (40.43 KiB) Viewed 239 times

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

Re: Infeasible problem MocoPredict

Post by Nicholas Bianco » Fri Dec 30, 2022 6:59 am

Hi Giorgio,

It is not typical to run a predictive simulation when you are applying ground reaction forces to the model. This is because the location where the ground reaction forces are applied will not change when the model kinematics change. This can lead to large moments being applied to the model if the foot moves away from the GRFs.

What are you trying to accomplish with these simulations?

Best,
Nick

POST REPLY