64
Numerical Aspects of Special Functions Nico M. Temme In collaboration with Amparo Gil and Javier Segura, Santander, Spain. [email protected] Centrum voor Wiskunde en Informatica (CWI), Amsterdam Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.1/45

Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Numerical Aspects of SpecialFunctions

Nico M. Temme

In collaboration with Amparo Gil and Javier Segura, Santander, Spain.

[email protected]

Centrum voor Wiskunde en Informatica (CWI), Amsterdam

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.1/45

Page 2: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Contents

The complete revision of Abramowitz & Stegun (1964)

Software for computing special functions

A book on numerics of special functions

Recursion relations to compute special functions

Parabolic cylinder functions

Using special functions

Can we rely on Maple or Mathematica ?

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.2/45

Page 3: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Contents

The complete revision of Abramowitz & Stegun (1964)

Software for computing special functions

A book on numerics of special functions

Recursion relations to compute special functions

Parabolic cylinder functions

Using special functions

Can we rely on Maple or Mathematica ?

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.2/45

Page 4: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Contents

The complete revision of Abramowitz & Stegun (1964)

Software for computing special functions

A book on numerics of special functions

Recursion relations to compute special functions

Parabolic cylinder functions

Using special functions

Can we rely on Maple or Mathematica ?

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.2/45

Page 5: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Contents

The complete revision of Abramowitz & Stegun (1964)

Software for computing special functions

A book on numerics of special functions

Recursion relations to compute special functions

Parabolic cylinder functions

Using special functions

Can we rely on Maple or Mathematica ?

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.2/45

Page 6: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Contents

The complete revision of Abramowitz & Stegun (1964)

Software for computing special functions

A book on numerics of special functions

Recursion relations to compute special functions

Parabolic cylinder functions

Using special functions

Can we rely on Maple or Mathematica ?

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.2/45

Page 7: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Contents

The complete revision of Abramowitz & Stegun (1964)

Software for computing special functions

A book on numerics of special functions

Recursion relations to compute special functions

Parabolic cylinder functions

Using special functions

Can we rely on Maple or Mathematica ?

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.2/45

Page 8: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Contents

The complete revision of Abramowitz & Stegun (1964)

Software for computing special functions

A book on numerics of special functions

Recursion relations to compute special functions

Parabolic cylinder functions

Using special functions

Can we rely on Maple or Mathematica ?

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.2/45

Page 9: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

The complete revision of A & S (1964)

Dan Lozier’s progress report in OPSF (July 15, 2006):Looking Ahead to the DLMF

The Digital Library of Mathematical Functions has beena much bigger job than any of the project participantsexpected.

I am pleased to report that all of the chapters are in thefinal stages of editing and validating.

The process of selecting a publisher for the print editionhas been mapped out according to NIST and USGovernment procurement rules.

The procurement will be competitive among qualifiedmathematics publishers.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.3/45

Page 10: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

The complete revision of A & S (1964)

Dan Lozier’s progress report in OPSF (July 15, 2006):Looking Ahead to the DLMF

The Digital Library of Mathematical Functions has beena much bigger job than any of the project participantsexpected.

I am pleased to report that all of the chapters are in thefinal stages of editing and validating.

The process of selecting a publisher for the print editionhas been mapped out according to NIST and USGovernment procurement rules.

The procurement will be competitive among qualifiedmathematics publishers.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.3/45

Page 11: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

The complete revision of A & S (1964)

Dan Lozier’s progress report in OPSF (July 15, 2006):Looking Ahead to the DLMF

The Digital Library of Mathematical Functions has beena much bigger job than any of the project participantsexpected.

I am pleased to report that all of the chapters are in thefinal stages of editing and validating.

The process of selecting a publisher for the print editionhas been mapped out according to NIST and USGovernment procurement rules.

The procurement will be competitive among qualifiedmathematics publishers.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.3/45

Page 12: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

The complete revision of A & S (1964)

Dan Lozier’s progress report in OPSF (July 15, 2006):Looking Ahead to the DLMF

The Digital Library of Mathematical Functions has beena much bigger job than any of the project participantsexpected.

I am pleased to report that all of the chapters are in thefinal stages of editing and validating.

The process of selecting a publisher for the print editionhas been mapped out according to NIST and USGovernment procurement rules.

The procurement will be competitive among qualifiedmathematics publishers.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.3/45

Page 13: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

The complete revision of A & S (1964)

In addition to the print edition, the DLMF will bedistributed free from a public Web site at NIST. TheWeb address is http://dlmf.nist.gov. A sample chapteron Airy functions has existed on this Web site since thebeginning of the project.

A tremendous amount of work has been done on theWeb site since then to improve its "look and feel".

A new sample chapter on the gamma function is beingprepared. It will be on the Web site by the end of thesummer.

More than 50 individuals are contributing to the projectas paid authors and validators. The staff at NISTconsists of another dozen or so people.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.4/45

Page 14: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

The complete revision of A & S (1964)

In addition to the print edition, the DLMF will bedistributed free from a public Web site at NIST. TheWeb address is http://dlmf.nist.gov. A sample chapteron Airy functions has existed on this Web site since thebeginning of the project.

A tremendous amount of work has been done on theWeb site since then to improve its "look and feel".

A new sample chapter on the gamma function is beingprepared. It will be on the Web site by the end of thesummer.

More than 50 individuals are contributing to the projectas paid authors and validators. The staff at NISTconsists of another dozen or so people.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.4/45

Page 15: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

The complete revision of A & S (1964)

In addition to the print edition, the DLMF will bedistributed free from a public Web site at NIST. TheWeb address is http://dlmf.nist.gov. A sample chapteron Airy functions has existed on this Web site since thebeginning of the project.

A tremendous amount of work has been done on theWeb site since then to improve its "look and feel".

A new sample chapter on the gamma function is beingprepared. It will be on the Web site by the end of thesummer.

More than 50 individuals are contributing to the projectas paid authors and validators. The staff at NISTconsists of another dozen or so people.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.4/45

Page 16: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

The complete revision of A & S (1964)

In addition to the print edition, the DLMF will bedistributed free from a public Web site at NIST. TheWeb address is http://dlmf.nist.gov. A sample chapteron Airy functions has existed on this Web site since thebeginning of the project.

A tremendous amount of work has been done on theWeb site since then to improve its "look and feel".

A new sample chapter on the gamma function is beingprepared. It will be on the Web site by the end of thesummer.

More than 50 individuals are contributing to the projectas paid authors and validators. The staff at NISTconsists of another dozen or so people.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.4/45

Page 17: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Software for computing special functions

A complete survey of the available software: Lozier &Olver (1994); last update: December 2000.http://math.nist.gov/mcsd/Reports/2001/nesf/paper.pdf

Interactive systems based on computer algebra:Matlab, Maple, Mathematica.

Mathematical libraries:CALGO, SLATEC, CERN, IMSL, NAG.

Books with software:Baker, Moshier, Numerical Recipes, Thompson, Wong& Guo, Zhang & Jin.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45

Page 18: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Software for computing special functions

A complete survey of the available software: Lozier &Olver (1994); last update: December 2000.http://math.nist.gov/mcsd/Reports/2001/nesf/paper.pdf

Interactive systems based on computer algebra:Matlab, Maple, Mathematica.

Mathematical libraries:CALGO, SLATEC, CERN, IMSL, NAG.

Books with software:Baker, Moshier, Numerical Recipes, Thompson, Wong& Guo, Zhang & Jin.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45

Page 19: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Software for computing special functions

A complete survey of the available software: Lozier &Olver (1994); last update: December 2000.http://math.nist.gov/mcsd/Reports/2001/nesf/paper.pdf

Interactive systems based on computer algebra:Matlab, Maple, Mathematica.

Mathematical libraries:CALGO, SLATEC, CERN, IMSL, NAG.

Books with software:Baker, Moshier, Numerical Recipes, Thompson, Wong& Guo, Zhang & Jin.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45

Page 20: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Software for computing special functions

A complete survey of the available software: Lozier &Olver (1994); last update: December 2000.http://math.nist.gov/mcsd/Reports/2001/nesf/paper.pdf

Interactive systems based on computer algebra:Matlab, Maple, Mathematica.

Mathematical libraries:CALGO, SLATEC, CERN, IMSL, NAG.

Books with software:Baker, Moshier, Numerical Recipes, Thompson, Wong& Guo, Zhang & Jin.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45

Page 21: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

A book on numerics of special functions

The topics mentioned in this lecture, and several othertopics, will be discussed extensively, with examples ofsoftware, in a new book with the title

Numerical Methods for Special Functions.

Written together with my co-authors Amparo Gil and JavierSegura (Santander, Spain).

We have just submitted the first version for review.

To be published by SIAM.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.6/45

Page 22: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

A book on numerics of special functions

As the basic methods for computing special functions weconsider

Power series: convergent, asymptotic

Chebyshev series

Recurrence relations and continued fractions

Quadrature methods

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.7/45

Page 23: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

A book on numerics of special functions

Other important methods and aspects are

Continued fractions

Computation of the zeros of special functions

Padé approximations

Sequence transformations

Best rational approximations

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.8/45

Page 24: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

A book on numerics of special functions

Other topics are

The Euler summation formula

Numerical solution of ODEs: Taylor expansion method

Uniform asymptotic expansions

Asymptotic inversion of distribution functions

Symmetric elliptic integrals

Numerical inversion of Laplace transforms

Approximations of Stirling Numbers

Oscillatory integrals

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.9/45

Page 25: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

A book on numerics of special functions

In the software section we discuss mainly the G-S-T Fortrancodes published earlier. Routines can be downloaded fromhttp://personales.unican.es/segurajj/book/software.html

Airy and Scorer functions of complex arguments andtheir derivatives.

Legendre functions of integer and half-odd degrees;toroidal harmonics.

Modified Bessel functions of integer and half integerorders.

Modified Bessel functions of purely imaginary orders.

Parabolic cylinder functions.

Zeros of the Bessel function

������ �

.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.10/45

Page 26: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Recursion relations

To compute

Bessel functions

Legendre functions

Confluent hypergeometric functions (Kummer,Whittaker, Coulomb)

Parabolic cylinder functions

Gauss hypergeometric functions

Incomplete gamma and beta functions

Orthogonal polynomials

recursion relations are important and frequently used.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.11/45

Page 27: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Recursion relations

The recursion relations are of the form

��� � � ��� � ��� � � � ��� � � � � � � � � � �� � �

When there are two linearly independent solutions

��� and� � , such that

�� �� ����

�� � �

the computation of the minimal solution

�� � � � � � � ��� � �

from

� � and

� ! (forward recursion) is usually very unstable.The solution � � is called a dominant solution.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.12/45

Page 28: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Recursion relations

For example, the functions

�� �� � � � � � � � � � � � �� � �

� � � � �� � ��� ��� � � � � � � ��� � � � � � �

satisfy the recursion relation

��� � � � � � �� ��� � �� �� � � � � � � � � � �� � �

Computing

� � ��

with Maple, standard 10 Digits, we seethat � � ��� � � �� � � � � � �� � � � � � �

a negative number.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.13/45

Page 29: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Recursion relations

The function

�� ��� � � � � �� ��� � � � � � � � � � � � �

� � � � � � �

is for � � �

a dominant solution of the recursion.

It can be computed in a stable way with starting values

� � ��� � � � � � �� � ��

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.14/45

Page 30: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Recursion relations

The recursion for the functions

� � � � follows from thesimpler (inhomogeneous) recursion

�� � � �� �� �

�� �Use this in backward direction with false starting value��� !

�� � �

. Then

� � � � � �� � �� �� � � � �� � � � � � � � �

which is correct in all shown digits.

Backward recursion for a minimal solution with false startingvalues is the basis for the Miller algorithm.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.15/45

Page 31: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Parabolic cylinder functions

PCFs are solutions of the differential equation

� � � �

�� �

� ��� � ��Special cases:

Hermite polynomials

� � � � � � � �� �� ��� � � �

when

� � � ��

� , � � � � � � �� � � �complementary error function � � � � � � �� � �� ��� � � �

when � �� .

PCFs are special cases of Kummer functions (confluenthypergeometric functions).

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.16/45

Page 32: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Parabolic cylinder functions

Two linearly independent solutions of the differentialequations are denoted by

� �� � � �

and

� �� � � �

.

Another notation is

���

��� � � � �� ��

� � � �

.

Scaling is very important to prevent underflow and overflow(and to extend the domains for computation).

When � � �

the computation is not too difficult.

When � � �

and

�� �

� � �� , oscillations occur.

Large parameters � and � , with

�� �

�� �� , are especially

difficult to handle.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.17/45

Page 33: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Parabolic cylinder functions

The regions in the

�� � � �

-plane where different methods ofcomputation for PCFs are considered. Only for �

� �; for

negative � connection formulas are used.

0 5 10 15 20x

-80

-60

-40

-20

0

20

40

a

2

3 56

f

f f f

f

6

4

11

f

f12

11fA B

4

1

3

5

6

3

2

3

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.18/45

Page 34: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Parabolic cylinder functions

Maclaurin series

In region 1 (small � and � ) we use Maclaurin series

� � �� � � � � ��� � ��� � �� � � � � � � �

��� �� � � �

� � �� � � � � �� � �� � �� � � � � � � �

� �

�� � � �

Recursion relations for the coefficients are used.

� � and � � are solutions of the differential equation, but donot constitute a numerically satisfactory pair of solutions forlarge values of � .

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.19/45

Page 35: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Parabolic cylinder functions

� � and � � are used in

� �� � � � � �� � � � � � �� � � � � � � �� � � � � � �� � � � �

� �� � � � � �� � � � � � �� � � � � � � �� � � � � � �� � � � �

with

� �� � � � �

� �� � �� � � � � ��� � �

� � �� � � � �

� � � �� � � �� � ��� � �

� �� � � � � � � � �

� � � � � � � ��

�� �

� � � ��

�� � � � � �� � � � � �� � �

� � � � � � �� ��

�� �

� � �� ��

�� � �

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.20/45

Page 36: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Parabolic cylinder functions

In other regions we use

Quadrature

Recursions with computed starting values

Poincaré asymptotic expansions (in powers of � � )Uniform asymptotic expansions in terms of elementaryfunctions

Uniform asymptotic expansions in terms of Airyfunctions

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.21/45

Page 37: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Parabolic cylinder functions

Quadrature

For quadrature we transform some standard integrals intointegrals that can easily be evaluated by using thetrapezoidal rule.

It is well known that integrals of the type

� �

� � � � � ��� � �� � ��� �

with

analytic inside a strip

� �� � � � , for some � �

, areexcellent starting points for the trapezoidal rule.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.22/45

Page 38: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Parabolic cylinder functions

In many cases we transform finite integrals, say of the form

� �

� ��� � �� �

into an integral of the form

��� �

by using the error function:

� � ��� �

��

� � � � ��

and the integral becomes

� �

� ��� � �� �

��

�� � � � � � � �� � � �� �

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.23/45

Page 39: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

Special functions play an important role in

The solution of problems in mathematical physics,engineering, statistics, and so on.

As kernels in integral transforms.

. . .

. . .

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.24/45

Page 40: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

The non-central chi-squared distributions

The definition are for positive � � �� �:

���

�� � � � � ��

� � �� �

��� � � � �� � � � ��

�� � � � � ��

� � �� �

��� � � � �� � � �

where

and

are the incomplete gamma functions:

� �� � � � �

� �� �

��

� � � � � �� � � �� � � � �

� �� �

��

� � � � � ���

���

��� � � � � ��

��� � � � ��

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.25/45

Page 41: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

The non-central chi-squared distributions

Recursion relations are:

�� � � �� � � � ��

��� � � � �

��

� � �� � ��

� � � � � �

�� � � ��� � � � ��

��� � � � � ��

� � �� � ��

� � � � � �

where

��

��� �

is the modified Bessel function.

Stability aspects are very important here.

From these recursions homogeneous four-term recursionscan be derived for

��

�� � � � and

��

��� � � � .Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.26/45

Page 42: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

The non-central chi-squared distributions

Integral representations are:

���

��� � � � � ��

��

� � � � � �

� � �� � � � � � � �� �

��

�� � � � � ��

��

� � � � � �

� � �� � � � � � � ���

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.27/45

Page 43: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

The non-central chi-squared distributions

By using an integral representation of the Bessel function:

���

��� � � � � � �

� � �

� � ��� ��

� �� � � � �

� � � � �� �

�� � � � �

��

�� � � � � � �

� � �

� � ��� ��

� �� � � � �

� � � � �� �

�� � � � � � � �

which in fact are inverse Laplace transforms.

They are useful for deriving uniform asymptotic expansions.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.28/45

Page 44: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

The non-central chi-squared distributions

In problems in radar communications very large values of

�� � � � are used, say, about 10,000.

Asymptotic analysis shows a transition when � passes thevalue � � �. There is a fast transition from 0 to 1.

The main approximant is in that case the complementaryerror function.

See T(1993) and T(1996).

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.29/45

Page 45: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

A series of Bessel functions

Consider the series in terms of modified Bessel functions

� ��� � � � � � � � �� � ��� ��

� � �� �� �� �

�� �� ��� �� � � � � �� � � � � ��

The function

� ��� � � � is the solution of an elliptic boundaryvalue problem inside a circle.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.30/45

Page 46: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

A series of Bessel functions

The equation reads

� � ��� � �

� � �� � � �

� �� � � � � � � � � � � �

with boundary condition

� � � �� � � � �� � �

on the boundary of the circle �

. We use polarcoordinates

� � �� � � � � �� �

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.31/45

Page 47: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

A series of Bessel functions

This is a so-called singular perturbation problem, � is asmall parameter.

The solution has a boundary layer at the upper part of thecircle.

We recall the solution, we write � ���� ,

� ��� � � � � � � � �� � ��� ��

� � �� �� �� �

�� �� ��� �� � � � � �� � � � � ��

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.32/45

Page 48: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

A series of Bessel functions

1.0

−1.0

1.0−1.0

x

y

θ

r

Boundary layer inside the circle along the upper boundary

� � � �

and near the points

� � � � � �

.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.33/45

Page 49: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

A series of Bessel functions

It is difficult to compute

when � �

with � �, in

particular in the neighborhoods of the points�� � � � � � � � � �

.

It is not difficult to compute the modified Bessel functions.But when � is large, they become exponentially large, andthe convergence of the Fourier series starts with high

� �values.

In particular in the boundary layer large quantities arecanceling before convergence starts.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.34/45

Page 50: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

A series of Bessel functions

A perturbation analysis starts with the expansion

� ��� � � � ��

� � ��� � � �� � � �

in which the terms satisfy

� � � ��� � � �

� � � � � and

� � � ��� � � �

� � � � � � ��� � � � � � � � � �� � � �

and all � � should vanish at the lower part of the unit circle.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.35/45

Page 51: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

A series of Bessel functions

Integrating the first few relations for the �� gives

� � ��� � � � � � � �� � � �� � � � � � �

� �

� � ��� � � � � � �

� � �

� � � � � � �� � � � ��

where

� � � � �

.

Observe that these � � become singular at the points

� � � � � �

and that they do not satisfy the boundary condition � � �

on the upper part of the unit circle.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.36/45

Page 52: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Using special functions

A series of Bessel functions

Simple model problems in singular perturbations withknown exact solutions are of interest because

Numerical codes for more general problems can betested on these problems.

They may give new challenges in (uniform) asymptoticanalysis of integrals or series.

They may provide asymptotic approximations that aredifficult to obtain from perturbation analysis.

The series expansions of

� �� � � � is a challenge fornumerical computations.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.37/45

Page 53: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

Consider

� �� � �

�� � � � � � � � � � � � ���

Maple 9.5, Digits = 10, for

� � �

, gives

� � � � � �� � � � �� � � �� � �� � � � � � � �� � � ��

With Digits = 40, the answer is

So, the first answer seems to be correct in all showndigits.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.38/45

Page 54: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

Consider

� �� � �

�� � � � � � � � � � � � ���

Maple 9.5, Digits = 10, for

� � �

, gives

� � � � � �� � � � �� � � �� � �� � � � � � � �� � � ��

With Digits = 40, the answer is

� � � � � �� � � � �� � � �� �� � � � � � � � � � � � � � � � � � �� � � �� �� � � � � �

� �� � � � � � � �� � � � � � � � � � � � �� � � �� � �� � � � � �� � � � � � � ��

So, the first answer seems to be correct in all showndigits.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.38/45

Page 55: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

Consider

� �� � �

�� � � � � � � � � � � � ���

Maple 9.5, Digits = 10, for

� � �

, gives

� � � � � �� � � � �� � � �� � �� � � � � � � �� � � ��

With Digits = 40, the answer is

� � � � � �� � � � �� � � �� �� � � � � � � � � � � � � � � � � � �� � � �� �� � � � � �

� �� � � � � � � �� � � � � � � � � � � � �� � � �� � �� � � � � �� � � � � � � ��

So, the first answer seems to be correct in all showndigits.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.38/45

Page 56: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

Take another integral, which is almost the same:

� �� � �

�� � � � � � � � � � � � �� � � �� �

� �

� � � � � � � � ���

Maple 9.5, Digits=10, for

� � �

, gives

� � � � � � �� � � � �� � �� � � � � � �

With Digits = 40, the answer is

The correct answer is and for wehave

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.39/45

Page 57: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

Take another integral, which is almost the same:

� �� � �

�� � � � � � � � � � � � �� � � �� �

� �

� � � � � � � � ���

Maple 9.5, Digits=10, for

� � �

, gives

� � � � � � �� � � � �� � �� � � � � � �

�With Digits = 40, the answer is

� � � � � � � � � � � �

The correct answer is and for wehave

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.39/45

Page 58: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

Take another integral, which is almost the same:

� �� � �

�� � � � � � � � � � � � �� � � �� �

� �

� � � � � � � � ���

Maple 9.5, Digits=10, for

� � �

, gives

� � � � � � �� � � � �� � �� � � � � � �

�With Digits = 40, the answer is

� � � � � � � � � � � �

The correct answer is� �� � � � � �

and for

� � �

wehave

� � � � � �� � � � � � � � � � � � � � �

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.39/45

Page 59: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

The message is: one should have some feeling about thecomputed result.

Otherwise a completely incorrect answer can be accepted.

Mathematica is more reliable here, and says:

"NIntegrate failed to converge to prescribed accuracy after7 recursive bisections in

near� �� � �� � � � � �� � � � � �� �

".

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.40/45

Page 60: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

By the way, Maple 7 could do the following integral

� �� � �

�� � � � � � � � � � �� �

and the funny answer was, after some simplification,

� �� � � � � ��� � � � � � �� � ��� � � � �� � �

where � � � is the error function.In Maple 9.5 the answer is

� �� � � � � � � � � � � � � ��

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.41/45

Page 61: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

Consider

� � � � �

� � � �

��

� � � � � � � ��Numerical quadrature gives

� � � � � �� � � � � �� � �� � �� � � �

.Mathematica 4.1 gives for � �

in terms of the MeijerG-function:

� � � � � � ��� ����

� ��

�� � � ��

��

� � � � �

Mathematica evaluates:� � � � � �� � � � � �� � �� � � � �� � �

.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.42/45

Page 62: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

Ask Mathematica to evaluate

� � � � :

� � � � �� � � � � � � � � � � ��

This gives

� � � � � �� � � � � � � �� �� � � � � �

.

So, we have three numerical results:

� � � �� � � � � �� � �� � � � � � � �

� � � �� � � � � �� � �� � � � �� � ��

� � �� � � � � � � �� � � � �� � ��

Observe that� � � � � � � � � �

.

� � is correct.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.43/45

Page 63: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Can we rely on Maple and Mathematica ?

Maple 9.5:

� � � � �� � � � � � � � � � � � � �� � � � � � � � � � � � �

same as Mathematica. This is a wrong answer.

Next, Maple 9.5, with � �

,

� � � � �� � � � � � � � � � � � � � � � � �� � � �

giving

� � � � �� � � � � �� �� � � �� � �� � � � � � � � �

, which is thecorrect answer.

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.44/45

Page 64: Numerical Aspects of Special FunctionsNumerics of Special Functions,Castro Urdiales, SPAIN, September 1-3 2006. – p.5/45 A book on numerics of special functions The topics mentioned

Finally, ...

Thank You

Numerics of Special Functions, Castro Urdiales, SPAIN, September 1-3 2006. – p.45/45