Reference: components
Integral
Updated 3 November 2026 · 1 min read
An integral is a variable worked out by SepalSolver’s Integral: at every step, a function of x added up between two bounds. The bounds can move with the model.
- 1The function of x to add up.
- 2The range to add it up over.
Settings#
| Setting | What it is |
|---|---|
| Formula | A function of x to integrate. It may use t, stocks, constants and variables. |
| From x =, To x = | Formulas for the ends of the range. They can move as the model runs. |
Integral or stock?#
Both add something up, over different things. A stock adds its flows up over time, carrying its value from one step to the next. An integral adds a function up over x, afresh at every moment. Use a stock for anything that accumulates; use an integral when, at each moment, you need the area under a curve.
A worked example#
The area under the bell curve e−x² from 0 to a limit that grows by 0.1 a second:
| Time | Limit | Area |
|---|---|---|
| 10 s | 1 | 0.7468 |
| 25 s | 2.5 | 0.8859 |
| 30 s | 3 | 0.8862 |
The area can never pass √π / 2 = 0.886227, however far the limit goes. At a limit of 3 it is 0.886207, which is √π / 2 times erf(3), as it should be.
In the C##
double Area = Integral(x => Exp(-x * x), 0, Limit); // integrated over x
Use it for#
The area under a dose–response curve, energy over a spectrum, the volume of a tank of varying cross-section filled to a moving level, cumulative probability up to a threshold that changes.
See also
- Nonlinear function (Fzero)The x between two bounds that makes an expression zero, at every step.
- StockAn amount that builds up or runs down, changed only by its flows.
- FormulasWhat a formula can contain: names, t, operators and functions.
- VariableA value worked out from others by a formula, at every step.