Skip to content
Snippets Groups Projects
Verified Commit ad1aebec authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

fix(plots): better inertia plot

parent 2108cbba
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ function plotwindonoff(ResData)
POSITION = 'Front';
INTERESTING_POINTS = [
0.10, 2, 7.7
0.10, 3, 4.6
];
PLOT_TIME = true;
SAVE_TIKZ_PARAM = []; % INTERESTING_POINTS(1:2, :);
......@@ -73,18 +73,18 @@ function plotwindonoff(ResData)
h1 = plot(time, fzOff, 'LineWidth', 1.2);
h2 = plot(time, fzOn, 'LineWidth', 1.2);
h3 = plot(time, meanDiff, 'LineWidth', 1.2);
text((donwStrokeEndIdx / nPeriodIdx) / 2, -1.25, ...
text((donwStrokeEndIdx / nPeriodIdx) / 2, -2.75, ...
'Downstroke', ...
'HorizontalAlignment', 'center');
text(donwStrokeEndIdx / nPeriodIdx + ...
(1 - (donwStrokeEndIdx / nPeriodIdx)) / 2, -1.25, ...
(1 - (donwStrokeEndIdx / nPeriodIdx)) / 2, -2.75, ...
'Upstroke', ...
'HorizontalAlignment', 'center');
setgca();
legend([h1, h2, h3], {'\airspeed = 0 m/s', '\airspeed = 7.7 m/s', 'Difference'});
legend([h1, h2, h3], {'\airspeed = 0 m/s', '\airspeed = 4.6 m/s', 'Difference'});
legend('boxoff');
xlim([0, 1]);
ylim([-1.5 1.5]);
ylim([-3 2]);
if isinteresting(ResData(i, j), SAVE_TIKZ_PARAM)
figdir = 'figures/results/';
......@@ -96,114 +96,114 @@ function plotwindonoff(ResData)
end
title(expParam);
figure;
hold on;
plot(time, fzOff);
plot(time, fzOn);
plot(time, meanDiff);
plot(time(round(end / 5)), fzOn(round(end / 5)), 'or');
yyaxis right;
plot(time, windOff.angles(windOffIdx));
title(expParam);
legend('Wind off', 'Wind on', 'Diff');
grid on;
xlim([0, 1]);
figure;
ax1 = subplot(3, 1, 1);
setcolormap();
hold on;
plot(anglesOn, fzOn);
plot(anglesOn(round(end / 5)), fzOn(round(end / 5)), 'or');
setgca('XTickLabel', [], ...
'YLabel', [], ...
'XLabel', []);
ax2 = subplot(3, 1, 2);
setcolormap();
hold on;
plot(anglesOff, fzOff);
% plot(meanPeakAngle(round(end / 5)), meanPeakFoff(round(end / 5)), 'or');
setgca('XTickLabel', [], ...
'XLabel', []);
ax3 = subplot(3, 1, 3);
setcolormap();
hold on;
plot(anglesOff, meanDiff);
% plot(meanPeakAngle(round(end / 5)), meanDiff(round(end / 5)), 'or');
linkaxes([ax1 ax2 ax3], 'xy');
ax1.YLim = 1.25 * ax1.YLim;
setgca('YLabel', []);
if isinteresting(ResData(i, j), SAVE_TIKZ_PARAM)
figdir = 'figures/results/';
filename = sprintf('inertia-Dx%0.2f_F%0.2f_V%0.1f.tex', ...
ResData(i, j).Testcase.dx, ...
ResData(i, j).Testcase.freq, ...
ResData(i, j).Testcase.airspeed);
save2tikz([figdir, filename], '\small');
end %
figure;
hold on;
plot(time, fzOff);
plot(time, fzOn);
plot(time, meanDiff);
plot(time(round(end / 5)), fzOn(round(end / 5)), 'or');
yyaxis right;
plot(time, windOff.angles(windOffIdx));
title(expParam);
legend('Wind off', 'Wind on', 'Diff');
grid on;
xlim([0, 1]);
figure;
ax1 = subplot(3, 1, 1);
setcolormap();
hold on;
plot(anglesOn, fzOn);
plot(anglesOn(round(end / 5)), fzOn(round(end / 5)), 'or');
setgca('XTickLabel', [], ...
'YLabel', [], ...
'XLabel', []);
ax2 = subplot(3, 1, 2);
setcolormap();
hold on;
plot(anglesOff, fzOff);
% plot(meanPeakAngle(round(end / 5)), meanPeakFoff(round(end / 5)), 'or');
setgca('XTickLabel', [], ...
'XLabel', []);
ax3 = subplot(3, 1, 3);
setcolormap();
hold on;
plot(anglesOff, meanDiff);
% plot(meanPeakAngle(round(end / 5)), meanDiff(round(end / 5)), 'or');
linkaxes([ax1 ax2 ax3], 'xy');
ax1.YLim = 1.25 * ax1.YLim;
setgca('YLabel', []);
if isinteresting(ResData(i, j), SAVE_TIKZ_PARAM)
figdir = 'figures/results/';
filename = sprintf('inertia-Dx%0.2f_F%0.2f_V%0.1f.tex', ...
ResData(i, j).Testcase.dx, ...
ResData(i, j).Testcase.freq, ...
ResData(i, j).Testcase.airspeed);
save2tikz([figdir, filename], '\small');
end
% Add titles after having saved
title(ax1, ['Wind on - ', expParam]);
title(ax2, ['Wind off - ', expParam]);
title(ax3, ['Diff - ', expParam]);
% Add titles after having saved
title(ax1, ['Wind on - ', expParam]);
title(ax2, ['Wind off - ', expParam]);
title(ax3, ['Diff - ', expParam]);
% figure;
% hold on;
% plot(time, fzOff);
% plot(time, fzOn);
% plot(time, meanDiff);
% plot(time(round(end / 5)), fzOn(round(end / 5)), 'or');
% yyaxis right;
% plot(time, windOff.angles(windOffIdx));
% title(expParam);
% legend('Wind off', 'Wind on', 'Diff');
% grid on;
% xlim([0, 1]);
%
% figure;
% ax1 = subplot(3, 1, 1);
% setcolormap();
% hold on;
%
% plot(anglesOn, fzOn);
% plot(anglesOn(round(end / 5)), fzOn(round(end / 5)), 'or');
% setgca('XTickLabel', [], ...
% 'YLabel', [], ...
% 'XLabel', []);
%
% ax2 = subplot(3, 1, 2);
% setcolormap();
% hold on;
% plot(anglesOff, fzOff);
% % plot(meanPeakAngle(round(end / 5)), meanPeakFoff(round(end / 5)), 'or');
% setgca('XTickLabel', [], ...
% 'XLabel', []);
%
% ax3 = subplot(3, 1, 3);
% setcolormap();
% hold on;
% plot(anglesOff, meanDiff);
% % plot(meanPeakAngle(round(end / 5)), meanDiff(round(end / 5)), 'or');
% linkaxes([ax1 ax2 ax3], 'xy');
% ax1.YLim = 1.25 * ax1.YLim;
% setgca('YLabel', []);
%
% if isinteresting(ResData(i, j), SAVE_TIKZ_PARAM)
% figdir = 'figures/results/';
% filename = sprintf('inertia-Dx%0.2f_F%0.2f_V%0.1f.tex', ...
% ResData(i, j).Testcase.dx, ...
% ResData(i, j).Testcase.freq, ...
% ResData(i, j).Testcase.airspeed);
% save2tikz([figdir, filename], '\small');
% end %
%
% figure;
% hold on;
% plot(time, fzOff);
% plot(time, fzOn);
% plot(time, meanDiff);
% plot(time(round(end / 5)), fzOn(round(end / 5)), 'or');
% yyaxis right;
% plot(time, windOff.angles(windOffIdx));
% title(expParam);
% legend('Wind off', 'Wind on', 'Diff');
% grid on;
% xlim([0, 1]);
%
% figure;
% ax1 = subplot(3, 1, 1);
% setcolormap();
% hold on;
%
% plot(anglesOn, fzOn);
% plot(anglesOn(round(end / 5)), fzOn(round(end / 5)), 'or');
% setgca('XTickLabel', [], ...
% 'YLabel', [], ...
% 'XLabel', []);
%
% ax2 = subplot(3, 1, 2);
% setcolormap();
% hold on;
% plot(anglesOff, fzOff);
% % plot(meanPeakAngle(round(end / 5)), meanPeakFoff(round(end / 5)), 'or');
% setgca('XTickLabel', [], ...
% 'XLabel', []);
%
% ax3 = subplot(3, 1, 3);
% setcolormap();
% hold on;
% plot(anglesOff, meanDiff);
% % plot(meanPeakAngle(round(end / 5)), meanDiff(round(end / 5)), 'or');
% linkaxes([ax1 ax2 ax3], 'xy');
% ax1.YLim = 1.25 * ax1.YLim;
% setgca('YLabel', []);
%
% if isinteresting(ResData(i, j), SAVE_TIKZ_PARAM)
% figdir = 'figures/results/';
% filename = sprintf('inertia-Dx%0.2f_F%0.2f_V%0.1f.tex', ...
% ResData(i, j).Testcase.dx, ...
% ResData(i, j).Testcase.freq, ...
% ResData(i, j).Testcase.airspeed);
% save2tikz([figdir, filename], '\small');
% end
% % Add titles after having saved
% title(ax1, ['Wind on - ', expParam]);
% title(ax2, ['Wind off - ', expParam]);
% title(ax3, ['Diff - ', expParam]);
%
% % Add titles after having saved
% title(ax1, ['Wind on - ', expParam]);
% title(ax2, ['Wind off - ', expParam]);
% title(ax3, ['Diff - ', expParam]);
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment