How-to guides
Use a curve from data in a formula
Updated 3 November 2026 · 2 min read
Some relationships you know from data or experience but have no formula for: how crowding slows births, how efficiency falls off with load, what tax rate applies at each income. A lookup table holds such a curve as points, and formulas call it like a function.
Add one#
Click Lookup Table in the components list and place it on the canvas. Select it, and the side panel shows the curve and its points.
- 1The curve. Drag a point to move it; double-click to add or remove one.
- 2The same points as text. Paste two columns from a spreadsheet here.
You can shape it two ways:
- Drag a point on the curve. Double-click the background to add a point, or a point to remove it.
- Type or paste the points as
x, ypairs, one per line, under Points (x, y). Two columns copied from a spreadsheet work.
x must go up from one point to the next, and a table needs at least two points. What x stands for is a label for the x axis; it doesn’t change the arithmetic.
Use it in a formula#
Call the table by its name, with the value to look up in brackets:
BirthRate * Fish * Effect(Crowding)
Between two points the table reads along the straight line joining them. Beyond the first and last points it holds the end value flat.
A worked example#
In this model, fish breed at 0.8 a year and die at 0.2 a year. Births are slowed by Effect, a curve of how crowded the lake is: 1 when it is empty, 0.6 at its capacity of 1,000 fish, 0.2 at one and a half times capacity, 0 at twice.
- 1Effect, the lookup table.
- 2Crowding = Fish / Capacity, the value looked up.
The population settles where births equal deaths: 0.8 × Effect = 0.2, so Effect = 0.25. On the curve, 0.25 lies between 0.6 at crowding 1 and 0.2 at crowding 1.5, at 1 + 0.5 × (0.6 − 0.25)/(0.6 − 0.2) = 1.4375. That is 1,437.5 fish, and it is where the model settles.
See also
- Lookup tableA curve from points, called like a function.
- FormulasWhat a formula can contain: names, t, operators and functions.
- Write a rule in C#When a formula can't say it: ifs, loops and local variables in a block of your own C#.
- Feedback loopsWhere behaviour comes from: loops that reinforce and loops that balance.