The Dynamic Solver
A controlled tank (holdup, composition, temperature, plus one integral state per controller) assembled into an augmented ODE system and integrated with SciPy's implicit BDF method — stable for the stiff dynamics a closed control loop produces.
dynamicsodetank
Concept
Every steady-state unit op gives you a converged answer with no notion of when. The dynamics engine adds time: a controlled tank's holdup, composition, and temperature (plus one integral-error state per closed loop) are assembled into one augmented ODE system and integrated forward from an initial condition, with step disturbances applied to the feed along the way.
The math
Show the governing equations
Integrated with SciPy's implicit BDF method — the right choice for a stiff system, which a closed control loop reliably produces (fast controller dynamics next to slow process dynamics). Heat capacity and density are evaluated once at the initial state (constant-property approximation) so the right-hand side stays pure-Python fast.
Execution
POST /api/simulations/{sim_id}/dynamics
{
"duration": 100.0, "n_points": 200,
"feed": {"flow": 5.0, "composition": {"water": 1.0}, "temperature": 320.0},
"tank": {"area": 1.0, "level0": 1.0, "T0": 320.0},
"controllers": [
{"pv": "level", "mv": "outlet_flow", "setpoint": 1.0,
"Kc": 5.0, "tauI": 20.0, "tauD": 0.0, "u_min": 0.0, "u_max": 50.0}
],
"disturbances": [{"time": 20.0, "var": "feed_flow", "value": 7.0}]
}Returns sampled time-series (level, composition, temperature, MV/PV per loop) for the Transient Trends monitor to plot live.