Home License -- for personal use only. Not for government, academic, research, commercial, or other organizational use. 02-Oct-2024 08:21:28 poisson_1d_test(): MATLAB/Octave version 9.11.0.2358333 (R2021b) Update 7 Test poisson_1d(). poisson_1d_test01() 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 poisson_1d_test02(): 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 poisson_1d_test(): Normal end of execution. 02-Oct-2024 08:21:29