You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When given discontinuous functions, the results mess up, badly. For instance, this test function gives an interval labelled :unique that definitely does not contain a root:
function f( x )
return x + sign(x)
end
X = -5 .. 5
rt = roots(f, X)
println(rt)
println("f returns: ",f(rt[1].interval))
gives
Root{Interval{Float64}}[Root([0.480468, 0.480469], :unique)]
f returns: [1.48046, 1.48047]
so evaluating on the function itself makes clear that there is no root here. Things get even sillier in 2D, where I get an empty set that is claimed to contain a root! 😄
function f( (x, y) )
return SVector(
x + 0.1 * sign(sin(10*y)),
x - 0.1 * sign(cos(10*y)) + y - 0.5,
)
end
X = -5 .. 5
rt = roots(f, X × X)
Now I'm not expecting great results exactly, as discontinuous functions are of course very hard to say anything meaningful about -- the fixed-point theorem doesn't apply, of course. But maybe some kind of sanity-checking (that contains_zero(f(X)), at least?) would be helpful. And if that sanity check fails, to give a warning to the user that their functions appear nondifferentiable and problematic.
This is similar in spirit to #146 , but that stems from max providing incorrect derivative information. I don't know if this "issue" is firmly just out of scope. :)
The text was updated successfully, but these errors were encountered:
Piecewise function are not yet handled gracefully by IntervalArithmetic. Now many of them are unsupported, as we need to be careful to return a correct result.
@Kolaru I think this issue might be fixed on master. However, the example given currently errors since the derivative of sign for Interval fails, which is an issue with IntervalArithmetic.jl directly.
When given discontinuous functions, the results mess up, badly. For instance, this test function gives an interval labelled
:unique
that definitely does not contain a root:gives
so evaluating on the function itself makes clear that there is no root here. Things get even sillier in 2D, where I get an empty set that is claimed to contain a root! 😄
returns
Now I'm not expecting great results exactly, as discontinuous functions are of course very hard to say anything meaningful about -- the fixed-point theorem doesn't apply, of course. But maybe some kind of sanity-checking (that
contains_zero(f(X))
, at least?) would be helpful. And if that sanity check fails, to give a warning to the user that their functions appear nondifferentiable and problematic.This is similar in spirit to #146 , but that stems from
max
providing incorrect derivative information. I don't know if this "issue" is firmly just out of scope. :)The text was updated successfully, but these errors were encountered: