Skip to content
Snippets Groups Projects
Commit 16db4910 authored by Matteo Gotti's avatar Matteo Gotti
Browse files

[fins-dimensioning][missions][functions] fixed motors and updated functions

parent 65906e9c
Branches
No related tags found
1 merge request!9Merging fins-dimensioning into main
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
......@@ -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
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, ...
......
Source diff could not be displayed: it is stored in LFS. Options to address this: view the blob.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment