Skip to content
Solace · In buildSolace build book

Guide

OpenRocket custom expressions explained

How to calculate your own values in OpenRocket: the expression builder, units, index expressions, range expressions and a sensor filter example.

Concept render of the NOVTAR Solace rocket climbing after launch
Concept render of a Solace climb. NOVTAR Solace is in build and has not flown.

Updated 2026-11-24 ยท 4 min read

What is a custom expression in OpenRocket?

OpenRocket's Custom Expressions page (OpenRocket 23.09 documentation, read 24 November 2026) says you are not limited to the built-in simulation variables. You write an expression, and OpenRocket works it out at each time step of the simulation. The result can then be plotted or exported, which our plot and export guide explains.

How do you add one?

From the Analyze menu, choose custom expressions. The window starts empty, so you use the New expression button. You can also import expressions from another .ork file. The expression builder asks for four things: a name, a short symbol, the units and the expression itself. Each field has an indicator that turns from red to green, and you can only add or update the expression once all are green.

What are the rules for the name, symbol and units?

The documentation says:

  • Name: anything, as long as it has not been used before.
  • Symbol: a short symbol, not used before, with no numbers, spaces or special characters such as brackets or operators.
  • Units: no restrictions, and it can be empty for a dimensionless value. If you enter a standard SI unit exactly as listed, OpenRocket can convert the units when plotting or exporting. The listed units are m, m^2, m/s, kg, kg m^2, kg m^3, N, Ns, s, Pa, V, A, J, W, kg m/s, Hz and K.

Can one expression use another?

Yes. You can nest custom expressions by using one expression's symbol inside another. The order matters, because they are calculated in sequence. The blue arrows in the custom expression pane change the order. The Insert Variable button lists the available variables and their symbols, and the Insert Operator window lists the maths operators and functions.

What is an index expression?

Normally an expression sees the current time step only. An index expression reaches back to an earlier value, using square brackets with a time in seconds. The documentation gives two examples: m / m[0] is the current mass divided by the launch mass, and m - m[t-1] is the change in mass over the last second. OpenRocket interpolates to get the value at exactly that time. A time below 0 or above t is clipped to 0 or t, and you cannot read data that has not been calculated yet. You cannot nest another index or range expression inside the brackets.

What is a range expression?

A range expression gives a whole stretch of values, with a colon between the lower and upper bounds. If you leave the bounds out, the lower bound defaults to 0 and the upper to t. The documentation says range data is generated by interpolation with a fixed time step equal to the default step in your simulation options, and that functions such as trapz for trapezoidal integration and tnear for finding when a variable is nearest a value can use it. The operator list shows those that take a range.

How would you model a filtered accelerometer?

The documentation's own example models a low-pass filter as a moving average: mean(At[t-0.5:t]) is the mean of total acceleration (At) over the last 0.5 seconds. It then clips high values and scales to a voltage with 0.2 * uclip( mean(At[t-.5:]), 10 ). Our reading is that this is a way to see roughly what a filtered sensor would report. It is not a model of any particular chip. Our accelerometer range guide covers real sensor limits.

What about NOVTAR Solace?

We have not published any custom expression for NOVTAR Solace, and it has not flown. When it does, we would use expressions like these to compare a simulation with the log from its flight computer.

Next steps

  1. Run your normal simulation first.
  2. Add one simple expression, such as the mass ratio, and plot it.
  3. Check the units match an SI unit exactly if you want conversion.
  4. Export the result with the flight data export.

Questions

What are custom expressions in OpenRocket?

Your own calculated values, worked out at each simulation time step and plotted or exported like built-in variables. They have been available since OpenRocket 12.09.

Where do I add a custom expression?

From the Analyze menu under custom expressions, then the New expression button.

How do I get a value from earlier in the flight?

Use an index expression with square brackets, for example m[0] for the launch mass or m[t-1] for the mass one second ago.

Can I calculate an average over a time window?

Yes, with a range expression such as mean(At[t-0.5:t]), which averages total acceleration over the last 0.5 seconds.

Has NOVTAR Solace been simulated with custom expressions?

Not that we have published. NOVTAR Solace has not flown.