我正在尝试在我的 jupyter 笔记本上测试一个 Matplotlib 动画示例,如下所示:
from matplotlib import animation
# solve the ode problem of the double compound pendulum again
from scipy.integrate import odeint
from numpy import cos, sin
g = 9.82; L = 0.5; m = 0.1
def dx(x, t):
x1, x2, x3, x4 = x[0], x[1], x[2], x[3]
dx1 = 6.0/(m*L**2) * (2 * x3 - 3 * cos(x1-x2) * x4)/(16 - 9 * cos(x1-x2)**2)
dx2 = 6.0/(m*L**2) * (8 * x4 - 3 * cos(x1-x2) * x3)/(16 …Run Code Online (Sandbox Code Playgroud)