Professional Documents
Culture Documents
MATLAB Code
MATLAB Code
%% Email: tiwaritiwari@kgpian.iitkgp.ac.in
% Initial Conditions
X0 = [theta1,theta1_dot,d2, d2_dot];
% Time Span
tSpan=0:0.1:20;
d2 = xSol(:,3);
d2_dot = xSol(:,4);
plot(tSol,theta1,'r')
xlabel('Time (s)')
ylabel('theta1 (deg)')
title('theta1 vs Time')
hold on
% plot(tSol,theta1_dot,'r')
% xlabel('Time (s)')
% ylabel('theta1_dot (deg/sec)')
% title('theta1_dot vs Time')
%
% hold on
%
% plot(tSol,d2,'r')
% xlabel('Time (s)')
% ylabel('d2 (m)')
% title('d2 vs Time')
%
% hold on
%
% plot(tSol,d2_dot,'r')
% xlabel('Time (s)')
% ylabel('d2_dot (m/s)')
% title('d2_dot vs Time')
global m1 r1 l1 I1 m2 g
end
theta1 vs Time
200
180
160
140
120
theta1 (deg)
100
80
60
40
20
0
0 2 4 6 8 10 12 14 16 18 20
Time (s)
theta1 d ot vs Time
200
150
100
theta1 d ot (deg/sec)
50
-50
-100
-150
0 2 4 6 8 10 12 14 16 18 20
Time (s)
d2 vs Time
12
10
8
d2 (m)
0
0 2 4 6 8 10 12 14 16 18 20
Time (s)
d2d ot vs Time
2
1.5
1
d2 d ot (m/s)
0.5
-0.5
0 2 4 6 8 10 12 14 16 18 20
Time (s)