I am stuck with a problem in scipy. I want to numerically integrate a
function with a square root like singularity at one end of the
integration interval. The integral has the form
\int_{0}^{1} f(x) * x / sqrt(1-x**2) dx
or alternatively
\int_{0}^{A} f(x) / sqrt(A-x) dx.
Can the quad function in scipy deal with this kind of singularity. I
tried to use the points argument of the quad function but I still get
warning messages and do not know how much I can trust the results.
Alternatively, I was wondering if I can implement a Chebyshev–Gauss
quadrature myself to lift the singularity? Or is there a way to do
this elegantly using scipy?
I would be very glad about a short answer.
Best regards,
Daniel Platz
_______________________________________________
SciPy-User mailing list
SciPy...@scipy.org
http://mail.scipy.org/mailman/listinfo/scipy-user
Yes, `quad` supports weight functions of this form (see its `weight` and
`wvar` arguments). Run
scipy.integrate.quad_explain()
to find what to specify as these arguments
--
Pauli Virtanen
Hi,
I am stuck with a problem in scipy. I want to numerically integrate a
function with a square root like singularity at one end of the
integration interval. The integral has the form
\int_{0}^{1} f(x) * x / sqrt(1-x**2) dx
or alternatively
\int_{0}^{A} f(x) / sqrt(A-x) dx.
Can the quad function in scipy deal with this kind of singularity. I
tried to use the points argument of the quad function but I still get
warning messages and do not know how much I can trust the results.
Alternatively, I was wondering if I can implement a Chebyshev–Gauss
quadrature myself to lift the singularity? Or is there a way to do
this elegantly using scipy?
I would be very glad about a short answer.