Tanh-Sinh Quadrature V3.0

I have received from Graeme Dennes  another update to his Tanh-Sinh Quadrature spreadsheet, offering fast and convenient numerical integration functions.  The spreadsheet can be downloaded from: Tanh-Sinh Quadrature (including, as usual, full open source code). Here is Graeme’s description of the changes:

Tanh-Sinh Quadrature v3.0 by Graeme Dennes

To the best of this author’s knowledge, this V3.0 package is the fastest, most powerful, most accurate and comprehensive general-purpose quadrature package available today at no cost. It includes full open source code and extensive documentation.

A number of improvements have been incorporated into this release:

1. Nine new quadrature programs have been included in the total of 13.

2. Double Exponential (DE) semi-infinite interval (a,inf) and (-inf,b) programs and infinite interval (-inf,inf) programs for both non-periodic and periodic functions are included.

3. The Tanh-Sinh finite interval (a,b) program and the DE programs are (still) the star attractions for combined speed and accuracy!

4. The Quadpack QAGI infinite interval program has also been included for the three infinite intervals. Its speed is about a quarter of the DE programs.

5. A “modern” quadrature program, RMS (Recursive Monotone Stable), has been included for the finite interval. Its speed is about twice as fast as the Quadpack QAGE program on which it is based, but is about a quarter of the speed of the Tanh-Sinh program.

6. The finite interval Gauss-Kronrod program now uses a modified version of the Quadpack QAGE program for a performance improvement. It’s the accuracy champion!

7. A new automatic error management feature has been added to improve accuracy and reliability of all programs.

8. The array data used by the programs (except Romberg) are generated and/or loaded at workbook open time, improving the overall performance of these programs.

9. A simple function plotting tool has been included in the Tanh-Sinh worksheet to enable the selected function to be easily plotted and observed. It uses the same test function data as used by the Tanh-Sinh program, and can assist decisions regarding “difficult” integrals.

10. The suite of test integrals has been comprehensively expanded.

Graeme Dennes

 As always, Graeme’s work is very thorough and comes with extensive documentation, both on the worksheet and throughout the code.  In addition to the integration functions Graeme has also put much work into the error checking, graphics and benchmarking routines, and these are well worth a close look even for those who don’t need to do numerical integration.

I have attached some screenshots below, but please download the spreadsheet and have a good look.

Tanh-Sinh integration with associated graph; click for full size view

Functions to plot are selected with the spin button

For earlier posts on this spreadsheet search the blog for Tanh-Sinh, or trace back from: Tanh-Sinh Quadrature V2.1.

This entry was posted in Excel, Maths, Newton, Numerical integration, UDFs, VBA and tagged , , , , . Bookmark the permalink.

5 Responses to Tanh-Sinh Quadrature V3.0

  1. Pingback: Daily Download 17: Numerical Integration | Newton Excel Bach, not (just) an Excel Blog

  2. Vick says:

    hi

    How to contact Graeme Dennes? I wanted to get the Gauss Konrod algorithm in simple VBA format without all the other features in the tan sinh workbook.

    For eg, in vba i want to define a function as such:

    function f(x)
    f = x^2
    end function

    and then use the f function to compute inside the GK algorithm as such:

    function GK(a,b,n)
    ..
    ..

    GK = f(…..,….),etc
    end function

    So that on the worksheet i just use: =GK(1,5,1000) to get result for integration of x^2 between min 1 and max 5!

    Thanks
    Vick

    Like

    • dougaj4 says:

      Vick – I have sent a link of your question to Graeme, but this is actually something I have been planning to look at for some time, so I’ll move it up the “to-do” list.

      Any particular reason for using the GK algorithm, rather than the others?

      Like

      • vick says:

        Hi dougaj4

        I love the tanh-sinh workbook which demonstrates the capability of the different integration methods. However, in order to use it properly in serious calculations, it has to be coded in a simple way so that i can call the excel function to perform any integral as per my own requirement like my examples above. I don’t really need the time performance features or the graphing facility. It also uses array in vba that bugs me a lot. I like to control each component of my integrator.

        Actually i think i need both the tanh-sinh algorithm and the GK algorithm since i tested them yesterday and the tanh-sinh performs brilliantly and rapidly. I actually need them to integrate the Hubble parameter in cosmological distance calculations. As Graeme wrote, the tanh-sinh is for speed performance and the GK for accuracy performance.

        Thanks a lot!

        Vick

        Like

  3. Pingback: Tanh-Sinh Quadrature V4.0 | Newton Excel Bach, not (just) an Excel Blog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.