I have been trying to use scipy.integrate.quadrature
for integrating a scalar-valued function that takes as input a vector of fixed dimension. However, despite the claim of scipy.integrate.quadrature
that it can take functions with vector inputs, I cannot for the life of me understand how to make this work.
It is possible that I am misunderstanding the documentation for scipy.integrate.quadrature
and that when it says the function can take vector inputs it simply means that it is able to evaluate the function at multiple points simultaneously (which is not equivalent to my problem).
More specifically I am trying to integrate over a function, f(x), where x is a vector and f() maps x to a scalar. If its true that my initial interpretation of scipy.integrate.quadrature
is false, does anyone know of any packages (written in python
) that can compute an integral in the way that I have mentioned ? I know there is something called scipy.integrate.nquad
which perhaps is what I'm looking for? Any guidance or insight here would be awesome.
nquad
docstring. There are alsodblquad
andtplquad
for the special cases wherex
is 2-d or 3-d, respectively. – Voight