Skip to content

Math Channels

Math channels are calculated channels you define with an equation. They let you derive new signals from existing data channels — and from other math channels — directly in Trace View, without exporting to a spreadsheet first.


Overview

A math channel is defined by an expression that references other channels using the channel(x) syntax, where x is the current X-axis value. For example:

vCar(x) * 3.6

converts car speed from m/s to km/h at every point along the lap.

Math channels can reference both raw data channels and other math channels, so you can build layered calculations such as normalised signals, balance metrics, or team-specific analysis channels.

Math channels that are visible in Trace View are included when results are exported from the File Viewer, and bundle permissions can include them so shared result packages carry the calculated channels your team expects.

Math channels are available across every chart type in Trace View — trace lines, scatter, distribution, correlation, and the track heat map. Select a math channel from the metrics axis selector wherever you choose a channel for an axis or colour scale.


Referencing Vehicle Parameters

In addition to data channels, expressions can reference vehicle setup parameters as scalar values using a dotted path, for example:

aero.front_wing.cl_multiplier
chassis.wheelbase.value

These values come from the vehicle attached to each result, so the same equation evaluates correctly across results run on different vehicles. The equation editor suggests parameters from the currently loaded vehicle as you type.

Per-result resolution

If a path is not found on the currently loaded vehicle, a warning appears, but the channel is still saved and evaluates against each result's own vehicle at run time. This lets you keep one library of analysis channels that work across your fleet.


Referencing Metrics

Expressions can also reference a result's summary metrics — lap time, top speed, energy figures, and so on — using the metrics. prefix:

metrics.vCarMax
vCar(x) / metrics.vCarMax * 100

Like vehicle parameters, metrics are scalars, so they take no (x). They resolve against each result's own metrics, and the equation editor suggests them as you type alongside channels and vehicle parameters.

Where a referenced metric has a convertible unit, an Input metric units section appears in the editor so you can choose the unit it is evaluated in. This defaults to the metric's SI base unit.

Unknown metric names

A metric name that isn't recognised raises an amber warning ("Unknown metric reference") rather than blocking the save, so a channel written against a metric that only some results carry can still be stored and reused.


Operators and Signs

Any binary operator may be followed directly by a signed number, so expressions like the following are valid:

vCar(x) * -1
gLat(x) / -9.81
nEngine(x) ^ -2

Chained signs are also resolved correctly (x * --1 becomes x, and x * ---1 becomes -x). Malformed sequences such as vCar(x) */ are still rejected by the editor.


Conditionals

An expression can restrict itself to the samples you care about. Two syntaxes are available and they mean exactly the same thing — write whichever reads better. Whichever you type is what gets saved, and Format never rewrites one into the other.

mean(hRideF(x)) when vCar(x) >= 120 && abs(gLat(x)) < 0.1
if (vCar(x) >= 120 && abs(gLat(x)) < 0.1) {
  mean(hRideF(x))
}

when binds loosest, so the whole && chain is the condition — no extra brackets needed. Because if is an expression rather than a statement it nests anywhere, including inside a function argument, and else if chains work as you would expect:

if (vCar(x) > 250) {
  3
} else if (vCar(x) > 120) {
  2
} else {
  1
}

Both spellings of each boolean operator parse identically: && / and, || / or, ! / not.

Comparisons cannot be chained. Write a > 1 && a < 5, not 1 < a < 5 — the editor rejects the latter rather than pick a meaning for it.

Where you put the reducer matters

This is the part worth reading twice. A conditional hides samples; reducers ignore hidden samples. Those two facts together mean the position of mean(...) relative to the condition changes what you get.

Expression Result
mean(hRideF(x) when c) One value — the average of hRideF over only the samples where c holds. The conditional average, usable as a metric.
mean(hRideF(x)) when c A series — the whole-run average of hRideF, drawn only where c holds. Plots as a flat line broken into segments.

The first is what you usually want ("average front ride height while cornering steadily at 120–140 km/h"). The second is useful for checking the window falls where you think it does.

null

null is the absent value. A condition that fails with no else / otherwise produces it. A null sample is a gap: it draws as a break in the line rather than a zero, and reducers skip it — which is exactly what makes the conditional average above work.

Give a fallback when you want a number instead of a gap:

hRideF(x) when vCar(x) > 120 otherwise 0
if (vCar(x) > 120) { hRideF(x) } else { 0 }

ifBetween

ifBetween(value, low, high) is shorthand for a pair of comparisons, inclusive on both ends:

ifBetween(vCar(x), 120, 140)

is the same as vCar(x) >= 120 && vCar(x) <= 140.


Reading a Value Off a Series

channel[value unit] is the value of a channel where an axis first reaches that point, linearly interpolated between the two straddling samples rather than snapped to the nearest one:

hRideF[100 km/h]

The unit's group chooses which channel is searched:

Unit group Channel searched
speed (m/s, km/h, mi/h, …) vCar
length (m, mm, in, …) sRun
time (s, ms, min, …) tRun

So hRideF[500 m] is the front ride height 500 m into the run, and hRideF[2.5 s] is its value 2.5 seconds in.

Any other unit has no default channel and must name one explicitly. You can also use the explicit form to override the default:

hRideF[vCar = 100 km/h]
nEngine[nEngine = 8000 RPM]

The unit must be one from the platform's unit list; an unrecognised one is flagged in the editor.

The result is a single value, so an index can be used as a metric and indexes combine like numbers:

hRideF[100 km/h] - hRideR[100 km/h]

Only where the point is crossed once

The lookup takes the first crossing. That makes it meaningful on an acceleration run, where a given speed is reached once, and misleading on a lap where the car passes through it repeatedly. If the axis never reaches the value, the result is null.


Reserved Names

A math channel cannot be named after anything the expression language already uses, because a reference to it could not be told apart from the token itself. That covers the function names (mean, sum, integral, ifBetween, sin, …), the constants pi and e, the variable x, the metrics prefix, and the conditional keywords if, else, when, otherwise, and, or, not and null.

The editor rejects a reserved name as you save, and suggests Eq_<name> instead.


Channel Units

Each math channel can declare its own unit, chosen from the searchable unit list in the equation editor. The declared unit appears on axis labels and tooltips wherever the channel is shown, just like a built-in channel.

You can also pin the input unit for each dependency channel. For example, if your expression expects vCar in km/h rather than m/s, pin vCar → km/h and the conversion is applied automatically before your expression runs.


Aggregate Functions

In addition to standard arithmetic and elementary functions, aggregate functions work across the trace. Some produce a new per-point trace, and some reduce to a single value.

Series functions (per-point trace)

Function Arguments Result
integral(channel(x)) 1 Running cumulative integral (trapezoidal) at every point
integral(channel(x), lower, upper) 3 A single definite integral value over the range from lower to upper
cumsum(channel(x)) 1 Running cumulative sum at every point
derivative(channel(x)) 1 Numerical derivative (rate of change) at every point

Reducers (single value)

Each reducer collapses a channel to one value, so a math channel built from a reducer can be used as a metric (on the metrics graphs and sweep parallel-coordinates page) as well as a flat line on a trace. Called with one argument they reduce the whole trace; with (channel(x), lower, upper) they reduce only the slice where the X axis is within those bounds.

Function Result
sum Total (whole-trace or windowed sum)
max / min Maximum / minimum value
mean Arithmetic mean
std Standard deviation
rms Root-mean-square, sqrt(mean(x²))
median Median value
mode Most frequent value (best for discrete channels such as NGear)
first / last First / last sample

Examples:

integral(vCar(x))               # cumulative distance from speed (trace)
integral(vCar(x), 100, 500)     # distance covered between 100 m and 500 m (single value)
cumsum(gLat(x))                 # running cumulative lateral g (trace)
derivative(vCar(x))             # longitudinal acceleration from speed (trace)
max(vCar(x))                    # top speed (single value)
mean(gLat(x), 100, 500)         # average lateral g between 100 m and 500 m
rms(gLong(x))                   # RMS longitudinal g (single value)

Bounds apply to the X axis

The second and third arguments (on integral, sum, and the other reducers) are the lower and upper bounds along the current X axis (for example distance or time). cumsum and derivative accept only a single argument.


Display Units

Aggregate functions operate on data already converted to your chosen display units. If a referenced channel (for example hRollCentreR) is set to display in mm, the function receives values in mm, so the result comes out in the units you expect — no manual rescaling required.


The Equation Editor

The editor highlights your expression as you type, underlines the exact characters of any error with the reason, and offers completions — grouped into keywords, functions, constants, channels, car parameters and metrics — navigable with the arrow keys. Inside a […] index it offers units instead, since a channel name is not what belongs there.

Tab indents and Shift+Tab outdents, so an if block can be laid out by hand. Press Escape to move focus out of the field.

Format tidies the layout and nothing else:

  • Spacing around operators is made consistent, and an if block is indented.
  • Only the parentheses that change the meaning are kept, so redundant ones are dropped.
  • Which conditional syntax you wrote is preserved; when is never turned into if.
  • Running it twice changes nothing.

Autoformat, the checkbox beside the Format button, applies that same tidy-up automatically every time you save. It is on by default and remembered in your browser. Switch it off to have your equation stored exactly as you typed it, spacing and all.

Expression reference opens a searchable guide to everything available — channels, metrics, car parameters, functions and conditionals — where clicking any entry inserts it at the cursor.


Pulling Math Channels Out of ARD

Math channels are included when results are exported from the File Viewer, and teams on a plan with API access can request them by name alongside a result's other channels — a reducer arrives with the metrics, anything else with the trace data, using null for the gaps. See HHDM Integration.


  • Trace View — Where math channels are created, edited, and displayed
  • Metrics — Summary values derived from result channels
  • Channel Reference — Units and descriptions for every channel you can reference
  • HHDM Integration — Pulling math channels into other tools over the API