Miscellaneous

How do you write a Legendre polynomial in Matlab?

How do you write a Legendre polynomial in Matlab?

Legendre Polynomial P ( n , x ) = 2 n − 1 n x P ( n − 1 , x ) − n − 1 n P ( n − 2 , x ) , where P ( 0 , x ) = 1 P ( 1 , x ) = x . ∫ x = − 1 x = 1 P ( n , x ) P ( m , x ) d x = { 0 if n ≠ m 1 n + 1 / 2 if n = m .

How do you use Legendre in Matlab?

Use the legendre function to operate on a vector and then examine the format of the output. Calculate the second-degree Legendre function values of a vector. The format of the output is such that: Each row contains the function value for different values of m (the order of the associated Legendre function)

What is generating function of Legendre polynomial?

The Legendre polynomials can be alternatively given by the generating function ( 1 − 2 x z + z 2 ) − 1 / 2 = ∑ n = 0 ∞ P n ( x ) z n , but there are other generating functions.

How do you solve numerically in Matlab?

S = vpasolve( eqn , var , init_param ) numerically solves the equation eqn for the variable var using the initial guess or search range init_param . Y = vpasolve( eqns , vars ) numerically solves the system of equations eqns for the variables vars . This syntax returns a structure array Y that contains the solutions.

How do you derive in Matlab?

Find the derivative of g at x = 2 . In this example, MATLAB® software automatically simplifies the answer….More Examples.

Mathematical Operator MATLAB Command
d f d x diff(f) or diff(f, x)
d f d a diff(f, a)
d 2 f d b 2 diff(f, b, 2)
J = ∂ ( r , t ) ∂ ( u , v ) J = jacobian([r; t],[u; v])

What is meant by Legendre polynomial?

In physical science and mathematics, Legendre polynomials (named after Adrien-Marie Legendre, who discovered them in 1782) are a system of complete and orthogonal polynomials, with a vast number of mathematical properties, and numerous applications.

What is orthogonality of Legendre polynomial?

Abstract We give a remarkable second othogonality property of the classical Legendre polynomials on the real interval [−1, 1]: Polynomials up to de- gree n from this family are mutually orthogonal under the arcsine measure weighted by the degree-n normalized Christoffel function.

What is the difference between solve and Vpasolve in Matlab?

solve solves equations and inequalities that contain parameters. vpasolve does not solve inequalities, nor does it solve equations that contain parameters.

How is the Associated Legendre function returned in MATLAB?

Associated Legendre function values, returned as a scalar, vector, matrix, or multidimensional array. The normalization of P depends on the value of normalization. The size of P depends on the size of X: If X is a vector, then P is a matrix of size (n+1) -by- length (X).

Which is an example of a Legendre function?

For a specified degree, legendre computes for all orders m from m = 0 to m = n. Input values, specified as a scalar, vector, matrix, or multidimensional array of real values in the range [-1,1]. For example, with spherical harmonics it is common to use X = cos (theta) as the input values to compute .

Which is the formula for Legendre polynomial approximation?

Legendre polynomial approximation in follows the same recipe as monomial approximation: Compute the matrix . Compute the right side values . Solve using the formula . The approximation can be evaluated as (8)

Which is the solution to the Associated Legendre equation?

Associated Legendre Functions. The associated Legendre functions are solutions to the general Legendre differential equation. n is the integer degree and m is the integer order of the associated Legendre function, such that . The associated Legendre functions are the most general solutions to this equation given by.