Octave Matrix of discretized Legendre polynomials
NickName:vojta havlíček Ask DateTime:2013-08-02T11:29:50

Octave Matrix of discretized Legendre polynomials

I need to get N x columns(L) matrix of legendre polynomials evaluated over L for arbitrary N.

Is there a better way of computing the matrix than just explicitly evaluating the polynomial vector for each row? The code snippet for this approach (N = 4) is here:

L = linspace(-1,1,800);

# How to do this in a better way?
G = [legendre_Pl(0,L); legendre_Pl(1,L); legendre_Pl(2,L); legendre_Pl(3,L)];

Thanks, Vojta

Copyright Notice:Content Author:「vojta havlíček」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/18008316/octave-matrix-of-discretized-legendre-polynomials

More about “Octave Matrix of discretized Legendre polynomials” related questions

Octave Matrix of discretized Legendre polynomials

I need to get N x columns(L) matrix of legendre polynomials evaluated over L for arbitrary N. Is there a better way of computing the matrix than just explicitly evaluating the polynomial vector fo...

Show Detail

Numerical integration Legendre Polynomials MATLAB

The Legendre polynomials are implemented in MATLAB as vectors, where you also get all the associated Legendre polynomials evaluated at a particular point x. Thus, I don't know how I can use these

Show Detail

Python and associated Legendre polynomials

I have been searching for a python implementation of the associated Legendre polynomials quite a long time and have found nothing satisfying me. There is an implementation in scipy.special, but it ...

Show Detail

Generalized associated Legendre Polynomials

Is there a simple way to calculate the generalized associated Legendre polynomials in Python (article)? I know that you can get the associated Legendre Polynomials using SciPy or pyshtools (articl...

Show Detail

Legendre polynomials derivative

I use this code to create legendre polynomials, from 1st to the 7th order. N = 4000 xvals = np.linspace(-1, 1, N) def Legendre(x, n): leg = legendre(n) P_n = leg(x) return P_n for i in

Show Detail

Matlab code optimization for Legendre polynomials

I know Matlab has built-in functions for determining the associated Legendre functions. I want to compute the Legendre polynomials which are a particular case of those ones. I have written my own c...

Show Detail

Boost alternative to gsl_sf_legendre_sphPlm_array() for Legendre polynomials

My understanding is that Boost library is much faster than GSL. I'm now maintaining a code that calls gsl_sf_legendre_sphPlm_array at some point in the calculation to compute Legendre polynomials. ...

Show Detail

Problems with GSL using Legendre polynomials

I'm trying to update an old code that was using a version of GSL with deprecated functions, but I'm having troubles to find how to use the new version of the normalized Legendre polynomials functio...

Show Detail

Orthogonality issue in scipy's legendre polynomials

I recently stumbled upon a curious issue concerning the scipy.special.legendre() (scipy documentation). The legendre polynomials should be pairwise orthogonal. However, when I calculate them over a...

Show Detail

Overcoming broadcasting error for Legendre polynomails, scipy eval_legendre

I am trying to evaluate the Legendre polynomial P_n(x) with scipy's special function scipy.special.eval_legendre(n, x) which allows you to evaluate a Legendre at certain points. I would then lik...

Show Detail