%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                                                        %
%  A solution to CSE For Your Homework Project 2         %
%  Robot Arm Control: Like a Pendulum Swings             %
%  Dianne P. O'Leary and Yalin E. Sadguyu                %
%  12/02 and 01/03                                       %
%                                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% File name = project2solution.m                         %
% The code investigates a nonlinear second-order         %
% differential equation modeling a mechanical pendulum   %
%    m*l*theta''(t)+c*x'(t)+m*g*sin(theta(t)) = u(t)     %
% where  theta is the angle the pendulum makes           %
%              with the vertical axis                    %
%        t  is time                                      %
%        m  is the mass of the pendulum                  %
%        l  is the length of the pendulum                %
%        g = 9.81 m/sec^2 = acceleration due to gravity  %
%        c = damping coefficient                         %
% as well as the linear version of it, with sin(theta(t))%
% replaced by theta(t)  for t >= 0 .                     %
%                                                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

global mydata theta10

close all

problem4

problem5

problem6
