Post Reply 
(33S) Legendre Polynomials
05-18-2022, 02:59 AM
Post: #1
(33S) Legendre Polynomials
Legendre Polynomials

The value of Legendre Polynomials can be calculated using a closed formula from Rodrigues' formula:

P_n(x) = Σ( comb(n, k) * comb(n+k, k) * ((x - 1)/2)^k, k= 0, n)

Program:
HP 33S:
LBL L: Size: LN = 30, CK = 14EC
LBL M: Size: LN = 105, CK = AA05

Run XEQ L.
Code:

L0001  LBL L
L0002  0
L0003  STO P
L0004  INPUT X
L0005  INPUT N
L0006  STO K
M0001  LBL M
M0002  RCL N
M0003  RCL K
M0004  nCr
M0005  RCL N
M0006  RCL+ K
M0007  LASTx
M0008  nCr
M0009  ×
M0010  -1
M0011  RCL+ X
M0012  2
M0013  ÷
M0014  RCL K
M0015  y^x
M0016  ×
M0017  STO+ P
M0018  DSE K
M0019  GTO M
M0020  1
M0021  STO+ P
M0022  RCL P
M0023  RTN

Examples:
N = 2, X = 0.25; Result: -0.406250
N = 3, X = -0.46; Result: 0.446660
N = 4, X = 0.73; Result: -0.380952

Source:
"Legendre polynomials" Wikipedia. https://en.wikipedia.org/wiki/Legendre_polynomials Updated April 6, 2022. Last Accessed April 29, 2022.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(33S) Legendre Polynomials - Eddie W. Shore - 05-18-2022 02:59 AM



User(s) browsing this thread: 1 Guest(s)