Sun Feb 25 15:46:22 2024 laguerre_polynomial_test(): Python version: 3.8.10 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): 0: 1 Evaluate L(1,z): 0: 0 Computed zeros for L(2,z): 0: 0.585786 1: 3.41421 Evaluate L(2,z): 0: -1.66533e-16 1: -8.32667e-16 Computed zeros for L(3,z): 0: 0.415775 1: 2.29428 2: 6.28995 Evaluate L(3,z): 0: 7.40149e-17 1: 7.40149e-16 2: -5.92119e-16 Computed zeros for L(4,z): 0: 0.322548 1: 1.74576 2: 4.53662 3: 9.39507 Evaluate L(4,z): 0: -8.88178e-16 1: 6.66134e-16 2: 2.22045e-16 3: -2.84217e-14 Computed zeros for L(5,z): 0: 0.26356 1: 1.4134 2: 3.59643 3: 7.08581 4: 12.6408 Evaluate L(5,z): 0: -1.33227e-16 1: 2.66454e-16 2: 1.77636e-16 3: -1.42109e-15 4: 2.27374e-14 laguerre_polynomial_test04(): l_quadrature_rule() computes the quadrature rule associated with L(n,x) X W 0: 0.193044 0.409319 1: 1.02666 0.421831 2: 2.56788 0.147126 3: 4.90035 0.0206335 4: 8.18215 0.00107401 5: 12.7342 1.58655e-05 6: 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.0 Exponential product table: Col: 0 1 2 3 4 Row 0 : 1 2.79557e-16 2.54829e-16 2.24456e-17 -1.43016e-16 1 : 2.79557e-16 1 -4.06232e-16 -1.8685e-16 3.5389e-17 2 : 2.54829e-16 -4.20109e-16 1 -2.14991e-16 -5.1852e-17 3 : 2.24456e-17 -1.8685e-16 -2.14557e-16 1 -5.96636e-16 4 :-1.43016e-16 3.56059e-17 -6.74645e-17 -5.89698e-16 1 5 :-4.00727e-16 1.1872e-16 -2.30393e-16 1.01785e-15 -1.97758e-15 Col: 5 Row 0 :-4.00727e-16 1 : 1.1872e-16 2 :-2.33862e-16 3 : 1.03173e-15 4 :-1.97758e-15 5 : 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: 0 1 2 3 4 Row 0 : 2 -2 1.99998 -1.99973 1.99749 1 : -2 9.99996 -17.9991 25.9883 -33.8934 2 : 1.99998 -17.9991 65.9815 -145.762 255.9 3 : -1.99973 25.9883 -145.762 487.031 -1160.53 4 : 1.99749 -33.8934 255.9 -1160.53 3629.63 5 : -1.98292 41.2967 -388.545 2203.41 -8474.02 Col: 5 Row 0 : -1.98292 1 : 41.2967 2 : -388.545 3 : 2203.41 4 : -8474.02 5 : 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: 0 1 2 3 4 Row 0 : 1 6.2057e-17 2.06066e-16 1.4962e-16 7.77373e-17 1 : 6.2057e-17 1 -1.99493e-17 6.50521e-17 1.16226e-16 2 : 2.06066e-16 3.55618e-17 1 -1.249e-16 -1.31839e-16 3 : 1.4962e-16 6.50521e-17 -1.21431e-16 1 1.94289e-16 4 : 7.77373e-17 6.07153e-17 -7.63278e-17 1.94289e-16 1 5 :-2.41777e-17 9.19403e-17 1.45717e-16 -6.10623e-16 1.11022e-16 Col: 5 Row 0 :-2.41777e-17 1 : 6.41848e-17 2 : 1.45717e-16 3 :-5.82867e-16 4 : 1.11022e-16 5 : 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: 0 1 2 3 4 Row 0 : 1 -1 -4.77401e-16 4.10479e-16 -8.1532e-17 1 : -1 3 -2 -3.73139e-15 1.31492e-15 2 :-4.77401e-16 -2 5 -3 -1.249e-15 3 : 4.10479e-16 -3.84241e-15 -3 7 -4 4 : -8.1532e-17 1.14492e-15 -1.22125e-15 -4 9 5 :-2.81459e-16 4.26048e-15 -1.17129e-14 9.99201e-15 -5 Col: 5 Row 0 :-2.81459e-16 1 : 4.26048e-15 2 :-1.18794e-14 3 : 9.76996e-15 4 : -5 5 : 11 Graphics saved as "l_polynomial.png" Graphics saved as "lm1_polynomial.png" Graphics saved as "lm2_polynomial.png" Graphics saved as "lf05_function.png" laguerre_polynomial_test(): Normal end of execution. Sun Feb 25 15:46:23 2024