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.

  1. 1The function of x to add up.
  2. 2The range to add it up over.

Settings#

SettingWhat it is
FormulaA 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:

TimeLimitArea
10 s10.7468
25 s2.50.8859
30 s30.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.