From f5774f2ab9cb79eb9db6923f1e9c847955ee5295 Mon Sep 17 00:00:00 2001
From: Mauco03 <marco.gaibotti@skywarder.eu>
Date: Wed, 19 Feb 2025 12:09:54 +0100
Subject: [PATCH] [documentation] Updated automatrices documentation

---
 autoMatricesProtub/README.md | 84 ++++++++++++++++++++++++++++++------
 1 file changed, 70 insertions(+), 14 deletions(-)

diff --git a/autoMatricesProtub/README.md b/autoMatricesProtub/README.md
index 9c562a1c..165ba7a9 100644
--- a/autoMatricesProtub/README.md
+++ b/autoMatricesProtub/README.md
@@ -1,19 +1,75 @@
 # autoMatricesProtub
-This is a program developed in MATLAB to create the aerodynamic matrices of a rocket using Missile DATCOM 97 for different airbrakes configurations.
 
-## Usage
-The script requires the geometric variables describing the rocket which are taken from `simulationsData.m`:
+This program is developed in MATLAB to create the aerodynamic matrices of a rocket using Missile DATCOM 97 for different airbrakes configurations.
 
-``` matlab
-settings.mission = 'mission_name';
-dataPath = strcat('../data/', settings.mission);
-run(strcat(dataPath,'/simulationsData.m'));
-```
-where you have to replace `mission_name` with the specific name of the mission required.<br/>
-The variables that do not depend directly on the geometry of the rocket and that cannot be known a priori, like flight conditions, are taken from `configAutoMatProtub.m`.<br/>
-The computation is started by running `mainAutoMatProtub.m`
+---
+
+## How to Use It
+
+1. **Configure the Settings:** The script `autoMatProtubConfig.m` is where you set up the parameters for Missile DATCOM. You can configure:
+    * **State Values:** Define the Mach numbers, angles of attack, sideslip angles, and altitudes for which the aerodynamic coefficients will be computed.
+    * **High AOA Values:** Set the parameters for high angle of attack scenarios.
+    * **XCG Discretization:** Specify the number of center of gravity positions to generate aerodynamic matrices.
+
+2. **Run Script:** Execute the script `mainAutoMatProtub.m` to start the computation process.
+
+3. **Check Out the Results:** Once the computation is complete, the results are saved in `.mat` files in the mission's data directory.
+
+---
+
+## Key Files
+
+* **`mainAutoMatProtub.m`:** The main script to run the computation. It:
+    * Loads the necessary data and configurations.
+    * Computes the aerodynamic coefficients for both standard and high angle of attack scenarios.
+    * Saves the results in `.mat` files.
+
+* **`autoMatProtubConfig.m`:** The configuration script where you set up the parameters for the aerodynamic computation. Key settings include:
+    * **State Values:** Mach numbers, angles of attack, sideslip angles, and altitudes.
+    * **High AOA Values:** Parameters for high angle of attack scenarios.
+    * **XCG Discretization:** Number of center of gravity positions.
+
+    **Example Settings Inside `autoMatProtubConfig.m`:**
+    ```matlab
+    %% STATES
+    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.alt = (0:400:4000);         % above local ground (env.z0 will be added in main)
+
+    %% HIGH AOA
+    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.alt = (0:400:4000);  % above local ground (env.z0 will be added in main)
+
+    %% XCG Discretization
+    vars.Nxcg = 3;                   % Number of wanted xcgs in order to generate N aerodynamic matrices
+    ```
+
+* **`saveVars.m`:** A helper function to save the computed aerodynamic coefficients and state variables into `.mat` files.
+
+---
 
 ## Output
-The output data is stored in one `.mat` file named after the engine in the rocket.
-The coefficient matrix is directly saved in `../data/mission_name` and the access to each field is completely numerical, even to select the sub-matrix referred to a specific coefficient. <br/>
-For further details about these matrices, we suggest reading the [`README.md`](https://git.skywarder.eu/afd/msa/msa-toolkit/-/tree/master/simulator/README.md) file in the `simulator` folder.
+
+The output data is stored in `.mat` files named after the engine in the rocket. The coefficient matrices are saved in the mission's data directory under `common/missions/<missionName>/data/<engineName>.mat`. The data includes:
+
+* **State Variables:** Mach numbers, angles of attack, sideslip angles, altitudes, and center of gravity positions.
+* **Geometry Variables:** Rocket geometry parameters such as fin dimensions, nose length, and diameter.
+* **Aerodynamic Coefficients:** Coefficients for different flight conditions and airbrake configurations.
+
+---
+
+## Coefficients Matrix Dimensions
+
+The dimensions of the coefficients matrix are as follows:
+* **Coefficients:** The 15 exported aerodynamic coefficients.
+* **Alpha:** Angles of attack.
+* **Mach:** Mach numbers.
+* **Beta:** Sideslip angles.
+* **Altitude:** Altitudes.
+* **XCG:** Center of gravity positions.
+* **Airbrakes:** Airbrake configurations.
+
+
-- 
GitLab