DRSS is a MATLAB Domain-Specific Language (DSL) for simulating low-altitude, subsonic rocketry.
Comparing to OpenRocket, DRSS offers much greater extensibility and ergonomics for implementing custom event handling and special components, and takes full advantages of MATLAB's mature tooling and environment. Unlike the former, users are not limited to the behaviors and capabilities of a GUI. DRSS allows users to perform optimization of not just rocket design but also flight plan parameters against any arbitrary cost function. Stage separation, parachutes, and parallel simulation of jettisioned payloads are also more ergonomic. Results generally align between DRSS and other GUI-based softwares, though aerodynamic calculations and atmospheric wind modeling may have nuanced differences.
- Declarative: An intuitive and expressive syntax to define rocket components, dynamics and scripted events.
- Accurate Physics: Research-backed and field-tested models for rocket aerodynamics, motor thrust, and parachute dynamics.
- Event Handling: Complex event-driven behaviors like stage separation and parachute deployment.
- Solver-agnostic: Choose from any MATLAB's built-in ODE solvers and customize their parameters to suit your needs.
- Modularity: Easily extend and customize simulations with object-oriented programming.
-
Clone the Repository
git clone https://github.com/SitanHuang/DRSS.git
-
Add to MATLAB Path
addpath(genpath('path_to_DRSS'));
Note: The +VADL
folder contains modules specific to the Vanderbilt Aerospace Design Laboratory and initially developed for VADL's participation in NASA's USLI competitions and can serve as examples or be extended for your own projects.
DRSS is object-oriented and provides plug-and-play abstraction over the physical components, events and dynamics of a rocket system.
It is ergonomical to implement custom behaviors in DRSS. Consult in-line documentation below:
Additionally, the built-in dynamics objects serve as good examples.
-
A
System
is a specialMassGroup
that represents a 3 Degree-of-Freedom point mass that is subject to certain dynamics and holds states data in the time domain. It serves as the root container for all other components, including masses, dynamics, and events. It can be the actual rocket, a rocket stage, or a jettisioned payload. -
The
Mass
class represent a one-dimensional mass span with properties such as moment of inertia, mass, length, center of gravity, and relative location measured from the tip of the parent. Masses should be sequentially appended to aMassGroup
.
Events are special Dynamics
objects that trigger based on certain conditions, such as reaching apogee or a specific altitude. They can enable or disable other Dynamics
objects and trigger other events. Custom events must implement the IEventTriggerDynamics interface. Examples:
apogeeListener = DRSS.core.dynamics.events.Apogee() ...
.setEnabledOnInit(false);
disableAscentDynamics = DRSS.core.dynamics.events.TriggerOnEnable() ...
.setDisableBoundDynamicsOnTrigger(true) ...
.trigger(rocketDynamics) ...
.trigger(apogeeListener);
apogeeListener ...
.trigger(disableAscentDynamics) ...
.trigger(rocketDescentDrag) ...
.trigger(drogue);
A Dynamics
object abstracts the various physical forces, torques and behaviors acting upon a System
. Examples:
- Parachute: Simulates the deployment and drag of parachutes during descent. Usually triggered by an altitude detection event.
drogue = DRSS.core.dynamics.Parachute() ...
.setDiameter(15 * uc.in_to_m) ...
.setCD(1.5) ...
.setN(8) ...
.setEnabledOnInit(false) ... % usually triggered by an event listener
.setDeploymentTimeDelay(0.5) ...
...
- LaunchRail: Models the launch rail mechanics and applies initial conditions to
System
.
launchRailDynamics = DRSS.core.dynamics.LaunchRail() ...
.setLaunchRailAngleDeg(5) ...
.setLaunchRailLength(12 * 12 * uc.in_to_m) ...
.setLaunchRailButtonLoc(61 * uc.in_to_m) ...
.setLaunchRailExitVelocityMethod( ...
DRSS.core.dynamics.LaunchExitVelocityMethods.RAIL_BUTTON_CROSSES_RAIL_TIP) ...
.bindToGravityDynamics(gravityDynamics) ...
...
- Gravity: Models the gravitational force acting on the rocket.
gravityDynamics = DRSS.core.dynamics.Gravity() ...
.setTerminateOnGrounding(true) ...
.setGroundingTimeThreshold(1) ...
...
- Motor: Models a rocket motor and its thrust profile.
motorDynamics = DRSS.core.dynamics.Motor( ...
"L1400.csv", "L1400", @VADL.vadl_motor_database);
- RocketAerodynamics: Calculates aerodynamic forces during ascent based on the rocket's geometry and atmospheric conditions.
rocketDynamics = DRSS.core.dynamics.RocketAerodynamics( ...
'D', rocket_diameter, ...
'L_nose', 7.5 * uc.in_to_m, ...
... % other parameters
).recalcTransientParameters(sys);
- Other
Dynamics
objects can be found inDRSS.core.dynamics.*
The following script demonstrates how to simulate a rocket's ascent from launch rail to apogee, including the definition of rocket sections, dynamics, and events.
The following script simulates the descent of a payload after jettisoning from the main rocket body.
All contributions are welcome. Simply initiate pull requests here on Github.
Note: This project is intended for educational and simulation purposes only. Always follow safety regulations and guidelines when conducting rocketry activities.