Why
The goal of this issue is to get rid of as many non-zeros in the Jacobian (more precisely: the jacobian_prototype) as possible to boost performance. Some of these non-zeros are only there in case a reduction factor is triggered, which is generally a rare event. Connections that only cause non-zeros in the Jacobian because of a reduction factor:
Basin upstream of a UserDemand
Basin upstream of a Pump *
Basin upstream or downstream of an Outlet *
.* Unless controlled by PID control (or continuous control in the future)
If we can get rid of the reduction factors for these nodes, we can probably significantly boost the performance of models that have many connections of this type.
How
We still somehow need to handle the events that are now captured by these reduction factors. One way to do this is by using VectorContinuousControl which we previously used for DiscreteControl. Say for each basin we have a boolean flag is_empty and the expression
is_empty + storage^2
Then is_empty is set to true if this expression is $0$, in which state no abstraction from the basin is possible. One thing to figure out is what should be the trigger to set is_empty back to false.
Maybe we can get rid of low_storage_factor completely this way. Similar things can be done for the other reduction factors of Outlet.
Why The goal of this issue is to get rid of as many non-zeros in the Jacobian (more precisely: the
jacobian_prototype
) as possible to boost performance. Some of these non-zeros are only there in case a reduction factor is triggered, which is generally a rare event. Connections that only cause non-zeros in the Jacobian because of a reduction factor:UserDemand
Pump
*Outlet
*.* Unless controlled by PID control (or continuous control in the future)
If we can get rid of the reduction factors for these nodes, we can probably significantly boost the performance of models that have many connections of this type.
How We still somehow need to handle the events that are now captured by these reduction factors. One way to do this is by using
VectorContinuousControl
which we previously used forDiscreteControl
. Say for each basin we have a boolean flagis_empty
and the expressionThen
is_empty
is set totrue
if this expression is $0$, in which state no abstraction from the basin is possible. One thing to figure out is what should be the trigger to setis_empty
back tofalse
.Maybe we can get rid of
low_storage_factor
completely this way. Similar things can be done for the other reduction factors ofOutlet
.