Numerical integration in Log space

I'm working on a numerical integration problem where the function I'm integrating spans several orders of magnitude. To handle this, I'm considering performing the integration in logarithmic space.

Could anyone advise on the best methods or algorithms for numerical integration in log space?

Logspace Integration.pxp (18.31 KB)

Thank you for your response.

Sorry for the lack of my explanation.

I'm trying to calculate the area between the wave and zero.

When I use  AreaXY function, the problem is that it picks up errors on the long-time side.

Do you have any good solutions?

The area at any time is the value of the integral wave. Any integration method will follow the steps on the curve, including the steps that are considered as "errors" (noise). The two ways often taken to go around this problem are as follows: a) calculate an average final value over a range of the integral curve to average out the noise or b) smooth the source curve before integrating it.

There are two issues to consider here:

1.  The x-range:  Here I would recommend splitting the range to say N intervals and then sum the N contributions.  This may be done for you in some of the adaptive algorithms (see Integrate1D) that will subdivide the domain until the integral converges.  Counting on the adaptive algorithm is not the most efficient method.  Ideally, you should be able to determine proper intervals and apply Integrate1D in each one.

2.  The noise at the high end: here, regardless of integration method, it would be best to replace the original data with an acceptable smooth (and continuous) version thereof.  If you are using Integrate1D you can write a user function that returns the value of the integrand and handles the "smooth and continuous" requirement.

AG