-
Notifications
You must be signed in to change notification settings - Fork 3
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
Functions with branches #91
Comments
Hi there, if you look at the definition of julia> myclamp(x::Interval, lo, hi) = max(min(x, hi), lo)
myclamp (generic function with 1 method)
julia> clamp(-4..4, 2, 3)
[-4, 4]
julia> myclamp(-4..4, 2, 3)
[2, 3] That being said, I am not convinced by your result, the function julia> fun(x) = clamp(x, -1, 1)/x
fun (generic function with 1 method)
julia> fun(0)
NaN and if The nice plot is because |
Hello and thanks for your answer :) Is there any reason
More generally, this julia> using IntervalArithmetic
julia> 1..3 > 2
false seems very dangerous and non-rigorous, if this appears in if a > 2
something
else
something else
end the code will just pick one branch and return something but the inequality could equally well be true! The code below should most definitely throw an error julia> 1..3 < 2 ? 1 : 2
2 since the correct and rigorous answer is I realized that the example was unfortunate due to the singularity at 0. This particular singularity happens to be removable, but the julia function obviously doesn't know this. Is there any nice strategy to handle removable singularities other than splitting up the domain into two, one for each side of the singularity? |
Thanks for trying the package @baggepinnen. I think the short answer is that the library doesn't yet have proper support for functions with branches (I suggest we add a comment about this in the docs). That said, a safer alternative in those cases may be to pass an interval from |
Hello! I just tried this package to see if it could be useful for automatic stability proofs of nonlinear feedback systems using the circle criterion. I'm not sure if I'm using it wrong, but I get an infinite enclosure for a simple function (relative saturation)
The text was updated successfully, but these errors were encountered: