Skip to content
Snippets Groups Projects
Commit 4725f94d authored by Marco Luigi Gaibotti's avatar Marco Luigi Gaibotti
Browse files

[alpha-phi][Automatrices] Added option to override saveVars and computeHighAOA as argument

parent 9d0cd8a5
Branches alpha-phi
No related tags found
1 merge request!19Draft: Implementation of Alpha phi
Pipeline #11402 failed
...@@ -22,11 +22,15 @@ set(groot,'defaultAxesTickLabelInterpreter','latex'); ...@@ -22,11 +22,15 @@ set(groot,'defaultAxesTickLabelInterpreter','latex');
set(groot,'defaulttextinterpreter','latex'); set(groot,'defaulttextinterpreter','latex');
set(groot,'defaultLegendInterpreter','latex'); set(groot,'defaultLegendInterpreter','latex');
flags.saveVars = true;
flags.computeHighAOA = false;
%% STATES %% STATES
% State values in which the aerodynamic coefficients will be computed % State values in which the aerodynamic coefficients will be computed
vars.mach = 0.05:0.05:1; vars.mach = 0.05:0.05:1;
vars.alpha = [-22 -15 -10 -7.5 -5 -2.5 -1 -0.5 -0.1 0 0.1 0.5 1 2.5 5 7.5 10 15 22]; vars.alpha = [0 0.1 0.5 1 2.5 5 7.5 10 15 22 35 60 90.1 115 130 170];
vars.beta = [-13 -8 -5 -2.5 -0.1 0 0.1 2.5 5 8 13]; vars.beta = [];
vars.phi = [0:12:120];
vars.alt = (0:400:4000); % above local ground (env.z0 will be added in main) vars.alt = (0:400:4000); % above local ground (env.z0 will be added in main)
% xcg discretization % xcg discretization
...@@ -36,6 +40,7 @@ vars.Nxcg = 3; % Number of wanted xcgs in order to generate N ...@@ -36,6 +40,7 @@ vars.Nxcg = 3; % Number of wanted xcgs in order to generate N
varsHighAOA.mach = 0.05:0.05:0.7; varsHighAOA.mach = 0.05:0.05:0.7;
varsHighAOA.alpha = [-170 -130 -115 -90.1 -60 -35 -10 -5 -1 0 1 5 10 35 60 90.1 115 130 170]; varsHighAOA.alpha = [-170 -130 -115 -90.1 -60 -35 -10 -5 -1 0 1 5 10 35 60 90.1 115 130 170];
varsHighAOA.beta = [-170 -130 -115 -90.1 -60 -35 -10 -5 -1 0 1 5 10 35 60 90.1 115 130 170]; varsHighAOA.beta = [-170 -130 -115 -90.1 -60 -35 -10 -5 -1 0 1 5 10 35 60 90.1 115 130 170];
varsHighAOA.phi = [];
varsHighAOA.alt = (0:400:4000); % above local ground (env.z0 will be added in main) varsHighAOA.alt = (0:400:4000); % above local ground (env.z0 will be added in main)
%% FINS CN partial output %% FINS CN partial output
......
...@@ -3,7 +3,8 @@ arguments ...@@ -3,7 +3,8 @@ arguments
rocket = []; % Empty by default rocket = []; % Empty by default
environment Environment = Environment.empty environment Environment = Environment.empty
settings Settings = Settings.empty settings Settings = Settings.empty
options.saveVars logical = true options.saveVars logical = []
options.computeHighAOA = []
end end
%% PATH %% PATH
currentPath = fileparts(mfilename("fullpath")); currentPath = fileparts(mfilename("fullpath"));
...@@ -19,6 +20,8 @@ if isempty(rocket), rocket = Rocket(mission, [], "loadCoefficients", false); end ...@@ -19,6 +20,8 @@ if isempty(rocket), rocket = Rocket(mission, [], "loadCoefficients", false); end
if isempty(environment), environment = Environment(mission, rocket.motor); end if isempty(environment), environment = Environment(mission, rocket.motor); end
if isempty(settings), autoMatSettings = Settings('autoMatProtub'); end if isempty(settings), autoMatSettings = Settings('autoMatProtub'); end
Settings.read(autoMatSettings, options, 'flags');
%% FINALIZE CONFIG (with data not directly editable) %% FINALIZE CONFIG (with data not directly editable)
% correcting altitudes % correcting altitudes
autoMatSettings.vars.alt = autoMatSettings.vars.alt + environment.z0; autoMatSettings.vars.alt = autoMatSettings.vars.alt + environment.z0;
...@@ -88,11 +91,11 @@ input = createDissileInput(rocket, autoMatSettings.vars); ...@@ -88,11 +91,11 @@ input = createDissileInput(rocket, autoMatSettings.vars);
coeffsOut = exportVars( ... coeffsOut = exportVars( ...
autoMatSettings.vars, rocket, mission, coeffsTot, finsCN, chosenXcg, ... autoMatSettings.vars, rocket, mission, coeffsTot, finsCN, chosenXcg, ...
autoMatSettings.saveFinsCN, options.saveVars, 'aeroCoefficients.mat'); autoMatSettings.saveFinsCN, autoMatSettings.flags.saveVars, 'aeroCoefficients.mat');
%% COMPUTE AND EXPORT HIGH AOA AERODYNAMIC COEFFICIENTS %% COMPUTE AND EXPORT HIGH AOA AERODYNAMIC COEFFICIENTS
coeffsOutHighAOA = []; coeffsOutHighAOA = Coefficient();
if autoMatSettings.computeHighAOA if autoMatSettings.flags.computeHighAOA
fprintf('Generating new coefficients: High AoA...\n'); fprintf('Generating new coefficients: High AoA...\n');
autoMatSettings.varsHighAOA.xcg = rocket.xcg(end); autoMatSettings.varsHighAOA.xcg = rocket.xcg(end);
if length(autoMatSettings.varsHighAOA.alpha) > 20 || ... if length(autoMatSettings.varsHighAOA.alpha) > 20 || ...
...@@ -106,7 +109,7 @@ if autoMatSettings.computeHighAOA ...@@ -106,7 +109,7 @@ if autoMatSettings.computeHighAOA
coeffsOutHighAOA = exportVars( ... coeffsOutHighAOA = exportVars( ...
autoMatSettings.varsHighAOA, rocket, mission, coeffsTotHighAOA, finsCNHighAOA, chosenXcg, ... autoMatSettings.varsHighAOA, rocket, mission, coeffsTotHighAOA, finsCNHighAOA, chosenXcg, ...
autoMatSettings.saveFinsCN, options.saveVars, 'aeroCoefficientsHighAOA.mat'); autoMatSettings.saveFinsCN, autoMatSettings.flags.saveVars, 'aeroCoefficientsHighAOA.mat');
end end
AMtime = toc; AMtime = toc;
......
Subproject commit 1bc8c371f3852dab849aa6db901c8f275dfe025f Subproject commit 01ad37374e485282e37e3e35917d233f22e6bc53
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment