I'm quite sure Fun
used to work on intervals in the complex domain. But now
f(x) = cos(x)
Fun(f, Interval(1.0+1.0im, 2.0+2.0im))
throws the error
ERROR: MethodError: no method matching isless(::Complex{Float64}, ::Complex{Float64})
Closest candidates are:
isless(::Missing, ::Any) at missing.jl:66
isless(::InfiniteArrays.OrientedInfinity{Bool}, ::Number) at /.julia/packages/InfiniteArrays/Z4yap/src/Infinity.jl:145
isless(::Number, ::InfiniteArrays.OrientedInfinity{Bool}) at /.julia/packages/InfiniteArrays/Z4yap/src/Infinity.jl:144
...
Stacktrace:
[1] <(::Complex{Float64}, ::Complex{Float64}) at ./operators.jl:260
[2] >(::Complex{Float64}, ::Complex{Float64}) at ./operators.jl:286
[3] isempty(::Interval{:closed,:closed,Complex{Float64}}) at /.julia/packages/IntervalSets/xr34V/src/IntervalSets.jl:153
Hello, I was playing around with the poisson equation example and wonder if I could replace the RHS $f$ with something like $\delta (x) \delta (y)$. I tried to construct the RHS like this:
fx = KroneckerDelta()
fy = KroneckerDelta()
f = Fun((x,y) -> fx(x) * fy(y))
But I got the error that ERROR: MethodError: no method matching isless(::Int64, ::Nothing)
. What is the proper way for me to do that? Thanks in advance!
I’m trying to implement something like this FAQ example,
S = Chebyshev(1..2);
p = points(S,20); # the default grid
v = exp.(p); # values at the default grid
f = Fun(S,ApproxFun.transform(S,v));
but multi-variate (2D tensor Chebyshev will do). The canonical thing,
S = Chebyshev((1..2)^2)
p = points(S, 20)
errors. Of course I could just construct the points via tensor products, but then I’m unsure how to use the ApproxFun.transform(S,v)
correctly. Is this documented somewhere? Is there an example I can look at?
Basically, I just want to freeze the polynomial degree, rather than prescribe a solver tolerance.
ApproxFun
to evaluate the basis functions...
ApproxFun
might be useful. I noticed e.g. that restricting the degree in \
rather than the tolerance throws warnings even if it is intended. By “manual mode” I mean non-adaptive.
julia (v1.2)> f = Fun(cos);
julia (v1.2)> f(.1)
0.9950041652780257
julia (v1.2)> f(.1 + .1im)
0.0
julia (v1.2)> f(.1 + .0im)
0.9950041652780257 + 0.0im
julia (v1.2)> g = Fun(Chebyshev(), randn(Complex{Float64}, 20));
julia (v1.2)> g(.1)
2.1013219596855888 - 0.11052912191219874im
julia (v1.2)> g(.1 + .1im)
0.0 + 0.0im
julia (v1.2)> cos(.1 + .1im)
0.9999833333373015 - 0.00999998888888977im
Circle
or Segment
extrapolate(f,x)
in ApproxFun if you wish