Skip to content
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

Quadrature rules for the weight function w(x) = 1/(1+x^2) #98

Closed
nhavt opened this issue Apr 23, 2021 · 8 comments
Closed

Quadrature rules for the weight function w(x) = 1/(1+x^2) #98

nhavt opened this issue Apr 23, 2021 · 8 comments

Comments

@nhavt
Copy link

nhavt commented Apr 23, 2021

Hi there,

I am looking for a quadrature rule that supports the weight w(x) = 1/(1+x^2). So could you please tell me whether I can find your package? Thank you very much in advance.

@dlfivefifty
Copy link
Member

dlfivefifty commented Apr 23, 2021

No we only have classical cases

ClassicalOrthogonalPolynomials.jl can do this. I’ll post code shortly

@nhavt
Copy link
Author

nhavt commented Apr 23, 2021

Hi dlfivefifty, that is great! Thank you very much for looking at my issue. I look forward to seeing your code.

@dlfivefifty
Copy link
Member

Sorry need to tag some bug fixes but once that's done the following code works:

julia> x = axes(Legendre(),1)
Inclusion(-1.0..1.0 (Chebyshev))

julia> Q = LanczosPolynomial(inv.(1 .+ x.^2));

julia> x,w = ClassicalOrthogonalPolynomials.golubwelsch(Q[:,Base.OneTo(10)])
([-0.9724303119085456, -0.858355460511601, -0.667296759861326, -0.42080409420924214, -0.14339095204048347, 0.14339095204048447, 0.42080409420924336, 0.6672967598613262, 0.8583554605116023, 0.9724303119085471], [0.03615028973210828, 0.08958952909454486, 0.15418172912568381, 0.22593495363521388, 0.2795416618098968, 0.27954166180989914, 0.2259349536352133, 0.15418172912568348, 0.08958952909454379, 0.03615028973210902])

@nhavt
Copy link
Author

nhavt commented Apr 29, 2021

Hi @dlfivefifty, thank you very much for your response. There is no rush on this. I can wait a bit. Also, could you please tell me a bit about "LanczosPolynomial" since this is new to me? Does that refer to this work, https://core.ac.uk/download/pdf/82178243.pdf?

@dlfivefifty
Copy link
Member

Just means OPs w.r.t. w (The "Lanczos" refers to the fact that the algorithm used is lanczos with a different inner product, but this is basically equivalent to the Stieltjes procedure. Actually its likely to switch to a cholesky...)

@nhavt
Copy link
Author

nhavt commented Apr 30, 2021

yes, thank you for your explanation. Could you please tell me the references that you use to implement the algorithm?

@dlfivefifty
Copy link
Member

http://approximatelyfunctioning.blogspot.com/2020/09/quasi-matrices-orthogonal-polynomials.html

@nhavt
Copy link
Author

nhavt commented Apr 30, 2021

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants