special functions

30 views
Skip to first unread message

Tobin Fricke

unread,
Dec 6, 2005, 7:37:50 PM12/6/05
to si...@groups.google.com
; Just for fun, definitions of a few special functions (families of
; orthogonal polynomials) in scmutils.
; Implementation is via the Rodrigues relations, as given in Arfken
; and Weber; function names correspond to analagous functions in
; Mathematica.

; Hermite Polynomials

(define ((HermiteH n) x)
(* (expt -1 n)
(exp (expt x 2))
(((expt D n) (lambda (x) (exp (- (expt x 2))))) x)))

; Is there a better way to implement the last line, maybe without the
lambda clause?

; Laguerre Polynomials

(define ((LaguerreL n) x)
(* (/ (exp x) (factorial n))
(((expt D n) (lambda (x) (* (expt x n)
(exp (- x)))))
x)))

; Legendre Polynomials

(define ((LegendreP n) x)
(/ (((expt D n) (lambda (x) (expt (+ -1 (expt x 2)) n))) x)
(expt 2 n)
(factorial n)))

Tobin

--
http://web.pas.rochester.edu/~tobin/

Reply all
Reply to author
Forward
0 new messages