help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: normalized ALF (Assotiated Legendre Function)


From: Marco Caliari
Subject: Re: normalized ALF (Assotiated Legendre Function)
Date: Tue, 12 Feb 2008 15:10:56 +0100 (CET)

Dear all,

please consider the cleaner enclosed script.

I tried to run Ben's example in Maple for ten minutes, with no success. I don't know how to give a vector in input to LegendreP.

Best regards,

Marco

On Tue, 12 Feb 2008, Ben Abbott wrote:


On Feb 12, 2008, at 1:44 AM, Dmitri A. Sergatskov wrote:

FWIW: Marko's script seems to agree with "legendre_Plm"
wrapper of GSL's function (gsl package from octave-forge).

Sincerely,

Dmitri.
--


That is good news!

It would be nice to do a direct comparison for the example below.

        result_matlab = legendre (80, [-1:0.1:1]);

Any chance anyone who knows c/c++ has the inclination to write a short program using gsl to calculate that example and post the results?

In addition, I noticed the comment below in the reference manual for gsl,

"The following functions compute the associated Legendre Polynomials P_l^m(x). Note that this function grows combinatorially with l and can overflow for l larger than about 150. There is no trouble for small m, but overflow occurs when m and l are both large. Rather than allow overflows, these functions refuse to calculate P_l^m(x) and return GSL_EOVRFLW when they can sense that l and m are too big."

It would be more proper to restrict the issuing of the warning for the cases where overflow actually occurs. For example, even this trivial calculation warns of overflow.

        octave:73> legendre(0,0)
        warning: legendre is unstable for higher orders
        ans =  1

I'll take a look at modifying the script to catch overflows and issue the warning only when such occurs.

Ben

Attachment: legendre.m
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]