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
I believe that currently we have no mechanism for a user to do this in terms of interval objects. (They would have to manually define it using inf, sup, if etc.)
A natural way would be to define Heaviside as in #653 and then
f(x) = Heaviside(x) * sqrt(x)
But this will give empty for x < 0, instead of 0, since sqrt(x) gives empty.
We either need a "strong 0" that gives 0 when multiplied by empty, or a general function
restrict_to_domain(f, D)
that does this in the interval context.
The text was updated successfully, but these errors were encountered:
This can be implemented using piecewise from this comment:
julia>f(x) =piecewise((-Inf..0=> x ->0..0, 0..Inf=> x ->sqrt(x)), x)
f (generic function with 1 method)
julia>f(1..2)
[0.0, 1.41422]_trv
julia>f(-1..1)
[0.0, 1.0]_trv
julia>f(-1..(-1))
[0.0, 0.0]_trv
Suppose I want to define a function
I believe that currently we have no mechanism for a user to do this in terms of interval objects. (They would have to manually define it using
inf
,sup
,if
etc.)A natural way would be to define
Heaviside
as in #653 and thenBut this will give empty for
x < 0
, instead of0
, sincesqrt(x)
gives empty.We either need a "strong 0" that gives
0
when multiplied by empty, or a general functionthat does this in the interval context.
The text was updated successfully, but these errors were encountered: