-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLateral.m
183 lines (138 loc) · 3.46 KB
/
Lateral.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
clc;
clear;
%% data normal configuration
mass=14126; %=W
Ixx=3582;
Iyy=55802;
Izz=56669;
Ixz=2658;
b=21.95;
gravity=32.174;
alpha=2.30;
gamma=0;
%% table1
M=0.257;
W=14126;
%% table
Yv=-0.178;
Yb=-51.1; %assume Yp=Yb
Yp=-51.1;
Lb=-20.9;
Nb=2.68;
Lp=-1.38;
Np=0.0993;
Lr=1.16;
Nr=-0.157;
Yda=0;
Lda=4.76;
Nda=0.266;
Ydr=0.0317;
Ldr=5.35;
Ndr=-0.923;
%eq
V_tot=287;
%Assume
alpha0=2.3;
w0=V_tot*sin(alpha0);
u0=V_tot*cos(alpha0);
v0=0;
theta0=0;
Yr=0;
%%
% lateral state space
A_latr_full=[Yv Yp Yr-u0 -gravity*cos(theta0) 0
Lb Lp Lr 0 0
Nb Np Nr 0 0
0 1 tan(theta0) 0 0
0 0 1/cos(theta0) 0 0];
B_latr_full=[Yda Ydr
Lda Ldr
Nda Ndr
0 0
0 0];
C_latr_full=eye(5);
D_latr_full=zeros(5,2);
latr_full_state_space=ss(A_latr_full,B_latr_full,C_latr_full,D_latr_full);
[V,D] = eig(A_latr_full);
[d,ind]=sort(diag(D));
disp('Full System Info');
damp(A_latr_full);
stepinfo(latr_full_state_space)
figure;
step(latr_full_state_space(:,1))
title('Full System Reponse to Step Input');
[yfss,t]=step(latr_full_state_space(:,1));
nondimenlat(yfss,t,b,u0);
figure;
impulse(latr_full_state_space(:,1))
title('Full System Reponse to Impulse Input');
[yfsi,t]=impulse(latr_full_state_space(:,1));
nondimenlat(yfsi,t,b,u0);
figure;
x0=[0 0 0 0 0]; %%%%%%%%%%%%%
initial(latr_full_state_space,x0)
title('Full System Response to Initial Conditions');
%%1 dof spiral
A_spiral=[Lr*Nb/Lb-Nr];
B_spiral=[0];
C_spiral=[1];
D_spiral=[0];
Spiral_state_space=ss(A_spiral,B_spiral,C_spiral,D_spiral);
[V_spiral,D_spiral] = eig(A_spiral);
disp('Spiral System Info');
damp(A_spiral);
stepinfo(Spiral_state_space)
figure;
step(Spiral_state_space);
title('Spiral Response to Step Input');
figure;
impulse(Spiral_state_space);
title('Spiral Response to Impulse Input');
figure;
x0=[0]; %%%%%%%%%%%%%
initial(Spiral_state_space,x0)
title('Spiral Response to Initial Conditions');
% 2D dutch Roll
A_dutch=[Yv Yr/u0-1;
Nb Nr];
B_dutch=[Yda Ydr/u0;
Nda Ndr];
C_dutch=eye(2);
D_dutch=zeros(2,2);
Dutch_roll_state_space=ss(A_dutch,B_dutch,C_dutch,D_dutch);
[V_dutch,D_dutch] = eig(A_dutch);
[d_dutch,ind_dutch]=sort(diag(D_dutch));
disp('Dutch Roll System Info');
damp(A_dutch);
stepinfo(Dutch_roll_state_space)
figure;
step(Dutch_roll_state_space(:,1));
title('Dutch Roll Response to Step Input');
figure;
impulse(Dutch_roll_state_space(:,1));
title('Dutch Roll Response to Impulse Input');
figure;
x0=[0;0]; %%%%%%%%%%%%%
initial(Dutch_roll_state_space,x0)
title('Dutch Response to Initial Conditions');
%%% %%%%%
%%%%%Rolling%%%%%%%%%
A_roll=[Lp];
B_roll=[Lda];
C_roll=[1];
D_roll=[0];
roll_state_space=ss(A_roll,B_roll,C_roll,D_roll);
[V_roll,D_roll] = eig(A_roll);
disp('Roll System Info');
damp(A_roll);
stepinfo(roll_state_space)
figure;
step(roll_state_space);
title('roll Response to Step Input');
figure;
impulse(roll_state_space);
title('roll Response to Impulse Input');
figure
x0=[0]; %%%%%%%%%%%%%
initial(roll_state_space,x0);
title('roll Response to Initial Conditions');