% You should run LongSC.m before running this script.
echo off
t=0:.1:5;					% time scale to expose short period mode
u=d2r*ones(length(t),1);	% deltae step of one degree
y=lsim(sys,u,t);
figure(1)
subplot(4,1,1)
plot(t,y(:,1))
xlabel('time(sec)')
ylabel('u(ft/sec)')
ts=['Step elevator response, ',aircraft,', ',configuration,' configuration'];
title(ts)
subplot(4,1,2)
plot(t,y(:,2))
xlabel('time(sec)')
ylabel('alpha(deg)')
text(2,-.5,'Note highly damped short period mode')
subplot(4,1,3)
plot(t,y(:,3))
xlabel('time(sec)')
ylabel('q(deg/sec)')
text(2,-1.3,'Note highly damped short period mode')
subplot(4,1,4)
plot(t,y(:,4))
xlabel('time(sec)')
ylabel('theta(deg)')

t=0:1:200;					% time scale to expose short period mode
u=d2r*ones(length(t),1);	% deltae step of one degree
y=lsim(sys,u,t);
figure(2)
subplot(4,1,1)
plot(t,y(:,1))
xlabel('time(sec)')
ylabel('u(ft/sec)')
ts=['Step elevator response, ',aircraft,', ',configuration,' configuration'];
title(ts)
text(40,10,'Note lightly damped phugoid mode')
subplot(4,1,2)
plot(t,y(:,2))
xlabel('time(sec)')
ylabel('alpha(deg)')
subplot(4,1,3)
plot(t,y(:,3))
xlabel('time(sec)')
ylabel('q(deg/sec)')
subplot(4,1,4)
plot(t,y(:,4))
xlabel('time(sec)')
ylabel('theta(deg)')
text(40,1.0,'Note lightly damped phugoid mode')
