From b816a706e89c1d1d792eefcf922d39e22ff5db52 Mon Sep 17 00:00:00 2001
From: Mauco03 <marco.gaibotti@skywarder.eu>
Date: Mon, 21 Apr 2025 21:03:58 +0200
Subject: [PATCH 1/9] [alpha-phi] Moved enums to dedicated folder

---
 classes/enums/CoeffType.m           | 7 +++++++
 classes/{bays => enums}/MotorType.m | 0
 2 files changed, 7 insertions(+)
 create mode 100644 classes/enums/CoeffType.m
 rename classes/{bays => enums}/MotorType.m (100%)

diff --git a/classes/enums/CoeffType.m b/classes/enums/CoeffType.m
new file mode 100644
index 0000000..85e051c
--- /dev/null
+++ b/classes/enums/CoeffType.m
@@ -0,0 +1,7 @@
+classdef CoeffType
+    enumeration
+        AlphaTotPhi
+        AlphaBeta
+    end
+end
+
diff --git a/classes/bays/MotorType.m b/classes/enums/MotorType.m
similarity index 100%
rename from classes/bays/MotorType.m
rename to classes/enums/MotorType.m
-- 
GitLab


From 703ac4cfdb2b9111e4e5a85effaa2256cdd61710 Mon Sep 17 00:00:00 2001
From: Mauco03 <marco.gaibotti@skywarder.eu>
Date: Mon, 21 Apr 2025 21:04:40 +0200
Subject: [PATCH 2/9] [alpha-phi] Implementing coefficient type enum and
 symmetry flag

---
 classes/misc/Coefficient.m | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/classes/misc/Coefficient.m b/classes/misc/Coefficient.m
index f7eb51b..fecc6f0 100644
--- a/classes/misc/Coefficient.m
+++ b/classes/misc/Coefficient.m
@@ -58,10 +58,12 @@ classdef Coefficient
         dynamic                     double  % Dynamic derivatives: [Clp, Cmad, Cmq, Cnr, Cnp]
     end
 
-
     properties(SetAccess = private)
-        isReady             (1, 1)  logical % Whether all coefficients are loaded and of the right size
-        isDynamic           (1, 1)  logical % Whether to load dynamic derivatives. Adds XCG dependece
+        type                        CoeffType   % Wheter based on alphaTot-phi or alpha-beta
+        symmetry            (1, 1)  logical     % Apply axial simmetry: valid for alphaTot-phi
+
+        isReady             (1, 1)  logical     % Whether all coefficients are loaded and of the right size
+        isDynamic           (1, 1)  logical     % Whether to load dynamic derivatives. Adds XCG dependece
     end
 
     properties(Access = private)
@@ -171,6 +173,14 @@ classdef Coefficient
         end
 
         function obj = set.state(obj, value)
+            if isfield(value, 'phis') && ~isempty(value.phis)
+                if ~isempty(value.betas), error('Cannot set both alpha, beta and phi'); end
+                obj.type = CoeffType.AlphaTotPhi;
+                obj.symmetry = (360/obj.STATE.phis(end) == obj.GEOMETRY.nPanel);
+            else
+                obj.type = CoeffType.AlphaBeta;
+            end
+
             obj.STATE   = value;
             obj.isReady = obj.checkProperties();
             obj         = obj.updateInterpolants();
-- 
GitLab


From 9000a0138530a6c589823cf78d7033b18ea7d449 Mon Sep 17 00:00:00 2001
From: Mauco03 <marco.gaibotti@skywarder.eu>
Date: Tue, 22 Apr 2025 11:05:32 +0200
Subject: [PATCH 3/9] [alpha-phi] Improved checks

---
 classes/misc/Coefficient.m                   | 30 ++++++++++++++++----
 functions/miscellaneous/createDissileInput.m |  9 +++---
 2 files changed, 29 insertions(+), 10 deletions(-)

diff --git a/classes/misc/Coefficient.m b/classes/misc/Coefficient.m
index fecc6f0..8d7c89a 100644
--- a/classes/misc/Coefficient.m
+++ b/classes/misc/Coefficient.m
@@ -167,6 +167,10 @@ classdef Coefficient
         end
 
         function obj = set.geometry(obj, value)
+            if ~isempty(obj.STATE) && isfield(obj.STATE, 'phis') && ~isempty(obj.STATE.phis)
+                obj.symmetry = (360/obj.STATE.phis(end) == value.nPanel);
+            end
+
             obj.GEOMETRY = value;
             obj.isReady  = obj.checkProperties();
             obj          = obj.updateInterpolants();
@@ -174,9 +178,13 @@ classdef Coefficient
 
         function obj = set.state(obj, value)
             if isfield(value, 'phis') && ~isempty(value.phis)
-                if ~isempty(value.betas), error('Cannot set both alpha, beta and phi'); end
+                if ~isempty(value.betas)
+                    error('Cannot set both alpha, beta and phi'); 
+                end
+                if ~isempty(obj.GEOMETRY)
+                    obj.symmetry = (360/value.phis(end) == obj.GEOMETRY.nPanel);
+                end
                 obj.type = CoeffType.AlphaTotPhi;
-                obj.symmetry = (360/obj.STATE.phis(end) == obj.GEOMETRY.nPanel);
             else
                 obj.type = CoeffType.AlphaBeta;
             end
@@ -224,12 +232,17 @@ classdef Coefficient
 
             alpha = obj.STATE.alphas;
             mach = obj.STATE.machs;
-            beta = obj.STATE.betas;
             altitude = obj.STATE.altitudes;
             airbakes = obj.STATE.hprot;
             xcg = obj.GEOMETRY.xcg;
  
-            gridVecs = {alpha, mach, beta, altitude, airbakes, xcg};
+            if obj.type == CoeffType.AlphaBeta
+                theta = obj.STATE.betas;                             % Converting to rad
+            else
+                theta = obj.STATE.phis;                              % Converting to rad
+            end
+
+            gridVecs = {alpha, mach, theta, altitude, airbakes, xcg};
             dims = cellfun(@(x) length(x), gridVecs);
             dims(dims == 0) = 1;                                            % Empty case is the same as scalar case
 
@@ -243,15 +256,20 @@ classdef Coefficient
             %% Retrieve flight conditions
             alpha = obj.STATE.alphas*pi/180;                                % Converting to rad
             mach = obj.STATE.machs;
-            beta = obj.STATE.betas*pi/180;                                  % Converting to rad
             altitude = obj.STATE.altitudes;
             xcg = obj.GEOMETRY.xcg;
 
             if isempty(obj.STATE.hprot), airbakes = 0;
                 else, airbakes = obj.STATE.hprot/obj.STATE.hprot(end);      % Normalizing on height
             end
+            
+            if obj.type == CoeffType.AlphaBeta
+                theta = obj.STATE.betas*pi/180;                             % Converting to rad
+            else
+                theta = obj.STATE.phis*pi/180;                              % Converting to rad
+            end
 
-            gridVecs = {alpha, mach, beta, altitude, airbakes, xcg};
+            gridVecs = {alpha, mach, theta, altitude, airbakes, xcg};
 
             % Find singleton dims (last dimension is coefficients and will not be of length 1)
             singletonDims = cellfun(@(x) isscalar(x) || isempty(x), gridVecs);
diff --git a/functions/miscellaneous/createDissileInput.m b/functions/miscellaneous/createDissileInput.m
index 39bc2b0..1c3f5ee 100644
--- a/functions/miscellaneous/createDissileInput.m
+++ b/functions/miscellaneous/createDissileInput.m
@@ -49,12 +49,12 @@ if not(any(vars.alpha == 1))
     error('vars.alpha does not contains 1');
 end
 
-if not(any(vars.alpha == -1))
-    error('vars.alpha does not contains -1');
+if isempty(vars.phi) && not(any(vars.alpha == -1))
+    error('vars.alpha does not contain -1 in alpha-beta configuration');
 end
 
-if not(isequal(vars.alpha, -fliplr(vars.alpha)))
-    error('vars.alpha is not symmetric');
+if isempty(vars.phi) && not(isequal(vars.alpha, -fliplr(vars.alpha)))
+    error('vars.alpha is not symmetric in alpha-beta configuration');
 end
 
 % if any(vars.abk > 1)
@@ -69,6 +69,7 @@ input.fltcon.about = 'Flight conditions quantities';
 input.fltcon.MACH = vars.mach;
 input.fltcon.ALPHA = vars.alpha;
 input.fltcon.BETA = vars.beta;
+input.fltcon.PHI = vars.phi;
 input.fltcon.ALT = vars.alt;
 
 %% REFQ
-- 
GitLab


From 1bc8c371f3852dab849aa6db901c8f275dfe025f Mon Sep 17 00:00:00 2001
From: Mauco03 <marco.gaibotti@skywarder.eu>
Date: Sat, 26 Apr 2025 22:48:52 +0200
Subject: [PATCH 4/9] [alpha-phi][Coefficient] Implemented coefficient
 transport

---
 classes/misc/Coefficient.m | 30 +++++++++++++++++++++++++++---
 1 file changed, 27 insertions(+), 3 deletions(-)

diff --git a/classes/misc/Coefficient.m b/classes/misc/Coefficient.m
index 8d7c89a..2e64d4e 100644
--- a/classes/misc/Coefficient.m
+++ b/classes/misc/Coefficient.m
@@ -91,7 +91,7 @@ classdef Coefficient
             obj         = obj.updateInterpolants();
         end
 
-        function coefficients = get(obj, alpha, mach, beta, altitude, airbakes, xcg)
+        function [coefficients] = get(obj, alpha, mach, beta, altitude, airbakes, xcg)
             % GET: Retrieve aerodynamic coefficients for specified flight conditions
             %
             %   This method interpolates the aerodynamic coefficients based on
@@ -116,10 +116,31 @@ classdef Coefficient
             
             if ~obj.isReady, error('Cannot interpolate coefficients: check that all dimensions match'); end
 
+            % Interpolating coefficients
             coefficients = zeros(11, 1);
-            coefficients(1:6) = obj.staticInterpolant(alpha, mach, beta, altitude, airbakes);
-            % Transporting static coefficients to new xcg
+            if obj.type == CoeffType.AlphaBeta
+                coefficients(1:6) = obj.staticInterpolant(alpha, mach, beta, altitude, airbakes);
+            else
+                [alphaTot, phi] = getAlphaPhi(alpha, beta);
+                phi = wrapTo2Pi(phi);
+
+                finAngle = 2*pi / obj.GEOMETRY.nPanel;                           % Angle between two fin panels
+                n = floor(phi / finAngle);
+                deltaPhi = n*finAngle;  
+                psi = phi - deltaPhi;                                            % Angle wrapped to finAngle
+                
+                coefficients(1:6) = obj.staticInterpolant(alphaTot, mach, psi, altitude, airbakes); % Get coeffs in limited range
+
+                if n > 1 % If necessary, perform rotation on different frame
+                    R = [cos(deltaPhi), -sin(deltaPhi);
+                        sin(deltaPhi), cos(deltaPhi)];
+    
+                    coefficients([2, 3]) = R  * coefficients([2, 3]);
+                    coefficients([5, 6]) = R' * coefficients([5, 6]);
+                end
+            end
 
+            % Transporting static coefficients to new xcg
             % C_B = C_A + d / c * [0; -CN; CY]_A <- NOTE: Non torna il meno su CN
             d = xcg - obj.GEOMETRY.xcg(1);
             l = obj.GEOMETRY.diameter;
@@ -130,6 +151,9 @@ classdef Coefficient
             coefficients(4:6) = coefficients(4:6) + d/l * forceCoeffs;
 
             if ~obj.isDynamic, return; end
+            if obj.type == CoeffType.AlphaTotPhi
+                error('Alpha-Phi coefficients do not support dynamic derivatives yet')
+            end
             coefficients(7:11) = obj.dynamicInterpolant(alpha, mach, beta, altitude, airbakes, xcg);
         end
     end
-- 
GitLab


From 17b238fc626f981b43f20e61d72523234f873fb0 Mon Sep 17 00:00:00 2001
From: Mauco03 <marco.gaibotti@skywarder.eu>
Date: Sun, 27 Apr 2025 00:28:43 +0200
Subject: [PATCH 5/9] [alpha-phi][Rocket] Added option to not load highAOA
 matrices

---
 classes/@Rocket/Rocket.m                         | 16 ++++++++++------
 .../config/rocketConfig.m                        |  1 +
 .../config/rocketConfig.m                        |  1 +
 .../config/rocketConfig.m                        |  1 +
 .../config/rocketConfig.m                        |  1 +
 .../config/rocketConfig.m                        |  2 +-
 .../config/rocketConfig.m                        |  1 +
 .../config/rocketConfig.m                        |  1 +
 .../config/rocketConfig.m                        |  1 +
 .../config/rocketConfig.m                        |  3 ++-
 10 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/classes/@Rocket/Rocket.m b/classes/@Rocket/Rocket.m
index 825e836..30c76a4 100644
--- a/classes/@Rocket/Rocket.m
+++ b/classes/@Rocket/Rocket.m
@@ -52,7 +52,8 @@ classdef Rocket < Config
         parachutes                  cell            % [-]       (nParachutes, nStages) Parachutes onboard
 
         dynamicDerivatives  (1, 1)  logical         % [-]       True if dynamic derivatives will be loaded
-        
+        highAOACoefficients (1, 1)  logical         % [-]       True if highAOACoefficients are loaded
+
         coefficients                Coefficient     % [-]       Aerodynamic coefficients
         coefficientsHighAOA         Coefficient     % [-]       Aerodynamic coefficients at high angle of attack
     end
@@ -150,13 +151,16 @@ classdef Rocket < Config
                     fullfile(mission.dataPath, 'aeroCoefficients.mat'), ...
                     coeffName);
 
-                obj.coefficientsHighAOA = Coefficient( ...
-                    fullfile(mission.dataPath, 'aeroCoefficientsHighAOA.mat'), ...
-                    coeffName);
+                if obj.highAOACoefficients
+                    obj.coefficientsHighAOA = Coefficient( ...
+                        fullfile(mission.dataPath, 'aeroCoefficientsHighAOA.mat'), ...
+                        coeffName);
+                end
 
                 answer = '';
                 
-                if isempty(obj.coefficients.static) || isempty(obj.coefficientsHighAOA.static)
+                if isempty(obj.coefficients.static) || ...
+                        (obj.highAOACoefficients && isempty(obj.coefficientsHighAOA.static))
                     answer = questdlg(['Coefficient matrices not found. ' ...
                         'Do you want to create new matrices?']);
                 elseif options.checkGeometry
@@ -195,7 +199,7 @@ classdef Rocket < Config
                         parserPath = fullfile(mission.msaPath, 'autoMatricesProtub');
                         addpath(genpath(parserPath));
                         [obj.coefficients, obj.coefficientsHighAOA] = ...
-                            mainAutoMatProtub(obj);
+                            mainAutoMatProtub(obj, 'computeHighAOA', obj.highAOACoefficients);
                     case 'Cancel'
                         error('Rocket creation aborted')
                     otherwise
diff --git a/missions/2021_Lynx_Portugal_October/config/rocketConfig.m b/missions/2021_Lynx_Portugal_October/config/rocketConfig.m
index 160c5b0..cb26401 100644
--- a/missions/2021_Lynx_Portugal_October/config/rocketConfig.m
+++ b/missions/2021_Lynx_Portugal_October/config/rocketConfig.m
@@ -20,6 +20,7 @@ rocket.lengthCenterNoMot = 1.7640;                                     % [m]
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
 rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PLD - Includes Parafoil + Nose
 parafoil = Parafoil();
diff --git a/missions/2021_Lynx_Roccaraso_September/config/rocketConfig.m b/missions/2021_Lynx_Roccaraso_September/config/rocketConfig.m
index d0dc3df..0851f94 100644
--- a/missions/2021_Lynx_Roccaraso_September/config/rocketConfig.m
+++ b/missions/2021_Lynx_Roccaraso_September/config/rocketConfig.m
@@ -20,6 +20,7 @@ rocket.lengthCenterNoMot = 1.7840;                                     % [m]
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
 rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PLD - Includes Parafoil + Nose
 parafoil = Parafoil();
diff --git a/missions/2022_Pyxis_Portugal_October/config/rocketConfig.m b/missions/2022_Pyxis_Portugal_October/config/rocketConfig.m
index 2f949bf..17d63ca 100644
--- a/missions/2022_Pyxis_Portugal_October/config/rocketConfig.m
+++ b/missions/2022_Pyxis_Portugal_October/config/rocketConfig.m
@@ -20,6 +20,7 @@ rocket.lengthCenterNoMot = 1.4470;                                     % [m]
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
 rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PLD - Includes Parafoil + Nose
 parafoil = Parafoil();
diff --git a/missions/2022_Pyxis_Roccaraso_September/config/rocketConfig.m b/missions/2022_Pyxis_Roccaraso_September/config/rocketConfig.m
index ee3a3c7..5b7406a 100644
--- a/missions/2022_Pyxis_Roccaraso_September/config/rocketConfig.m
+++ b/missions/2022_Pyxis_Roccaraso_September/config/rocketConfig.m
@@ -22,6 +22,7 @@ rocket.lengthCenterNoMot = 1.61;                                     % [m]
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
 rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PLD - Includes Parafoil + Nose
 parafoil = Parafoil();
diff --git a/missions/2023_Gemini_Portugal_October/config/rocketConfig.m b/missions/2023_Gemini_Portugal_October/config/rocketConfig.m
index 401c415..f9d6d4c 100644
--- a/missions/2023_Gemini_Portugal_October/config/rocketConfig.m
+++ b/missions/2023_Gemini_Portugal_October/config/rocketConfig.m
@@ -19,7 +19,7 @@ rocket.lengthCenterNoMot = 1.517;                                     % [m]
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
 rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
-
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PLD - Includes Parafoil + Nose
 parafoil = Parafoil();
diff --git a/missions/2023_Gemini_Roccaraso_September/config/rocketConfig.m b/missions/2023_Gemini_Roccaraso_September/config/rocketConfig.m
index fc2715b..cadbc7e 100644
--- a/missions/2023_Gemini_Roccaraso_September/config/rocketConfig.m
+++ b/missions/2023_Gemini_Roccaraso_September/config/rocketConfig.m
@@ -19,6 +19,7 @@ rocket.lengthCenterNoMot = 1.517;                                     % [m]
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
 rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PLD - Includes Parafoil + Nose
 parafoil = Parafoil();
diff --git a/missions/2024_Lyra_Portugal_October/config/rocketConfig.m b/missions/2024_Lyra_Portugal_October/config/rocketConfig.m
index f87640c..1d90d15 100644
--- a/missions/2024_Lyra_Portugal_October/config/rocketConfig.m
+++ b/missions/2024_Lyra_Portugal_October/config/rocketConfig.m
@@ -13,6 +13,7 @@ rocket.lengthCenterNoMot = [];                                          % [m]
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
 rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PLD - Includes Parafoil + Nose
 parafoil = Parafoil();
diff --git a/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m b/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m
index 2939db0..133be74 100644
--- a/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m
+++ b/missions/2024_Lyra_Roccaraso_September/config/rocketConfig.m
@@ -19,6 +19,7 @@ rocket.lengthCenterNoMot = [];                                          % [m]
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
 rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PLD - Includes Parafoil + Nose
 parafoil = Parafoil();
diff --git a/missions/2025_Orion_Portugal_October/config/rocketConfig.m b/missions/2025_Orion_Portugal_October/config/rocketConfig.m
index 6a13ec2..cab54ff 100644
--- a/missions/2025_Orion_Portugal_October/config/rocketConfig.m
+++ b/missions/2025_Orion_Portugal_October/config/rocketConfig.m
@@ -12,7 +12,8 @@ rocket.diameter = 0.15;                                                   % [m]
 % If dynamic derivatives are loaded, coefficient will depend on rocket xcg
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
-rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
+rocket.dynamicDerivatives = false;                                      % [-]      True if dynamic derivatives will be loaded
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PRF - Includes Parafoil + Nose
 parafoil = Parafoil();
-- 
GitLab


From 01ad37374e485282e37e3e35917d233f22e6bc53 Mon Sep 17 00:00:00 2001
From: Mauco03 <marco.gaibotti@skywarder.eu>
Date: Sun, 27 Apr 2025 00:29:28 +0200
Subject: [PATCH 6/9] [alpha-phi] Updated aerodynamic matrices

---
 .../2025_Orion_Portugal_October/data/aeroCoefficients.mat     | 4 ++--
 .../data/aeroCoefficientsHighAOA.mat                          | 4 ++--
 missions/2025_Orion_Roccaraso_September/config/rocketConfig.m | 1 +
 3 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/missions/2025_Orion_Portugal_October/data/aeroCoefficients.mat b/missions/2025_Orion_Portugal_October/data/aeroCoefficients.mat
index b3c1b23..3aa85db 100644
--- a/missions/2025_Orion_Portugal_October/data/aeroCoefficients.mat
+++ b/missions/2025_Orion_Portugal_October/data/aeroCoefficients.mat
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:75ad0a581c512de8f345a79f16d8e3d2bf681547eb386ce000434c66d6b292e0
-size 288267248
+oid sha256:f4ad48c4d016c33811361e5823e3fb0c87ae64679ff148293e2fcbb48c52f056
+size 300753532
diff --git a/missions/2025_Orion_Portugal_October/data/aeroCoefficientsHighAOA.mat b/missions/2025_Orion_Portugal_October/data/aeroCoefficientsHighAOA.mat
index 9bd98f0..00d9ce5 100644
--- a/missions/2025_Orion_Portugal_October/data/aeroCoefficientsHighAOA.mat
+++ b/missions/2025_Orion_Portugal_October/data/aeroCoefficientsHighAOA.mat
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:da4a2977b055341314ba88e9698ffbac9702c2e57e9b876c67ea2da01631b783
-size 40438794
+oid sha256:1659d1dc6b19ea13c3cdd75b8f9627d42123c4cb6dff535d93618247a17ab9d1
+size 46224320
diff --git a/missions/2025_Orion_Roccaraso_September/config/rocketConfig.m b/missions/2025_Orion_Roccaraso_September/config/rocketConfig.m
index c4e1ffc..e320c15 100644
--- a/missions/2025_Orion_Roccaraso_September/config/rocketConfig.m
+++ b/missions/2025_Orion_Roccaraso_September/config/rocketConfig.m
@@ -19,6 +19,7 @@ rocket.lengthCenterNoMot = [];                                          % [m]
 %   When false, coefficients are saved with current motor's name
 %   When true,  coefficients are saved as 'generic'
 rocket.dynamicDerivatives = false;                                    % [-]      True if dynamic derivatives will be loaded
+rocket.highAOACoefficients = false;                                     % [-]      True if separate matrix for high AOA will be loaded
 
 %% PLD - Includes Parafoil + Nose
 parafoil = Parafoil();
-- 
GitLab


From de478f1de46cae0c209f8d3940fc3ff5b3f235eb Mon Sep 17 00:00:00 2001
From: Mauco03 <marco.gaibotti@skywarder.eu>
Date: Sat, 3 May 2025 21:53:06 +0200
Subject: [PATCH 7/9] [motor] Added SFT2 motor

---
 .../2025_Orion_Portugal_October/config/environmentConfig.m    | 2 +-
 missions/2025_Orion_Portugal_October/config/rocketConfig.m    | 2 +-
 missions/2025_Orion_Portugal_October/data/motors.mat          | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/missions/2025_Orion_Portugal_October/config/environmentConfig.m b/missions/2025_Orion_Portugal_October/config/environmentConfig.m
index a667f90..4820fb5 100644
--- a/missions/2025_Orion_Portugal_October/config/environmentConfig.m
+++ b/missions/2025_Orion_Portugal_October/config/environmentConfig.m
@@ -11,7 +11,7 @@ environment.omega = 85*pi/180;          % [deg] Launchpad elevation
 environment.phi = 133*pi/180;           % [deg] Launchpad azimuth
 environment.pin1Length = 0.5603;        % [m] Distance from the upper pin to the upper tank cap
 environment.pin2Length = 0.2055;        % [m] Distance from the lower pin to the lower tank cap  
-environment.rampLength = 12;            % [m] Total launchpad length 
+environment.rampLength = 10;            % [m] Total launchpad length 
 
 % environment.temperature = [];           % [K] Ground temperature correction
 % environment.pressure = [];              % [Pa] Ground pressure correction
diff --git a/missions/2025_Orion_Portugal_October/config/rocketConfig.m b/missions/2025_Orion_Portugal_October/config/rocketConfig.m
index cab54ff..d47071c 100644
--- a/missions/2025_Orion_Portugal_October/config/rocketConfig.m
+++ b/missions/2025_Orion_Portugal_October/config/rocketConfig.m
@@ -75,7 +75,7 @@ airbrakes.servoTau = 0.0374588;
 %% MOTOR
 motor = Motor();
 
-motor.name = 'HRE_ARM_EuRoC_2024';
+motor.name = 'HRE_ARM_SFT_2';
 
 motor.cutoffTime = [];                                               % [s] OVERRIDE Cutoff time
 motor.ignitionTransient = 0.3;                                       % [s] Ignition transient
diff --git a/missions/2025_Orion_Portugal_October/data/motors.mat b/missions/2025_Orion_Portugal_October/data/motors.mat
index b559afd..679c796 100644
--- a/missions/2025_Orion_Portugal_October/data/motors.mat
+++ b/missions/2025_Orion_Portugal_October/data/motors.mat
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:c61e85655bf70ce3494f1f60ceafe391437e566c54e5451cfbcc652a2bf26871
-size 382167
+oid sha256:30f01e10ad8f07a578c9dcbdd18982ffb77eab23057ef003df0f20e51bea5bc2
+size 597957
-- 
GitLab


From c9bfcf4811946aa3ef734e5fc1599d4998470fa8 Mon Sep 17 00:00:00 2001
From: Mauco03 <marco.gaibotti@skywarder.eu>
Date: Sun, 18 May 2025 21:00:28 +0200
Subject: [PATCH 8/9] [alpha-phi] Fixed a bug where coeffType would not be set

---
 classes/misc/Coefficient.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/classes/misc/Coefficient.m b/classes/misc/Coefficient.m
index 2e64d4e..35aed65 100644
--- a/classes/misc/Coefficient.m
+++ b/classes/misc/Coefficient.m
@@ -240,7 +240,7 @@ classdef Coefficient
 
             obj.finsCN = dataCoeffs.finsCN;
             obj.GEOMETRY = dataCoeffs.geometry;
-            obj.STATE = dataCoeffs.state;
+            obj.state = dataCoeffs.state;
             
             % Load coefficients
             obj.total = dataCoeffs.total;
-- 
GitLab


From e6e250f2d3ce4f2b258181e00d8681966bac3973 Mon Sep 17 00:00:00 2001
From: Lorenzo Bettonte <lorenzo.bettonte@skywarder.edu>
Date: Sun, 18 May 2025 22:41:23 +0200
Subject: [PATCH 9/9] [alpha-phi] fixed a bug where n would in the wrong range
 (in Coefficient's class)  and Handle AoA matrix usage in alphaTotPhi cases
 (in ballistic)

---
 classes/misc/Coefficient.m         |  2 +-
 functions/odeFunctions/ballistic.m | 13 ++++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/classes/misc/Coefficient.m b/classes/misc/Coefficient.m
index 35aed65..219bca8 100644
--- a/classes/misc/Coefficient.m
+++ b/classes/misc/Coefficient.m
@@ -131,7 +131,7 @@ classdef Coefficient
                 
                 coefficients(1:6) = obj.staticInterpolant(alphaTot, mach, psi, altitude, airbakes); % Get coeffs in limited range
 
-                if n > 1 % If necessary, perform rotation on different frame
+                if n > 0 % If necessary, perform rotation on different frame
                     R = [cos(deltaPhi), -sin(deltaPhi);
                         sin(deltaPhi), cos(deltaPhi)];
     
diff --git a/functions/odeFunctions/ballistic.m b/functions/odeFunctions/ballistic.m
index d08b306..fed5600 100644
--- a/functions/odeFunctions/ballistic.m
+++ b/functions/odeFunctions/ballistic.m
@@ -134,7 +134,7 @@ end
 if not(abs(ur) < 1e-9 || velsNorm < 1e-9)
     alpha = atan(wr/ur);
     beta = atan(vr/ur);                                                     % beta = asin(vr/V_norm) is the classical notation, Datcom uses this one though.
-    % alpha_tot = atan(sqrt(wr^2 + vr^2)/ur);   % datcom 97' definition
+    alphaTot = atan(sqrt(wr^2 + vr^2)/ur);   % datcom 97' definition
 else
     alpha = 0;
     beta = 0;
@@ -144,14 +144,17 @@ alphaOut = alpha;
 betaOut = beta;
 
 %% INTERPOLATE AERODYNAMIC COEFFICIENTS:
-
-if abs(alpha) > rocket.coefficients.state.alphas(end)*pi/180 || ...
-        abs(beta) > rocket.coefficients.state.betas(end)*pi/180
-    coeffsValues = rocket.coefficientsHighAOA.get(alpha, mach, beta, absoluteAltitude, extension, xcg);
+if rocket.coefficients.type == CoeffType.AlphaBeta
+    if abs(alpha) > rocket.coefficients.state.alphas(end)*pi/180 || abs(beta) > rocket.coefficients.state.betas(end)*pi/180
+        coeffsValues = rocket.coefficientsHighAOA.get(alpha, mach, beta, absoluteAltitude, extension, xcg);
+    end
+elseif abs(alphaTot) > rocket.coefficients.state.alphas(end)*pi/180
+        coeffsValues = rocket.coefficientsHighAOA.get(alpha, mach, beta, absoluteAltitude, extension, xcg);
 else
     coeffsValues = rocket.coefficients.get(alpha, mach, beta, absoluteAltitude, extension, xcg);
 end
 
+
 % Retrieve Coefficients
 CA = coeffsValues(1); CY = coeffsValues(2); CN = coeffsValues(3);
 Cl = coeffsValues(4); Cm = coeffsValues(5); Cn = coeffsValues(6);
-- 
GitLab