07-Jan-2022 22:40:08 laguerre_polynomial_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test laguerre_polynomial(). LAGUERRE_POLYNOMIAL_TEST01: L_POLYNOMIAL_VALUES stores values of the Laguerre polynomials. L_POLYNOMIAL evaluates the polynomial. Tabulated Computed N X L(N,X) L(N,X) Error 0 1 1 1 0 1 1 0 0 0 2 1 -0.5 -0.5 0 3 1 -0.6666666666666667 -0.6666666666666666 -1.1e-16 4 1 -0.625 -0.625 0 5 1 -0.4666666666666667 -0.4666666666666667 0 6 1 -0.2569444444444444 -0.2569444444444445 5.6e-17 7 1 -0.04047619047619048 -0.04047619047619059 1.1e-16 8 1 0.1539930555555556 0.1539930555555554 1.9e-16 9 1 0.3097442680776014 0.3097442680776012 1.7e-16 10 1 0.4189459325396825 0.4189459325396824 1.1e-16 11 1 0.4801341790925124 0.4801341790925122 1.7e-16 12 1 0.4962122235082305 0.4962122235082302 2.8e-16 5 0.5 -0.4455729166666667 -0.4455729166666667 0 5 3 0.85 0.85 0 5 5 -3.166666666666667 -3.166666666666667 -4.4e-16 5 10 34.33333333333333 34.33333333333333 0 LAGUERRE_POLYNOMIAL_TEST02 L_POLYNOMIAL_COEFFICIENTS determines polynomial coefficients of L(n,x). L(0) = 1 L(1) = -1 * x 1 L(2) = 0.5 * x^2 -2 * x 1 L(3) = -0.166667 * x^3 1.5 * x^2 -3 * x 1 L(4) = 0.0416667 * x^4 -0.666667 * x^3 3 * x^2 -4 * x 1 L(5) = -0.00833333 * x^5 0.208333 * x^4 -1.66667 * x^3 5 * x^2 -5 * x 1 L(6) = 0.00138889 * x^6 -0.05 * x^5 0.625 * x^4 -3.33333 * x^3 7.5 * x^2 -6 * x 1 L(7) = -0.000198413 * x^7 0.00972222 * x^6 -0.175 * x^5 1.45833 * x^4 -5.83333 * x^3 10.5 * x^2 -7 * x 1 L(8) = 2.48016e-05 * x^8 -0.0015873 * x^7 0.0388889 * x^6 -0.466667 * x^5 2.91667 * x^4 -9.33333 * x^3 14 * x^2 -8 * x 1 L(9) = -2.75573e-06 * x^9 0.000223214 * x^8 -0.00714286 * x^7 0.116667 * x^6 -1.05 * x^5 5.25 * x^4 -14 * x^3 18 * x^2 -9 * x 1 L(10) = 2.75573e-07 * x^10 -2.75573e-05 * x^9 0.00111607 * x^8 -0.0238095 * x^7 0.291667 * x^6 -2.1 * x^5 8.75 * x^4 -20 * x^3 22.5 * x^2 -10 * x 1 LAGUERRE_POLYNOMIAL_TEST03: L_POLYNOMIAL_ZEROS computes the zeros of L(n,x) Check by calling L_POLYNOMIAL there. Computed zeros for L(1,z): 1: 1 Evaluate L(1,z): 1: 0 Computed zeros for L(2,z): 1: 0.585786 2: 3.41421 Evaluate L(2,z): 1: -1.66533e-16 2: -1.66533e-16 Computed zeros for L(3,z): 1: 0.415775 2: 2.29428 3: 6.28995 Evaluate L(3,z): 1: 2.96059e-16 2: -4.44089e-16 3: -4.73695e-15 Computed zeros for L(4,z): 1: 0.322548 2: 1.74576 3: 4.53662 4: 9.39507 Evaluate L(4,z): 1: -5.55112e-17 2: 0 3: 2.22045e-16 4: 4.61853e-14 Computed zeros for L(5,z): 1: 0.26356 2: 1.4134 3: 3.59643 4: 7.08581 5: 12.6408 Evaluate L(5,z): 1: -1.33227e-16 2: 1.06581e-15 3: 1.42109e-15 4: -1.84741e-14 5: -9.09495e-14 LAGUERRE_POLYNOMIAL_TEST04: L_QUADRATURE_RULE computes the quadrature rule associated with L(n,x) X W 1: 0.193044 0.409319 2: 1.02666 0.421831 3: 2.56788 0.147126 4: 4.90035 0.0206335 5: 8.18215 0.00107401 6: 12.7342 1.58655e-05 7: 19.3957 3.17032e-08 Use the quadrature rule to estimate: Q = Integral ( 0 <= X < +00 ) X^E exp(-X) dx E Q_Estimate Q_Exact 0 1 1 1 1 1 2 2 2 3 6 6 4 24 24 5 120 120 6 720 720 7 5040 5040 8 40320 40320 9 362880 362880 10 3.6288e+06 3.6288e+06 11 3.99168e+07 3.99168e+07 12 4.79002e+08 4.79002e+08 13 6.22702e+09 6.22702e+09 LAGUERRE_POLYNOMIAL_TEST05: LM_POLYNOMIAL_VALUES stores values of the Laguerre polynomial Lm(n,m,x) LM_POLYNOMIAL evaluates the polynomial. Tabulated Computed N M X Lm(N,M,X) Lm(N,M,X) Error 1 0 1 1 0 2 0 1 1 0 3 0 1 1 0 4 0 1 1 0 5 0 1 1 0 1 0.5 1.5 1.5 0 2 0.5 1.625 1.625 0 3 0.5 1.479166666666667 1.479166666666667 2.2e-16 4 0.5 1.1484375 1.1484375 0 3 0.2 0.4586666666666667 0.4586666666666665 2.2e-16 3 0.2 2.878666666666667 2.878666666666666 8.9e-16 3 0.2 8.098666666666666 8.098666666666665 1.8e-15 3 0.2 17.11866666666667 17.11866666666667 3.6e-15 4 0.25 10.45328776041667 10.45328776041666 5.3e-15 5 0.25 13.29019368489583 13.29019368489583 0 6 0.25 56.2245364718967 56.22453647189671 -7.1e-15 7 0.25 74.84729341779436 74.84729341779438 -1.4e-14 8 0.25 323.8912982762806 323.8912982762805 1.1e-13 9 0.25 442.6100000097533 442.6100000097532 1.1e-13 10 0.25 1936.87657228825 1936.87657228825 2.3e-13 LAGUERRE_POLYNOMIAL_TEST06 LM_POLYNOMIAL_COEFFICIENTS determines polynomial coefficients of Lm(n,m,x). Lm(0,0) = 1 Lm(1,0) = -1 * x 1 Lm(2,0) = 0.5 * x^2 -2 * x 1 Lm(3,0) = -0.166667 * x^3 1.5 * x^2 -3 * x 1 Lm(4,0) = 0.0416667 * x^4 -0.666667 * x^3 3 * x^2 -4 * x 1 Lm(5,0) = -0.00833333 * x^5 0.208333 * x^4 -1.66667 * x^3 5 * x^2 -5 * x 1 Lm(0,1) = 1 Lm(1,1) = -1 * x 2 Lm(2,1) = 0.5 * x^2 -3 * x 3 Lm(3,1) = -0.166667 * x^3 2 * x^2 -6 * x 4 Lm(4,1) = 0.0416667 * x^4 -0.833333 * x^3 5 * x^2 -10 * x 5 Lm(5,1) = -0.00833333 * x^5 0.25 * x^4 -2.5 * x^3 10 * x^2 -15 * x 6 Lm(0,2) = 1 Lm(1,2) = -1 * x 3 Lm(2,2) = 0.5 * x^2 -4 * x 6 Lm(3,2) = -0.166667 * x^3 2.5 * x^2 -10 * x 10 Lm(4,2) = 0.0416667 * x^4 -1 * x^3 7.5 * x^2 -20 * x 15 Lm(5,2) = -0.00833333 * x^5 0.291667 * x^4 -3.5 * x^3 17.5 * x^2 -35 * x 21 Lm(0,3) = 1 Lm(1,3) = -1 * x 4 Lm(2,3) = 0.5 * x^2 -5 * x 10 Lm(3,3) = -0.166667 * x^3 3 * x^2 -15 * x 20 Lm(4,3) = 0.0416667 * x^4 -1.16667 * x^3 10.5 * x^2 -35 * x 35 Lm(5,3) = -0.00833333 * x^5 0.333333 * x^4 -4.66667 * x^3 28 * x^2 -70 * x 56 Lm(0,4) = 1 Lm(1,4) = -1 * x 5 Lm(2,4) = 0.5 * x^2 -6 * x 15 Lm(3,4) = -0.166667 * x^3 3.5 * x^2 -21 * x 35 Lm(4,4) = 0.0416667 * x^4 -1.33333 * x^3 14 * x^2 -56 * x 70 Lm(5,4) = -0.00833333 * x^5 0.375 * x^4 -6 * x^3 42 * x^2 -126 * x 126 LAGUERRE_POLYNOMIAL_TEST07 Compute an exponential product table for L(n,x): Tij = integral ( 0 <= x < +oo ) exp(b*x) Ln(i,x) Ln(j,x) exp(-x) dx Maximum degree P = 5 Exponential argument coefficient B = 0 Exponential product table: Col: 1 2 3 4 5 Row 1 : 1 1.29083e-16 3.36141e-16 4.3079e-16 3.35157e-16 2 : 1.29083e-16 1 4.57784e-16 6.54917e-17 2.13012e-16 3 : 3.36141e-16 4.57784e-16 1 9.88118e-16 2.01052e-16 4 : 4.3079e-16 5.16137e-17 9.88118e-16 1 5.82217e-17 5 : 3.35157e-16 1.85256e-16 1.71575e-16 5.81132e-17 1 6 : 2.94847e-16 2.79948e-16 -4.92878e-16 5.79398e-16 1.17094e-15 Col: 6 Row 1 : 2.94847e-16 2 : 3.01198e-16 3 :-4.65123e-16 4 : 6.34475e-16 5 : 1.17094e-15 6 : 1 LAGUERRE_POLYNOMIAL_TEST07 Compute an exponential product table for L(n,x): Tij = integral ( 0 <= x < +oo ) exp(b*x) Ln(i,x) Ln(j,x) exp(-x) dx Maximum degree P = 5 Exponential argument coefficient B = 0.5 Exponential product table: Col: 1 2 3 4 5 Row 1 : 2 -2 1.99998 -1.99973 1.99749 2 : -2 9.99996 -17.9991 25.9883 -33.8934 3 : 1.99998 -17.9991 65.9815 -145.762 255.9 4 : -1.99973 25.9883 -145.762 487.031 -1160.53 5 : 1.99749 -33.8934 255.9 -1160.53 3629.63 6 : -1.98292 41.2967 -388.545 2203.41 -8474.02 Col: 6 Row 1 : -1.98292 2 : 41.2967 3 : -388.545 4 : 2203.41 5 : -8474.02 6 : 23413.3 LAGUERRE_POLYNOMIAL_TEST08 Compute a power product table for L(n,x): Tij = integral ( 0 <= x < +oo ) x^e L(i,x) L(j,x) exp(-x) dx Maximum degree P = 5 Exponent of X, E = 0 Power product table: Col: 1 2 3 4 5 Row 1 : 1 -5.71092e-16 -2.74032e-17 1.75966e-16 2.35922e-16 2 :-5.71092e-16 1 -5.86987e-16 -6.18429e-16 -2.25514e-16 3 :-2.74032e-17 -5.86987e-16 1 -1.59595e-16 -1.97065e-15 4 : 1.75966e-16 -6.19296e-16 -1.04083e-16 1 5.55112e-16 5 : 2.35922e-16 -2.22045e-16 -1.97065e-15 5.82867e-16 1 6 : 2.25731e-16 -5.3256e-16 -1.22818e-15 2.77556e-17 2.22045e-16 Col: 6 Row 1 : 2.25731e-16 2 : -5.0307e-16 3 :-1.23512e-15 4 : 2.77556e-17 5 : 1.66533e-16 6 : 1 LAGUERRE_POLYNOMIAL_TEST08 Compute a power product table for L(n,x): Tij = integral ( 0 <= x < +oo ) x^e L(i,x) L(j,x) exp(-x) dx Maximum degree P = 5 Exponent of X, E = 1 Power product table: Col: 1 2 3 4 5 Row 1 : 1 -1 -3.3308e-16 -2.46602e-16 3.31766e-17 2 : -1 3 -2 1.12237e-15 5.82867e-16 3 : -3.3308e-16 -2 5 -3 7.77156e-16 4 :-2.46602e-16 9.54098e-16 -3 7 -4 5 : 3.31766e-17 5.82867e-16 3.33067e-16 -4 9 6 : 4.9483e-16 7.63278e-17 -3.16414e-15 6.21725e-15 -5 Col: 6 Row 1 : 4.9483e-16 2 : 2.98372e-16 3 :-3.38618e-15 4 : 6.21725e-15 5 : -5 6 : 11 laguerre_polynomial_test(): Normal end of execution. 07-Jan-2022 22:40:13