[comp.lang.fortran] oscillatory integral: help needed

sun@pacific.mps.ohio-state.edu (Mingqiu Sun) (02/11/90)

Does anyone have any good routines/ideas of integrating oscillatory
functions of the form f(x)cos(a*x+b*x*X)?  integration intervals
can be something like [x1, x2] or [x1, +infinity].

One simple scheme is to transform ax+bxx to a new variable, say u.
then use routines that can evaluate f(u)cos(u). but unfortunately
this will introduce a divergent fact into the integrand which
makes the scheme inefficient and lack of precision.

All response will be appreciated.

trh@ukc.ac.uk (T.R.Hopkins) (02/13/90)

In article <1395@pacific.mps.ohio-state.edu> sun@pacific.mps.ohio-state.edu (Mingqiu Sun) writes:
>Does anyone have any good routines/ideas of integrating oscillatory
>functions of the form f(x)cos(a*x+b*x*X)?  integration intervals
>can be something like [x1, x2] or [x1, +infinity].
>
>One simple scheme is to transform ax+bxx to a new variable, say u.
>then use routines that can evaluate f(u)cos(u). but unfortunately
>this will introduce a divergent fact into the integrand which
>makes the scheme inefficient and lack of precision.
>
>All response will be appreciated.

The nag library offers two routines for the finite interval case:
1) for oscillating, non-singular intervals it uses an adaptive routine
   using a Gauss 30-point and Kronrod 61 point rule,

2) for f(u)cos(u) - provided f(u) is not violently oscillatory
   a modified Clenshaw-Curtis procedure is used.

For the semi-infinite case it depends on what the integrand
does as x gets large

3) for f(u)cos(u) the method used is the same as for 2) above and
   subintervals are computed for increasing u until they are
   considered negligible. f(u) is is assumed to be positive and
   monotone decreasing.

4) for general oscillating functions an adaptive Gauss 7-point
   and Kronrod 15 point rule is used on a transformed integrand.

in both cases 3 and 4 the epsilon algorithm is used to perform
extrapolation.

The nag routines are based on routines from quadpack

1) QAG
2) QFOUR
3) QAWFE
4) QAGI

These may be obtained from netlib@research.att.com by sending mail of
the form

send qag from quadpack

this also gets you the dependency routines.

References

Piessens, R. et al  QUADPACK, A subroutine package for automatic 
		    integration (1983) Springer verlag

(This tells you how to call the quadpack routines + a little in
the way of general advice)

Davis P.J. and Rabinowitz P.  Methods of Numerical Integration
		     (1975?) Academic Press Second Edition
					    ==============

(Has everything you will ever want to know (and more) on the subject
 of quadrature).

Tim


-- 
Tim Hopkins,                  { trh@ukc.ac.uk
Computing Laboratory,           trh%ukc@cs.ucl.ac.uk
University of Kent,              na.hopkins@score.stanford.edu }
Canterbury CT2 7NF, Kent, UK.