07-Jan-2022 23:12:01 multigrid_poisson_1d_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test multigrid_poisson_1d(). multigrid_poisson_1d_test01_mono() MONOGRID_POISSON_1D solves a 1D Poisson BVP using the Gauss-Seidel method. -u"(x) = 1, for 0 < x < 1 u(0) = 0, u(1) = 0. Solution is u(x) = ( -x^2 + x ) / 2 Mesh index K = 5 Number of intervals N=2^K = 32 Number of nodes = 2^K+1 = 33 I X(I) U(I) U Exact(X(I)) 1 0.000000 0 0 2 0.031250 0.0150838 0.0151367 3 0.062500 0.029192 0.0292969 4 0.093750 0.0423251 0.0424805 5 0.125000 0.0544837 0.0546875 6 0.156250 0.0656682 0.065918 7 0.187500 0.0758789 0.0761719 8 0.218750 0.0851163 0.0854492 9 0.250000 0.0933807 0.09375 10 0.281250 0.100672 0.101074 11 0.312500 0.106992 0.107422 12 0.343750 0.112339 0.112793 13 0.375000 0.116714 0.117188 14 0.406250 0.120118 0.120605 15 0.437500 0.122549 0.123047 16 0.468750 0.124009 0.124512 17 0.500000 0.124497 0.125 18 0.531250 0.124014 0.124512 19 0.562500 0.122559 0.123047 20 0.593750 0.120131 0.120605 21 0.625000 0.116732 0.117188 22 0.656250 0.11236 0.112793 23 0.687500 0.107016 0.107422 24 0.718750 0.100699 0.101074 25 0.750000 0.0934081 0.09375 26 0.781250 0.085144 0.0854492 27 0.812500 0.0759058 0.0761719 28 0.843750 0.0656933 0.065918 29 0.875000 0.054506 0.0546875 30 0.906250 0.0423435 0.0424805 31 0.937500 0.0292052 0.0292969 32 0.968750 0.0150909 0.0151367 33 1.000000 0 0 Maximum error = 0.000502527 Number of iterations = 575 multigrid_poisson_1d_test01_multi(): MULTIGRID_POISSON_1D solves a 1D Poisson BVP using the multigrid method. -u"(x) = 1, for 0 < x < 1 u(0) = 0, u(1) = 0. Solution is u(x) = ( -x^2 + x ) / 2 Mesh index K = 5 Number of intervals N=2^K = 32 Number of nodes = 2^K+1 = 33 I X(I) U(I) U Exact(X(I)) 1 0.000000 0 0 2 0.031250 0.0151174 0.0151367 3 0.062500 0.0292622 0.0292969 4 0.093750 0.0424323 0.0424805 5 0.125000 0.0546305 0.0546875 6 0.156250 0.0658541 0.065918 7 0.187500 0.0761055 0.0761719 8 0.218750 0.0853817 0.0854492 9 0.250000 0.093685 0.09375 10 0.281250 0.101013 0.101074 11 0.312500 0.107367 0.107422 12 0.343750 0.112744 0.112793 13 0.375000 0.117148 0.117188 14 0.406250 0.120575 0.120605 15 0.437500 0.123028 0.123047 16 0.468750 0.124503 0.124512 17 0.500000 0.125003 0.125 18 0.531250 0.124526 0.124512 19 0.562500 0.123072 0.123047 20 0.593750 0.120639 0.120605 21 0.625000 0.11723 0.117188 22 0.656250 0.112841 0.112793 23 0.687500 0.107474 0.107422 24 0.718750 0.10113 0.101074 25 0.750000 0.0938081 0.09375 26 0.781250 0.0855096 0.0854492 27 0.812500 0.0762335 0.0761719 28 0.843750 0.065978 0.065918 29 0.875000 0.0547417 0.0546875 30 0.906250 0.0425244 0.0424805 31 0.937500 0.0293273 0.0292969 32 0.968750 0.0151519 0.0151367 33 1.000000 0 0 Maximum error = 6.75166e-05 Number of iterations = 43 multigrid_poisson_1d_test02_mono(): MONOGRID_POISSON_1D solves a 1D Poisson BVP using the Gauss-Seidel method. -u"(x) = - x * (x+3) * exp(x), for 0 < x < 1 u(0) = 0, u(1) = 0. Solution is u(x) = x * (x-1) * exp(x) Mesh index K = 5 Number of intervals N=2^K = 32 Number of nodes = 2^K+1 = 33 I X(I) U(I) U Exact(X(I)) 1 0.000000 0 -0 2 0.031250 -0.0311615 -0.0312344 3 0.062500 -0.0622285 -0.0623727 4 0.093750 -0.0930982 -0.0933113 5 0.125000 -0.123659 -0.123938 6 0.156250 -0.153789 -0.154132 7 0.187500 -0.18336 -0.183762 8 0.218750 -0.21223 -0.212687 9 0.250000 -0.240247 -0.240755 10 0.281250 -0.26725 -0.267803 11 0.312500 -0.293063 -0.293657 12 0.343750 -0.317498 -0.318127 13 0.375000 -0.340356 -0.341014 14 0.406250 -0.36142 -0.362101 15 0.437500 -0.38046 -0.381157 16 0.468750 -0.39723 -0.397938 17 0.500000 -0.411467 -0.41218 18 0.531250 -0.422892 -0.423603 19 0.562500 -0.431206 -0.431908 20 0.593750 -0.436089 -0.436777 21 0.625000 -0.437204 -0.43787 22 0.656250 -0.434189 -0.434828 23 0.687500 -0.426662 -0.427268 24 0.718750 -0.414214 -0.414782 25 0.750000 -0.396415 -0.396938 26 0.781250 -0.372803 -0.373277 27 0.812500 -0.342894 -0.343312 28 0.843750 -0.306169 -0.306528 29 0.875000 -0.262082 -0.262377 30 0.906250 -0.210054 -0.21028 31 0.937500 -0.14947 -0.149624 32 0.968750 -0.079681 -0.0797599 33 1.000000 0 0 Maximum error = 0.000712828 Number of iterations = 702 multigrid_poisson_1d_test02_multi(): MULTIGRID_POISSON_1D solves a 1D Poisson BVP using the multigrid method. -u"(x) = - x * (x+3) * exp(x), for 0 < x < 1 u(0) = 0, u(1) = 0. Solution is u(x) = x * (x-1) * exp(x) Mesh index K = 5 Number of intervals N=2^K = 32 Number of nodes = 2^K+1 = 33 I X(I) U(I) U Exact(X(I)) 1 0.000000 0 -0 2 0.031250 -0.0312133 -0.0312344 3 0.062500 -0.062331 -0.0623727 4 0.093750 -0.0932499 -0.0933113 5 0.125000 -0.123857 -0.123938 6 0.156250 -0.154033 -0.154132 7 0.187500 -0.183644 -0.183762 8 0.218750 -0.212552 -0.212687 9 0.250000 -0.240603 -0.240755 10 0.281250 -0.267636 -0.267803 11 0.312500 -0.293473 -0.293657 12 0.343750 -0.317929 -0.318127 13 0.375000 -0.340801 -0.341014 14 0.406250 -0.361875 -0.362101 15 0.437500 -0.38092 -0.381157 16 0.468750 -0.39769 -0.397938 17 0.500000 -0.411922 -0.41218 18 0.531250 -0.423336 -0.423603 19 0.562500 -0.431634 -0.431908 20 0.593750 -0.436497 -0.436777 21 0.625000 -0.437589 -0.43787 22 0.656250 -0.434551 -0.434828 23 0.687500 -0.427004 -0.427268 24 0.718750 -0.414543 -0.414782 25 0.750000 -0.396734 -0.396938 26 0.781250 -0.373114 -0.373277 27 0.812500 -0.34319 -0.343312 28 0.843750 -0.306441 -0.306528 29 0.875000 -0.262317 -0.262377 30 0.906250 -0.210239 -0.21028 31 0.937500 -0.149596 -0.149624 32 0.968750 -0.0797441 -0.0797599 33 1.000000 0 0 Maximum error = 0.000281309 Number of iterations = 73 multigrid_poisson_1d_test(): Normal end of execution. 07-Jan-2022 23:12:01