clear all

global m J lc g B
m = .4;
J = 27.17;
lc = 7.58;
g = 32.2*12;
B = 30;

thetastart = pi/2;

start = [0; thetastart];  % start = [hi; thetai]

t0 = 0;
tf = 15;
N = 1000;

[t,output] = rk4fixed('simplependulum',[t0 tf],start,N);

subplot(2,1,1);
plot(t,output(:,1));
title('Angular Momemtum vs. Time'); xlabel('Time (sec)'); ylabel('h (lbf*in/sec)');

subplot(2,1,2);
plot(t,output(:,2));
title('Angle vs. Time'); xlabel('Time (sec)'); ylabel('Angle (rad)');