% Simple plot of damped Duffing equation
%
% d^2 y/dt^2 = y-y^3-delta*dy/dt
%
% Left click for initial conditions, right click to stop.
% Need function  duffeq.m

clear

axis([-5 5 -5 5]);
[x0 y0 bb]=ginput(1);           
hold on
while bb<2, 
   [T,Y] = ode45('duffeq',[0 100],[x0 y0]); 
   plot(Y(:,1),Y(:,2)), 
   [x0 y0,bb]=ginput(1);
end
hold off;
