(setup_fig)
| 82 | |
| 83 | |
| 84 | def test_euler(setup_fig): |
| 85 | discrete_dyn = IntegratorEuler(ode_dynamics, dt) |
| 86 | u0 = np.zeros(discrete_dyn.nu) |
| 87 | us = [u0] * nsteps |
| 88 | xs = aligator.rollout(discrete_dyn, x0, us).tolist() |
| 89 | if DISPLAY: |
| 90 | display(xs, dt) |
| 91 | e = computeMechanicalEnergy(rmodel, rdata, xs) |
| 92 | plt.plot(times_, e, label="RK2") |
| 93 | |
| 94 | |
| 95 | def test_rk2(setup_fig): |
nothing calls this directly
no test coverage detected