diff --git a/common b/common index 5284cad0c7c8e41cfcf7a299437780e1eaa3619d..980f4165e3b771afc96141ea1dadb033d5a42320 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 5284cad0c7c8e41cfcf7a299437780e1eaa3619d +Subproject commit 980f4165e3b771afc96141ea1dadb033d5a42320 diff --git a/simulator/mainSimulator.m b/simulator/mainSimulator.m index 04846a9b2c5fc84d5afa3da1170d9a54d73faa16..2294620f2820bb4d89577477e8ae4ce1793fd20e 100644 --- a/simulator/mainSimulator.m +++ b/simulator/mainSimulator.m @@ -89,4 +89,5 @@ toc(tStart) prints(ascent, descent, environment) if settings.simulator.plots, stdPlots(ascent, descent, rocket, environment, settings); end +if settings.simulator.SMonly, designPlots(ascent, descent, rocket, environment, settings); end end \ No newline at end of file diff --git a/simulator/simulatorConfig.m b/simulator/simulatorConfig.m index 977961b274431f6f25b9dfb1446337728b76cd4e..6a92c67fe2779c6b84f2e087d1768c8677ce5cc6 100644 --- a/simulator/simulatorConfig.m +++ b/simulator/simulatorConfig.m @@ -22,6 +22,7 @@ simulator.unitTest = true; % NOTE: airbrakes enable flag is set in rocketConfig %% PLOTS -simulator.plots = true; % True to plot data after simulation +simulator.plots = false; % True to plot data after simulation simulator.landingMap = true; % True to run geoplots -simulator.satellite3D = false; % True to plot trajectory on 3D map \ No newline at end of file +simulator.satellite3D = false; % True to plot trajectory on 3D map +simulator.SMonly = true; % True to plot only SM (useful during design!) \ No newline at end of file diff --git a/simulator/src/designPlots.m b/simulator/src/designPlots.m new file mode 100644 index 0000000000000000000000000000000000000000..68c77c787544d00ff1d860c19dc568e1115ed8d0 --- /dev/null +++ b/simulator/src/designPlots.m @@ -0,0 +1,22 @@ +function designPlots(ascent, descent, rocket, environment, settings) +arguments + ascent struct + descent struct + rocket Rocket + environment Environment + settings Settings +end + +tAscent = ascent.state.time; + +%%% Stability Margin +figure('Name','Stability Margins - ascent Phase','NumberTitle','off'); +plot(tAscent, -ascent.coeff.XCPlon, '.',... + tAscent, -ascent.coeff.XCPlat, '.',... + tAscent, ascent.coeff.XCPtot, '.'); + +title('Stability margin vs time'), grid on; +legend('Longitudinal', 'Lateral', 'Total') +xlabel('Time (s)'); ylabel('S.M.(/)') +ylim([0 6.5]) +end \ No newline at end of file