Reference: components

Constant

Updated 3 November 2026 · 1 min read

A constant is a fixed number with a unit, a range and a slider. Every number in a model with a meaning should be one.

Place one#

Click Constant in the components list, then the canvas. It is drawn as a diamond with its value.

Settings#

SettingWhat it is
NameIts name; in formulas, one word.
UnitWhat it is measured in.
ValueIts value, with a slider.
Lowest, HighestThe ends of the slider’s range, and the limits a fit may search within.
InputLets an outer model set it when this one goes in as a module.

Constants also appear as sliders in the Simulation tab, so you can change them without selecting them: under Key Parameters when the model marks some as key, as the examples do, or all of them under Constants. The Variables tab lists every constant with its value.

Use it for#

Rates, sizes, prices, times and anything else you assume rather than compute: a contact rate, a room temperature, a half-life, a plateau rate. Writing RecoveryRate * Infected rather than 0.14 * Infected says what 0.14 is, gives it a unit to check, and puts a slider on it.

Ranges#

Set Lowest and Highest to what is believable, not merely possible. They do two jobs: they keep the slider in a useful range, and they are the bounds Fit to Data searches between. A range that is too narrow traps a fit; one that is far too wide lets it wander into values that mean nothing.

In the C##

Each constant is one declaration at the top of the program, with its unit and name as a comment:

double RoomTemperature = 20;                // °C, room temperature