Get started
What the Model Builder is
Updated 3 November 2026 · 4 min read
The Model Builder is for anything that changes over time because of what it is now. You draw the system as stocks and flows, SepalSolver works out how it moves, and you get charts you can fit to measurements and send to someone as a link.
The idea in one example#
Take an outbreak in a town of 10,000 people. On any given day, some people can still catch it, some are ill, and some have recovered. Those three numbers are the state of the town. Tomorrow’s numbers depend on today’s: the more people are ill, the more new infections there are, and the more have already caught it, the fewer are left to infect.
That is a system whose rates depend on its own state, and almost everything worth modelling looks like it. Money in an account earns interest on what is already there. A drug in the blood is cleared faster when there is more of it. A reservoir’s pressure falls as oil comes out, and the falling pressure slows the oil down. Writing the equations for these by hand is possible. Seeing them is easier.
What you draw#
A model is built from five parts. Each has a shape on the canvas, and the shape tells you what it is before you read its name.
A stock is an amount you could count at one moment: people ill, litres in a tank, degrees of heat in a cup. A flow is a rate that fills or drains a stock: people falling ill per day, litres per minute. Constants are the fixed numbers the flows depend on, each with a slider. Variables give names to values worked out along the way. Links show what depends on what, and appear on their own when you write a formula.
Stocks and flows explains why this way of drawing a system works so well. You don’t need it to start.
What runs it#
You never compute anything in your browser, and neither does the builder. When you press Run, it writes your model as a C# program and sends it to Reineur Solver, which runs it with SepalSolver: Ode45 or another solver integrates the stocks over time, Fzero solves equations you can’t rearrange, and Lsqcurvefit fits constants to data. Every number on every chart came out of that program.
You can read the program. The C# Code tab shows it exactly as it was sent, and Read and run the C# behind a model shows how to take it to the terminal and change it. If you are learning SepalSolver, this is a good way to see how its solvers are called on a real problem.
What you can do with the answer#
- Watch it move. Scrub along the time bar and every block on the canvas shows its value at that moment.
- Try other numbers. Drag a constant’s slider and the model reruns as you let go.
- Match it to measurements. Import a CSV of what really happened, tick the constants you don’t know, and let Fit to Data find them, with a ± on each.
- Ask what matters. Sweep a constant across its range, or compare scenarios, and see how far the answer moves.
- Send it. A share link carries the whole model; an embed puts it, sliders and all, into a page.
The examples#
The Models page opens with five worked models from different fields. Each has notes that explain how it was built and what to try. They are the fastest way to see what a finished model looks like.
| Example | What it shows |
|---|---|
| Carbon and warming | Carbon moving between the air, the ocean and the land, warming the surface; fitted to 60 years of measurements |
| Outbreak in a town | The three-stock epidemic above, with loops marked and a vaccination flow you can switch on |
| Oil field: depletion | Oil leaving a reservoir as pressure falls, with water pushing in from below |
| Gas field | A gas reservoir’s material balance, matched to pressure surveys and forecast with wells |
| Oil field: Havlena–Odeh | The same for oil, with an aquifer, diagnostic plots and drive indices |
Where to go next#
Read The editor at a glance to find your way around, then build your first model. It takes about ten minutes and ends with checking the answer by hand.
See also
- The editor at a glanceThe five areas of the editor, what each is for, and the time bar under the canvas.
- A cup of coffee coolingYour first model: one stock, one flow and two constants, checked against the exact answer.
- Stocks and flowsWhy a system is easier to model as what accumulates and what moves it.
- Read and run the C# behind a modelThe program SepalSolver runs, and how to take it to the terminal and change it.