No BSD License  

Highlights from
Generalized Laguerre polynomial

4.33333

4.3 | 4 ratings Rate this file 32 Downloads (last 30 days) File Size: 2.78 KB File ID: #15916

Generalized Laguerre polynomial

by Mattthias Trampisch

 

13 Aug 2007 (Updated 16 Aug 2007)

LaguerreGen calculates the generalized Laguerre polynomial L{n, alpha} for real valued alphas

| Watch this File

File Information
Description

LaguerreGen calculates the generalized Laguerre polynomial L{n, alpha}

This function computes the generalized Laguerre polynomial L{n,alpha}.
If no alpha is supplied, alpha is set to zero and this function calculates the "normal" Laguerre polynomial.

Input:
 - n = nonnegative integer as degree level
 - alpha >= -1 real number (input is optional)

The output is formated as a polynomial vector of degree (n+1) corresponding to MATLAB norms (that is the highest coefficient is the first element).

Possible usage:
 - polyval(LaguerreGen(n, alpha), x) evaluates L{n, alpha}(x)
 - roots(LaguerreGen(n, alpha)) calculates roots of L{n, alpha}

Calculation is done recursively using matrix operations for very fast execution time. The formula is taken from Szegö: Orthogonal Polynomials, 1958, formula (5.1.10)

Acknowledgements

The author wishes to acknowledge the following in the creation of this submission:
AssociatedLaguerrePoly.m

MATLAB release MATLAB 7.3 (R2006b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (4)
14 Aug 2007 John D'Errico

Not bad. But it could be better.

The help is acceptable, but not what I'd call great. It never carefully defines the inputs, although it does give an example of use of the function, so you can figure out which order they must appear.

Based on the help, I was planning on giving this a rating of 4, until I tripped over a bug. The help states:

% Given nonnegative integer n and alpha >= -1

The zero'th order Laguerre polynomial (for any value of alpha) is well defined.

  L_0(x,alpha) = 1

and since zero is a non-negative integer, the help suggests that LaguerreGen can provide that polynomial. In fact, an error results.

>> LaguerreGen(0,0)

??? Subscripted assignment dimension mismatch.

Error in ==> LaguerreGen at 33
L(2,:)=[zeros(1, n-1), -1, (alpha+1)];

The higher order polynomials are computable, and the code is indeed efficient. I checked a few polynomials up to about order 10, and the coefficients were accurate.

I was a little surprised that no default was supplied for alpha. I.e., when alpha == 0 (or is not supplied) a generalized Laguerre should reduce to a standard Laguerre.

16 Aug 2007 John D'Errico

This now properly returns the zero'th order polynomial. The help is better. There is a default for alpha. Preallocation is now used to speed it up. This now looks like a 5 rating to me.

04 Aug 2008 Geert Van Damme

I'd like to propose the following elegant alternative: determine the coefficients of the associated Laguerre polynomial of order n, by determining the coefficients of the characteristic polynomial of its companion matrix:

function [c] = Laguerre_coeff(n, alpha)

i = 1:n;
a = (2*i-1) + alpha;
b = sqrt( i(1:n-1) .* ((1:n-1) + alpha) );
CM = diag(a) + diag(b,1) + diag(b,-1);

c = (-1)^n/factorial(n) * poly(CM);

14 Sep 2008 GHADBANE Ahmed  
Please login to add a comment or rating.
Updates
15 Aug 2007

Additional error checking and auto set of alpha if not supplied.

16 Aug 2007

One minor pre-allocation error removed

Tag Activity for this File
Tag Applied By Date/Time
differential equations Mattthias Trampisch 22 Oct 2008 09:22:56
generalized laguerre polynomial Mattthias Trampisch 22 Oct 2008 09:22:56
roots Mattthias Trampisch 22 Oct 2008 09:22:56
value Mattthias Trampisch 22 Oct 2008 09:22:56
mathematics Mattthias Trampisch 22 Oct 2008 09:22:56
diferential equations Francesco Grubas 08 Mar 2009 13:46:40
generalized laguerre polynomials Francesco Grubas 08 Mar 2009 13:46:40
mathematics Francesco Grubas 08 Mar 2009 13:46:40
roots Francesco Grubas 08 Mar 2009 13:46:40
value Francesco Grubas 08 Mar 2009 13:46:40

Contact us at files@mathworks.com