29 April 2007 06:43:45 AM FEM1D_NONLINEAR C++ version Solve a nonlinear boundary value problem: -d/dx (p(x) du/dx) + q(x)*u + u*u' = f(x) on an interval [xl,xr], with the values of u or u' specified at xl and xr. The interval [XL,XR] is broken into N = 10 subintervals Number of basis functions per element is NL = 2 The equation is to be solved for X greater than XL = 0 and less than XR = 1 The boundary conditions are: At X = XL, U = 0 At X = XR, U' = 1 This is test problem #1: P(X) = 1, Q(X) = 0, F(X) = X. Boundary conditions: U(0) = 0, U''(1) = 1. The exact solution is U(X) = X Number of quadrature points per element is 1 Number of iterations is 10 Node Location 0 0 1 0.1 2 0.2 3 0.3 4 0.4 5 0.5 6 0.6 7 0.7 8 0.8 9 0.9 10 1 Subint Length 1 0.1 2 0.1 3 0.1 4 0.1 5 0.1 6 0.1 7 0.1 8 0.1 9 0.1 10 0.1 Subint Quadrature point 1 0.05 2 0.15 3 0.25 4 0.35 5 0.45 6 0.55 7 0.65 8 0.75 9 0.85 10 0.95 Subint Left Node Right Node 1 0 1 2 1 2 3 2 3 4 3 4 5 4 5 6 5 6 7 6 7 8 7 8 9 8 9 10 9 10 Number of unknowns NU = 10 Node Unknown 0 -1 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 10 10 Printout of tridiagonal linear system: Equation ALEFT ADIAG ARITE RHS 1 0 20 -10 0.01 2 -10 20 -10 0.02 3 -10 20 -10 0.03 4 -10 20 -10 0.04 5 -10 20 -10 0.05 6 -10 20 -10 0.06 7 -10 20 -10 0.07 8 -10 20 -10 0.08 9 -10 20 -10 0.09 10 -10 10 0 1.0475 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.14975 2 0.2 0.2985 3 0.3 0.44525 4 0.4 0.589 5 0.5 0.72875 6 0.6 0.8635 7 0.7 0.99225 8 0.8 1.114 9 0.9 1.22775 10 1 1.3325 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.0849454 2 0.2 0.170164 3 0.3 0.255932 4 0.4 0.342534 5 0.5 0.430266 6 0.6 0.519437 7 0.7 0.610377 8 0.8 0.703436 9 0.9 0.798989 10 1 0.897438 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.105202 2 0.2 0.210298 3 0.3 0.315181 4 0.4 0.419746 5 0.5 0.523887 6 0.6 0.627501 7 0.7 0.730483 8 0.8 0.832732 9 0.9 0.934149 10 1 1.03464 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.100039 2 0.2 0.200077 3 0.3 0.300111 4 0.4 0.40014 5 0.5 0.500163 6 0.6 0.600179 7 0.7 0.700189 8 0.8 0.800194 9 0.9 0.900195 10 1 1.0002 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.1 2 0.2 0.2 3 0.3 0.3 4 0.4 0.4 5 0.5 0.5 6 0.6 0.6 7 0.7 0.7 8 0.8 0.8 9 0.9 0.9 10 1 1 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.1 2 0.2 0.2 3 0.3 0.3 4 0.4 0.4 5 0.5 0.5 6 0.6 0.6 7 0.7 0.7 8 0.8 0.8 9 0.9 0.9 10 1 1 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.1 2 0.2 0.2 3 0.3 0.3 4 0.4 0.4 5 0.5 0.5 6 0.6 0.6 7 0.7 0.7 8 0.8 0.8 9 0.9 0.9 10 1 1 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.1 2 0.2 0.2 3 0.3 0.3 4 0.4 0.4 5 0.5 0.5 6 0.6 0.6 7 0.7 0.7 8 0.8 0.8 9 0.9 0.9 10 1 1 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.1 2 0.2 0.2 3 0.3 0.3 4 0.4 0.4 5 0.5 0.5 6 0.6 0.6 7 0.7 0.7 8 0.8 0.8 9 0.9 0.9 10 1 1 Computed solution: Node X(I) U(X(I)) 0 0 0 1 0.1 0.1 2 0.2 0.2 3 0.3 0.3 4 0.4 0.4 5 0.5 0.5 6 0.6 0.6 7 0.7 0.7 8 0.8 0.8 9 0.9 0.9 10 1 1 Compare computed and exact solutions: X Computed U Exact U 0 0 0 0.125 0.125 0.125 0.25 0.25 0.25 0.375 0.375 0.375 0.5 0.5 0.5 0.625 0.625 0.625 0.75 0.75 0.75 0.875 0.875 0.875 1 1 1 FEM1D_NONLINEAR: Normal end of execution. 29 April 2007 06:43:45 AM