Note
Click here to download the full example code
Double pendulumΒΆ
Out:
[0, 0, 1, 0]
import matplotlib.pyplot as plt
import numpy as np
from scipy.integrate import odeint
import reg_bench.ode
dblpdl = reg_bench.ode.double_pendulum()
dy = dblpdl()
y0 = dblpdl.initial_conditions()
t = np.linspace(0, 10, 5 * 10 ** 3)
print(y0)
s = odeint(dy, y0, t)
for j in range(4):
plt.figure(j)
plt.plot(t, s[:, j])
plt.show()
Total running time of the script: ( 0 minutes 0.508 seconds)