The Rev Dodgson said:
Did you see:
https://newtonexcelbach.wordpress.com/2014/12/29/numerical-integration-tanh-sinh-quadrature-v-4-3/
The Tanh-Sinh method is an alternative approximate integration method to the Gauss. It’s very well documented in the download file. (I’m allowed to say that because it was written by someone else).
From your link:
“To the best of the author’s knowledge, this Tanh-Sinh and DE Quadrature workbook is the fastest, most powerful, most accurate, most robust and most comprehensive general-purpose quadrature package available today at no cost. It includes full open source code and extensive documentation. The speed and the accuracy of the Tanh-Sinh method in particular and the Double-Exponential (DE) method in general are simply astounding! The DE technique (Ref. 1) combines the fastest speed and highest accuracy of all numerical integration techniques developed thus far.
The quadrature programs are provided as custom functions (UDFs) for performing numerical integration of single-dimension analytic functions.
The programs are grouped below according to the interval of integration, as follows:
1. Finite Interval (a, b)
a. Tanh-Sinh Quadrature. The
UDF is named:
QUAD_TANH_SINH, and is demonstrated on the
TANH-
SINH worksheet.
Refer to the T-S
README, T-S
DATA and T-S
EXAMPLES worksheets for information on using the program.
Use this program as the general-purpose integrator for the finite interval (a, b).
b. Gauss-Kronrod Quadrature. The
UDF is named:
QUAD_GAUSS_KRONROD, and is demonstrated on the G-K worksheet.
Refer to the T-S
README, T-S
DATA and T-S
EXAMPLES worksheets for information on using the program.
Try using this program as the first alternative should the Tanh-Sinh program fail to integrate a function.
c. Recursive Monotone Stable (
RMS) Quadrature. The
UDF is named
QUAD_RMS and is demonstrated on the
RMS worksheet.
Refer to the T-S
README, T-S
DATA and T-S
EXAMPLES worksheets for information on using the program.
Try using this program should the above two programs fail to integrate a function.
d. Romberg Quadrature. The
UDF is named:
QUAD_ROMBERG, and is demonstrated on the
ROMBERG worksheet.
Refer to the T-S
README, T-S
DATA and T-S
EXAMPLES worksheets for information on using the program.
This program is included for historical reasons and for comparisons with the above programs. It is the slowest and least accurate of the four finite-interval programs.
4. Infinite Interval (-inf, inf)
a. Double Exponential (DE) Quadrature for Non-Periodic functions. The
UDF name is:
QUAD_DE_3, and is demonstrated on the DE-3 worksheet.
Refer to the DE
README and DE
EXAMPLES worksheets for information on using the program.
NOTE: This program does not support periodic functions (ie, those with sine, cosine etc terms).
Use this program as the general-purpose integrator for the infinite interval (-inf, inf) for non-periodic functions.
b. Double Exponential (DE) Quadrature for Periodoc functions. The
UDF name is:
QUAD_DE_OSC_3, and is demonstrated on the DE-
OSC-3 worksheet.
Refer to the DE
README and DE
EXAMPLES worksheets for information on using the program.
NOTE: This program does support periodic functions (ie, those with sine, cosine etc terms).
Use this program as the general-purpose integrator for the infinite interval (-inf, inf) for periodic functions.
c.
QAGI Quadrature. The
UDF is named:
QUAD_QAGI_3 and is demonstrated on the
QAGI-3 worksheet.
Try this program should either of the above two DE programs fail to integrate a function.
————————————————————
Thanks a million Rev D. I’ll look into these in detail. Particularly those on an infinite domain. Which of these are multi-dimensional and how many dimensions?
The Rev Dodgson said:
For your second alternative, what advantages do you see to this method over the Gaussian (or similar) method?
It’s used in problems that have a very large number of dimensions, it’s widely used in computing path integrals in lattice quantum dynamics. Let’s suppose that you need to integrate something along a path that is free to fluctuate in position. Further suppose that between start and end there are 100 waypoints (in 1-D or 50 in 2-D, 33 in 3-D) that can vary. Then that becomes an integration in 100 dimensions. If you were to set up a grid to do the integration then to get anywhere near sufficient accuracy would require at least 5 grid points in each dimension. The total number of points that need to be sampled is then 5^100, which at 10^70 points is way beyond the capacity of even the most powerful supercomputers, and 100/50/33 isn’t that many waypoints.
The location of the path in lattice quantum dynamics is constrained by a probability function that varies sort of as e^(-x^2), so their strategy is to randomly vary all dimensions at once in such a way that changes have a 50% chance of satisfying e^(-x^2)>0.5. This reduces the integration domain by a huge amount without sacrificing significant accuracy. “x” here is a 100 dimensional vector, and the function is more complicated than -x^2, but you get the idea. To put it another way, the function is very rarely >>0.
For a civil engineering equivalent, suppose you wanted to calculate the average terrain height for a very fast train between Sydney and Canberra when you don’t know the exact route, you only know that the route should have less than a certain amount of cut and fill and a limit on the maximum gradient and minimum bend radius.