Differences Finies
Differences Finies
!fI-2x1i'_.ti 1 t o(tt')
^.1 : /r.,,r_ r.,.1 "\
(4) -;r- P(tit l'+
\
r oth21\
_/l
/
-t c1lt.1)x1 i r(t1),
Next, we drop the two terms o(h2) i, (4) and intr.odr,rce the notation p7 : pG),
q.i : q (rr), and r j : r(ri)i this prodLrc s the cliffèrence eqnation
h,
/ + n-ql
^
!)
;pt - | x
Jn^-
2 rz
|
2 * h2qz Tpr- t o xz
,)
^zïn-qj
-h
2 vJ tPt-t xj
h.^
o -+DN-)
-h
- ) 2 + h2qN-z l UN-) -
t
r xN-2
-11
ïPN-t - t /+
^
t')
n-qN_l .ïN- I
-h2'r + eo
t)
-n-12
_hrrj
-h2, N -z
-h2ry-1 * e1y
where
/h \ /-h \
eo:lit, t t1" and ur-lipr-t+tlB
\Z ,/ \ L /
When computations wrth step size h are used, the numerical approximation to the
solution is a set of discrete points {(/;, x;)}; if the analytic solLrtion x(ri) is known, we
can compare x. j and x (t j ) ,
..2t2
x"(t) : (t) +
4 px - U Ux(r)
I
with .r(0) : 1.25 and x(4) : -0,95 over the interval [0, 4l
The functions p, q,and r are p(t) : 2t l0 ) r2), q(t) : -21(l * t2), and r(t) : l,
respectively. The linite-diffel'ence nrethod is r.rsed to constrLrcl numelical solutions {-v;} us-
ing the system of eqr-rations (6). Sample values of the zrpploximations {xi t}, {x i,z}, {xi t},
and {x7,+) con'esponcLing to the step sizes ht : 0.2, hy : Q 1, hj :0.05, and hq :0.025
are given in Table 9.17. Figuu-e 9.26 shows the graph of the polygonal path formed from
{(t1, x1,t)} fol the case hr : 0 2. There are 4l terms in the sequence generated with
hz:0.1 , and the sequence {xJ.2} only inclirdes evely other tet'm from these computations;
they correspond to the 21 valr,res of {r;} given in Table 9.17. Similally, the seqLrences {xl.:}
and [x7.+] ale a poltion of the valires genelated with step sizes hr : 0.05 and h4: 0.025,
respectively, and they correspond to the 2l values of {ti} in Tabte 0.t2.
Next we compal'e numelical solutions in Table 9.17 with the analytic solirtion: x(t1 :
L25 + 0 486089652t - 2,2512 +2t arÇTan(r) - j lnç I l- t') + lt2 tnçt + 12 ). The numerical
538 CHp.p. 9 SolurroN oF DTFFERENTTAL EouArroNS
)t )
Table 9.17 Nr"rrnelical Approximations fbr v"ll) : -- r'(r) - .-
| +f' -r(l) + l
I +r-
rj, r
x j.2 ri3 j'l x(t 1)
h-0.2 /r-01 h:005 h :' 0.025 exzrct
solutiorls can be shown to have error of order O0t2). Hence reducing the step size by a
factor of j resLrlts iu the errol being reduced by aboLrt ]. A calefirl scl'utiny of Table 9.18
will reveal that this is happening. For instance, ar ti : 1.0 the erlors incr"rn'ed with step
sizes/r1,h2,h3, and/r4are e1t:0 014780. e1.z:0 003660. ei.,:0 0009 13, ande14:
0 000228, respectively. Their successive latios e i.2le i.r - 0 003660 10.014180 - 0 2416.
e1tle1.z: 0 000913/0 003660 :0.2495, and e 1.+le i: : 0 000228/0 000913 :0.2491
are approaching ].
Finally, we show how Richalclson's improvemenf scheme can be used to extrapolate
the seemingly inaccurate seqLrences {x7. 1}, {x7 z}, {xi 3},.and {xr.+} and obtain six digits
of precision, Elirninate the ellol terms O(h2) ancl O((hl2)25 in the apploxirr-rations {x; r)
and{.xi.z} bygenerating-l-heexl-rapolaLedseqLrence{iir}: {(4x12-x1t)13} Similarly,
the ellor terms O((h/2)r.) ancl Ottlt1412 l for {r;,u } ancl {-r, j) are eliminatecl by generat-
ing {27 z) : {(4,r7..t - x1ù13|. It has been shown that the seconcl level of Richardson's
improvement schene applies to the sequences {zi 1} and {i; z}, so the third improvement
is {(162, 2- z j,t)115).Let Lrs illustrate the situation by finding the extrapolared values that
Sec. 9.9 FINITE-DIFFERENCE METHoD s39
0.0
-05
-1.0
Figure 9.26 The graph of the nnmerical approximation for
x(t1 : u(t) + w(t), which is the solution to
,,2t
x'(l): 2
r+t. - rx(r)
ta t" I I
(using /z :0.2).
-l'(r)
Finally, the third extrapolation involves the terms z j.t and z j.2:
-:-:l'05688e
162;) - z.i | 16(1.056889) - 1.056932
: : I 056886.
15 15
This last computation contains six decirnal places of accuracy. The vah,res at the other
points are given in Table 9,19. r
Program 9,12 will call Program 9.11 to solve the tridiagonal system (6). Pro-
gram 9.12 requires that the coeflicient functions p(r), cl (r), and r(r) (boLrndary value
problem ( 1)) be saved in M-files p ,m, q.m, and r . m, respectively.
x(tj)-xj,4
: j.4 e
lt1 :9 2 h2:01 h3 :
00 0.000000
9.95 114 :0.025
0 000000 0 000000
02 0 002841 0 000000
0.000704 0 000176
04 0 005898 0.00 | 460
0.000044
0 000364 0 00009 I
06 0 009007 0 002229 0 000556 0.000r39
0.8 0.012013 0.002914 0.000742
10 0 014780 0 0001 85
0 003660 0 000913
1.2 0 017208 0.000228
0.004263 0 001063
1.4 0.019235 0 000265
0.004766 0.001 189
].O 0 02081s 0.000297
0.005160 0.001281
l8 0.021920 0 005435
0 000322
0 0013s6 0 000338
2.0 0.022533 0 00-5588 0.001 394
2.2 0.022639 0.000348
0 0056t5 0.00 t40l
2.4 0.022232 0 000350
0 005516 0 00t31'7
z,o 0 02t304 0.000344
0 00s2Bs 0 001319
28 0.0i9852 0.000329
0.004926 0 001230
30 0 017872 0 000308
0 00443s 0 001 107
J.Z 0.015362 0.000277
0.0038 t2 0.0009s l
3.4 0.0t2322 0 000237
0 0030s9 0 000763
36 0 008749 0 000191
0 002t1) 0 000s4r
38 0 00464r 0 000135
0 001 152 0 000287
40 0 000000 0 000072
0 000000 0 000000 0 000000
Sec, 9.9 FrulrE-DTFpnRENCE METHOD 54: