function xdot=duffingp(t,x) global s; xdot=zeros(2,1); xdot(1)=x(2); xdot(2)=x(1)-x(1)^3-0.5*x(2)*(1-1.24165*x(1)^2)+0.7*sin(7*(t+s));