-
Notifications
You must be signed in to change notification settings - Fork 18
Description
It is expected that HydPy-Musk-MCT receives positive inflow values. However, it sometimes might receive negative inflow values due to configuration mistakes or minor rounding errors. Currently, our documentation does not define the model's behaviour for such cases. As we do not raise exceptions during simulation runs (harder to do in Cython in nogil mode and could cause relevant performance losses), the only options seem to be to reset negative inflow values to zero or to always pass nan values as outflow after the first negative inflow occurred.
I tried to analyse the current behaviour by modifying MCT's base example by setting nmbsegments to 1 and length to 2 and decreasing the inflow linearly by subtracting 2 * ts. The results vary between different HydPy versions:
However, I am not sure if these two modes ("reflecting" and "stop working") are stable for all considered versions, or if differences in other model components cause minor simulation differences which trigger either the first or the second behaviour.
Anyhow, we should decide on the desired behaviour and ensure Musk-MCT always holds to it. "Reflection" makes no sense. I would prefer the "stop working" mode because then users can see (when inspecting the results) that something is wrong. However, technical rounding errors should not cause Musk-CT to stop working. Maybe we could introduce a solver parameter that defines a threshold below which setting inflow values to zero is okay, similar to ToleranceDischarge.




