Re: 2d Gaussian Quadrature
From: Peter Simon (petersamsimon2_at_hotmail.com)
Date: 09/13/04
- Previous message: *** Hendrickson: "Re: Newbie Question about Fortran speed"
- In reply to: Confused Scientist: "2d Gaussian Quadrature"
- Next in thread: beliavsky_at_aol.com: "Re: 2d Gaussian Quadrature"
- Reply: beliavsky_at_aol.com: "Re: 2d Gaussian Quadrature"
- Reply: jan van oosterwijk: "Re: 2d Gaussian Quadrature"
- Reply: Peter Simon: "Re: 2d Gaussian Quadrature"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 13 Sep 2004 09:03:28 -0700
"Confused Scientist" <Confused.Scientist@gmail.com> wrote in message news:<ci2h8s$ead@odak26.prod.google.com>...
> Does anyone have a simple 2d Gaussian Quadrature code written up that
> they can share? I'd prefer FORTRAN 77. The region is smooth and
> well-behaved.
Many years ago I wrote a Fortran 77 routine to integrate a
complex-valued function of two real variables. It is an adaptation of
the well-known code QUANC8 from the text Computer Methods for
Mathematical Computations by Forsythe, Malcolm, and Moler, generalized
to two dimensions using the recommendations given in the paper by
Fritsch, Kahaner, and Lyness, Double Integration Using One Dimensional
Adaptive Quadrature Routines: A Software Interface Problem, ACM Trans.
Math. Software, vol 7, no. 1, March 1981, pp. 46-75. The advantages
of an adaptive routine over a single application of a gaussian
quadrature formula are that 1) the function is automatically sampled
more frequently in regions where it varies more rapidly, hopefully
achieving the user-specified accuracy bound with the minimum possible
number of function evaluations, and 2) an estimate of the error in the
computed value of the integral is provided.
More recently I converted this routine to Fortran 90 and also created
a Fortran 90 version for pure real integrands. These are bundled in
the module dblint.f90
I have made these routines available on my website at
http://www.vcnet.com/cdblin.f and http://www.vcnet.com/dblint.f90 If
you would like to try out my Fortran 77 routine cdblin.f but your
integrand is pure real you could simply code it up as a complex
function having zero imaginary part. Then, if you find that cdblin
works well for your problem you could easily convert it to a version
that expects a real integrand, to avoid the inefficiency of performing
unneeded complex calculations. Or you could bite the bullet and use
the Fortran 90 version. I have tested these routines on a number of
smooth and singular (but integrable) integrands, and have found them
to be robust and accurate.
>
> Also, does anyone know of a text (that a chemist could understand)
> about methods for performing/coding multiple integrations...
> Thanks in advance!
When I was working on this problem I found the book by Davis, Methods
of Numerical Integration, useful.
Hope this helps,
Peter Simon
- Previous message: *** Hendrickson: "Re: Newbie Question about Fortran speed"
- In reply to: Confused Scientist: "2d Gaussian Quadrature"
- Next in thread: beliavsky_at_aol.com: "Re: 2d Gaussian Quadrature"
- Reply: beliavsky_at_aol.com: "Re: 2d Gaussian Quadrature"
- Reply: jan van oosterwijk: "Re: 2d Gaussian Quadrature"
- Reply: Peter Simon: "Re: 2d Gaussian Quadrature"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]