diff --git a/functions/miscellaneous/exitVelocity.m b/functions/miscellaneous/exitVelocity.m index 4cdc36718f616dd6188b32a92b7a9f48335a6e57..5709f67ca4144e2a99391b0f16d9a845f9ec41f0 100644 --- a/functions/miscellaneous/exitVelocity.m +++ b/functions/miscellaneous/exitVelocity.m @@ -1,4 +1,4 @@ -function velExit = exitVelocity(settings) +function velExit = exitVelocity(rocket, environment, settings) %{ exitVelocity - This function calculates the launchpad exit velocity. @@ -27,15 +27,12 @@ SPDX-License-Identifier: GPL-3.0-or-later % Initial State X0pad = [0; 0; 0; 0]; % Attitude -Q0 = angleToQuat(settings.PHI, settings.OMEGA, 0*pi/180)'; - - - nAlpha = size(settings.Coeffs, 2); - nBeta = size(settings.Coeffs, 4); - meanCA = settings.Coeffs(1, ceil(nAlpha/2), 1, ceil(nBeta/2), 1, 1, 1); % CA at alpha = 0 | beta = 0 | Mach = 0.05 | ARB = closed | Xcg = full - -[~, Ypad] = ode113(@launchPadFreeDyn, [0, 10], X0pad, settings.ode.optionspad,... - settings, Q0, meanCA); +Q0 = angleToQuat(environment.phi, environment.omega, 180*pi/180)'; + nAlpha = size(rocket.coefficients.total, 2); + nBeta = size(rocket.coefficients.total, 4); + meanCA = rocket.coefficients.total(1, ceil(nAlpha/2), 1, ceil(nBeta/2), 1, 1, 1); % CA at alpha = 0 | beta = 0 | Mach = 0.05 | ARB = closed | Xcg = full +[~, Ypad] = ode113(@launchPadFreeDyn, [0, 10], X0pad, settings.ode.optLaunchpad,... + rocket, environment, Q0, meanCA); velExit = Ypad(end, 4); \ No newline at end of file diff --git a/functions/simulations/quickApogeeOnly.m b/functions/simulations/quickApogeeOnly.m index a8595a15840210efbe3aeccc849af7f1f5e78b37..1f34971a3ccc4830a80d8ba55486041e31360d05 100644 --- a/functions/simulations/quickApogeeOnly.m +++ b/functions/simulations/quickApogeeOnly.m @@ -4,7 +4,7 @@ arguments environment Environment wind WindCustom settings Settings - wrapper DataWrapper + wrapper = []; % DataWrapper (empty by default) end %{ quickApogeeOnly - This function tests the fins simulating the ascent @@ -41,20 +41,16 @@ if not(rocket.airbrakes.enabled) && length(rocket.airbrakes.extension) > 1 error('To simulate different airbrakes opening, please set to true settings.multipleAB in config.m'); end -% if rocket.airbrakes.enabled && length(rocket.airbrakes.extension) < 2 -% error('In airbrakes smooth opening simulations, airbrakes configuration must be always greater than 2 (from launch), check config.m') -% end - if rocket.airbrakes.enabled && length(rocket.airbrakes.extension) > 1 && length(rocket.airbrakes.deltaTime) < length(rocket.airbrakes.extension) - 2 error('In airbrakes smooth opening simulations, AB configuration usage time vector must be at least of length length(pCOntrol)-2, check config.m') end -% if settings.wind.variable -% error('Wind variable model available just in stoch simulations'); -% end - %% DATA PREPARATION -options = odeset(settings.ode.optAscent, 'OutputFcn', @storeData); +if isempty(wrapper) + options = odeset(settings.ode.optAscent); +else + options = odeset(settings.ode.optAscent, 'OutputFcn', @storeData); +end tf = settings.ode.finalTime; %% INITIAL CONDITIONS @@ -68,10 +64,6 @@ W0 = [0; 0; 0]; Y0a = [X0; V0; W0; Q0; 0]; -%% WIND GENERATION -% [uw, vw, ww, ~] = windConstGenerator(settings.wind); -% settings.constWind = [uw, vw, ww]; - %% ASCENT t0 = 0; [Ta, Ya] = ode113(@ballistic, [t0, tf], Y0a, options, ... diff --git a/missions/2024_Lyra_Portugal_October/data/motors.mat b/missions/2024_Lyra_Portugal_October/data/motors.mat index 33a052f0c162bcbfd2a7ecceb6dac061d7cddda3..fbad2d9fa76d068810d415d028c5213f4277a325 100644 --- a/missions/2024_Lyra_Portugal_October/data/motors.mat +++ b/missions/2024_Lyra_Portugal_October/data/motors.mat @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dff4610133e4db71aadd2d83e2b0513655581b4b0a4c404973735814963af198 -size 5465773 +oid sha256:b6b54a264d9ae4628a203d7bcca2a4db3e6853835d5d1a403d4f8d999d2a0d08 +size 5458716