List of useful custom expressions - plaa/Modular GitHub Wiki
The purpose of this page is to serve as a repository for useful custom expressions. For general information about how to use custom expressions in OpenRocket, see the users guide, section 9.
Basic properties of the physics of rocketry and kinematics. Can be quite useful from an educational point of view. Download all rocket dynamics expressions (.ork)
The energy in Joules (J) which the rocket possesses due to its translational motion. See http://en.wikipedia.org/wiki/Kinetic_energy Equation:
0.5 * m * Vt^2
The energy in Joules (J) which the rocket possesses due to its position in a gravitational field. The zero point is defined to be at mean sea level. Equation:
m * g * h
The chemical energy stored in the propellant. Equation:
mp * 500000
Here a representative figure for the potential energy of a solid rocket fuel of 500 kJ/kg is used.
The magnitude of the translational momentum vector. See http://en.wikipedia.org/wiki/Momentum Equation:
m * Vt
The magnitude of the angular momentum vector of the rocket about the roll axis. In Newton-meter-seconds (Nms). See http://en.wikipedia.org/wiki/Angular_momentum Equation:
Ir * dΦ
The ratio of the current mass to the launch mass. Equation:
m / m[0]
A measure of how efficient a rocket is in in turning propellant flow into thrust. Specific impulse is relative to the earth-weight of propellant and has units of seconds (s). See http://en.wikipedia.org/wiki/Specific_impulse. Equation:
(trapz(Ft[:]))/(9.81*(mp[0]-mp))
This gives the overall specific impulse for the flight. Note: you are probably mostly interested in the final value that this converges to. Future versions of openrocket may allow a quantity to be calculated only at the end of the flight.
Average exhaust speed along the axis of the engine. In m/s. Equation:
Isp*9.81
Gives the maximum change in speed of the rocket (m/s) in the ideal case of no external forces. Equation:
Ve*log(m[0]/m])
Download all aerodynamic expressions (.ork)
Note that some of these expressions depend on variables such as the center of pressure location and angle of attack which are only defined after launch guide clearance and before recovery device deployment.
A coefficient proportional to the corrective force that the rocket creates in response to a disturbance. See http://www.apogeerockets.com/education/downloads/Newsletter193.pdf Equation:
Vt^2*Ar*(Cn/α)*(Cp-Cg)*(P/(287.058*T)) / 2
The frequency at which the angle of attack of the rocket will oscillate following a disturbance. See http://www.apogeerockets.com/education/downloads/Newsletter196.pdf Equation (in Hz):
sqrt(Ccm/Il)/6.2831
A coefficient proportional to the rate at which any osculations resulting from a disturbance will die away. It is the sum of a propulsive damping term and a aerodynamic damping term. See http://www.apogeerockets.com/education/downloads/Newsletter195.pdf
This property can not be expressed as a custom expression, but is available as a simulation listener. To obtain this quantity, add the following simulation listener to your simulation settings for one or more of your simulations. Note that you don't actually have to run the simulation yet, just add it to at least one simulation.
A dimensionless quantity proportional to the rate of decay of oscillations and independent of the rocket velocity. As the damping ratio tends to 1 the system is critically damped and oscillations tend to zero. In the presence of constant crosswind some oscillation reduces weathercocking and overall a good balance is achieved with damping ratios between .05 and .3. See http://www.apogeerockets.com/education/downloads/Newsletter197.pdf for more details.
Cdm/(2*sqrt(Il*Ccm))
Note: requires damping moment listener
A pressure term (Pa) associated with the flow of a gas. It is proportional to the aerodynamic stress on the rocket. See http://www.grc.nasa.gov/WWW/k-12/airplane/dynpress.html. Note this is the usual version for incompressible flow.
Equation:
0.5 * Vt^2 * P / (T*287)
Simply the maximum dynamic pressure experienced during the flight.
Equation:
max(Q[:])
Note: with this and the later expressions, you are probably mostly interested in the final value of this at the end of the simulation.
The time (in seconds) after launch when the forces on the rocket are the greatest.
Equation:
tnear(Q[:],Qm)
The total time (in seconds) during the flight for which the dynamic pressure on the rocket is within 90% of the maximum.
Equation:
t*binf(Q[:],0.9*Qm,Qm)
These expressions are related to instrumentation you might have flying on a rocket. Download all instrumentation expressions (.ork)
Emulates an accelerometer with some low pass filtering (.5 s time constant) and a given upper saturation level (30 m/s^2).
Equation:
uclip( mean(At[t-.5:]), 30 )
Note: you may also want to break this up into acceleration Ax, Ay, Az.
The loss or attenuation due to distance in dB of a radio signal transmitted from the rocket to launch site. Here the radio frequency is given in MHz, 100 MHz in this example.
Equation:
20 * log10(.0418 * sqrt(Px^2+Py^2+h^2) * 100)
Download all rocket design expressions (.ork)
This estimates the rate of heat transfer in watts (W) due to friction from the air to the rocket. It is derived by using the drag force to get the change in momentum of a column of air around the rocket and from this the work done by the air on the rocket. It should be roughly proportional to velocity.
Equation:
(Fd*287*T)/(2*Ar*Vt*P)
This could be a starting point to further analysis taking into account the geometry and material of the rocket to find the temperature distribution. Or it could be used for an experimental test.
Simply integral of heating rate gives total heat transferred in Joules (J) Equation:
trapz(Rh[:])
These are mostly just for fun
Expression which appears in several equations in special relativity. Equation:
1/sqrt(1 - (Vt^2 / 299792458^2 ))
The mass of an object in motion (kg)
m*γ
The total energy of a moving body in J
sqrt( (m*299792458^2)^2 + (m*Vt*299792458^2)^2)