Problem with the GaussianQuadratureWeights[n, a, b]

*To*: mathgroup at smc.vnet.net*Subject*: [mg26431] Problem with the GaussianQuadratureWeights[n, a, b]*From*: Cheng Liu <cliu at lanl.gov>*Date*: Wed, 20 Dec 2000 00:21:50 -0500 (EST)*Sender*: owner-wri-mathgroup at wolfram.com

Hi, I accidently run into this strange behavior. I am using the package NumericalMath`GaussianQuadrature` and the function GaussianQuadratureWeights[n, a, b] to obtain the abscissas and weights for the n-point Gaussian quadrature formula on the interval (a, b). The specific interval in my problem is (0, 1), I noticed that when 40 <= n <= 50, if n is odd, the function gives correct answer, but when n is even, the function gives the following error message: In[43]:= GaussianQuadratureWeights[42, 0, 1] \!\(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0.`\) encountered."\) \!\(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0.`\) encountered."\) \!\(Power::"infy" \(\(:\)\(\ \)\) "Infinite expression \!\(1\/0.`\) encountered."\) General::stop : Further output of Power::infy will be suppressed during this calculation. ?::indet : Indeterminate expression - 1672.96 + ComplexInfinity + ComplexInfinity + \[LeftSkeleton]6\[RightSkeleton] + ComplexInfinity + ComplexInfinity encountered. Out[43]= {{0.000800191, Indeterminate}, {0.00421136, Indeterminate}, {0.0103287, Indeterminate}, {0.0191203, Indeterminate}, {0.0305382, Indeterminate}, {0.0445201, Indeterminate}, {0.0609897, Indeterminate}, {0.079857, Indeterminate}, {0.101019, Indeterminate}, {0.12436, Indeterminate}, {0.149753, Indeterminate}, {0.177058, Indeterminate}, {0.206128, Indeterminate}, {0.236802, Indeterminate}, {0.268914, Indeterminate}, {0.302288, Indeterminate}, {0.336742, Indeterminate}, {0.372087, Indeterminate}, {0.408132, Indeterminate}, {0.444677, Indeterminate}, {0.481526, Indeterminate}, {0.518474, Indeterminate}, {0.555323, Indeterminate}, {0.591868, Indeterminate}, {0.627913, Indeterminate}, {0.663258, Indeterminate}, {0.697712, Indeterminate}, {0.731086, Indeterminate}, {0.763198, Indeterminate}, {0.793872, Indeterminate}, {0.822942, Indeterminate}, {0.850247, Indeterminate}, {0.87564, Indeterminate}, {0.898981, Indeterminate}, {0.920143, Indeterminate}, {0.93901, Indeterminate}, {0.95548, Indeterminate}, {0.969462, Indeterminate}, {0.98088, Indeterminate}, {0.989671, Indeterminate}, {0.995789, Indeterminate}, {0.9992, Indeterminate}} When n > 50, the above behavior disappears. Of course, I didn't check cases when n is really big (it's also not necessary in view of ordinary numerical computation). The version of Mathematica I am using is "4.0 for Power Macintosh (July 26, 1999)". Any explanations? Thanks. Cheng -- ==================================================== Cheng Liu, Ph.D. MST-8, Structure/Property Relations Materials Science and Technology Division Los Alamos National Laboratory Los Alamos, New Mexico 87545 Phone: 505-665-6892 (office), 505-667-9950 (lab) Fax: 505-667-8021 email: cliu at lanl.gov ====================================================