Files
2025-06-04 14:13:22 +08:00

161 lines
5.4 KiB
Matlab

function hf = plot_lat_mode(H_lst, Ma_cell, CGx_lst, rlst, surfix_lst)
ss_c = {'r', 'b', 'm'};
ss_m = {'-o', '-+', '-*', '-x', '-s', '-^', '-v', '-p'};
ss_m1 = {'o', '+', '*', 'x', 's', '^', 'v', 'p'};
hf{1,1} = new_figure(); % 荷兰滚模态频率
hf{1,2} = '荷兰滚模态频率';
hf{2,1} = new_figure(); % 荷兰滚阻尼比
hf{2,2} = '荷兰滚阻尼比';
hf{3,1} = new_figure(); % 滚转模态时间参数
hf{3,2} = '滚转模态时间参数';
hf{4,1} = new_figure(); % 螺旋模态时间参数
hf{4,2} = '螺旋模态时间参数';
hf{5,1} = new_figure(); % 滚摆比
hf{5,2} = '滚摆比';
hf{6,1} = new_Dunch_Mode_Figure(2); %
hf{6,2} = '荷兰滚阻尼比频率';
hf{7,1} = new_figure(); %
hf{7,2} = '滚转模态频率';
n_H = length(H_lst);
n_CGx = length(CGx_lst);
lg_postion = { [0.15 0.7 0.1980 0.120],... %
[0.7 0.6 0.1980 0.120],...
[0.7 0.6 0.1980 0.120],...
[0.15 0.6 0.1980 0.120],...
[0.7 0.6 0.1980 0.120],...
[0.7 0.6 0.1980 0.120],...
[0.15 0.7 0.1980 0.120]};
for idx = 1:length(rlst)
H(idx,1) = rlst{idx}.H;
Ma(idx,1) = rlst{idx}.Ma;
CGx(idx,1) = rlst{idx}.CGx;
mode_lat = rlst{idx}.mode_lat;
wn_Dutch_Roll(idx,1) = mode_lat.wn_Dutch_Roll;
zeta_Dutch_Roll(idx,1) = mode_lat.zeta_Dutch_Roll;
tau_Roll(idx,1) = mode_lat.tau_Roll;
root_Roll(idx,1) = mode_lat.root_Roll;
tau_Spiral(idx,1) = mode_lat.tau_Spiral;
t2_Spiral(idx,1) = mode_lat.t2_Spiral;
roll_yaw_ratio(idx,1) = mode_lat.roll_yaw_ratio;
end
for idx_cgx = 1:length(CGx_lst)
cgx = CGx_lst (idx_cgx);
for idx_H = 1:length(H_lst)
h = H_lst(idx_H);
Ma_lst = Ma_cell{idx_H};
j = 1;
Ma_rlst = [];
wn_Dutch_Roll_rlst = [];
zeta_Dutch_Roll_rlst = [];
tau_Roll_rlst = [];
tau_Spiral_rlst = [];
roll_yaw_ratio_rlst = [];
root_Roll_rlst = [];
for idx_Ma = 1:length(Ma_lst)
ma = Ma_lst(idx_Ma);
idx1 = (H==h)&(Ma==ma)&(CGx==cgx);
if sum(idx1)==0
continue;
end
Ma_rlst(j) = ma;
wn_Dutch_Roll_rlst(j) = wn_Dutch_Roll(idx1);
zeta_Dutch_Roll_rlst(j) = zeta_Dutch_Roll(idx1);
tau_Roll_rlst(j) = tau_Roll(idx1);
tau_Spiral_rlst(j) = tau_Spiral(idx1);
roll_yaw_ratio_rlst(j) = roll_yaw_ratio(idx1);
root_Roll_rlst(j) = root_Roll(idx1);
j = j+1;
end
ss = [ss_m{idx_H}, ss_c{idx_cgx}];
ss1 = [ss_m1{idx_H}, ss_c{idx_cgx}];
figure(hf{1});
plot(Ma_rlst, wn_Dutch_Roll_rlst, ss);
hold on;
grid on;
xlabel('Ma');
ylabel('荷兰滚模态频率(rad/s)');
figure(hf{2});
plot(Ma_rlst, zeta_Dutch_Roll_rlst, ss);
hold on;
grid on;
xlabel('Ma');
ylabel('荷兰滚模态阻尼比');
figure(hf{3});
plot(Ma_rlst, tau_Roll_rlst, ss);
hold on;
grid on;
xlabel('Ma');
ylabel('滚转模态时间常数(s)');
% ylim([0, 1]);
figure(hf{4});
plot(Ma_rlst, tau_Spiral_rlst, ss);
hold on;
grid on;
xlabel('Ma');
ylabel('螺旋模态时间常数(s)');
figure(hf{5});
plot(Ma_rlst, roll_yaw_ratio_rlst, ss);
hold on;
grid on;
xlabel('Ma');
ylabel('滚摆比');
figure(hf{6});
plot(zeta_Dutch_Roll_rlst, wn_Dutch_Roll_rlst, ss1);
hold on;
grid on;
xlabel('荷兰滚模态阻尼比');
ylabel('荷兰滚模态频率(rad/s)');
figure(hf{7});
plot(Ma_rlst, -root_Roll_rlst, ss);
hold on;
grid on;
xlabel('Ma');
ylabel('滚转模态频率(rad/s)');
end
end
for idx = 1:7
figure(hf{idx});
lg = new_legend(hf{idx}, lg_postion{idx});
set(hf{idx}, 'CurrentAxes', lg);
hold on;
ds = 1/(n_H+n_CGx);
for idx_H = 1:n_H
am = plot(0.25, ds*(n_CGx+n_H-idx_H)+ds/2, ['k',ss_m{idx_H}]);
as = text(0.5, ds*(n_CGx+n_H-idx_H)+ds/2, ['H = ', num2str(H_lst(idx_H)/1000),' km']);
set(as, 'FontSize', 8);
set(am, 'MarkerSize', 6);
end
for idx_cgx = (n_H+1):(n_H+n_CGx)
plot([0.15 0.35], [ds*(n_CGx+n_H-idx_cgx)+ds/2 ds*(n_CGx+n_H-idx_cgx)+ds/2], ss_c{idx_cgx-n_H});
as = text(0.5, ds*(n_CGx+n_H-idx_cgx)+ds/2, surfix_lst{idx_cgx-n_H});
set(as,'FontSize',8);
end
hold off;
axis([0 1 0 1] );
%=======================================================
OLD_POS = get(lg,'position');
NEW_POS = [ OLD_POS(1:3) , 0.03*(n_CGx+n_H)];
set(lg,'position',NEW_POS);
end
end