(setup_fig)
| 104 | |
| 105 | |
| 106 | def test_midpoint(setup_fig): |
| 107 | discrete_dyn = IntegratorMidpoint(ode_dynamics, dt) |
| 108 | u0 = np.zeros(discrete_dyn.nu) |
| 109 | us = [u0] * nsteps |
| 110 | xs = aligator.rollout_implicit(discrete_dyn, x0, us).tolist() |
| 111 | if DISPLAY: |
| 112 | display(xs, dt) |
| 113 | e = computeMechanicalEnergy(rmodel, rdata, xs) |
| 114 | plt.plot(times_, e, label="midpoint") |
| 115 | |
| 116 | |
| 117 | if __name__ == "__main__": |
nothing calls this directly
no test coverage detected