∿Dynamics LabSTOCK & FLOW STUDIOR1 · NOV 13, 2026
THE MODEL
EXAMPLE MODEL

Balance inventory, production capacity, and profit under uncertain demand.

Locally autosaved

Stock & flow diagram

Drag to arrange · Click to edit
100%

Element properties

Simulation settings

Time is measured in model units.

Model equations

Select any row to edit
VariableTypeEquation / initial valueUnitsLast run: final
DYNAMICS LAB / R1

Build a model. Explore its behavior.

1. Create your system

Choose Stock, Converter, or Parameter, then click the canvas. For a Flow, click its source stock (or empty canvas for a cloud), then its destination. Click an element to edit. Drag to move. Press Escape to leave a tool.

A stock accumulates its inflows minus outflows. Its equation specifies its initial value. A flow equation is a rate per time unit. Converters calculate intermediate values; parameters hold constants. Dashed information links are derived automatically from equation references.

2. Run and compare

Set start, end, and time step. RK4 is the default; Euler is available for teaching and simple checks. Run the model, select chart variables, and pin a run before changing parameters to compare scenarios. CSV exports include all time steps.

3. Explore uncertainty

Enable parameters in Risk Analysis. Each trial draws one independent value per parameter, held constant throughout that run. Choose Uniform, Normal, Triangular, Beta-PERT (λ = 4), or Lognormal. Normal uses mean and standard deviation. Lognormal uses arithmetic mean and standard deviation. PERT and Triangular use minimum, maximum, and most likely value. Seeds reproduce trials.

The fan shows pointwise percentiles, not a simultaneous confidence band. Threshold probabilities use the selected outcome measure. Failed trials are reported and excluded, so interpret probabilities cautiously if any fail. Input sensitivity is linear correlation, not causation.

4. Optimize a policy

Enable decision parameters and set bounds. Maximize or minimize an output at the final time, its peak, minimum, time average, or time integral. Optional integer decisions and one output constraint are supported. Choose minimum ≥ bound to impose a floor at every recorded time step.

The search uses seeded differential evolution (rand/1/bin). Feasible candidates outrank infeasible candidates. Robust mode maximizes or minimizes the mean over a fixed set of sampled scenarios; constraints must hold across that set. It is a search, not a global-optimality guarantee. Use independent Monte Carlo trials to assess the resulting policy.

Equations

Use variable identifiers exactly (case-sensitive), e.g. Population * Growth_rate. Rename an identifier in the property editor to update references. Use the label field for names with spaces.

+ − * / ^ ( )Arithmetic; ^ means power< <= > >= == != && || !Comparisons and logicTIME, DT, PI, EBuilt-in values (any case)min(a,b), max(a,b), abs(x)Bounds and magnitudesqrt(x), exp(x), ln(x), log(x)Roots, exponentials, natural / base-10 logsin(x), cos(x), tan(x)Angles in radiansfloor(x), ceil(x), round(x)Roundingpow(x,y), clamp(x,low,high)Power and clippingif(condition,yes,no)Evaluates only the selected branchstep(height,start)Step at an absolute timeramp(slope,start)Linear ramp from a start timelookup(x,0,0,10,100,20,150)Piecewise linear; flat outside endpoints
Numerical practice. Reduce DT and compare results to assess convergence. Nonnegative stocks cause a run to fail if an integration step would go negative; outflows are not silently rescaled. Positive-only flows are clamped to zero when their equation is negative. Enable signed flow for reversible or net rates. Units are labels, with no automatic dimensional checking. This first release does not import proprietary PowerSim/STELLA/iThink files or include built-in transport delays, correlated sampling, or sensitivity to time-varying random shocks. Delays can be modeled with additional stocks.

Model files: .sdf (JSON). Browser autosave is a convenience; use Save model for a portable copy. All calculations run locally. Method reference: Differential evolution overview.