01 October 2013 08:33:31 AM FEM1D_PMETHOD C++ version 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 0 1 2.08167e-17 0 2 -8.32667e-17 1 0 3.46945e-17 1 1 1 1 2 1.73472e-17 2 0 -3.03577e-16 2 1 3.79471e-17 2 2 1 Representation of solution: Basis function coefficients: 0 0.95493 1 -1.25361e-18 2 -0.220787 X Approximate Solution -1 0 -0.8 0.308802 -0.6 0.588546 -0.4 0.809559 -0.2 0.950645 0 0.999087 0.2 0.950645 0.4 0.809559 0.6 0.588546 0.8 0.308802 1 0 Comparison of computed and exact solutions: X U computed U exact Difference -1 0 6.12323e-17 6.12323e-17 -0.8 0.308802 0.309017 0.000214907 -0.6 0.588546 0.587785 -0.000761186 -0.4 0.809559 0.809017 -0.000542347 -0.2 0.950645 0.951057 0.00041123 0 0.999087 1 0.000913031 0.2 0.950645 0.951057 0.00041123 0.4 0.809559 0.809017 -0.000542347 0.6 0.588546 0.587785 -0.000761186 0.8 0.308802 0.309017 0.000214907 1 0 6.12323e-17 6.12323e-17 Big L2 error = 0.000572595 PMETHOD Normal end of execution. 01 October 2013 08:33:31 AM