diff --git a/utils/plotwindonoff.m b/utils/plotwindonoff.m index 7e957ad2130431369bf44a23a466601a1721675f..4f9f2a3d19e8cb8dd1c9820d421c716f9f120cfe 100644 --- a/utils/plotwindonoff.m +++ b/utils/plotwindonoff.m @@ -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