MCPcopy Create free account
hub / github.com/Apress/python-for-matlab-development / Duff

Function Duff

code/ode/duffing.py:33–36  ·  view source on GitHub ↗
(t,u,k=0.7,c=0.1,k3=1,
         A=44.5,omega=1.1)

Source from the content-addressed store, hash-verified

31from scipy.integrate import RK45
32import matplotlib.pyplot as plt
33def Duff(t,u,k=0.7,c=0.1,k3=1,
34 A=44.5,omega=1.1):
35 return [u[1], -k*u[0]-c*u[1] -
36 k3*u[0]**3+A*np.sin(omega*t)]
37T0, Tn = 0, 40
38U_0 = [0, 0]
39t, u = [], []

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected