simulate
Run time-step simulations of water systems with timed set-point or ramp events, returning downsampled min, max, and final series along with warnings and mode changes.
Instructions
Simulate over time with a fixed step and timed events (set or linear ramp).
Samples at every multiple of step, at each event time and at the end. Returns downsampled series with min, max and final over the full run; each warning once (first time, last time, active at end); every mode change. Controls act after each sample's solve (taking effect over the next step); their series are always included and controls reports each loop at the end. Unless restore is true, the system keeps its final state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| step | No | Time step, e.g. '1 s'. | 1 s |
| units | No | Unit per path, e.g. {'v.volume_flow': 'L/s', 'mains.port.p': 'bar absolute'}; a key '*.<name>' matches every path ending in '.<name>'. | |
| events | No | e.g. [{'at': '60 s', 'set': {'valve.opening': 0}}, {'at': '2 min', 'ramp': {'filter.clogging': [0, 0.8]}, 'over': '30 min'}]. | |
| restore | No | Put parameters, inputs and states (tank levels) back afterwards. | |
| duration | Yes | Total time: seconds or e.g. '10 min'. | |
| system_id | Yes | ||
| variables | No | Paths ('v.volume_flow', 'v.port_a.p'), instance names, 'control' or '*'. Default: observables, states, port pressures and control results. | |
| max_points | No | Downsample series to this many samples. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| time | Yes | ||
| issues | Yes | ||
| samples | Yes | ||
| controls | No | ||
| duration | Yes | ||
| warnings | Yes | ||
| system_id | Yes | ||
| variables | Yes | ||
| final_modes | Yes | ||
| mode_changes | Yes |