How to maintain eigenvalues sequence
1 view (last 30 days)
Show older comments
Hello,
I have to draw root-locus for longitudinal motion; Short Period Mode and Phugoid Mode. Here is a code
%% Dynamics
Vp = 111.174
A_lon = [-0.0283 0.3139 -11.0665 -32.0344;
-0.4204 -1.5452 108.6931 -3.2616;
0.0205 -0.2011 -3.5080 0;
0 0 1 0]
B_lon = [0.0115 0.1150;
-0.2185 0;
-0.3591 0;
0 0]
C_lon = [1 0 0 0;
0 -1 0 Vp]
%% LQR Servo Design
A_servo = [A_lon zeros(4,2);
-C_lon zeros(2,2)]
B_servo = [B_lon ; zeros(2,2)]
n = 100; a = logspace(-2,2,n);
for i = 1:n
Q = a(i)*[1 0 0 0 0 0;
0 1 0 -Vp 0 0;
0 0 0 0 0 0;
0 -Vp 0 power(Vp,2) 0 0;
0 0 0 0 1 0;
0 0 0 0 0 1];
R = eye(2);
[K,S,P] = lqr(A_servo,B_servo,Q,R);
p_cl = P;
cl_sh(i,1) = p_cl(5); cl_sh(i,2) = p_cl(6);
cl_ph(i,1) = p_cl(3); cl_ph(i,2) = p_cl(4);
end
%% Plot
figure;
plot(real(cl_sh(:,1)), imag(cl_sh(:,1)), '+', real(cl_sh(:,2)), imag(cl_sh(:,2)), 'x', MarkerSize=5);
title("Root Locus of Short Period Mode")
xlabel("real")
ylabel("imag")
grid on;
figure;
plot(real(cl_ph(:,1)), imag(cl_ph(:,1)), '+', real(cl_ph(:,2)), imag(cl_ph(:,2)), 'x', MarkerSize=5)
title("Root Locus of Phugoid Mode")
xlabel("real")
ylabel("imag")
grid on;
When the code is executed, the sequence of eigenvalues is misaligned from some point in the iteration statement and the point was depended on weight of Q, R matrix. So when the sequence of eigenvalues is out of order from a certain point in time like this, how should we modify the code to solve it?
0 Comments
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!