How to solve this differential equation using scipy odeint?
I am trying to solve the following differential equation using scipy odeint without much success: import numpy as np from scipy.misc import derivative from scipy.integrate import odeint Imag = 16000. w = 2*np.pi*60 tau = .05 theta = 1.52 phi = theta - np.radians(90) t = np.linspace(0,.1,10000) def Ip(t): return np.sqrt(2)*Imag*(np.sin(w*t+phi-theta)-np.exp(-t/tau)*np.sin(phi-theta)) B = lambda Ip: Ip/(53.05+0.55*abs(Ip)) def L(B): return derivative(B,Ip(t))*377.2 def dI(t): return derivative(Ip,t) def f(y,t): Rb = 8. N = 240. Is = y[0] f0 = (1/(L(B)+0.002))*((dI(t)*L(B)/N)-Rb*y[0]) return [f0]