Rank: 2205 based on 30 downloads (last 30 days) and 1 file submitted
photo

Mattthias Trampisch

E-mail

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Files Posted by Mattthias
Updated   File Tags Downloads
(last 30 days)
Comments Rating
16 Aug 2007 Generalized Laguerre polynomial LaguerreGen calculates the generalized Laguerre polynomial L{n, alpha} for real valued alphas Author: Mattthias Trampisch value, mathematics, roots, differential equation..., generalized laguerre ..., diferential equations 30 3
  • 4.33333
4.3 | 4 ratings
Comments and Ratings on Mattthias' Files View all
Updated File Comment by Comments Rating
14 Sep 2008 Generalized Laguerre polynomial LaguerreGen calculates the generalized Laguerre polynomial L{n, alpha} for real valued alphas Author: Mattthias Trampisch Ahmed, GHADBANE

04 Aug 2008 Generalized Laguerre polynomial LaguerreGen calculates the generalized Laguerre polynomial L{n, alpha} for real valued alphas Author: Mattthias Trampisch Van Damme, Geert

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);

16 Aug 2007 Generalized Laguerre polynomial LaguerreGen calculates the generalized Laguerre polynomial L{n, alpha} for real valued alphas Author: Mattthias Trampisch D'Errico, John

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.

14 Aug 2007 Generalized Laguerre polynomial LaguerreGen calculates the generalized Laguerre polynomial L{n, alpha} for real valued alphas Author: Mattthias Trampisch D'Errico, John

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.

Top Tags Applied by Mattthias
differential equations, generalized laguerre polynomial, mathematics, roots, value
Files Tagged by Mattthias
Updated   File Tags Downloads
(last 30 days)
Comments Rating
16 Aug 2007 Generalized Laguerre polynomial LaguerreGen calculates the generalized Laguerre polynomial L{n, alpha} for real valued alphas Author: Mattthias Trampisch value, mathematics, roots, differential equation..., generalized laguerre ..., diferential equations 30 3
  • 4.33333
4.3 | 4 ratings

Contact us