MathGroup Archive 1993

[Date Index] [Thread Index] [Author Index]

Search the Archive

Problem with the Gaussian Quadrature package

  • To: mathgroup at yoda.physics.unc.edu
  • Subject: Problem with the Gaussian Quadrature package
  • From: prange at sdr.slb.com (Michael Prange)
  • Date: 24 Aug 1993 10:09:09 -0400 (EDT)

I found a problem with the GaussianQuadrature package distributed with
mma 2.2 on a sparc10.  Here is the version info:

(* :Package Version: Mathematica 2.0 *)

(* :History:
	Original version by Jerry B. Keiper, May 1990.
	Revised by Jerry B. Keiper, December 1990.
*)

When I evaluate GaussianQuadratureWeights[1, 0, 1, 16] I get {{0, 2.}}.
According to Abramowitz and Stegun table 25.8 (p. 921) the answer should
be {{.5, 1}}.  The problem with the code seems to be with the line
        If[ n == 1, Return[N[{{0, 2}}, prec]]];
My guess is that this line should be
        If[ n == 1, Return[N[{{(b+a)/2, b-a}}, prec]]];


There also seems to be a problem with large n.  Linearsolve complained
of a loss of precision, so I boosted the precision from 16 to 32.  The
resulting quadrature weights are

In[23]:= Map[Last,GaussianQuadratureWeights[40, 0, 1, 32]]

Out[23]= {0, 0.013, -0.01, 0.00, 0.0, 0.0, 0., 00., 00., 000., 000., 000., 
 
>    000., 000., 000., 000., 000., 00., 0., 0000., 0000., 0., 00., 000., 
 
>    000., 000., 000., 000., 000., 000., 000., 00., 00., 0., 0.0, 0.0, 0.00, 
 
>    -0.01, 0.013, 0}

Where does 0000. come from?

Michael
prange at sdr.slb.com





  • Prev by Date: Mma Notebook to "PDEs with Mathematica (Dimitri Vvedensky)"
  • Next by Date: Notebook incompatibilities
  • Previous by thread: Re: Mma Notebook to "PDEs with Mathematica (Dimitri Vvedensky)"
  • Next by thread: Re: Problem with the Gaussian Quadrature package