7 September 2021 4:40:29.394 PM CHEBYSHEV_POLYNOMIAL_TEST FORTRAN90 version Test the CHEBYSHEV_POLYNOMIAL library. CHEBYSHEV_POLYNOMIAL_TEST01: T_PROJECT_COEFFICIENTS_DATA estimates the Chebyshev polynomial coefficients for a function given as data (x,fx). Here, we use fx = f(x) = x^2 for the data. Since T(0,x) = 1 and T(2,x) = 2*x^2 - 1, the correct expansion is f(x) = 1/2 T(0,x) + 0 T(1,x) + 1/2 T(2,x) + 0 * all other polys if we are using the interval [A,B] = [-1,+1]. Using interval [A,B] = [ 0.00000 , 1.00000 ] Data ( X, D(X) ): 1 0.468038 0.219060 2 0.494169 0.244203 3 0.371498 0.138011 4 0.640966 0.410837 5 0.908509 0.825389 6 0.750570 0.563355 7 0.968064 0.937147 8 0.128331 0.164688E-01 9 0.353595 0.125029 10 0.664862 0.442041 11 0.141659 0.200674E-01 12 0.741731 0.550165 13 0.153157 0.234571E-01 14 0.427229 0.182524 15 0.488614 0.238743 16 0.333543E-01 0.111251E-02 17 0.152421 0.232323E-01 18 0.313897E-01 0.985312E-03 19 0.911551 0.830925 20 0.262772 0.690489E-01 Coefficients of Chebyshev expansion of degree 4 based in [A,B]. 1: 0.37500000 2: 0.50000000 3: 0.12500000 4: 0.18639266E-15 I X(I) D(X(I)) Chebyshev(X(I)) 1 0.4680 0.2191 0.2191 2 0.4942 0.2442 0.2442 3 0.3715 0.1380 0.1380 4 0.6410 0.4108 0.4108 5 0.9085 0.8254 0.8254 6 0.7506 0.5634 0.5634 7 0.9681 0.9371 0.9371 8 0.1283 0.1647E-01 0.1647E-01 9 0.3536 0.1250 0.1250 10 0.6649 0.4420 0.4420 11 0.1417 0.2007E-01 0.2007E-01 12 0.7417 0.5502 0.5502 13 0.1532 0.2346E-01 0.2346E-01 14 0.4272 0.1825 0.1825 15 0.4886 0.2387 0.2387 16 0.3335E-01 0.1113E-02 0.1113E-02 17 0.1524 0.2323E-01 0.2323E-01 18 0.3139E-01 0.9853E-03 0.9853E-03 19 0.9116 0.8309 0.8309 20 0.2628 0.6905E-01 0.6905E-01 T_MASS_MATRIX_TEST: T_MASS_MATRIX computes the mass matrix for the Chebyshev polynomials T(i,x). A(I,J) = integral ( -1 <=x <= +1 ) T(i,x) T(j,x) / sqrt ( 1 - x^2 ) dx 0 if i is not equal to j; pi if i = j = 0; pi/2 if i = j =/= 0. T mass matrix: Col 1 2 3 4 Row 1: 3.14159 0.888178E-15 -0.555112E-15 -0.222045E-15 2: 0.888178E-15 1.57080 0.111022E-15 0.333067E-15 3: -0.555112E-15 0.277556E-15 1.57080 0.666134E-15 4: -0.222045E-15 0.333067E-15 0.666134E-15 1.57080 T_MOMENT_TEST: T_MOMENT returns the value of integral ( -1 <=x <= +1 ) x^e / sqrt ( 1 - x^2 ) dx E Integral 0 3.14159 1 0.00000 2 1.57080 3 0.00000 4 1.17810 5 0.00000 6 0.981748 7 0.00000 8 0.859029 9 0.00000 10 0.773126 T_POLYNOMIAL_TEST: T_POLYNOMIAL evaluates Chebyshev polynomials T(n,x). Tabulated Computed N X T(n,x) T(n,x) 0 0.8000 1.00000 1.00000 1 0.8000 0.800000 0.800000 2 0.8000 0.280000 0.280000 3 0.8000 -0.352000 -0.352000 4 0.8000 -0.843200 -0.843200 5 0.8000 -0.997120 -0.997120 6 0.8000 -0.752192 -0.752192 7 0.8000 -0.206387 -0.206387 8 0.8000 0.421972 0.421972 9 0.8000 0.881543 0.881543 10 0.8000 0.988497 0.988497 11 0.8000 0.700051 0.700051 12 0.8000 0.131586 0.131586 T_POLYNOMIAL_AB_TEST: T_POLYNOMIAL_AB evaluates Chebyshev polynomials TAB(n,x) shifted from [-1,+1] to the domain [A,B]. Here, we will use the new domain [0,1] and the desired maximum polynomial degree will be N = 5. Tables of T values: Col 1 2 3 4 5 Row 1: 1. -1. 1. -1. 1. 2: 1. -0.800000 0.280000 0.352000 -0.843200 3: 1. -0.600000 -0.280000 0.936000 -0.843200 4: 1. -0.400000 -0.680000 0.944000 -0.752000E-01 5: 1. -0.200000 -0.920000 0.568000 0.692800 6: 1. 0. -1. -0. 1. 7: 1. 0.200000 -0.920000 -0.568000 0.692800 8: 1. 0.400000 -0.680000 -0.944000 -0.752000E-01 9: 1. 0.600000 -0.280000 -0.936000 -0.843200 10: 1. 0.800000 0.280000 -0.352000 -0.843200 11: 1. 1. 1. 1. 1. Col 6 Row 1: -1. 2: 0.997120 3: 0.758400E-01 4: -0.883840 5: -0.845120 6: 0. 7: 0.845120 8: 0.883840 9: -0.758400E-01 10: -0.997120 11: 1. T_POLYNOMIAL_AB_VALUE_TEST: T_POLYNOMIAL_AB_VALUE evaluates Chebyshev polynomials TAB(n,x) shifted from [-1,+1] to the domain [A,B]. Here, we will use the new domain [0,1]. Tabulated Computed N X T01(n,x) T01(n,x) -1 0.8500 0.00000 0.00000 0 0.8500 1.00000 1.00000 1 0.8500 0.700000 0.700000 2 0.8500 -0.200000E-01 -0.200000E-01 3 0.8500 -0.728000 -0.728000 4 0.8500 -0.999200 -0.999200 5 0.8500 -0.670880 -0.670880 6 0.8500 0.599680E-01 0.599680E-01 7 0.8500 0.754835 0.754835 8 0.8500 0.996801 0.996801 9 0.8500 0.640687 0.640687 10 0.8500 -0.998401E-01 -0.998401E-01 11 0.8500 -0.780463 -0.780463 12 0.8500 -0.992808 -0.992808 7 0.0000 -1.00000 -1.00000 7 0.1000 0.206387 0.206387 7 0.2000 -0.978470 -0.978470 7 0.3000 0.258022 0.258022 7 0.4000 0.987021 0.987021 7 0.5000 0.00000 -0.00000 7 0.6000 -0.987021 -0.987021 7 0.7000 -0.258022 -0.258022 7 0.8000 0.978470 0.978470 7 0.9000 -0.206387 -0.206387 7 1.0000 1.00000 1.00000 T_POLYNOMIAL_COEFFICIENTS_TEST T_POLYNOMIAL_COEFFICIENTS determines coefficients for Chebyshev polynomials T(n,x). p(x) = 1.00000 p(x) = 1.00000 * x p(x) = 2.00000 * x ^ 2 - 1.00000 p(x) = 4.00000 * x ^ 3 - 3.00000 * x p(x) = 8.00000 * x ^ 4 - 8.00000 * x ^ 2 + 1.00000 p(x) = 16.0000 * x ^ 5 - 20.0000 * x ^ 3 + 5.00000 * x T_POLYNOMIAL_PLOT_TEST T_POLYNOMIAL_PLOT plots selected Chebyshev polynomials T(n,x). Created graphics data file "t_polynomial_data.txt". Created graphics command file "t_polynomial_commands.txt". T_POLYNOMIAL_VALUE_TEST: T_POLYNOMIAL_VALUE evaluates Chebyshev polynomials T(n,x). Tabulated Computed N X T(n,x) T(n,x) -1 0.8000 0.00000 0.00000 0 0.8000 1.00000 1.00000 1 0.8000 0.800000 0.800000 2 0.8000 0.280000 0.280000 3 0.8000 -0.352000 -0.352000 4 0.8000 -0.843200 -0.843200 5 0.8000 -0.997120 -0.997120 6 0.8000 -0.752192 -0.752192 7 0.8000 -0.206387 -0.206387 8 0.8000 0.421972 0.421972 9 0.8000 0.881543 0.881543 10 0.8000 0.988497 0.988497 11 0.8000 0.700051 0.700051 12 0.8000 0.131586 0.131586 T_POLYNOMIAL_ZEROS_TEST: T_POLYNOMIAL_ZEROS returns zeroes of T(n,x). N X T(n,x) 1 0.0000 0.612323E-16 2 0.7071 0.222045E-15 2 -0.7071 -0.222045E-15 3 0.8660 0.333067E-15 3 0.0000 -0.183697E-15 3 -0.8660 -0.333067E-15 4 0.9239 -0.222045E-15 4 0.3827 -0.222045E-15 4 -0.3827 0.111022E-15 4 -0.9239 -0.222045E-15 5 0.9511 -0.444089E-15 5 0.5878 0.00000 5 0.0000 0.306162E-15 5 -0.5878 -0.777156E-15 5 -0.9511 0.444089E-15 T_QUADRATURE_RULE_TEST: T_QUADRATURE_RULE computes the quadrature rule associated with T(n,x); X W 1 -0.974928 0.448799 2 -0.781831 0.448799 3 -0.433884 0.448799 4 0.219909E-15 0.448799 5 0.433884 0.448799 6 0.781831 0.448799 7 0.974928 0.448799 Use the quadrature rule to estimate: Q = Integral ( -1 <= X <= +1 ) X^E / sqrt ( 1-x^2) dx E Q_Estimate Q_Exact 0 3.14159 3.14159 1 -0.111022E-15 0.00000 2 1.57080 1.57080 3 -0.111022E-15 0.00000 4 1.17810 1.17810 5 0.00000 0.00000 6 0.981748 0.981748 7 0.555112E-16 0.00000 8 0.859029 0.859029 9 0.111022E-15 0.00000 10 0.773126 0.773126 11 0.166533E-15 0.00000 12 0.708699 0.708699 13 0.277556E-15 0.00000 TEST07: T_PROJECT_COEFFICIENTS computes the Chebyshev coefficients of a function defined over [-1,+1]. T_PROJECT_COEFFICIENTS_AB works in [A,B]. Chebyshev coefficients for exp(x) in [-1,+1] 1: 1.2660657 2: 1.1303150 3: 0.27145036 4: 0.43793924E-01 Chebyshev coefficients for exp(x) in [-1,+1] 1: 1.2660659 2: 1.1303182 3: 0.27149534 4: 0.44336839E-01 5: 0.54740412E-02 6: 0.53972788E-03 Chebyshev coefficients for sin(x) in [-1,+1] 1: 0.18503717E-16 2: 0.88010117 3: 0.11102230E-15 4: -0.39126718E-01 5: 0.27755576E-15 6: 0.50252011E-03 Chebyshev coefficients for sin(x) in [-1,+1] 1: 0.27419192 2: 0.76218997 3: -0.21149415 4: -0.25905204E-15 5: -0.91264026E-02 6: -0.43519518E-03 Chebyshev coefficients for sqrt(x) in [0,+1] 1: 0.78192791 2: 0.29746637 3: -0.99045761E-01 4: 0.22521776E-01 5: -0.18175236E-01 6: 0.43465406E-02 TEST08: T_PROJECT_COEFFICIENTS_DATA computes the Chebyshev coefficients of a function defined by data. We are looking for an approximation that is good in [-1,+1]. Begin by using equally spaced points in [-1,+1]. Chebyshev coefficients for exp(x) on [-1,+1] 1: 1.2666688 2: 1.1305248 3: 0.27178537 4: 0.44393903E-01 Chebyshev coefficients for exp(x) on [-1,+1] 1: 1.2660784 2: 1.1303204 3: 0.27151495 4: 0.44338101E-01 5: 0.54759925E-02 6: 0.54239389E-03 Chebyshev coefficients for sin(x) on [-1,+1] 1: 0.69516041E-16 2: 0.88009912 3: 0.11319053E-15 4: -0.39127875E-01 5: 0.58509481E-16 6: 0.50001398E-03 Now sample equally spaced points in [0,+1]. The approximation still applies to the interval [-1,+1]. Chebyshev coefficients for sin(x) on [0,+1] 1: 0.44992630 2: 0.42522113 3: -0.29344840E-01 4: -0.44997777E-02 5: 0.15411011E-03 6: 0.14138949E-04 Chebyshev coefficients for sqrt(x) on [0,+1] 1: 0.62765450 2: 0.43908313 3: -0.99607426E-01 4: 0.46042692E-01 5: -0.26014620E-01 6: 0.14499032E-01 Now random points in [-1,+1]. Chebyshev coefficients for sin(x) on [-1,+1] 1: 0.61913446E-06 2: 0.88010193 3: 0.14246210E-05 4: -0.39123673E-01 5: 0.10885680E-05 6: 0.50457706E-03 TEST09: T_PROJECT_COEFFICIENTS computes the Chebyshev interpolant C(F)(N,X) of a function F(X) defined over [-1,+1]. T_PROJECT_VALUE evaluates that projection. Compute projections of order N to exp(x) over [-1,+1], N Max||F(X)-C(F)(N,X)|| 0 1.718 1 0.3722 2 0.5647E-01 3 0.6657E-02 4 0.6397E-03 5 0.5180E-04 6 0.3620E-05 7 0.2224E-06 8 0.1219E-07 9 0.6027E-09 10 0.2714E-10 TEST10: T_PROJECT_COEFFICIENTS_AB computes the Chebyshev interpolant C(F)(N,X) of a function F(X) defined over [A,B]. T_PROJECT_VALUE_AB evaluates that projection. Compute projections of order N to exp(x) over [ 0.0, 1.5] N Max||F(X)-C(F)(N,X)|| 0 2.365 1 2.598 2 1.966 3 1.556 4 1.241 5 1.032 6 0.8813 7 0.7731 8 0.6925 9 0.6263 10 0.5700 TT_PRODUCT_TEST: TT_PRODUCT(I,J;X) = T(I,X) * T(J,X) I J X TI TJ TI*TJ TT_PRODUCT 6 2 0.300838 0.259622 -0.818993 -0.212629 -0.212629 6 2 0.104346 -0.809662 -0.978224 0.792031 0.792031 5 4 -0.887576 0.733126 -0.337412 -0.247365 -0.247365 4 2 0.520093 -0.578625 -0.459007 0.265593 0.265593 0 3 0.372563 1.00000 -0.910837 -0.910837 -0.910837 1 2 -0.290364 -0.290364 -0.831377 0.241402 0.241402 0 1 -0.519077 1.00000 -0.519077 -0.519077 -0.519077 4 4 0.327903E-01 0.991408 0.991408 0.982889 0.982889 2 2 -0.921046 0.696653 0.696653 0.485326 0.485326 2 -1 -0.835709 0.396820 0.00000 0.00000 0.00000 TT_PRODUCT_INTEGRAL_TEST: TT_PRODUCT_INTEGRAL computes the product integral of a pair of Chebyshev T polynomials T(i,x) and T(j,x). A(I,J) = integral ( -1 <=x <= +1 ) T(i,x) T(j,x) / sqrt ( 1 - x^2 ) dx 0 if i is not equal to j; pi if i = j = 0; pi/2 if i = j =/= 0. T(i,x)*T(j,x) integral matrix: Col 1 2 3 4 5 Row 1: 3.14159 0. 0. 0. 0. 2: 0. 1.57080 0. 0. 0. 3: 0. 0. 1.57080 0. 0. 4: 0. 0. 0. 1.57080 0. 5: 0. 0. 0. 0. 1.57080 TTT_PRODUCT_INTEGRAL_TEST: TTT_PRODUCT_INTEGRAL computes the triple integral Tijk = integral ( -1 <= x <= 1 ) T(i,x) T(j,x) T(k,x) / sqrt ( 1-x^2) dx I J K Tijk Tijk computed exact 4 2 2 0.785398 0.785398 6 3 3 0.785398 0.785398 5 3 0 0.00000 -0.463518E-14 4 1 3 0.785398 0.785398 5 3 4 0.00000 -0.727196E-14 2 2 1 0.00000 -0.177636E-14 5 3 2 0.785398 0.785398 5 1 3 0.00000 -0.366374E-14 2 2 2 0.00000 -0.346945E-14 3 3 3 0.00000 -0.352496E-14 4 3 2 0.00000 -0.321965E-14 3 3 1 0.00000 -0.274780E-14 4 3 4 0.00000 -0.485723E-14 6 3 0 0.00000 -0.402456E-14 4 2 2 0.785398 0.785398 3 1 3 0.00000 -0.274780E-14 3 2 2 0.00000 -0.316414E-14 6 3 1 0.00000 -0.646705E-14 2 1 3 0.785398 0.785398 2 2 0 1.57080 1.57080 TU_PRODUCT_TEST: TU_PRODUCT(I,J;X) = T(I,X) * U(J,X) I J X TI UJ TI*UJ TU_PRODUCT 1 2 -0.296139 -0.296139 -0.649206 0.192255 0.192255 1 -1 -0.837101 -0.837101 0.00000 -0.00000 0.00000 0 -1 0.636552 1.00000 0.00000 0.00000 0.00000 2 4 -0.837045 0.401290 0.446715 0.179262 0.179262 5 4 -0.612279 0.152508 -1.25000 -0.190635 -0.190635 1 3 0.886033 0.886033 2.02055 1.79027 1.79027 1 3 -0.287811E-01 -0.287811E-01 0.114933 -0.330791E-02 -0.330791E-02 5 1 -0.790466 0.988082 -1.58093 -1.56209 -1.56209 6 4 0.967201 0.298304E-01 3.77616 0.112644 0.112644 1 1 0.133279E-01 0.133279E-01 0.266558E-01 0.355266E-03 0.355266E-03 U_MASS_MATRIX_TEST: U_MASS_MATRIX computes the mass matrix for the Chebyshev polynomials U(i,x). A(I,J) = integral ( -1 <=x <= +1 ) U(i,x) U(j,x) * sqrt ( 1 - x^2 ) dx 0 if i is not equal to j; pi/2 if i = j =/= 0. U mass matrix: Col 1 2 3 4 Row 1: 1.57080 0.666134E-15 0.555112E-16 0.277556E-15 2: 0.666134E-15 1.57080 0.111022E-14 0.177636E-14 3: 0.555112E-16 0.105471E-14 1.57080 0.233147E-14 4: 0.277556E-15 0.177636E-14 0.233147E-14 1.57080 U_MOMENT_TEST: U_MOMENT returns the value of integral ( -1 <=x <= +1 ) x^e * sqrt ( 1 - x^2 ) dx E Integral 0 1.57080 1 0.00000 2 0.392699 3 0.00000 4 0.196350 5 0.00000 6 0.122718 7 0.00000 8 0.859029E-01 9 0.00000 10 0.644272E-01 U_POLYNOMIAL_TEST: U_POLYNOMIAL evaluates the Chebyshev polynomials U(n,x). Tabulated Computed N X U(n,x) U(n,x) 0 0.8000 1.00000 1.00000 1 0.8000 1.60000 1.60000 2 0.8000 1.56000 1.56000 3 0.8000 0.896000 0.896000 4 0.8000 -0.126400 -0.126400 5 0.8000 -1.09824 -1.09824 6 0.8000 -1.63078 -1.63078 7 0.8000 -1.51101 -1.51101 8 0.8000 -0.786839 -0.786839 9 0.8000 0.252072 0.252072 10 0.8000 1.19015 1.19015 11 0.8000 1.65217 1.65217 12 0.8000 1.45333 1.45333 U_POLYNOMIAL_AB_TEST: U_POLYNOMIAL_AB evaluates Chebyshev polynomials UAB(n,x) shifted from [-1,+1] to the domain [A,B]. Here, we will use the new domain [0,1] and the desired maximum polynomial degree will be N = 5. Tables of U values: Col 1 2 3 4 5 Row 1: 1. -2. 3. -4. 5. 2: 1. -1.60000 1.56000 -0.896000 -0.126400 3: 1. -1.20000 0.440000 0.672000 -1.24640 4: 1. -0.800000 -0.360000 1.08800 -0.510400 5: 1. -0.400000 -0.840000 0.736000 0.545600 6: 1. 0. -1. -0. 1. 7: 1. 0.400000 -0.840000 -0.736000 0.545600 8: 1. 0.800000 -0.360000 -1.08800 -0.510400 9: 1. 1.20000 0.440000 -0.672000 -1.24640 10: 1. 1.60000 1.56000 0.896000 -0.126400 11: 1. 2. 3. 4. 5. Col 6 Row 1: -6. 2: 1.09824 3: 0.823680 4: -0.679680 5: -0.954240 6: 0. 7: 0.954240 8: 0.679680 9: -0.823680 10: -1.09824 11: 6. U_POLYNOMIAL_AB_VALUE_TEST: U_POLYNOMIAL_AB_VALUE evaluates Chebyshev polynomials UAB(n,x) shifted from [-1,+1] to the domain [A,B]. Here, we will use the new domain [0,1]. Tabulated Computed N X U01(n,x) U01(n,x) -1 0.8500 0.00000 0.00000 0 0.8500 1.00000 1.00000 1 0.8500 1.40000 1.40000 2 0.8500 0.960000 0.960000 3 0.8500 -0.560000E-01 -0.560000E-01 4 0.8500 -1.03840 -1.03840 5 0.8500 -1.39776 -1.39776 6 0.8500 -0.918464 -0.918464 7 0.8500 0.111910 0.111910 8 0.8500 1.07514 1.07514 9 0.8500 1.39328 1.39328 10 0.8500 0.875458 0.875458 11 0.8500 -0.167642 -0.167642 12 0.8500 -1.11016 -1.11016 7 0.0000 -8.00000 -8.00000 7 0.1000 1.51101 1.51101 7 0.2000 -1.13326 -1.13326 7 0.3000 -0.163635 -0.163635 7 0.4000 1.01980 1.01980 7 0.5000 0.00000 -0.00000 7 0.6000 -1.01980 -1.01980 7 0.7000 0.163635 0.163635 7 0.8000 1.13326 1.13326 7 0.9000 -1.51101 -1.51101 7 1.0000 8.00000 8.00000 U_POLYNOMIAL_COEFFICIENTS_TEST U_POLYNOMIAL_COEFFICIENTS determines coefficients for Chebyshev polynomials U(n,x). p(x) = 1.00000 p(x) = 2.00000 * x p(x) = 4.00000 * x ^ 2 - 1.00000 p(x) = 8.00000 * x ^ 3 - 4.00000 * x p(x) = 16.0000 * x ^ 4 - 12.0000 * x ^ 2 + 1.00000 p(x) = 32.0000 * x ^ 5 - 32.0000 * x ^ 3 + 6.00000 * x U_POLYNOMIAL_PLOT_TEST U_POLYNOMIAL_PLOT plots selected Chebyshev polynomials U(n,x). Created graphics data file "u_polynomial_data.txt". Created graphics command file "u_polynomial_commands.txt". U_POLYNOMIAL_VALUE_TEST: U_POLYNOMIAL_VALUE evaluates the Chebyshev polynomials U(n,x). Tabulated Computed N X U(n,x) U(n,x) -1 0.8000 0.00000 0.00000 0 0.8000 1.00000 1.00000 1 0.8000 1.60000 1.60000 2 0.8000 1.56000 1.56000 3 0.8000 0.896000 0.896000 4 0.8000 -0.126400 -0.126400 5 0.8000 -1.09824 -1.09824 6 0.8000 -1.63078 -1.63078 7 0.8000 -1.51101 -1.51101 8 0.8000 -0.786839 -0.786839 9 0.8000 0.252072 0.252072 10 0.8000 1.19015 1.19015 11 0.8000 1.65217 1.65217 12 0.8000 1.45333 1.45333 U_POLYNOMIAL_ZEROS_TEST: U_POLYNOMIAL_ZEROS returns zeroes of U(n,x). N X U(n,x) 1 0.0000 0.122465E-15 2 0.5000 0.444089E-15 2 -0.5000 -0.888178E-15 3 0.7071 0.666134E-15 3 0.0000 -0.244929E-15 3 -0.7071 0.666134E-15 4 0.8090 0.00000 4 0.3090 -0.111022E-15 4 -0.3090 0.555112E-15 4 -0.8090 -0.888178E-15 5 0.8660 0.133227E-14 5 0.5000 -0.888178E-15 5 0.0000 0.367394E-15 5 -0.5000 -0.177636E-14 5 -0.8660 -0.133227E-14 U_QUADRATURE_RULE_TEST: U_QUADRATURE_RULE computes the quadrature rule associated with U(n,x); X W 1 -0.923880 0.575094E-01 2 -0.707107 0.196350 3 -0.382683 0.335190 4 0.790193E-17 0.392699 5 0.382683 0.335190 6 0.707107 0.196350 7 0.923880 0.575094E-01 Use the quadrature rule to estimate: Q = Integral ( -1 <= X <= +1 ) X^E * sqrt ( 1-x^2) dx E Q_Estimate Q_Exact 0 1.57080 1.57080 1 0.832667E-16 0.00000 2 0.392699 0.392699 3 -0.555112E-16 0.00000 4 0.196350 0.196350 5 -0.138778E-15 0.00000 6 0.122718 0.122718 7 -0.166533E-15 0.00000 8 0.859029E-01 0.859029E-01 9 -0.173472E-15 0.00000 10 0.644272E-01 0.644272E-01 11 -0.173472E-15 0.00000 12 0.506214E-01 0.506214E-01 13 -0.173472E-15 0.00000 UU_PRODUCT_TEST: UU_PRODUCT(I,J;X) = U(I,X) * U(J,X) I J X UI UJ UI*UJ UU_PRODUCT 5 3 -0.857807 0.188933 -1.61839 -0.305768 -0.305768 5 -1 0.142457 0.764107 0.00000 0.00000 0.00000 0 3 -0.945575 1.00000 -2.98130 -2.98130 -2.98130 0 1 0.905859E-01 1.00000 0.181172 0.181172 0.181172 3 1 -0.677822 0.219923 -1.35564 -0.298138 -0.298138 6 3 -0.719537 -1.13648 -0.102081 0.116013 0.116013 0 2 -0.559625 1.00000 0.252719 0.252719 0.252719 5 -1 0.867317 0.312053E-01 0.00000 0.00000 0.00000 6 1 -0.253948 0.232202 -0.507896 -0.117935 -0.117935 5 4 -0.877605 -0.294970 1.24882 -0.368364 -0.368364 UU_PRODUCT_INTEGRAL_TEST: UU_PRODUCT_INTEGRAL computes the product integral of a pair of Chebyshev U polynomials U(i,x) and U(j,x). A(I,J) = integral ( -1 <=x <= +1 ) U(i,x) U(j,x) sqrt ( 1 - x^2 ) dx 0 if i is not equal to j; pi/2 if i = j U(i,x)*U(j,x) integral matrix: Col 1 2 3 4 5 Row 1: 1.57080 0. 0. 0. 0. 2: 0. 1.57080 0. 0. 0. 3: 0. 0. 1.57080 0. 0. 4: 0. 0. 0. 1.57080 0. 5: 0. 0. 0. 0. 1.57080 V_MASS_MATRIX_TEST: V_MASS_MATRIX computes the mass matrix for the Chebyshev polynomials V(i,x). A(I,J) = integral ( -1 <=x <= +1 ) V(i,x) V(j,x) sqrt(1+x)/sqrt (1-x) dx 0 if i is not equal to j; pi if i = j. V mass matrix: Col 1 2 3 4 Row 1: 3.14159 -0.444089E-15 0.177636E-14 0.166533E-14 2: -0.444089E-15 3.14159 -0.333067E-15 -0.177636E-14 3: 0.177636E-14 -0.222045E-15 3.14159 0.510703E-14 4: 0.166533E-14 -0.177636E-14 0.488498E-14 3.14159 V_MOMENT_TEST: V_MOMENT returns the value of integral ( -1 <=x <= +1 ) x^e * sqrt(1+x) / sqrt(1-x) dx E Integral 0 3.14159 1 1.57080 2 1.57080 3 1.17810 4 1.17810 5 0.981748 6 0.981748 7 0.859029 8 0.859029 9 0.773126 10 0.773126 V_POLYNOMIAL_TEST: V_POLYNOMIAL evaluates Chebyshev polynomials V(n,x). Tabulated Computed N X V(n,x) V(n,x) 0 0.8000 1.00000 1.00000 1 0.8000 0.600000 0.600000 2 0.8000 -0.400000E-01 -0.400000E-01 3 0.8000 -0.664000 -0.664000 4 0.8000 -1.02240 -1.02240 5 0.8000 -0.971840 -0.971840 6 0.8000 -0.532544 -0.532544 7 0.8000 0.119770 0.119770 8 0.8000 0.724175 0.724175 9 0.8000 1.03891 1.03891 10 0.8000 0.938082 0.938082 11 0.8000 0.462021 0.462021 12 0.8000 -0.198849 -0.198849 V_POLYNOMIAL_AB_TEST: V_POLYNOMIAL_AB evaluates Chebyshev polynomials VAB(n,x) shifted from [-1,+1] to the domain [A,B]. Here, we will use the new domain [0,1] and the desired maximum polynomial degree will be N = 5. Tables of T values: Col 1 2 3 4 5 Row 1: 1. -3. 5. -7. 9. 2: 1. -2.60000 3.16000 -2.45600 0.769600 3: 1. -2.20000 1.64000 0.232000 -1.91840 4: 1. -1.80000 0.440000 1.44800 -1.59840 5: 1. -1.40000 -0.440000 1.57600 -0.190400 6: 1. -1. -1. 1. 1. 7: 1. -0.600000 -1.24000 0.104000 1.28160 8: 1. -0.200000 -1.16000 -0.728000 0.577600 9: 1. 0.200000 -0.760000 -1.11200 -0.574400 10: 1. 0.600000 -0.400000E-01 -0.664000 -1.02240 11: 1. 1. 1. 1. 1. Col 6 Row 1: -11. 2: 1.22464 3: 2.07008 4: -0.169280 5: -1.49984 6: -1. 7: 0.408640 8: 1.19008 9: 0.422720 10: -0.971840 11: 1. V_POLYNOMIAL_AB_VALUE_TEST: V_POLYNOMIAL_AB_VALUE evaluates Chebyshev polynomials VAB(n,x) shifted from [-1,+1] to the domain [A,B]. Here, we will use the new domain [0,1]. Tabulated Computed N X V01(n,x) V01(n,x) -1 0.8500 0.00000 0.00000 0 0.8500 1.00000 1.00000 1 0.8500 0.400000 0.400000 2 0.8500 -0.440000 -0.440000 3 0.8500 -1.01600 -1.01600 4 0.8500 -0.982400 -0.982400 5 0.8500 -0.359360 -0.359360 6 0.8500 0.479296 0.479296 7 0.8500 1.03037 1.03037 8 0.8500 0.963228 0.963228 9 0.8500 0.318145 0.318145 10 0.8500 -0.517825 -0.517825 11 0.8500 -1.04310 -1.04310 12 0.8500 -0.942515 -0.942515 7 0.0000 -15.0000 -15.0000 7 0.1000 3.14180 3.14180 7 0.2000 -1.39124 -1.39124 7 0.3000 -1.21778 -1.21778 7 0.4000 1.18371 1.18371 7 0.5000 1.00000 1.00000 7 0.6000 -0.855898 -0.855898 7 0.7000 -0.890509 -0.890509 7 0.8000 0.875277 0.875277 7 0.9000 0.119770 0.119770 7 1.0000 1.00000 1.00000 V_POLYNOMIAL_COEFFICIENTS_TEST V_POLYNOMIAL_COEFFICIENTS determines coefficients for Chebyshev polynomials V(n,x). p(x) = 1.00000 p(x) = 2.00000 * x - 1.00000 p(x) = 4.00000 * x ^ 2 - 2.00000 * x - 1.00000 p(x) = 8.00000 * x ^ 3 - 4.00000 * x ^ 2 - 4.00000 * x + 1.00000 p(x) = 16.0000 * x ^ 4 - 8.00000 * x ^ 3 - 12.0000 * x ^ 2 + 4.00000 * x + 1.00000 p(x) = 32.0000 * x ^ 5 - 16.0000 * x ^ 4 - 32.0000 * x ^ 3 + 12.0000 * x ^ 2 + 6.00000 * x - 1.00000 V_POLYNOMIAL_PLOT_TEST V_POLYNOMIAL_PLOT plots selected Chebyshev polynomials V(n,x). Created graphics data file "v_polynomial_data.txt". Created graphics command file "v_polynomial_commands.txt". V_POLYNOMIAL_VALUE_TEST: V_POLYNOMIAL_VALUE evaluates Chebyshev polynomials V(n,x). Tabulated Computed N X V(n,x) V(n,x) -1 0.8000 0.00000 0.00000 0 0.8000 1.00000 1.00000 1 0.8000 0.600000 0.600000 2 0.8000 -0.400000E-01 -0.400000E-01 3 0.8000 -0.664000 -0.664000 4 0.8000 -1.02240 -1.02240 5 0.8000 -0.971840 -0.971840 6 0.8000 -0.532544 -0.532544 7 0.8000 0.119770 0.119770 8 0.8000 0.724175 0.724175 9 0.8000 1.03891 1.03891 10 0.8000 0.938082 0.938082 11 0.8000 0.462021 0.462021 12 0.8000 -0.198849 -0.198849 V_POLYNOMIAL_ZEROS_TEST: V_POLYNOMIAL_ZEROS returns zeroes of V(n,x). N X V(n,x) 1 0.5000 0.222045E-15 2 -0.3090 -0.333067E-15 2 0.8090 0.222045E-15 3 -0.6235 0.444089E-15 3 0.2225 -0.222045E-15 3 0.9010 0.111022E-15 4 -0.7660 -0.310862E-14 4 -0.1736 0.333067E-15 4 0.5000 -0.666134E-15 4 0.9397 0.777156E-15 5 -0.8413 0.355271E-14 5 -0.4154 -0.111022E-14 5 0.1423 -0.166533E-15 5 0.6549 -0.222045E-15 5 0.9595 -0.444089E-15 V_QUADRATURE_RULE_TEST: V_QUADRATURE_RULE computes the quadrature rule associated with V(n,x); X W 1 -0.913545 0.362140E-01 2 -0.669131 0.138594 3 -0.309017 0.289438 4 0.104528 0.462664 5 0.500000 0.628319 6 0.809017 0.757759 7 0.978148 0.828605 Use the quadrature rule to estimate: Q = Integral ( -1 <= X <= +1 ) X^E * sqrt (1+x)/sqrt(1-x) dx E Q_Estimate Q_Exact 0 3.14159 3.14159 1 1.57080 1.57080 2 1.57080 1.57080 3 1.17810 1.17810 4 1.17810 1.17810 5 0.981748 0.981748 6 0.981748 0.981748 7 0.859029 0.859029 8 0.859029 0.859029 9 0.773126 0.773126 10 0.773126 0.773126 11 0.708699 0.708699 12 0.708699 0.708699 13 0.658078 0.658078 VV_PRODUCT_INTEGRAL_TEST: VV_PRODUCT_INTEGRAL computes the product integral of a pair of Chebyshev V polynomials V(i,x) and V(j,x). A(I,J) = integral ( -1 <=x <= +1 ) V(i,x) V(j,x) sqrt ( 1 + x ) / sqrt ( 1 - x ) dx 0 if i is not equal to j; pi if i = j V(i,x)*V(j,x) integral matrix: Col 1 2 3 4 5 Row 1: 3.14159 0. 0. 0. 0. 2: 0. 3.14159 0. 0. 0. 3: 0. 0. 3.14159 0. 0. 4: 0. 0. 0. 3.14159 0. 5: 0. 0. 0. 0. 3.14159 W_MASS_MATRIX_TEST: W_MASS_MATRIX computes the mass matrix for the Chebyshev polynomials W(i,x). A(I,J) = integral ( -1 <=x <= +1 ) W(i,x) W(j,x) sqrt(1-x)/sqrt(1+x) dx 0 if i is not equal to j; pi if i = j. W mass matrix: Col 1 2 3 4 Row 1: 3.14159 0.444089E-15 0.177636E-14 -0.166533E-14 2: 0.444089E-15 3.14159 0.333067E-15 -0.177636E-14 3: 0.177636E-14 0.222045E-15 3.14159 -0.510703E-14 4: -0.166533E-14 -0.177636E-14 -0.488498E-14 3.14159 W_MOMENT_TEST: W_MOMENT returns the value of integral ( -1 <=x <= +1 ) x^e * sqrt(1-x) / sqrt(1+x) dx E Integral 0 3.14159 1 -1.57080 2 1.57080 3 -1.17810 4 1.17810 5 -0.981748 6 0.981748 7 -0.859029 8 0.859029 9 -0.773126 10 0.773126 W_POLYNOMIAL_TEST: W_POLYNOMIAL evaluates Chebyshev polynomials W(n,x). Tabulated Computed N X W(n,x) W(n,x) 0 0.8000 1.00000 1.00000 1 0.8000 2.60000 2.60000 2 0.8000 3.16000 3.16000 3 0.8000 2.45600 2.45600 4 0.8000 0.769600 0.769600 5 0.8000 -1.22464 -1.22464 6 0.8000 -2.72902 -2.72902 7 0.8000 -3.14180 -3.14180 8 0.8000 -2.29785 -2.29785 9 0.8000 -0.534767 -0.534767 10 0.8000 1.44223 1.44223 11 0.8000 2.84233 2.84233 12 0.8000 3.10550 3.10550 W_POLYNOMIAL_AB_TEST: W_POLYNOMIAL_AB evaluates Chebyshev polynomials WAB(n,x) shifted from [-1,+1] to the domain [A,B]. Here, we will use the new domain [0,1] and the desired maximum polynomial degree will be N = 5. Tables of T values: Col 1 2 3 4 5 Row 1: 1. -1. 1. -1. 1. 2: 1. -0.600000 -0.400000E-01 0.664000 -1.02240 3: 1. -0.200000 -0.760000 1.11200 -0.574400 4: 1. 0.200000 -1.16000 0.728000 0.577600 5: 1. 0.600000 -1.24000 -0.104000 1.28160 6: 1. 1. -1. -1. 1. 7: 1. 1.40000 -0.440000 -1.57600 -0.190400 8: 1. 1.80000 0.440000 -1.44800 -1.59840 9: 1. 2.20000 1.64000 -0.232000 -1.91840 10: 1. 2.60000 3.16000 2.45600 0.769600 11: 1. 3. 5. 7. 9. Col 6 Row 1: -1. 2: 0.971840 3: -0.422720 4: -1.19008 5: -0.408640 6: 1. 7: 1.49984 8: 0.169280 9: -2.07008 10: -1.22464 11: 11. W_POLYNOMIAL_AB_VALUE_TEST: W_POLYNOMIAL_AB_VALUE evaluates Chebyshev polynomials WAB(n,x) shifted from [-1,+1] to the domain [A,B]. Here, we will use the new domain [0,1]. Tabulated Computed N X W01(n,x) W01(n,x) -1 0.8500 0.00000 0.00000 0 0.8500 1.00000 1.00000 1 0.8500 2.40000 2.40000 2 0.8500 2.36000 2.36000 3 0.8500 0.904000 0.904000 4 0.8500 -1.09440 -1.09440 5 0.8500 -2.43616 -2.43616 6 0.8500 -2.31622 -2.31622 7 0.8500 -0.806554 -0.806554 8 0.8500 1.18705 1.18705 9 0.8500 2.46842 2.46842 10 0.8500 2.26874 2.26874 11 0.8500 0.707817 0.707817 12 0.8500 -1.27780 -1.27780 7 0.0000 -1.00000 -1.00000 7 0.1000 -0.119770 -0.119770 7 0.2000 -0.875277 -0.875277 7 0.3000 0.890509 0.890509 7 0.4000 0.855898 0.855898 7 0.5000 -1.00000 -1.00000 7 0.6000 -1.18371 -1.18371 7 0.7000 1.21778 1.21778 7 0.8000 1.39124 1.39124 7 0.9000 -3.14180 -3.14180 7 1.0000 15.0000 15.0000 W_POLYNOMIAL_COEFFICIENTS_TEST W_POLYNOMIAL_COEFFICIENTS determines coefficients for Chebyshev polynomials W(n,x). p(x) = 1.00000 p(x) = 2.00000 * x + 1.00000 p(x) = 4.00000 * x ^ 2 + 2.00000 * x - 1.00000 p(x) = 8.00000 * x ^ 3 + 4.00000 * x ^ 2 - 4.00000 * x - 1.00000 p(x) = 16.0000 * x ^ 4 + 8.00000 * x ^ 3 - 12.0000 * x ^ 2 - 4.00000 * x + 1.00000 p(x) = 32.0000 * x ^ 5 + 16.0000 * x ^ 4 - 32.0000 * x ^ 3 - 12.0000 * x ^ 2 + 6.00000 * x + 1.00000 W_POLYNOMIAL_PLOT_TEST W_POLYNOMIAL_PLOT plots selected Chebyshev polynomials W(n,x). Created graphics data file "w_polynomial_data.txt". Created graphics command file "w_polynomial_commands.txt". W_POLYNOMIAL_VALUE_TEST: W_POLYNOMIAL_VALUE evaluates Chebyshev polynomials W(n,x). Tabulated Computed N X W(n,x) W(n,x) -1 0.8000 0.00000 0.00000 0 0.8000 1.00000 1.00000 1 0.8000 2.60000 2.60000 2 0.8000 3.16000 3.16000 3 0.8000 2.45600 2.45600 4 0.8000 0.769600 0.769600 5 0.8000 -1.22464 -1.22464 6 0.8000 -2.72902 -2.72902 7 0.8000 -3.14180 -3.14180 8 0.8000 -2.29785 -2.29785 9 0.8000 -0.534767 -0.534767 10 0.8000 1.44223 1.44223 11 0.8000 2.84233 2.84233 12 0.8000 3.10550 3.10550 W_POLYNOMIAL_ZEROS_TEST: W_POLYNOMIAL_ZEROS returns zeroes of W(n,x). N X W(n,x) 1 -0.5000 0.444089E-15 2 -0.8090 -0.333067E-15 2 0.3090 0.222045E-15 3 -0.9010 0.888178E-15 3 -0.2225 -0.333067E-15 3 0.6235 0.444089E-15 4 -0.9397 -0.666134E-15 4 -0.5000 0.133227E-14 4 0.1736 -0.555112E-15 4 0.7660 -0.888178E-15 5 -0.9595 0.444089E-15 5 -0.6549 -0.666134E-15 5 -0.1423 0.105471E-14 5 0.4154 0.00000 5 0.8413 0.310862E-14 W_QUADRATURE_RULE_TEST: W_QUADRATURE_RULE computes the quadrature rule associated with W(n,x); X W 1 -0.978148 0.828605 2 -0.809017 0.757759 3 -0.500000 0.628319 4 -0.104528 0.462664 5 0.309017 0.289438 6 0.669131 0.138594 7 0.913545 0.362140E-01 Use the quadrature rule to estimate: Q = Integral ( -1 <= X <= +1 ) X^E * sqrt (1-x)/sqrt(1+x) dx E Q_Estimate Q_Exact 0 3.14159 3.14159 1 -1.57080 -1.57080 2 1.57080 1.57080 3 -1.17810 -1.17810 4 1.17810 1.17810 5 -0.981748 -0.981748 6 0.981748 0.981748 7 -0.859029 -0.859029 8 0.859029 0.859029 9 -0.773126 -0.773126 10 0.773126 0.773126 11 -0.708699 -0.708699 12 0.708699 0.708699 13 -0.658078 -0.658078 WW_PRODUCT_INTEGRAL_TEST: WW_PRODUCT_INTEGRAL computes the product integral of a pair of Chebyshev W polynomials W(i,x) and W(j,x). A(I,J) = integral ( -1 <=x <= +1 ) W(i,x) W(j,x) sqrt ( 1 - x ) / sqrt ( 1 + x ) dx 0 if i is not equal to j; pi if i = j W(i,x)*W(j,x) integral matrix: Col 1 2 3 4 5 Row 1: 3.14159 0. 0. 0. 0. 2: 0. 3.14159 0. 0. 0. 3: 0. 0. 3.14159 0. 0. 4: 0. 0. 0. 3.14159 0. 5: 0. 0. 0. 0. 3.14159 CHEBYSHEV_POLYNOMIAL_TEST Normal end of execution. 7 September 2021 4:40:29.404 PM