@@ -394,7 +394,7 @@ def test_pendulum_passive_torque(with_passive_torque, phase_dynamics):
394394 pytest .skip ("These tests do not pass on Windows." )
395395
396396 if with_passive_torque :
397- model_filename = "/examples/getting_started /models/pendulum_with_passive_torque.bioMod"
397+ model_filename = "/examples/torque_driven_ocp /models/pendulum_with_passive_torque.bioMod"
398398 else :
399399 model_filename = "/examples/getting_started/models/pendulum.bioMod"
400400
@@ -420,6 +420,9 @@ def test_pendulum_passive_torque(with_passive_torque, phase_dynamics):
420420 controls = sol .decision_controls (to_merge = SolutionMerge .NODES )
421421 q , qdot , tau = states ["q" ], states ["qdot" ], controls ["tau" ]
422422
423+ # Check if the solution converged
424+ assert sol .status == 0
425+
423426 if with_passive_torque :
424427 # initial and final position
425428 npt .assert_almost_equal (q [:, 0 ], np .array ([0.0 , 0.0 ]))
@@ -430,12 +433,12 @@ def test_pendulum_passive_torque(with_passive_torque, phase_dynamics):
430433 # initial and final controls
431434 npt .assert_almost_equal (
432435 tau [:, 0 ],
433- np .array ([97.717082 , 0.0 ]),
436+ np .array ([6.1617263058229215 , 0.0 ]),
434437 decimal = 6 ,
435438 )
436439 npt .assert_almost_equal (
437440 tau [:, - 1 ],
438- np .array ([- 37.470441 , 0.0 ]),
441+ np .array ([- 11.820810710498906 , 0.0 ]),
439442 decimal = 6 ,
440443 )
441444
0 commit comments