Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1919.
Inspired by ongoing discussions with @Huite and @visr on smoothness (see also #1918, #1920) I started looking into making the type of interpolation configurable in the several places in the core where interpolation is used. For this PR I am focussing on$Q(h)$ relationships.
We require of the$Q(h)$ interpolation that the flow is $0$ below and at the lowest supplied level. That's trivial to achieve for linear interpolation, but not for non-linear (generally piecewise polynomial of degree >1) interpolation types. This requires a special approach for each method.
The question is which methods to support (and even whether this should be configurable for$Q(h)$ relationships at all). I now experiment with PCHIP Interpolation because of its smoothness and non-overshooting properties.
Another point of attention is extrapolation. For linear interpolation extrapolation makes sense, but for higher order interpolation methods extrapolation gets out of hand quick. We could make our own wrapper of interpolation types from
DataInterpolation
, but I also made an issue there to pick it up internally:SciML/DataInterpolations.jl#355