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#
| Setting | What it is |
|---|---|
| Name | Its name; in formulas, one word. |
| Unit | What it is measured in. |
| Value | Its value, with a slider. |
| Lowest, Highest | The ends of the slider’s range, and the limits a fit may search within. |
| Input | Lets 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
See also
- VariableA value worked out from others by a formula, at every step.
- Fit constants to measurementsChoose what to fit, run the fit, and read the ± and R² that come back.
- Find which constants matterSweep one constant across its range and see how far the answer moves.
- Module and boxesA model with inputs and outputs, used as one block; and folding any box.