julia> dot(Fun(), Fun())
ERROR: StackOverflowError:
Stacktrace:
[1] dot(::Function, ::Function) at /Users/osx/buildbot/slave/package_osx64/build/usr/share/julia/stdlib/v1.0/LinearAlgebra/src/generic.jl:665 (repeats 39122 times)
[2] top-level scope at none:0
1/sqrt(dot(psi[j], psi[k]))
, psi
being the basis of a space?
ERROR: LoadError: LoadError: Cannot convert coefficients from Chebyshev(-1.0..1.0) to Chebyshev(-1.0..1.0)⊗ConstantSpace(Point(2.0))
May i ask another question?
I try to reproduce an example from this chat given by @cortner
using ApproxFun
dom = Interval(0.001, 1) * PeriodicInterval(-pi, pi)
space = Space(dom)
Dr = Derivative(space, [1,0])
Dθ = Derivative(space, [0,1])
Mr = Multiplication(Fun( (r, θ) -> r, space ), space)
rDr = Mr * Dr
L = rDr * rDr + Dθ * Dθ
but PeriodicInterval(-pi, pi) is no more recognized.
What alternative can be used? Circle?
Thank you,
i tried
julia> dom = Interval(0.001, 1) * PeriodicSegment(-pi, pi)
ERROR: MethodError: no method matching *(::Interval{:closed,:closed,Float64}, ::PeriodicSegment{Floa
t64})
and
julia> dom = Segment(0.001, 1) * PeriodicSegment(-pi, pi)
ERROR: MethodError: no method matching *(::Segment{Float64}, ::PeriodicSegment{Float64})
imes
thank you.
using ApproxFun,LinearAlgebra
dm = Segment(0.001,1) × PeriodicSegment(-pi,pi)
sp = Space(dm)
Dr = Derivative(sp, [1,0]); Dθ = Derivative(sp, [0,1])
Mr = Multiplication(Fun( (r, θ) -> r, sp ), sp)
rDr = Mr * Dr
Lr = rDr * rDr; L = Lr + Dθ * Dθ
i modified it and now can play with.
Not sure whether this is the right place to ask since technically my question concerns SingularIntegralEquations.jl, but that package seems to be related enough to ApproxFun.jl that I'll go ahead anyway.
In the code of SingularIntegralEquations it says
# stieltjesintegral is an indefinite integral of stieltjes
# normalized so that there is no constant term
Can someone elaborate on that normalisation condition?
d/dx[(1-x)^a *(1+x)^b P_n^(a,b)] = C (1-x)^{a-1} (1+x)^{b-1} P_{n+1}^(a-1,b-1)
. Roughly speaking, for functions that vanish at ±1, derivatives and Stieltjes transforms commute, so provided a,b > 0
we can use this to write the integral of a Stieltjes transforms in terms of the integral of the integrand.
n = 0
case is special, and dictates the normalisation constant (as the construction for other n
will automatically decay something like O(z^(-n))
)
julia> f = exp(x) * sqrt(1-x^2);
julia> z = 10_000; stieltjesintegral(f,z) - log(z) * sum(f)
-4.264886882765495e-5
julia> x = Fun(1..2);
julia> f = exp(x) * sqrt((x-1)*(2-x));
julia> z = 100_000; stieltjesintegral(f,z) - log(z) * sum(f)
-2.8356239955229512e-5
stieltjes(f,z) = log(z) *sum(f) + o(1)
.
logkernel
(whose normalization is imposed by the actual definition):julia> logkernel(f, z) -log(abs(z))/π * sum(f)
-9.026071512430178e-6
Hi i was playing with modified example from Quantum states.jl
Using ApproxFun
fc1 = Fun(1, 0..1); fc2 = Fun(2, 1..2); fc3 = Fun(3, 2..3)
fc= fc1+fc2+fc3
D = Derivative(); sp = space(fc); x= Fun(sp);
B = [Dirichlet(sp); continuity(sp,0:1)]
λ, v = ApproxFun.eigs(B, -D^2 + fc, 500,tolerance=1E-10)
#returns result
λ, v = ApproxFun.eigs(B, -D^2 - 1/x*D + fc, 500,tolerance=1E-10)
# says Not implemented but if fc=fc1+fc2 it manages to return result
Is 1/x*D kind of a problematic composition?