function dz=duffing(t,z) % Duffing's equations (general form): % % du/dt = v % dv/dt = -(omega_0)^2*u-beta*u^3-delta*v+gamma*cos(omega*t+phi) % % where u is the displacement, v is the velocity, % and the paramaters are constants. dz=[z(2);(7.5*cos(t)-.05*z(2)-z(1)^3)]; % "Complex and Chaotic Nonlinear Dynamics. % Advances in Economics and Finance, % Mathematics and Statistics" % T.Vialar, Springer 2009 % Copyright(c).