DERPOL_LEGENDRE recursive construction of Legendre polynomials 1st derivative formula (2.3.19), pag. 77, CHQZ2 [dlnp1]=derpol_legendre(n,ln,dln,dlnm1) Input: n = polynomial degree ln = character expression of L_n(x) dln = character expression of (L_n)'(x) dlnm1 = character expression of (L_{n-1})'(x) Output: dlnp1 = character expression of (L_{n+1})'(x) Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, "Spectral Methods. Fundamentals in Single Domains" Springer Verlag, Berlin Heidelberg New York, 2006.
0001 function [dlnp1]=derpol_legendre(n,ln,dln,dlnm1) 0002 % DERPOL_LEGENDRE recursive construction of Legendre polynomials 1st derivative 0003 % formula (2.3.19), pag. 77, CHQZ2 0004 % 0005 % [dlnp1]=derpol_legendre(n,ln,dln,dlnm1) 0006 % 0007 % Input: n = polynomial degree 0008 % ln = character expression of L_n(x) 0009 % dln = character expression of (L_n)'(x) 0010 % dlnm1 = character expression of (L_{n-1})'(x) 0011 % 0012 % Output: dlnp1 = character expression of (L_{n+1})'(x) 0013 % 0014 % Reference: CHQZ2 = C. Canuto, M.Y. Hussaini, A. Quarteroni, T.A. Zang, 0015 % "Spectral Methods. Fundamentals in Single Domains" 0016 % Springer Verlag, Berlin Heidelberg New York, 2006. 0017 0018 % Written by Paola Gervasio 0019 % $Date: 2007/04/01$ 0020 0021 0022 ns=num2str(n); 0023 dlnp1=['(2*',ns,'+1)/(',ns,'+1).*(',ln,'+x.*(',dln,'))-',ns,'/(',ns,'+1).*(',dlnm1,')']; 0024 return 0025