numerically integrate to infinity
numerically integrate to infinity
(OP)
Hello!
I have a function f that I would like to integrate numerically. For this purpose I used quad(f,a,b) where a and b are the borders of integration. Now I want to integrate to b=infinity and this doesn't work with quad. Is there any other function I can use to numerically integrate to infinity?
Thank you very much
Katy
I have a function f that I would like to integrate numerically. For this purpose I used quad(f,a,b) where a and b are the borders of integration. Now I want to integrate to b=infinity and this doesn't work with quad. Is there any other function I can use to numerically integrate to infinity?
Thank you very much
Katy





RE: numerically integrate to infinity
Beyond that, you need to re-think your problem.
TTFN
RE: numerically integrate to infinity
Maybe you have missed that Matlab does have rules to calculate with infinity.
So why not implement a numerical integration that takes on the value zero, if the function is numerically zero and infinity if it takes on nonzero equally signed values (for example, I'm not an expert).
Thank you again for you comment, but I really think I didn't need this.
RE: numerically integrate to infinity
Trying to do something like a quadrature Simpson's rule over an infinite interval is simply not feasible, since the nominal error tolerance is too small. In order to get the interval sum to be evaluated within the tolerance requires a small step size, which when summed over infinite results in a stack overflow. If you try to integrate with too large a tolerance, you'll get garbage for an answer.
In general, you need to re-think your need to integrate to infinity. In most cases, if the integral is finite, you can simply integrate over a reasonably large range. The integral of the normal error requires less than 10 sigma to converge to a stable value, and that value is essentially equal to the same integral over infinity.
TTFN
RE: numerically integrate to infinity
I am not exactly an engineer. I come from mathematics and work in image processing right now. So I have heard about the Simpson rule, but I have of course no idea how it is implemented (concerning tolerance and co).
In particular I needed a discrete filter from a Gaussian like function. And putting large bounds 10^16 or 10^17 still made a noticable difference, but higher values made the integration impossible.
So I still don't know what to do...
At the beginning I was close to red-flagging you, but now I am really thankful for this comment.
Thanks
Katy
RE: numerically integrate to infinity
M
--
Dr Michael F Platten
RE: numerically integrate to infinity
In almost everything that's done in non-academic scenarios, we truncate and move on. There is no physical meaning to an integration over infinity in the real world. Everything has real limits.
TTFN