About HPC Systems Software User Guides Education Partners

  / gears / hpc / education / tutorials / matlab / linux


Introduction

Definition

Example 01

Example 02

Example 03

Example 04

Example 05

Example 06

Example 07

Example 08

Example 09

Example 10

Example 11

Example 12

Example 13

Example 14

Example 15

Example 16

Example 17

Example 18

References

Example 15


INERTIA = [3629 0 0 0 0 0;
0 3629 0 0 0 0;
0 0 3629 0 0 0;
0 0 0 3966 0 -1695;
0 0 0 0 14684 0;
0 0 0 -1695 0 12541];
FORCE = [-0.58; 92.68; 0; 1343.86; 8.41; -2780.4]
ACCELERATIONS = inv(INERTIA) * FORCE
VELOCITIES = ACCELERATIONS * 0.1
pause;
UH1H_A=[-0.0340 0.0041 0.0788 -0.3332 0.5267 -0.0917;
0.0020 -0.1534 -0.0115 -0.5926 -0.3763 0.5423;
0.0571 -0.0242 -0.9464 -0.7223 -0.8209 0.6116;
0.0012 -0.0556 -0.0324 -1.1435 -0.7824 0.3434;
0.0131 0.0017 -0.0142 0.1967 -0.6126 0.0192;
-0.0026 0.1212 -0.0527 -0.1555 -0.1171 -1.4981]
[VA,DA] = eig(UH1H_A)
UH1H_AA=[-0.0334 0.0040 -0.3233 0.5098 -0.0745 0
-0.0334 0.0040 0.0765 -0.3233 0.5098 -0.0745
0.0464 -0.0148 -0.8352 -0.7091 -0.6259 0.5153
0.0009 -0.0546 -0.0283 -0.9634 -0.5262 0.3371
0.0093 0.0012 -0.0101 0.1931 -0.4365 0.0137
-0.0009 0.1835 -0.0413 -0.1347 -0.1275 -0.9830]
[VAA,DAA] = eig(UH1H_AA)
UH1H_AABAR = inv(VAA) * UH1H_AA * VAA;
UH1H_ABAR = inv(VA) * UH1H_A * VA;
UH1H_B=[0.1141 0.0849 -0.0025 -0.0096;
-0.0179 0.0090 0.1054 0.2692;
-1.4946 0.4712 -0.0051 -0.0130;
-0.0248 0.0227 0.2200 0.2295;
-0.0001 -0.0683 0.0008 -0.0036;
0.0746 0.0290 0.0305 -0.6475]
UH1H_BBAR = inv(VA) * UH1H_B
C = [0.0000 0.0000 0.0000 0.0000 0.0000 0.0000];
D = [0.0000 0.0000 0.0000 0.0000];
T = [0:0.1:180];
U = [repmat(0,1,length(T));
repmat(0,1,length(T));
repmat(0,1,length(T));
repmat(0,1,length(T))];
X_0 = VELOCITIES
[Y,X]=lsim(UH1H_AA,UH1H_B,C,D,U,T,X_0);
x_dist = cumtrapz(T,X(:,1));
y_dist = cumtrapz(T,X(:,2));
z_dist = cumtrapz(T,X(:,3));
phi = cumtrapz(T,X(:,4));
the = cumtrapz(T,X(:,5));
psi = cumtrapz(T,X(:,6));
plot(T,X(:,1))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Forward velocity')
title('Figure 1: Variation of forward velocity with time')
print figure1.ps;
plot(T,X(:,2))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Sideward velocity')
title('Figure 3: Variation of Sideward velocity with time')
print;
plot(T,X(:,3))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Vertical velocity')
title('Figure 5: Variation of Vertical velocity with time')
print;
plot(T,X(:,4))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Roll Rate')
title('Figure 7: Variation of Roll Rate with time')

print;
plot(T,X(:,5))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Pitch Rate')
title('Figure 9: Variation of Pitch Rate with time')
print;
plot(T,X(:,6))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Yaw Rate')
title('Figure 11: Variation of Yaw Rate with time')
print;
plot(T,psi)
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Yaw Angle')
title('Figure 12: Variation of Yaw angle with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0',2)
plot(T,U(1,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Collective')
title('Figure 13: Variation of Collective with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0',2)
plot(T,U(2,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Longitudinal Cyclic')
title('Figure 14: Variation of Longitudinal Cyclic with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0',2)
plot(T,U(3,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Lateral Cyclic')
title('Figure 15: Variation of Lateral Cyclic with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0',2)
plot(T,U(4,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Pedals')
title('Figure 16: Variation of Pedals with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0',2)
k=0.4;
WEIGHT=[1.0 0.0 0.0 0.0 0.0 0.0;
0.0 1.0 0.0 0.0 0.0 0.0;
0.0 0.0 1.0 0.0 0.0 0.0;
0.0 0.0 0.0 1.0 0.0 0.0;
0.0 0.0 0.0 0.0 1.0 0.0;
0.0 0.0 0.0 0.0 0.0 3.0]
UH1H_Astar = UH1H_ABAR - k * WEIGHT * UH1H_BBAR * UH1H_BBAR';
[Ystar,Xstar]=lsim(UH1H_Astar,UH1H_BBAR,C,D,U,T,X_0);
Xstart = VA * Xstar';
Xstart = Xstart';
x_diststart = cumtrapz(T,Xstart(:,1));
y_diststart = cumtrapz(T,Xstart(:,2));
z_diststart = cumtrapz(T,Xstart(:,3));

phistart = cumtrapz(T,Xstart(:,4));
thestart = cumtrapz(T,Xstart(:,5));
psistart = cumtrapz(T,Xstart(:,6));
plot(T,Xstart(:,1))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Forward velocity')
title('Figure 17: Variation of controlled forward velocity with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print;
plot(T,x_diststart)
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Horizontal Distance')
title('Figure 18: Variation of controlled forward distance with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print;
plot(T,Xstart(:,2))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Sideward Velocity')
title('Figure 19: Variation of Controlled Sideward Velocity with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print;
plot(T,y_diststart)
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Sideward Distance')
title('Figure 20: Variation of Controlled Sideward distance with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print;
plot(T,Xstart(:,3))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Vertical velocity')
title('Figure 21: Variation of Controlled Vertical velocity with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print;
plot(T,z_diststart)
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Vertical Distance')
title('Figure 22: Variation of Controlled Vertical distance with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print
plot(T,Xstart(:,4))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Roll Rate')
title('Figure 23: Variation of Controlled Roll Rate with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print

plot(T,phistart)
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Roll Angle')
title('Figure 24: Variation of Controlled Roll Angle with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print

plot(T,Xstart(:,5))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Pitch Rate')
legend('UH-1H: Normal Landing',1)
title('Figure 25: Variation of Controlled Pitch Rate with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print
plot(T,thestart)
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Pitch Angle')
title('Figure 26: Variation of Controlled Pitch angle with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print
plot(T,Xstart(:,6))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Yaw Rate')
title('Figure 27: Variation of Controlled Yaw Rate with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print
plot(T,psistart)
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Controlled Yaw Angle')
title('Figure 28: Variation of Controlled Yaw angle with time')
legend('UH-1H: Controlled Normal Landing','-0.4 0 0 0','k=0.40',2)
print

plot(T,U(1,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Collective')
title('Figure 29: Variation of Collective with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0.40',2)
print

plot(T,U(2,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Longitudinal Cyclic')
title('Figure 30: Variation of Longitudinal Cyclic with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0.40',2)
print

plot(T,U(3,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Lateral Cyclic')
title('Figure 31: Variation of Lateral Cyclic with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0.40',2)
print

plot(T,U(4,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Pedals')
title('Figure 32: Variation of Pedals with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0.40',2)
print;

plot(x_diststart,z_diststart)
grid on
axis auto;
xlabel('Forward Distance in feet')
ylabel('Vertical Distance in feet')
title('Figure 33: Variation of Vertical Distance with Forward Distance')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0.40',2)
print;

uf = -k * UH1H_BBAR' * Xstart';

plot(T,uf(1,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Collective')
title('Figure 34: Variation of Collective with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0.40',2)
print

plot(T,uf(2,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Long. Cyc.')
title('Figure 35: Variation of Long. Cyc. with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0.40',2)
print

plot(T,uf(3,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Late. Cyc.')
title('Figure 36: Variation of Late. Cyc. with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0.40',2)
print

plot(T,uf(4,:))
grid on
axis auto;
xlabel('Time in seconds')
ylabel('Pedals')
title('Figure 37: Variation of Pedals with time')
legend('UH-1H: Normal Landing','-0.4 0 0 0','k=0.40',2)
print

Example

Please send questions or suggestions about this web page to beatnic@aset.psu.edu

ASET | ITS | Penn State