function spring3(eps,N)
% integrates the SHO via 2nd order Leap-frog
x(1,1) = 1; x20 = 0;
x(1,2) = x20 - eps*x(1,1)/2;
y(1) = 0;
for i = 1:N
x(i+1,1) = x(i,1) + eps*x(i,2);
x(i+1,2) = x(i,2) - eps*x(i+1,1);
y(i+1) = (x(i+1,2) + x(i,2))/2;
end
figure; axis([-2, 2 , -2, 2])
plot(x(:,1),y(:),x(1:N/10:N,1),y(1:N/10:N),'ro')
title(sprintf('phase plane for SHO with eps = %12.5f',eps));