MAE-440 Final Project Code
This project is designed for simulation and analysis of solid propellant grains. It performs detailed model-based calculations for propellant burn, motor chamber pressure, thrust characteristics, and the resulting flight trajectory of a rocket. The software is organized around propellant characterization, burn geometry, motor optimization, and vehicle ascent performance. While the program does account for all of the previously mentioned items, it is primarily meant to design propellant count and geometry characteristics.
Key features include:
- Grain design and burn simulation
- Pressure and thrust analysis per time step
- Trajectory calculation for powered/coast phases (accounts for 2-stage rocket and changing time of ignition of upper stage)
- Data display and graphing utilities
- Optimization tools for design parameters (Almost not usable, implements brute force approach)
- Flexible propellant grain and case geometry modeling
- Stepwise simulation and analysis of chamber pressure, burn rate, thrust, and impulse
- Rocket trajectory simulation including drag, Mach, and flight altitude/velocity
- Batch optimization of design variables to target max altitude or other constraints
- Data tabulation and terminal color-coded summary output
- Modular graphing for rapid visualization
| Module | Purpose |
|---|---|
| Propellant.py | Model solid propellant grain, burn area, web thickness and time stepping |
| TrajectoryFunctions.py | Calculates vehicle flight trajectory given burn and environmental data |
| DataDisplay.py | PrettyTables display utilities for all analysis results, with terminal color feedback |
| Graph.py | General-purpose line graphing/plotting utilities (matplotlib) |
| Terminal.py | Terminal color formatting and screen control tools |
| Optimizer.py | Brute-force optimizer for multistage/parameter sweep design tasks |
| machFinder.py | Supersonic/subsonic Mach number solvers for nozzle calculations |
| PropellantTest.py | Unit and integration tests for propellant performance simulation |
| GraphTest.py | Unit and integration tests for all graphing/visualization features |
| requirements.txt | List of required Python dependencies and versions |
- Python 3.10+
- Install dependencies with:
pip intstall -r requirements.txt
Place the code modules in a single project directory structure. Ensure that submodules such as libraries and dataStructures (if referenced) are available as dependencies.
A common workflow:
- Define propellant and motor geometry parameters in
data.py. - Simulate a single motor burn profile with
PropellantTest.pyfor pressure, thrust, impulse, and web recession output. - Simulate a trajectory using
TrajectoryFunctions.pyfor ascent analysis. - Use
Optimizer.pyto perform batch sweeps for parameters like bore diameter, grain length, nozzle expansion ratio, etc., aiming for the desired apogee or constraint set. - Visualize results with
Graph.pyand tabular outputs withDataDisplay.py.
- The toolkit is modular: add more physical models (e.g., new drag formulas, wind models) in separate files and link them in the workflow.
- Plug in new propellant chemistries or grain geometries by modifying or subclassing
Propellant.py. - Adjust tabulation and color criteria within
DataDisplay.pyas needed for different projects. - The optimizer supports brute-force sweeps; swap in global/local search or bounded strategies for faster results in future work.
- Use the included test scripts (
PropellantTest.py,GraphTest.py) to validate model and UI updates. - Integration with external or real test data can be achieved by building appropriate I/O wrappers and data pipelines.
Key libraries (see requirements.txt):
- numpy
- matplotlib
- prettytable
good matplotlib reference: https://www.geeksforgeeks.org/plot-mathematical-expressions-in-python-using-matplotlib/