Tue Oct 19 11:34:25 2021 fem1d_bvp_quadratic_test(): Python version: 3.6.9 Test fem1d_bvp_quadratic():. h1s_error_quadratic_test: Python version: 3.6.9 h1s_error_quadratic computes the H1 seminorm approximation error between the exact derivative of a function and the derivative of a piecewise quadratic approximation to the function, associated with n mesh points x(). N H1S_Error 3 1.39598 5 0.549041 9 0.281729 17 0.141775 33 0.0710014 65 0.0355149 129 0.0177593 257 0.00887985 h1s_error_quadratic_test: Normal end of execution. l1_error_test: Python version: 3.6.9 l1_error computes the little l1 approximation error between a function exact(x) and a vector of n values u() at points x(). N l1_error 3 0.700429 5 0.526957 9 0.441216 17 0.399123 33 0.378337 65 0.368018 l1_error_test: Normal end of execution. l2_error_quadratic_test: Python version: 3.6.9 l2_error_quadratic computes the L2 approximation error between a function exact(x) and a piecewise quadratic function u() associated with n mesh points x(). N L2_Error 3 0.0894667 5 0.0376212 9 0.00482689 17 0.000607302 33 7.60363e-05 65 9.5084e-06 l2_error_quadratic_test: Normal end of execution. max_error_quadratic_test: Python version: 3.6.9 max_error_quadratic computes the maximum absolute approximation error between a function exact(x) and a piecewise quadratic function u() associated with n mesh points x(). N Max_Error 3 0.172211 5 0.0711466 9 0.0111021 17 0.00146138 33 0.00018501 max_error_quadratic_test: Normal end of execution. fem1d_bvp_quadratic_test00 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A(X) = 1.0 C(X) = 1.0 F(X) = X U(X) = X - SINH(X) / SINH(1) Number of nodes = 11 I X U Uexact Error 0 0.000000 0.000000 0.000000 0.000000e+00 1 0.100000 0.014766 0.014766 4.253521e-08 2 0.200000 0.028679 0.028680 5.717636e-08 3 0.300000 0.040878 0.040878 1.369556e-07 4 0.400000 0.050483 0.050483 1.012851e-07 5 0.500000 0.056591 0.056591 2.601080e-07 6 0.600000 0.058260 0.058260 1.181175e-07 7 0.700000 0.054508 0.054507 4.334600e-07 8 0.800000 0.044294 0.044295 9.111253e-08 9 0.900000 0.026519 0.026518 6.820897e-07 10 1.000000 0.000000 0.000000 0.000000e+00 l1 norm of error = 1.74804e-07 L2 norm of error = 6.46452e-05 Seminorm of error = 0.0311155 Max norm of error = 7.64223e-05 fem1d_bvp_quadratic_test00 Normal end of execution. fem1d_bvp_quadratic_test01 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A1(X) = 1.0 C1(X) = 0.0 F1(X) = X * ( X + 3 ) * exp ( X ) U1(X) = X * ( 1 - X ) * exp ( X ) Number of nodes = 11 I X U Uexact Error 0 0.000000 0.000000 0.000000 0.000000e+00 1 0.100000 0.099473 0.099465 8.053079e-06 2 0.200000 0.195424 0.195424 1.063711e-09 3 0.300000 0.283482 0.283470 1.150505e-05 4 0.400000 0.358038 0.358038 1.730682e-09 5 0.500000 0.412197 0.412180 1.620006e-05 6 0.600000 0.437309 0.437309 1.883467e-09 7 0.700000 0.422911 0.422888 2.254381e-05 8 0.800000 0.356087 0.356087 1.371135e-09 9 0.900000 0.221395 0.221364 3.106609e-05 10 1.000000 0.000000 0.000000 0.000000e+00 l1 norm of error = 8.12492e-06 L2 norm of error = 0.000792161 Seminorm of error = 0.273938 Max norm of error = 0.00128552 fem1d_bvp_quadratic_test01 Normal end of execution. fem1d_bvp_quadratic_test02 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A2(X) = 1.0 C2(X) = 2.0 F2(X) = X * ( 5 - X ) * exp ( X ) U2(X) = X * ( 1 - X ) * exp ( X ) Number of nodes = 11 I X U Uexact Error 0 0.000000 0.000000 0.000000 0.000000e+00 1 0.100000 0.099471 0.099465 5.501657e-06 2 0.200000 0.195419 0.195424 5.088203e-06 3 0.300000 0.283475 0.283470 4.733163e-06 4 0.400000 0.358029 0.358038 8.496040e-06 5 0.500000 0.412187 0.412180 7.162985e-06 6 0.600000 0.437299 0.437309 9.625453e-06 7 0.700000 0.422902 0.422888 1.403186e-05 8 0.800000 0.356079 0.356087 7.384697e-06 9 0.900000 0.221392 0.221364 2.728618e-05 10 1.000000 0.000000 0.000000 0.000000e+00 l1 norm of error = 8.11911e-06 L2 norm of error = 0.000791639 Seminorm of error = 0.273938 Max norm of error = 0.00128743 fem1d_bvp_quadratic_test02 Normal end of execution. fem1d_bvp_quadratic_test03 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A3(X) = 1.0 C3(X) = 2.0 * X F3(X) = - X * ( 2 * X * X - 3 * X - 3 ) * exp ( X ) U3(X) = X * ( 1 - X ) * exp ( X ) Number of nodes = 11 I X U Uexact Error 0 0.000000 0.000000 0.000000 0.000000e+00 1 0.100000 0.099472 0.099465 6.783610e-06 2 0.200000 0.195422 0.195424 2.638322e-06 3 0.300000 0.283478 0.283470 7.811195e-06 4 0.400000 0.358033 0.358038 4.907359e-06 5 0.500000 0.412191 0.412180 1.078859e-05 6 0.600000 0.437302 0.437309 6.155136e-06 7 0.700000 0.422905 0.422888 1.702168e-05 8 0.800000 0.356081 0.356087 5.213245e-06 9 0.900000 0.221393 0.221364 2.864151e-05 10 1.000000 0.000000 0.000000 0.000000e+00 l1 norm of error = 8.17824e-06 L2 norm of error = 0.000791818 Seminorm of error = 0.273938 Max norm of error = 0.00128668 fem1d_bvp_quadratic_test03 Normal end of execution. fem1d_bvp_quadratic_test04 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A4(X) = 1.0 + X * X C4(X) = 0.0 F4(X) = ( X + 3 X^2 + 5 X^3 + X^4 ) * exp ( X ) U4(X) = X * ( 1 - X ) * exp ( X ) Number of nodes = 11 I X U Uexact Error 0 0.000000 0.000000 0.000000 0.000000e+00 1 0.100000 0.099477 0.099465 1.137923e-05 2 0.200000 0.195421 0.195424 3.926512e-06 3 0.300000 0.283499 0.283470 2.850301e-05 4 0.400000 0.358030 0.358038 7.912516e-06 5 0.500000 0.412238 0.412180 5.815353e-05 6 0.600000 0.437299 0.437309 9.790475e-06 7 0.700000 0.422990 0.422888 1.024294e-04 8 0.800000 0.356079 0.356087 7.582612e-06 9 0.900000 0.221528 0.221364 1.634191e-04 10 1.000000 0.000000 0.000000 0.000000e+00 l1 norm of error = 3.5736e-05 L2 norm of error = 0.00079244 Seminorm of error = 0.273938 Max norm of error = 0.00137041 fem1d_bvp_quadratic_test04 Normal end of execution. fem1d_bvp_quadratic_test05 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A5(X) = 1.0 + X * X for X <= 1/3 = 7/9 + X for 1/3 < X C5(X) = 0.0 F5(X) = ( X + 3 X^2 + 5 X^3 + X^4 ) * exp ( X ) for X <= 1/3 = ( - 1 + 10/3 X + 43/9 X^2 + X^3 ) .* exp ( X ) for 1/3 <= X U5(X) = X * ( 1 - X ) * exp ( X ) I X U Uexact Error 0 0.000000 0.000000 0.000000 0.000000e+00 1 0.100000 0.099690 0.099465 2.241951e-04 2 0.200000 0.195842 0.195424 4.175568e-04 3 0.300000 0.284132 0.283470 6.611607e-04 4 0.400000 0.358565 0.358038 5.268467e-04 5 0.500000 0.412668 0.412180 4.876947e-04 6 0.600000 0.437633 0.437309 3.247078e-04 7 0.700000 0.423209 0.422888 3.213542e-04 8 0.800000 0.356238 0.356087 1.512860e-04 9 0.900000 0.221550 0.221364 1.859622e-04 10 1.000000 0.000000 0.000000 0.000000e+00 l1 norm of error = 0.000300069 L2 norm of error = 0.000897284 Seminorm of error = 0.27394 Max norm of error = 0.0014469 fem1d_bvp_quadratic_test05 Normal end of execution. fem1d_bvp_quadratic_test06 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A6(X) = 1.0 C6(X) = 0.0 F6(X) = pi*pi*sin(pi*X) U6(X) = sin(pi*x) Compute L2 norm and seminorm of error for various N. N L1 error L2 error Seminorm error Maxnorm error 11 2.3654e-05 0.0013975 0.400719 0.00183654 21 1.54072e-06 0.000175528 0.201186 0.000239035 41 9.85135e-08 2.19673e-05 0.100697 3.01793e-05 81 6.23108e-09 2.74674e-06 0.0503613 3.78181e-06 161 3.91944e-10 3.43369e-07 0.0251823 4.7302e-07 fem1d_bvp_quadratic_test06 Normal end of execution. fem1d_bvp_quadratic_test07 Python version: 3.6.9 Becker/Carey/Oden example. Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. Compute L2 norm and seminorm of error for various N. N L1 error L2 error Seminorm error Maxnorm error 11 0.0236359 0.100991 1.82677 0.278261 21 0.00526296 0.0245235 2.11669 0.0869379 41 0.000771555 0.00570718 1.03276 0.0260734 81 5.37619e-05 0.000657628 0.680814 0.00399866 161 3.21083e-06 7.87438e-05 0.350447 0.000543592 fem1d_bvp_quadratic_test07 Normal end of execution. fem1d_bvp_quadratic_test08 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A8(X) = 1.0 C8(X) = 0.0 F8(X) = X * ( X + 3 ) * exp ( X ), X <= 2/3 = 2 * exp ( 2/3), 2/3 < X U8(X) = X * ( 1 - X ) * exp ( X ), X <= 2/3 = X * ( 1 - X ) * exp ( 2/3 ), 2/3 < X Number of nodes = 11 I X U Uexact Error 0 0.000000 0.000000 0.000000 0.000000e+00 1 0.100000 0.084636 0.099465 1.482981e-02 2 0.200000 0.165749 0.195424 2.967573e-02 3 0.300000 0.238968 0.283470 4.450209e-02 4 0.400000 0.298686 0.358038 5.935145e-02 5 0.500000 0.338007 0.412180 7.417312e-02 6 0.600000 0.348281 0.437309 8.902718e-02 7 0.700000 0.319995 0.409024 8.902872e-02 8 0.800000 0.252243 0.311637 5.939495e-02 9 0.900000 0.145599 0.175296 2.969747e-02 10 1.000000 0.000000 0.000000 0.000000e+00 l1 norm of error = 0.0445164 L2 norm of error = 0.0570532 Seminorm of error = 0.299039 Max norm of error = 0.0967138 fem1d_bvp_quadratic_test08 Normal end of execution. fem1d_bvp_quadratic_test09 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A9(X) = 1.0 C9(X) = 0.0 F9(X) = X * ( X + 3 ) * exp ( X ), X <= 2/3 = 2 * exp ( 2/3), 2/3 < X U9(X) = X * ( 1 - X ) * exp ( X ), X <= 2/3 = X * ( 1 - X ), 2/3 < X Number of nodes = 11 I X U Uexact Error 0 0.000000 0.000000 0.000000 0.000000e+00 1 0.100000 0.073447 0.099465 2.601876e-02 2 0.200000 0.143371 0.195424 5.205363e-02 3 0.300000 0.205401 0.283470 7.806894e-02 4 0.400000 0.253931 0.358038 1.041073e-01 5 0.500000 0.282062 0.412180 1.301179e-01 6 0.600000 0.281148 0.437309 1.561609e-01 7 0.700000 0.243386 0.210000 3.338608e-02 8 0.800000 0.181953 0.160000 2.195308e-02 9 0.900000 0.100977 0.090000 1.097654e-02 10 1.000000 0.000000 0.000000 0.000000e+00 l1 norm of error = 0.055713 L2 norm of error = 0.0885214 Seminorm of error = 0.260755 Max norm of error = 0.17056 fem1d_bvp_quadratic_test09 Normal end of execution. fem1d_bvp_quadratic_test10 Python version: 3.6.9 Solve -( A(x) U'(x) )' + C(x) U(x) = F(x) for 0 < x < 1, with U(0) = U(1) = 0. A(X) = 1.0 C(X) = 1.0 F(X) = X U(X) = X - SINH(X) / SINH(1) log(E) E L2error H1error Maxerror 1 2 0.00782394 0.129787 0.00766215 2 4 0.00100238 0.0749687 0.00108553 3 8 0.000126155 0.0387431 0.000146767 4 16 1.57969e-05 0.0195292 1.91493e-05 5 32 1.97549e-06 0.00978432 2.44769e-06 6 64 2.46963e-07 0.00489462 3.09464e-07 7 128 3.08712e-08 0.00244762 3.89059e-08 log(E1) E1 / E2 L2rate H1rate Maxrate 1 2/ 4 2.96447 0.791782 2.81935 2 4/ 8 2.99016 0.952349 2.8868 3 8/ 16 2.99748 0.988307 2.93816 4 16/ 32 2.99936 0.99709 2.9678 5 32/ 64 2.99984 0.999273 2.98358 6 64/ 128 2.99996 0.999818 2.99171 fem1d_bvp_quadratic_test10 Normal end of execution. fem1d_bvp_quadratic_test(): Normal end of execution. Tue Oct 19 11:34:27 2021