dblquad works weird: as the ranges increase, the integral value decreases

2 views (last 30 days)
Hi guys, I have a positive function that I need to get the double integral. As I increase the bands, the value increases but at some point it starts to decrease. For instance I show some ranges here:
>> dblquad(@f,-1000,0,-1000,1000)
ans =
8.9554
>> dblquad(@f,-10000,0,-10000,10000)
ans =
1.4848e+03
>> dblquad(@f,-100000,0,-100000,100000)
ans =
1.5721e+03
>> dblquad(@f,-1000000,0,-1000000,1000000)
ans =
9.0777e-57
>> dblquad(@f,-10000000,0,-10000000,10000000)
ans =
0
I actually need the infinite bounds but the dblquad does not allow for that. Does anybody have any idea what's happening here?

Answers (1)

Mike Hosea
Mike Hosea on 1 Mar 2013
I guess this question has sat here awhile. I just stumbled on it during a search. The reason is that adaptive quadrature works by sampling function values at a finite number of points. The fundamental assumption is that the initial sampling will reveal at least some of the function variation. If the initial points all return a function value of zero, or near to it, then the integrator will assume that the function is a constant zero function (or close enough) and return an integral of zero.
There are a couple of ways out of this. The brute force and ignorance way is to divide your region up into subsets with similar amounts of variation, making sure that you the integrator can't help but notice the function variation in the areas where there is a lot going on. Then down in the "tail" of the function, where the function values are much smaller, returning zero is OK. The other way is to transform the infinite interval into a finite one. This results in at least a mild singularity, but some integrators can handle it. DBLQUAD doesn't really. The new INTEGRAL2 function can often handle improper integrals. Just try putting -inf and inf in there instead of large finite numbers.

Categories

Find more on Delaunay Triangulation in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!