%Solve the large angle pendulum problem global G LENGTH G = 9.807; % [m/s/s} accel. due to gravity LENGTH = input('Enter pendulum length [m] >'); angle0 = input('Enter initial pendulum angle [degrees] >'); period = 2*pi*sqrt(LENGTH/G); fprintf('small angle period is %.3f seconds\n',period); tfinal = 2*period; yinit = (angle0*pi/180); [t, y] = ode45(@MEE380eq2,[0 tfinal], [0 yinit]); plot(t,y(:,1),'-',t,y(:,2),'.')