Solve an implicit ODE (differential algebraic equation DAE)
问题 I'm trying to solve a second order ODE using odeint from scipy. The issue I'm having is the function is implicitly coupled to the second order term, as seen in the simplified snippet (please ignore the pretend physics of the example): import numpy as np from scipy.integrate import odeint def integral(y,t,F_l,mass): dydt = np.zeros_like(y) x, v = y F_r = (((1-a)/3)**2 + (2*(1+a)/3)**2) * v # 'a' implicit a = (F_l - F_r)/mass dydt = [v, a] return dydt y0 = [0,5] time = np.linspace(0.,10.,21) F