function dW = Duffing(t,z,delta, alpha, beta, gamma, omega)

% W = [X;Y,t]
dW = zeros(3,1);

dW(1) = z(2);
dW(2) = -delta.*z(2) - alpha*z(1)^3 -beta*z(1) - gamma*omega*sin(omega*z(3));
dW(3) = 1;

end