19 January 2020 11:30:34 AM
FEM1D_ADAPTIVE
C version
Solve the two-point boundary value problem:
-d/dx ( P(x) * dU(x)/dx ) + Q(x) * U(x) = F(x)
on the interval [0,1], specifying the value
of U at each endpoint.
The number of basis functions per element is 2
The number of quadrature points per element is 2
Problem index = 6
"ARCTAN" problem:
U(X) = ATAN((X-0.5)/A)
P(X) = 1.0
Q(X) = 0.0
F(X) = 2*A*(X-0.5)/(A**2+(X-0.5)**2)**2
IBC = 3
UL = ATAN(-0.5/A)
UR = ATAN( 0.5/A)
A = 0.01
Arctangent problem
The equation is to be solved for
X greater than 0
and less than 1
The boundary conditions are:
At X = XL, U = -1.5508
At X = XR, U= 1.5508
Begin new iteration with 4 nodes.
Printout of tridiagonal linear system:
Equation A-Left A-Diag A-Rite RHS
1 8 -4 -9.87506
2 -4 8 -4 1.38778e-16
3 -4 8 9.87506
Basic solution
Node X(I) U(X(I)) Uexact Error
0 0 -1.5508 -1.5508 0
1 0.25 -1.23438 -1.53082 0.296435
2 0.5 -5.55112e-16 0 -5.55112e-16
3 0.75 1.23438 1.53082 -0.296435
4 1 1.5508 1.5508 0
ETA
0.244233
2.19633
2.19633
0.244233
Tolerance = 1.46435
Subdivide interval 2
Subdivide interval 3
Begin new iteration with 6 nodes.
Basic solution
Node X(I) U(X(I)) Uexact Error
0 0 -1.5508 -1.5508 0
1 0.25 -1.57269 -1.53082 -0.0418763
2 0.375 -1.55364 -1.49097 -0.0626714
3 0.5 -6.55032e-14 0 -6.55032e-14
4 0.625 1.55364 1.49097 0.0626714
5 0.75 1.57269 1.53082 0.0418763
6 1 1.5508 1.5508 0
ETA
0.00944353
0.185938
3.52685
3.52685
0.185938
0.00944353
Tolerance = 1.4889
Subdivide interval 3
Subdivide interval 4
Begin new iteration with 8 nodes.
Basic solution
Node X(I) U(X(I)) Uexact Error
0 0 -1.5508 -1.5508 0
1 0.25 -1.74416 -1.53082 -0.213342
2 0.375 -1.81084 -1.49097 -0.31987
3 0.4375 -1.78503 -1.41214 -0.372888
4 0.5 -2.44249e-15 0 -2.44249e-15
5 0.5625 1.78503 1.41214 0.372888
6 0.625 1.81084 1.49097 0.31987
7 0.75 1.74416 1.53082 0.213342
8 1 1.5508 1.5508 0
ETA
0.00944353
0.026573
0.292454
3.3433
3.3433
0.292454
0.026573
0.00944353
Tolerance = 1.10154
Subdivide interval 4
Subdivide interval 5
Begin new iteration with 10 nodes.
Basic solution
Node X(I) U(X(I)) Uexact Error
0 0 -1.5508 -1.5508 0
1 0.25 -1.56403 -1.53082 -0.0332166
2 0.375 -1.54065 -1.49097 -0.0496819
3 0.4375 -1.46981 -1.41214 -0.0576689
4 0.46875 -1.32254 -1.26109 -0.0614455
5 0.5 6.88338e-14 0 6.88338e-14
6 0.53125 1.32254 1.26109 0.0614455
7 0.5625 1.46981 1.41214 0.0576689
8 0.625 1.54065 1.49097 0.0496819
9 0.75 1.56403 1.53082 0.0332166
10 1 1.5508 1.5508 0
ETA
0.00944353
0.026573
0.0736369
0.235021
2.82238
2.82238
0.235021
0.0736369
0.026573
0.00944353
Tolerance = 0.760103
Subdivide interval 5
Subdivide interval 6
Begin new iteration with 12 nodes.
Basic solution
Node X(I) U(X(I)) Uexact Error
0 0 -1.5508 -1.5508 0
1 0.25 -1.51216 -1.53082 0.0186565
2 0.375 -1.46284 -1.49097 0.0281279
3 0.4375 -1.37903 -1.41214 0.0331091
4 0.46875 -1.22528 -1.26109 0.0358167
5 0.484375 -0.964992 -1.00148 0.0364909
6 0.5 4.55191e-14 0 4.55191e-14
7 0.515625 0.964992 1.00148 -0.0364909
8 0.53125 1.22528 1.26109 -0.0358167
9 0.5625 1.37903 1.41214 -0.0331091
10 0.625 1.46284 1.49097 -0.0281279
11 0.75 1.51216 1.53082 -0.0186565
12 1 1.5508 1.5508 0
ETA
0.00944353
0.026573
0.0736369
0.192415
0.41609
1.8311
1.8311
0.41609
0.192415
0.0736369
0.026573
0.00944353
Tolerance = 0.509861
Subdivide interval 6
Subdivide interval 7
Begin new iteration with 14 nodes.
Basic solution
Node X(I) U(X(I)) Uexact Error
0 0 -1.5508 -1.5508 0
1 0.25 -1.52873 -1.53082 0.00209243
2 0.375 -1.48768 -1.49097 0.00328175
3 0.4375 -1.40802 -1.41214 0.00412196
4 0.46875 -1.25633 -1.26109 0.00475898
5 0.484375 -0.997085 -1.00148 0.00439793
6 0.492188 -0.66027 -0.663203 0.0029329
7 0.5 2.08722e-14 0 2.08722e-14
8 0.507812 0.66027 0.663203 -0.0029329
9 0.515625 0.997085 1.00148 -0.00439793
10 0.53125 1.25633 1.26109 -0.00475898
11 0.5625 1.40802 1.41214 -0.00412196
12 0.625 1.48768 1.49097 -0.00328175
13 0.75 1.52873 1.53082 -0.00209243
14 1 1.5508 1.5508 0
ETA
0.00944353
0.026573
0.0736369
0.192415
0.410124
0.512307
0.653928
0.653928
0.512307
0.410124
0.192415
0.0736369
0.026573
0.00944353
Tolerance = 0.322026
Subdivide interval 5
Subdivide interval 6
Subdivide interval 7
Subdivide interval 8
Subdivide interval 9
Subdivide interval 10
Begin new iteration with 20 nodes.
Basic solution
Node X(I) U(X(I)) Uexact Error
0 0 -1.5508 -1.5508 0
1 0.25 -1.52941 -1.53082 0.00140268
2 0.375 -1.48872 -1.49097 0.00224713
3 0.4375 -1.40923 -1.41214 0.0029149
4 0.46875 -1.25763 -1.26109 0.0034657
5 0.476562 -1.1649 -1.16751 0.00261453
6 0.484375 -0.999675 -1.00148 0.00180788
7 0.488281 -0.863012 -0.86437 0.00135779
8 0.492188 -0.662316 -0.663203 0.000886981
9 0.496094 -0.372028 -0.372398 0.000370799
10 0.5 -3.44724e-14 0 -3.44724e-14
11 0.503906 0.372028 0.372398 -0.000370799
12 0.507812 0.662316 0.663203 -0.000886981
13 0.511719 0.863012 0.86437 -0.00135779
14 0.515625 0.999675 1.00148 -0.00180788
15 0.523438 1.1649 1.16751 -0.00261453
16 0.53125 1.25763 1.26109 -0.0034657
17 0.5625 1.40923 1.41214 -0.0029149
18 0.625 1.48872 1.49097 -