Skip to content
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

Conditions on non-continuous parameters #463

Closed
SouthEndMusic opened this issue Jul 27, 2023 · 2 comments
Closed

Conditions on non-continuous parameters #463

SouthEndMusic opened this issue Jul 27, 2023 · 2 comments
Labels
control Rule based control of physical layer

Comments

@SouthEndMusic
Copy link
Collaborator

SouthEndMusic commented Jul 27, 2023

Motivation

For #428 we effectively need a condition on a dynamic flow boundary. The way this is implemented now (see #446) is that the flow of this flow boundary is given by a timeseries which is interpolated using forward fill, and control listens to the edge out of this flow boundary. This makes the flow over this edge discontinuous in time, which means that the rootfinder for finding changes in conditions cannot detect a crossing (see #456). In general the forward fill interpolation is desirable because of conservation considerations (see #188).

Proposed solution

We keep the forward fill interpolation for the time series for the flow boundary (for conservation purposes), but fool the VectorContinousCallback into thinking it is continuous by giving it a linearly interpolated version of the flow boundary value. This brings in a discrepancy between what the model does and what the control responds to, but this discrepancy is probably small in practice.

The condition is changed from a condition on the edge to a condition on the flow boundary node itself. This is because a condition on an arbitrary edge is still problematic, because discontinuities in flow can propagate from further in the model to this edge.

This proposed solution is only reasonable if conditions on arbitrary edges are not desired (@gijsber?).

@github-project-automation github-project-automation bot moved this to To do in Ribasim Jul 27, 2023
@SouthEndMusic SouthEndMusic added the control Rule based control of physical layer label Jul 27, 2023
@visr
Copy link
Member

visr commented Aug 1, 2023

Discussed a way forward with @SouthEndMusic. We can remove listening to flow for now. For the case of listening to Lobith inflow, we can listen to the FlowBoundary. The FlowBoundary time update then needs to support linearly interpolating between data points.

@SouthEndMusic
Copy link
Collaborator Author

'Fooling' VectorContinousCallback by only presenting a continuous variable to it and nowhere else has not been implemented, the solution proposed by @visr was implemented.

Conditions on discontinuous parameters will still in general not work with VectorContinuousCallback, but could work with DiscreteCallback (see #455) with some loss of accuracy.

@github-project-automation github-project-automation bot moved this from To do to ✅ Done in Ribasim Aug 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
control Rule based control of physical layer
Projects
Archived in project
Development

No branches or pull requests

2 participants