07-Jan-2022 19:59:50 fem1d_pmethod_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test fem1d_pmethod(). 07-Jan-2022 19:59:50 FEM1D_PMETHOD MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Solve the two-point boundary value problem - d/dX (P dU/dX) + Q U = F on the interval [-1,1], with U(-1) = U(1) = 0. The P method is used, which represents U as a weighted sum of orthogonal polynomials. Highest degree polynomial to use is 2 Number of points to be used for output = 10 Problem #2: U=cos(0.5*pi*x), P=1, Q=0, F=0.25*pi*pi*cos(0.5*pi*x) Basis function orthogonality test: i j b(i,j)/a(i) 0 0 1.000000 0 1 0.000000 0 2 -0.000000 1 0 0.000000 1 1 1.000000 1 2 0.000000 2 0 -0.000000 2 1 0.000000 2 2 1.000000 Representation of solution: Basis function coefficients: 0 0.954930 1 -0.000000 2 -0.220787 X Approximate Solution -1.000000 0.000000 -0.800000 0.308802 -0.600000 0.588546 -0.400000 0.809559 -0.200000 0.950645 0.000000 0.999087 0.200000 0.950645 0.400000 0.809559 0.600000 0.588546 0.800000 0.308802 1.000000 0.000000 Comparison of computed and exact solutions: X U computed U exact Difference -1.000000 0.000000 0.000000 0.000000 -0.800000 0.308802 0.309017 0.000215 -0.600000 0.588546 0.587785 -0.000761 -0.400000 0.809559 0.809017 -0.000542 -0.200000 0.950645 0.951057 0.000411 0.000000 0.999087 1.000000 0.000913 0.200000 0.950645 0.951057 0.000411 0.400000 0.809559 0.809017 -0.000542 0.600000 0.588546 0.587785 -0.000761 0.800000 0.308802 0.309017 0.000215 1.000000 0.000000 0.000000 0.000000 Big L2 error = 0.000573 FEM1D_PMETHOD Normal end of execution. 07-Jan-2022 19:59:50 fem1d_pmethod_test(): Normal end of execution. 07-Jan-2022 19:59:50