diff --git a/apogeeAnalysis/README.md b/apogeeAnalysis/README.md index d259678ef3558e8169cc5714fc167ab8fe92d5b5..16c536dd375b01453e12e6ac6a5076189153a50a 100644 --- a/apogeeAnalysis/README.md +++ b/apogeeAnalysis/README.md @@ -1,101 +1,82 @@ -# apogeeAnalysis +### 3️⃣ **Review Output** -This program is developed in MATLAB for a primary apogee analysis with different motors when the structural mass is only known with a degree of uncertainty. The simulator computes the different apogees, maximum accelerations, and launchpad exit velocities for different motors and different masses. You can choose between simulating engines with a full or partial burn duration, in the latter the engine is cut at a fixed percentage of total burn time. +The simulation results are saved into structured variables for analysis and visualization. The following metrics are included: + +#### **Standard Analysis Results** +- **Apogee**: Maximum altitude achieved. +- **Maximum Acceleration**: Peak acceleration during flight, limited to 15g. +- **Launchpad Exit Velocity**: Velocity at launchpad exit, limited to 20 m/s. +- **Computation Time**: Time taken for the simulation. + +#### **Engine Cut Analysis Results** +- **Apogee**: Maximum altitude with engine cut-off considered. +- **Cut-Off Timing Variations**: Evaluates performance with up to 5 variations around 80% engine cut-off time. +- **Launchpad Exit Velocity**: Initial velocity, limited to 20 m/s. +- **Computation Time**: Time taken for the simulation. + +**Example Output**: +```matlab +standardResults = struct('apogee', 3100, 'maxAcceleration', 14.5, 'exitVelocity', 25, 'compTime', 2.7); +engineCutResults = struct('apogee', 2800, 'cutOffTimeVariations', 5, 'exitVelocity', 22, 'compTime', 3.1); +``` + + +## 📊 **Output Metrics** + +### **Standard Results** +The following metrics are calculated during the standard apogee analysis: +- **Apogee**: Maximum altitude reached by the rocket in meters. +- **Maximum Acceleration**: The highest acceleration experienced by the rocket during flight in g's. +- **Launchpad Exit Velocity**: The velocity of the rocket at the moment of launchpad exit in meters per second. +- **Computational Time**: Time taken to execute the simulation. + +### **Engine Cut Results** +For the engine cut scenario, the same metrics are calculated but with additional analysis on the effect of engine cutoff during flight: +- **Apogee**: Maximum altitude reached with engine cutoff simulated. +- **Maximum Acceleration**: The highest acceleration experienced with engine cutoff simulated. +- **Launchpad Exit Velocity**: The velocity at the moment of launchpad exit, simulating the effect of engine cutoff. +- **Computational Time**: Time taken to execute the engine cut simulation. + +### **Plots** +The following plots are generated based on the configuration settings: +- **Acceleration Plot**: Shows the rocket’s acceleration over time. +- **Launchpad Exit Velocity Plot**: Displays the rocket’s exit velocity against time. +- **Apogee Distribution Plot**: Displays the distribution of apogee values for all simulation runs, including uncertainties. ---- -## How to Use It -1. **Configure the Settings:** The script `apogeeAnalysisConfig.m` is where you set up the parameters for the apogee analysis. You can configure: - * **Total Impulse Range:** Define the range of total impulse to filter motors. - * **Mass Deviation:** Set the deviation from the structural mass. - * **Mass Points:** Specify the number of mass points in the deviation range. - * **Engine Company:** Choose the company that produces the engine. - * **Plot Options:** Set options for plotting maximum acceleration and launchpad exit velocity. - * **Wind and Launchpad Settings:** Configure wind magnitude, elevation, azimuth, and launchpad settings for both 'upwind' and 'downwind' scenarios. +## ⚠️ **Troubleshooting Output Issues** -2. **Run Script:** Execute the script `mainApogeeAnalysis.m` to start the computation process. +If the output data is not as expected, consider the following: -3. **Check Out the Results:** Once the computation is complete, the results are saved in `.mat` files in the mission's data directory. +1. **Check Configurations**: Ensure that motor settings, uncertainties, and environmental parameters are correctly specified in the `configApogee.m` file. Incorrect or missing configuration values could lead to unexpected results or errors during the simulation. + +2. **Inspect Simulation Logs**: Errors or warnings during the simulation will appear in the MATLAB command window. These logs provide helpful insights into what went wrong. Pay attention to any messages related to motor selection, uncertainties, or configuration issues that may require adjustment. + +3. **Verify Data Integrity**: If the simulation finishes successfully but the results appear invalid (e.g., unrealistic apogee or acceleration), ensure that the input data, such as motor properties, uncertainties, and environmental conditions, are reasonable and correctly configured. + +4. **Plot Visibility**: If plots are not displaying as expected, verify that the plotting options are enabled in the `configApogee.m` file. Additionally, ensure that the plot generation conditions (e.g., valid data for acceleration and exit velocity) are met. + +5. **Examine File Paths**: Make sure that the results and plot saving paths are correctly specified and accessible. Missing or incorrect file paths can prevent the saving of output data or plots. --- -## Key Files - -* **`mainApogeeAnalysis.m`:** The main script to run the computation. It: - * Loads the necessary data and configurations. - * Computes the apogee, maximum acceleration, and launchpad exit velocity for different motors and masses. - * Saves the results in `.mat` files. - -* **`apogeeAnalysisConfig.m`:** The configuration script where you set up the parameters for the apogee analysis. Key settings include: - * **Mission Name:** Specify the mission name. - * **Total Impulse Range:** Define the range of total impulse to filter motors. - * **Mass Deviation:** Set the deviation from the structural mass. - * **Mass Points:** Specify the number of mass points in the deviation range. - * **Engine Company:** Choose the company that produces the engine. - * **Plot Options:** Set options for plotting maximum acceleration and launchpad exit velocity. - * **Wind and Launchpad Settings:** Configure wind magnitude, elevation, azimuth, and launchpad settings for both 'upwind' and 'downwind' scenarios. - - **Example Settings Inside `apogeeAnalysisConfig.m`:** - ```matlab - %% ANALYSIS TYPE - analysis.isStandard = true; - analysis.isEngineCut = true; - - %% SELECT MOTORS - selection.producer = {'Skyward'}; - selection.totalImpulseRange = [10000 15000]; - selection.motorString = 'SFT'; - selection.motorName = {}; - - %% PLOTS OPTIONS - plots.targetApogee = 3000; - plots.maxAcceleration = 15; - plots.minVexit = 20; - plots.accelerationPlot = true; - plots.launchpadVelPlot = true; - - %% UNCERTAINTIES - uncert.totalImpulse = 145; - uncert.sigma = 3; - uncert.mass = 3; - uncert.massNumber = 15; - uncert.percEngineCut = 0.8; - uncert.percDeltaTime = 0.2; - uncert.timeEngineCutNumber = 5; - - %% HIGHEST CASE - cases(1).wind.altitudes = 0; - cases(1).wind.magVec = 0.01; - cases(1).wind.azVec = 180*pi/180; - cases(1).omega = 90*pi/180; - cases(1).phi = 0*pi/180; - cases(1).airbrakes.enabled = true; - cases(1).airbrakes.extension = 1; - cases(1).airbrakes.deltaTime = 0; - cases(1).thrustUncertSign = 1; - - %% LOWEST APOGEE CASE - cases(2).wind.altitudes = 0; - cases(2).wind.magVec = 9; - cases(2).wind.azVec = 0*pi/180; - cases(2).omega = 84*pi/180; - cases(2).phi = 0*pi/180; - cases(2).airbrakes.enabled = false; - cases(2).airbrakes.extension = 0; - cases(2).airbrakes.deltaTime = 0; - cases(2).thrustUncertSign = -1; - ``` +## 📝 **Further Analysis and Customization** + +You can further customize the post-simulation process and analysis: + +- **Modify Plotting Functions**: You can adjust the existing plotting functions in the `mainApogeeAnalysis.m` file to generate additional visualizations. For example, you could create additional plots for other metrics or different stages of the rocket flight. + +- **Sensitivity and Uncertainty Analysis**: If you want to analyze how different parameters affect the outcome, consider performing sensitivity analysis by adjusting one or more parameters, such as motor thrust or environmental conditions. This will help identify which factors have the greatest impact on apogee or acceleration. + +- **Advanced Statistical Analysis**: You can incorporate more advanced statistical tools to interpret the simulation results, such as Monte Carlo simulations, if you want to study the effect of uncertainty propagation in the system. + +- **Automate Comparison**: If you're running multiple simulations with different configurations, consider writing a MATLAB script that automatically compares the results and generates summary statistics or plots for easy interpretation. --- -## Outputs -The main outputs are the apogee, the maximum acceleration, and the launchpad exit velocity for every motor, mass, airbrakes, wind condition, and launchpad setup. This program will then plot a number of different figures, which will be a combination of the wind and airbrakes conditions chosen. +## 🛠 **License and Support** -### Plots -In every figure, there will be three subplots where apogees, maximum accelerations, and launchpad exit velocities will be plotted for every motor in every mass point. There will also be a legend, where the motors will be listed in the same order (and color) they appear in the apogee subplot. In the plots, some areas and lines appear. They represent the following: +This simulation framework is developed and maintained by **Skyward Experimental Rocketry** and is licensed under the **GPL-3.0-or-later** license. +For support, collaborations, or further inquiries, please contact us at [support@skywardrocket.com](mailto:support@skywardrocket.com). -- Green areas in both `upwind` and `downwind`, representing acceptable apogees. -- Line in the apogee subplot, representing the targeted apogee. -- Line in the maximum acceleration subplot, representing the maximum acceptable acceleration for electronic and structural constraints. -- Line in the launchpad exit velocity subplot, representing the minimum acceptable launchpad exit velocity for competition requirements.