%% This script illustrates the instability of the solution
%% with some particular values of e and a
function hill_unstable(a, e)
time = linspace(0, 50, 100);
%% a = 0.25;
%% e = 0.50;
[x, y] = ode45(@hill, time, [1, 0, a, e]);

%% xmin = 0;
%% xmax = 2*pi;

subplot(2,1,1);plot(y(:,1),y(:,2));
xlabel('Position','FontSize',16)
ylabel('Velocity','FontSize',16)

subplot(2,1,2);plot(x, y(:,1));
xlabel('Time','FontSize',16)
ylabel('Position','FontSize',16)
%% axis([xmin xmax -2 2])

print -dpsc2 -cmyk hillUnstableFig
