nass-simscape/Analysis/ground_motion_ol_cl.m

34 lines
973 B
Mathematica
Raw Normal View History

gm_ol = load('../data/ground_motion_ol.mat', 'Dmeas');
gm_cl = load('../data/ground_motion_001.mat', 'Dmeas');
%% Compare OL and CL - Time
figure;
hold on;
plot(gm_ol.Dmeas.Time, gm_ol.Dmeas.Data(:, 2));
plot(gm_cl.Dmeas.Time, gm_cl.Dmeas.Data(:, 2));
legend({'y - OL', 'y - CL'})
hold off;
xlabel('Time [s]'); ylabel('Displacement [m]');
exportFig('gm_control_time_y', 'normal-normal')
%% Compare OL and CL - PSD
han_windows_ol = hanning(ceil(length(gm_ol.Dmeas.Time)/10));
[psd_y_ol, freqs_y_ol] = pwelch(gm_ol.Dmeas.Data(:, 2), han_windows, 0, [], 1/Ts);
han_windows = hanning(ceil(length(gm_cl.Dmeas.Time)/10));
[psd_y, freqs_y] = pwelch(gm_cl.Dmeas.Data(:, 2), han_windows, 0, [], 1/Ts);
figure;
hold on;
plot(freqs_y_ol, sqrt(psd_y_ol));
plot(freqs_y, sqrt(psd_y));
set(gca,'xscale','log'); set(gca,'yscale','log');
xlabel('Frequency [Hz]'); ylabel('PSD [$m/\sqrt{Hz}$]');
legend({'y - OL', 'y - CL'})
hold off;
exportFig('gm_control_psd_y', 'normal-normal')