>
> Can someone point me to examples/documentation on doing double
> integrals numerically? That is, say you have to calculate a double
> integral with integrand f(x,y) for which no closed-form
> antiderivative (neither in x nor y) exists. Assume my xy-region of
> integration is rectangular. Is there a numerical_integral() type
> command for this case?
Not that I know of, but you can nest them. For example, to do \int_3^4
\int_1^x sin(x^2/y) dy dx one can do
sage: numerical_integral(lambda x: numerical_integral(sin(x^2/y),
1, x)[0], 3, 4)
(-0.78059401567023834, 8.6663344908170892e-15)
Note that the [0] on the inner integral causes it to ignore the error
term there.
- Robert
Anyway, presumably something similar should be done with .nintegral
and numerical_integral (which should really be a method of Symbolic
Expressions, at least ones with one variable if the variable is given,
i.e. (x^2).numerical_integral(x,0,1) ). It would also be really good
to make sure that numerical_integral can start handling cases with
parameters input at run time - am I correct that
numerical_integral(f(x,y).subs(x=3),...) still doesn't work that hot?
Or is that old info?
- kcrisman
On Feb 15, 2:37 pm, Robert Bradshaw <rober...@math.washington.edu>
wrote:
You can use scipy to calculate the integrals. See the documentation
here: http://docs.scipy.org/doc/scipy/reference/integrate.html (dblquad
and tplquad are the relevant functions).
Thanks,
Jason