Deltares / Ribasim

Water resources modeling
https://deltares.github.io/Ribasim/
MIT License
38 stars 5 forks source link

Support continuous controller #720

Closed SnippenE closed 5 days ago

SnippenE commented 9 months ago

Currently with DiscreteControl we can set values when thresholds are crossed. If say we want to gradually increase the flow_rate of an Outlet based on a water level further upstream (think Driel), we can currently approximate this with a stepped function by specifying many thresholds.

A more general fix would be to allow a LinearInterpolation from a scalar to another scalar, such that the target is continuously set based on the input. We need to think about how to implement this. Adding it to DiscreteControl may not be logical. Go better with #455.

SouthEndMusic commented 3 months ago

Note that this will influence the Jacobian sparsity structure. Pick up after https://github.com/Deltares/Ribasim/pull/1349.

SouthEndMusic commented 3 weeks ago

Some thoughts on this:

This works well of the outcome of the continuous control can be expressed as an explicit expression in terms of basin storages (not that we do not need to know this exact expression). From this expression the effect on the Jacobian sparsity is also immediately clear. Note here that the flow through connector nodes can also be expressed in terms of the storages of the connected basins.