Skip to content
System dynamics (stock & flow) templates

System dynamics — bathtub stocks + flows

Pedagogical stock + inflow + outflow example.

Template previewSystem dynamics (stock & flow)
Bathtub: stock and flow basicsinflow= tapoutflow= k*WaterWaterinit = 0tap rate= 5k= 0.1

Make it your own.

title "Bathtub: stock and flow basics"
cloud src at (-1,2)
stock W "Water" at (3,2) initial 0
cloud drain at (7,2)
flow inflow from src to W rate "tap"
flow outflow from W to drain rate "k*Water"
aux tap at (1,4) value 5 label "tap rate"
aux k at (5,4) value 0.1 label "k"
info tap -> inflow
info W -> outflow
info k -> outflow