28-Jul-2021 03:20:12 fem2d_project_function_test(): MATLAB/Octave version 9.9.0.1467703 (R2020b) Test fem2d_project_function(). FEM2D_PROJECT_FUNCTION MATLAB/Octave version 9.9.0.1467703 (R2020b) Seek U(x,y), the solution of the least squares equation: Minimize L2 norm of U(x,y) - W(x,y), for W(x,y) given, with U(x,y) a piecewise linear function in the interior, and matching W(x,y) on the boundary. Reformulate this in terms of a finite element problem: ( U(x,y) - W(x,y), V(x,y) ) = 0 inside the region, U(x,y) = W(x,y) on the boundary. The region is a rectangle, defined by: 0.000000 = XL<= X <= XR = 1.000000 0.000000 = YB<= Y <= YT = 1.000000 A finite element formulation is used, with piecewise linear basis functions on 3 node triangular elements. The corner nodes of the triangles are generated by an underlying grid whose dimensions are NX = 9 NY = 9 Number of nodes = 81 Number of elements = 128 K I J X Y U(x,y) W(x,y) 1 1 1 0.000000 0.000000 0.000000e+00 0.000000e+00 2 2 1 0.125000 0.000000 1.250000e-01 1.250000e-01 3 3 1 0.250000 0.000000 2.500000e-01 2.500000e-01 4 4 1 0.375000 0.000000 3.750000e-01 3.750000e-01 5 5 1 0.500000 0.000000 5.000000e-01 5.000000e-01 6 6 1 0.625000 0.000000 6.250000e-01 6.250000e-01 7 7 1 0.750000 0.000000 7.500000e-01 7.500000e-01 8 8 1 0.875000 0.000000 8.750000e-01 8.750000e-01 9 9 1 1.000000 0.000000 1.000000e+00 1.000000e+00 10 1 2 0.000000 0.125000 0.000000e+00 0.000000e+00 11 2 2 0.125000 0.125000 2.930589e-01 2.714466e-01 12 3 2 0.250000 0.125000 5.371268e-01 5.205981e-01 13 4 2 0.375000 0.125000 7.431838e-01 7.285534e-01 14 5 2 0.500000 0.125000 8.918706e-01 8.826834e-01 15 6 2 0.625000 0.125000 9.811632e-01 9.785534e-01 16 7 2 0.750000 0.125000 1.016460e+00 1.020598e+00 17 8 2 0.875000 0.125000 1.008569e+00 1.021447e+00 18 9 2 1.000000 0.125000 1.000000e+00 1.000000e+00 19 1 3 0.000000 0.250000 0.000000e+00 0.000000e+00 20 2 3 0.125000 0.250000 4.121268e-01 3.955981e-01 21 3 3 0.250000 0.250000 7.687985e-01 7.500000e-01 22 4 3 0.375000 0.250000 1.048744e+00 1.028281e+00 23 5 3 0.500000 0.250000 1.225801e+00 1.207107e+00 24 6 3 0.625000 0.250000 1.292183e+00 1.278281e+00 25 7 3 0.750000 0.250000 1.258167e+00 1.250000e+00 26 8 3 0.875000 0.250000 1.141460e+00 1.145598e+00 27 9 3 1.000000 0.250000 1.000000e+00 1.000000e+00 28 1 4 0.000000 0.375000 0.000000e+00 0.000000e+00 29 2 4 0.125000 0.375000 4.931838e-01 4.785534e-01 30 3 4 0.250000 0.375000 9.237441e-01 9.032815e-01 31 4 4 0.375000 0.375000 1.252442e+00 1.228553e+00 32 5 4 0.500000 0.375000 1.447726e+00 1.423880e+00 33 6 4 0.625000 0.375000 1.498284e+00 1.478553e+00 34 7 4 0.750000 0.375000 1.417183e+00 1.403281e+00 35 8 4 0.875000 0.375000 1.231163e+00 1.228553e+00 36 9 4 1.000000 0.375000 1.000000e+00 1.000000e+00 37 1 5 0.000000 0.500000 0.000000e+00 0.000000e+00 38 2 5 0.125000 0.500000 5.168706e-01 5.076834e-01 39 3 5 0.250000 0.500000 9.758013e-01 9.571068e-01 40 4 5 0.375000 0.500000 1.322726e+00 1.298880e+00 41 5 5 0.500000 0.500000 1.526095e+00 1.500000e+00 42 6 5 0.625000 0.500000 1.572726e+00 1.548880e+00 43 7 5 0.750000 0.500000 1.475801e+00 1.457107e+00 44 8 5 0.875000 0.500000 1.266871e+00 1.257683e+00 45 9 5 1.000000 0.500000 1.000000e+00 1.000000e+00 46 1 6 0.000000 0.625000 0.000000e+00 0.000000e+00 47 2 6 0.125000 0.625000 4.811632e-01 4.785534e-01 48 3 6 0.250000 0.625000 9.171825e-01 9.032815e-01 49 4 6 0.375000 0.625000 1.248284e+00 1.228553e+00 50 5 6 0.500000 0.625000 1.447726e+00 1.423880e+00 51 6 6 0.625000 0.625000 1.502442e+00 1.478553e+00 52 7 6 0.750000 0.625000 1.423744e+00 1.403281e+00 53 8 6 0.875000 0.625000 1.243184e+00 1.228553e+00 54 9 6 1.000000 0.625000 1.000000e+00 1.000000e+00 55 1 7 0.000000 0.750000 0.000000e+00 0.000000e+00 56 2 7 0.125000 0.750000 3.914599e-01 3.955981e-01 57 3 7 0.250000 0.750000 7.581673e-01 7.500000e-01 58 4 7 0.375000 0.750000 1.042183e+00 1.028281e+00 59 5 7 0.500000 0.750000 1.225801e+00 1.207107e+00 60 6 7 0.625000 0.750000 1.298744e+00 1.278281e+00 61 7 7 0.750000 0.750000 1.268798e+00 1.250000e+00 62 8 7 0.875000 0.750000 1.162127e+00 1.145598e+00 63 9 7 1.000000 0.750000 1.000000e+00 1.000000e+00 64 1 8 0.000000 0.875000 0.000000e+00 0.000000e+00 65 2 8 0.125000 0.875000 2.585686e-01 2.714466e-01 66 3 8 0.250000 0.875000 5.164599e-01 5.205981e-01 67 4 8 0.375000 0.875000 7.311632e-01 7.285534e-01 68 5 8 0.500000 0.875000 8.918706e-01 8.826834e-01 69 6 8 0.625000 0.875000 9.931838e-01 9.785534e-01 70 7 8 0.750000 0.875000 1.037127e+00 1.020598e+00 71 8 8 0.875000 0.875000 1.043059e+00 1.021447e+00 72 9 8 1.000000 0.875000 1.000000e+00 1.000000e+00 73 1 9 0.000000 1.000000 0.000000e+00 0.000000e+00 74 2 9 0.125000 1.000000 1.250000e-01 1.250000e-01 75 3 9 0.250000 1.000000 2.500000e-01 2.500000e-01 76 4 9 0.375000 1.000000 3.750000e-01 3.750000e-01 77 5 9 0.500000 1.000000 5.000000e-01 5.000000e-01 78 6 9 0.625000 1.000000 6.250000e-01 6.250000e-01 79 7 9 0.750000 1.000000 7.500000e-01 7.500000e-01 80 8 9 0.875000 1.000000 8.750000e-01 8.750000e-01 81 9 9 1.000000 1.000000 1.000000e+00 1.000000e+00 ||U|| = 1.002033 ||W|| = 0.994290 ||U-W|| = 0.125856 FEM2D_PROJECT_FUNCTION: Normal end of execution. fem2d_project_function_test(): Normal end of execution. 28-Jul-2021 03:20:12