-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Discrete Control tests based on realistic model #428
Comments
FlowBoundary holds a timeseries ranging from 200-1000m3/s with some variation around the 250 and 800m3/s If Flow Boundary between 250 and 800m3/s, the flow rate of pump 9 is set to 25m3/s by controller 18 (using DC or PID). If Flow Boundary below 250m3/s, the flow rate of pump 9 is set to 15m3/s. This flow rate is held until the Flow Boundary rises above 275m3/s. Basin 2 (length 10km) has the following characteristics. All other basins are in the same ballpark
|
@gijsber thanks for the information. I have some questions:
Other points:
|
Yes. |
@gijsber I have distilled the discrete control of nodes 17 and 18 as follows. Notation
Conditions
Control states
Logic
Final notes
|
Hi @SouthEndMusic, That looks pretty good. We miss one condition (q>275). If we add that it would become: Conditions
Logic
|
I realized a potential problem with listening to a flow influenced by a time series as a condition, and that is that such flows are not continuous. This might cause problems in the root finder of |
Yeah I think indeed that would be a problem, though I guess we could test to see what it does in that case. If there are errors we should probably go for a DiscreteCallback. |
What about the option of linear interpolation of the time series? Though that makes integration a bit more complex. |
Yeah I've gone back and forth on that, see #188 for the reasoning for the current approach. Though the discontinuities in the flow are from the callback, and I think that is allowed to do that there, so perhaps the ContinuousCallback can handle it fine, if it only assumes continuous functions between tstops? I've looked a bit at similar arguments online but couldn't find much more than SciML/ModelingToolkitStandardLibrary.jl#123 (comment) |
From a hydrological perspective, I would think that linear interpolation is acceptable. |
I think it depends, e.g. if you have a non-equidistant precipitation timeseries like 2020-01-01 00:00:00 0.0 which represents a short intense shower for a few minutes, do you want to gradually go from 0 to 10 over the month of January? If it is equidistant it might be good enough in general. |
@gijsber in the image you sent of the model edge |
For precipitation timeseries, this assumption is indeed not wise, but I would think that flow series have more continuous behaviour (and indeed you provide them typically as equidistant series) |
@SouthEndMusic I would suggest to add a linear resistance as needed |
A |
using a LevelBoundary is fine to me |
Suggested initial levels: |
@gijsber with the above initial levels the simulation now converges but only without the analytical Jacobian. The result doesn't seem very sensible though: |
Fixes #428. --------- Co-authored-by: Bart de Koning <[email protected]>
At the time of writing controlling node types other than
Pump
has been merged (#424), and making nodes active and inactive is on its way (#425). These features do not have proper tests yet, but they came about form a discussion about a model of the Netherlands. So, this issue is forFor the details of this model see below.
The text was updated successfully, but these errors were encountered: