function void = unstableIVP(void)
% First example of Chapter 1.  
% Motion of a pendulum treated as an IVP.
set(gcf,'DefaultAxesColorOrder',[0 0 0; 0 0 0; 0 0 0])
plot([0,7],[0,0])
axis([0 7 -3 8])

thetap0 = 2.0;
options = odeset('AbsTol',1e-10,'RelTol',1e-6);
[t,y] = ode45(@pendulum,[0 100],[0; thetap0],options);
plot(t,y(:,1),'-k','LineWidth',1)
ylabel('\theta(t)','fontsize', 16)
xlabel('t', 'fontsize', 16)

%=============================================
function yp = pendulum(t,y)
yp = [y(2); -sin(y(1))];


