diff --git a/autoMatricesProtub/autoMatProtubConfig.m b/autoMatricesProtub/autoMatProtubConfig.m index 3dc509dc8daa5bcd3cf1cc20702d3a8d776edd0d..84797c278c5cec39ac673f6c494c6bbac6bf6c9b 100644 --- a/autoMatricesProtub/autoMatProtubConfig.m +++ b/autoMatricesProtub/autoMatProtubConfig.m @@ -22,11 +22,15 @@ set(groot,'defaultAxesTickLabelInterpreter','latex'); set(groot,'defaulttextinterpreter','latex'); set(groot,'defaultLegendInterpreter','latex'); +flags.saveVars = true; +flags.computeHighAOA = false; + %% STATES % State values in which the aerodynamic coefficients will be computed 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.beta = [-13 -8 -5 -2.5 -0.1 0 0.1 2.5 5 8 13]; +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 = []; +vars.phi = [0:12:120]; vars.alt = (0:400:4000); % above local ground (env.z0 will be added in main) % xcg discretization @@ -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.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.phi = []; varsHighAOA.alt = (0:400:4000); % above local ground (env.z0 will be added in main) %% FINS CN partial output diff --git a/autoMatricesProtub/mainAutoMatProtub.m b/autoMatricesProtub/mainAutoMatProtub.m index 7c0167ec7b5f761c57726edff4355f3dc87cd5fa..e248f56e6cc5955ec450afe9bca883b1360bae7f 100644 --- a/autoMatricesProtub/mainAutoMatProtub.m +++ b/autoMatricesProtub/mainAutoMatProtub.m @@ -1,9 +1,10 @@ function [coeffsOut, coeffsOutHighAOA] = mainAutoMatProtub(rocket, environment, settings, options) arguments rocket = []; % Empty by default - environment Environment = Environment.empty - settings Settings = Settings.empty - options.saveVars logical = true + environment Environment = Environment.empty + settings Settings = Settings.empty + options.saveVars logical = [] + options.computeHighAOA = [] end %% PATH currentPath = fileparts(mfilename("fullpath")); @@ -19,6 +20,8 @@ if isempty(rocket), rocket = Rocket(mission, [], "loadCoefficients", false); end if isempty(environment), environment = Environment(mission, rocket.motor); end if isempty(settings), autoMatSettings = Settings('autoMatProtub'); end +Settings.read(autoMatSettings, options, 'flags'); + %% FINALIZE CONFIG (with data not directly editable) % correcting altitudes autoMatSettings.vars.alt = autoMatSettings.vars.alt + environment.z0; @@ -88,11 +91,11 @@ input = createDissileInput(rocket, autoMatSettings.vars); coeffsOut = exportVars( ... 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 -coeffsOutHighAOA = []; -if autoMatSettings.computeHighAOA +coeffsOutHighAOA = Coefficient(); +if autoMatSettings.flags.computeHighAOA fprintf('Generating new coefficients: High AoA...\n'); autoMatSettings.varsHighAOA.xcg = rocket.xcg(end); if length(autoMatSettings.varsHighAOA.alpha) > 20 || ... @@ -106,7 +109,7 @@ if autoMatSettings.computeHighAOA coeffsOutHighAOA = exportVars( ... autoMatSettings.varsHighAOA, rocket, mission, coeffsTotHighAOA, finsCNHighAOA, chosenXcg, ... - autoMatSettings.saveFinsCN, options.saveVars, 'aeroCoefficientsHighAOA.mat'); + autoMatSettings.saveFinsCN, autoMatSettings.flags.saveVars, 'aeroCoefficientsHighAOA.mat'); end AMtime = toc; diff --git a/common b/common index 1bc8c371f3852dab849aa6db901c8f275dfe025f..01ad37374e485282e37e3e35917d233f22e6bc53 160000 --- a/common +++ b/common @@ -1 +1 @@ -Subproject commit 1bc8c371f3852dab849aa6db901c8f275dfe025f +Subproject commit 01ad37374e485282e37e3e35917d233f22e6bc53