Você está na página 1de 12

220

INTRODUCTION

TO NUMERICAL ANALYSIS

where K and L are fixed constants, and consider the associated relations +i = e - p + h ^ \ak\e' n_ k + E k= -1 and e' n+1 = e' n_ p + h ^ \ak \{Ke n- k + Le' n_ k ) + E, k
1 r

(6.11.8)

(6.11.9)

where E and E' are fixed constants such that \E n\ Then, by an argument similar and \e' n\ ^ e' n for n = 0, 1, . . . , r, and if h\a-i\(h\a-i\K + L) <1, then |e| iS e n and |e^.| ^ e n for all positive integral values of n. In order to obtain a solution of (6.11.8) and (6.11.9) with this property, we first seek a particular solution in the form e n \,e' n X', where X and X' are independent of n, and so obtain the determination (6.11.11) E, to that \E' n\ g, E. of 6.8, it follows that if (6.11.10)
|e| g e

where again

cr

Y *-1

\ak \.

(6.11.13)

Upon this particular solution we may superimpose e = Afin, e' n = A'(3", if the constants hence so that A(/3 n+1 - /3n~) - hA' k= and
r -1 r

(6.11.14) expressions zeros and

A, A' , and /3 are determined so that these

satisfy (6.11.8) and (6.11.9) when E and E' are replaced by


r

=0

(6.11.15)

hKA ^ \otk \l3' - k + A' (^0 n+l k=1

- hL y k = I

0. (6.11.16)

These equations are compatible, with not both A and A' zero, if and only if the determinant of the coefficients of A and A' vanishes, that is, if j3 satisfies the characteristic equation p+i _ F -, -hK _h - 0n~ - hL 2\ak \l3n- t
=
1

/3"+1

'

NUMERICAL SOLUTION OF DIFFERENTIAL EQUATIONS

221

Now, when 0 1, the left-hand member reduces to -h<r = -hVK hLc r and is therefore negative. For large positive real values of /3, the highest power of
0

-hKo

(8

will dominate the expansion, and its coefficient is seen to be 1 hL\a i\ -hK\a_ which is positive when h is sufficiently small to ensure that h\ a^\(h\a^\K + L) < 1, in accordance with (6.11.11). It is interesting to notice that this is also the requirement that ( 6.10.12) hold for all n, so that the iteration relevant to a closed-type formula is convergent. Thus, if (6.11.18) is satisfied, there exists (at least) one positive real root of (6.11.17), say /3 0, which exceeds unity. If we write (6.11.18) 1 A|a_i| (h\a i\K L),

j30 = 1 + mi h + m2h2 + ,
and expand the elements of (6.11.17) in powers of h, there follows (p + V)m,ih + -hKa + ha + [(p + l)mi - L<x]h + = 0,

and hence, in particular, the requirement that the leading coefficient (of h2) in the expansion vanish leads to the equation (p + 1 ) 2 mf (p + l)Lcrmi Kcr 2 = 0, the positive root of which is m.! Thus we have the result <r L + VL 2 + 4/f V +
2 1

(6.11.19)

= 1 + triih + 0(A 2 ),
for small h.

(6 .11 .20 )

When /S = po, the two equations (6.11.15) and (6.11.16) become equivalent, and either can be used to express A in terms of A'. If we use the former, we find that

(6.11.21)
h ^ |a*!j3j where
M =

t= - I _ _ _
^?+1

(p +

)mj

+ 0(A).

(6.11.22)

222

INTRODUCTION TO NUMERICAL ANALYSIS

Thus with /So and


by

M SO

defined, Eqs. (6.11.8) and (6.11.9) are satisfied

- x,

(6.11.23)

where X and X' are constants defined in (6.11.12), and where A is an arbitrary constant. These expressions will dominate the solutions e and e' of (6.11.5) and (6.11.6) for all n if they do so for n = 0, 1, . . . , r. If we denote the maximum values of |e| and |'| for n 5 r by e and e', respectively, it remains only to choose A such that

A X ^ e. Thus, if we take A = max ( e + E' - LE Kha

- - X' g; S'. M

(6.11.24)

the expressions defined in (6.11.23) will exceed e and e', respectively, for n = 0 and, since A and n are positive and /3o > 1, will continue to do so for n > 0. It follows finally that, with A defined by (6.11.24), the errors e and e' n associated with the use of the formulas (6.10.3) and (6.10.4) are limited by the inequalities w &Ar.- E'- LE
KhaE

hrr

(6.11.25)

The relative simplicity of these forms is attained at the expense of conservatism of the bounds. Less-conservative bounds would be obtained in a much more complicated form if the general solution of ( 6.11.8) and (6.11.9) were obtained, with 2r +
2

independent

arbitrary constants, and if those constants were determined such that e n \tn\ and e n = \e n\ for n = 0, 1, . . . , r, or if (6.11.8) and (6.11.9) were replaced by dominating equations of less simple form. In those cases w'hen the coefficients a,- are nonnegative, so that
a = p + 1,

in accordance with (6.7.10), Eqs. (6.11.19) and (6.11.20) give

= Hence there follows

h + i* (L + VlHS) + 0(/i 2).

(6.11.26)

35 =

1 + | (L + VL 2 + 4/0 +
e

(x n xo)/h

( L + V L s + l K ) ( x . - x o)/2.

(6.11. 27)

NUMERICAL SOLUTION OF DIFFERENTIAL EQUATIONS

223

when h is small, so that the dominating functions in (6.11.25) grow in the same way as exp [?(L + y/L 1 + ^K)x n] as n increases. 6.12. Special Second-order Equations. Second-order equations of the special form y" = G(x,y), (6.12.1)

in which y' is not explicitly involved, arise very frequently in practice. If values of y' are not required, it is desirable to have available methods which do not entail their calculation. Two formulas having this property were derived, as formulas (5.5.11) and (5.5.12) for repeated integration, in 5.5, and may be written with the present notation in the forms yn+l = 2yn - 2/_! + A 2( 1 + OV + XVV2 + ^v 3 + + AV5 + -)y'l (6.12.2) and 2/n+i = 2yn - 2/_x + h\l - V + TVV2 + OV3 + OlC! (6.12.3) The former is of open type, the latter of closed type. In order to use either, a suitable number of preliminary ordinates must be calculated by another method, which takes into account the fact that y and y' are prescribed at x = Xo, after which the technique of the ensuing calculation, often known as Stormers method, is evident. Formulas (6.12.2) and (6.12.3) are each representative of a whole class of similar formulas, one class of open type and the other of closed type, which are analogous to the formulas given in 6.2 and 6.3. In particular, an additional formula of open type,
2/n+l

= Vn + Vn 2 - yn-3 + 3fc2(l - V + AV2 + OV3 + AW4

+ AVv 5 + -)y", (6.12.4)

may be listed (see Prob. 11 of Chap. 5). Formulas (6.12.3) and (6.12.4) comprise a pair of formulas for both of which the coefficient of the third difference vanishes. If only second differences are retained in these formulas, they become (3h\y'; - w: + AVV'O) yn+1 = y n + 2/_2 J + _
2/_3

+ A2c_

r)

(5y" + 2?/"_1 - %"_,)

240 (6.12.5)

h2 ( 2/"+i - Vt/"+1 + AV22/"+1)| (2/n+1 +


102/"

h6 r(?)

+ y'U ) I 240

(6.12.6)

224

INTRODUCTION

TO

NUMERICAL

ANALYSIS

where the coefficients of the remainder terms are the same as those of the omitted fourth differences in the formulas (6.12.3) and (6.12.4). The error term when one of the formulas is truncated with a difference not preceding one with a zero coefficient is of more complicated form. Milnes method employs (6.12.5) to afford an initial prediction y^_ v and (6.12.6) as the basic formula, to be solved for yn+ 1 by iteration. If the factor y +1 = yn+ i is calculated (as in 6.6), the estimated truncation error in the nth step is seen to be T ~ -y/18. Also, the convergence factor in the iteration at the nth step (see 6.9) is easily found to be approximately p Y^h2G y (x n,yn), so that h should be sufficiently small to ensure that |p| <<C 1. In order to illustrate the relevant analysis of error propagation, we consider the special case in which ( 6.12. 6) is the basis of the method.f With the same notation as was used in earlier developments, it is easily seen that the error e associated with the calculated value y satisfies a relation of the form e+i = 2e _! +
^2

(Gj,ntle+1 + 10G Vn n + G yn_,e n-i) + E n, (6.12.7)

for n S; 1, where G y , is an appropriate value of G y . This relation can also be written in the form (i - yg <?,.) (*+i - *.) -. + so that, if we have |<?(z,2/)l ^ K, for all relevant values of x and y, and if h is sufficiently small to ensure that (6.12.9) + l] loo,.)*. + E n, (6.12.8)

< 1, (6.12.10)
there follows (i k+i - u\ ^ I*. - _i| + ~ (llkl + |1|) + \E n\.

(6.12.11)
If e satisfies the relation (i where and if e0 g |eo|, (*m-i E = n) = e - e_i + ~ (He* + e^i) + E, (6.12.12) ]E n\ m^, ' (6.12.13) (6.12.14)

t The method used for the initial prediction at each step is irrelevant to this analysis.

ei

> |ei e 0|,

NUMERICAL SOLUTION OF DIFFERENTLAL EQUATIONS

225

there follows also e\ e 0 |eij |o| and hence ex |ei| ^ eo |o| or 01 sS |i|. Then, by comparing t6.12.ll) and (6.12.12), we find that e 2 ei S
|<=2

ei| and hence

et e i ^ |e 2| |ei| or e2 iS |e2|. By induction, there follows e n e n~i S | e-i| and e ^ |e| for n 0, 1, 2, . . . , so that the error e is then dominated by e n. The general solution of (6.12.12) is readily found to be of the form e = + A431 (6.12.15)

where /30 and /Si are the roots of the equation

( > - ) - 2( +
*
=

> + (1 and hence


/7?1

i i + rsKh* + VEFTiZw , , Wi
=

n/I

(6.12.17)

-------------------- 1 -

A Kh' ------------- =

1 + VRh + 0{h ) -

When A 0 and Ai are determined by the conditions e 0 = 0 and e x = [i|, under the assumption that e 0 = 0, there follows finally |e! ^ e where
e

"

= (/3? + Pl

'" ~ 1

M +_

^n)- (6.12.18)

If round-off errors are ignored, we have E ^ Trnr* 6l2/"U*- Also, since /So = 1 + y/Kh + 0(A2), and n = (x n x 0)/h, there follows e ~
24^g;

h^

{cosh

[y/K

(x n x0)] 1} (6.12.19)

+ Sinh [y/K (x - *)], y/Kh

when h is small. Whereas | 2/viU* is generally not easy to estimate directly, the factor (7t4[j/vi|moJ/240 can be estimated as h~2\T |Yn|m*/18ft 2 or as |V4i/* ! al/240. Similar but more involved error bounds can be derived in the more general case. In order to illustrate the calculation and to provide a basis for the considerations of the following section, we apply Milnes method, based on (6.12.5) and (6.1 2.6), to the problem

y" = xy, y(0) = 0,

2/(0) = 1,

'6.12.20)

226

INTRODUCTION

TO NUMERICAL ANALYSIS

for which the exact solution is expressible in the form y = 3r(7j(fr)( (6.12.21)

where Jj is the modified Bessel function of the first kind, of order -j. With h = 0.1, the calculation can be arranged as in Table 6.3, if differences are used and if five places are retained.

TABLE 6.3 X

V
0.00000 0.10001 0.20013 0.30068 0.40214 0.50523 0.61086 0.72017 0.83454

y"
0.00000 0.01000 0.04003 0.09020 0.16086 0.25262 0.36652 0.50412 0.66763

Vy"

vy'

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8

1000 3003 5017 7066 9176 11390 13760 16351

2003 2014 2049 2110 2214 2370 2591 1 -1 -1 -1

The first five lines are easily calculated in advance (only three lines are needed ), the ordinates being determined by use of a single Taylor series, and the values of y", determined from the equation y" = xy, and of the differences are entered as shown. If (6.12.5) is used to predict ys , the prediction is found to be 0.50522; the remainder of the sixth line is then filled in, after which (6.12.6) gives the revised value 0.50523, and the resultant slight modification in the remainder of the line does not call for additional iteration. The value
75

= 0.50523 0.50522 is then listed as

+1

unit in the fifth place,

and the calculation proceeds in the same way in succeeding steps. Since the truncation error in each step may be estimated as 7/I 8, we may be reasonably confident of the calculated values of y to the places retained (except for the usual uncertainty of one unit in the last place, due to round-off). In fact, the small values of
7

may be expected to correspond to the effects of round-off.

Clearly, the alternative forms of (6.12.5) and (6.12.6) may be used instead, without the need for calculation of differences. This procedure possesses an additional advantage in that then only the entries yn+1 and each iteration process. However, whereas
2/"+1

are modified in successive steps of advantages are of particular

these

significance when large-scale computing devices are used, so that simplicity in programming and minimization of storage requirements are of prime importance, they may compare unfavorably in other cases with the advantages which follow from the possibility of detecting gross errors by inspecting the regularity of the trend of the difference columns.

NUMERICAL SOLUTION OF DIFFERENTIAL EQUATIONS

227

Further, in place of using (6.12,5) to obtain an initial prediction fof' yn+ i, it is possible to estimate the second difference V 2$f"+1 and to then fill in the remainder of that line from right to left through y +1, after which use may be made of (6.12.6) to initiate the prediction. Thus, in Table 6.3, a glance at the V 2y" column would suggest the estimate V 22/s' ~ 0.026 after the calculation of y7. However, this procedure would not supply data for the
7

column.

It may be noticed that any linear equation of the second order, of the form Y" + P(x)Y' + Q(x)Y = F{x), can be reduced to the form ( 6.12.1) by the change of variables Y(x) = e~lf pd *y(x), in accordance with which ( 6.12.22) takes the form y" + f(x)y = g{x), where f(x) = {4Q(x) - 2P'(x) - [P(z)]2(, gix) = elt^Fix). (6.12.25) 6.13. Change of Interval. In many cases it is desirable to, say, double or halve the (6.12.24) (6.12.23) (6.12.22)

spacing at a certain stage of the advancing calculation. Doubling the spacing presents no difficulties, since it involves only the use of alternate values of previously calculated data, together with a direct calculation of modified differences relevant to the new spacing, if differences are used. Thus, in illustration, the smallness of the entries in the
7

column of Table 6.3

suggests that the same accuracy may be obtained with a doubled spacing ti 2h = 0.2. Ln fact, reference to the error expression in (6.12. 6) shows that the truncation error in each step can be estimated roughly by
Tn

W' ~ m ~w --00004v 42/">

and it is found that, for the data of Table 6.3, V *y" varies from 0.00024 to 0.00065, so that the largest single truncation error in the range covered is probably less than about three units in the eighth decimal place. Doubling the spacing h will multiply the truncation error by a factor of the order
26

and hence may be expected to lead to a

truncation error of less than about one unit in the sixth place in each step. The calculation following the work of Table 6.3, with doubled spacing, is given in Table 6.4.

228

INTRODUCTION

TO

NUMERICAL

ANALYSIS

TABLE 6.4
X

y
0.00000 0.20013 0.40214 0.61086 0.83454 1.08531 1.38000 1.74164

y"
0.00000 0.04003 0.16086 0.36652 0.66763 1.08531 1.65600 2.43830

Vy"

vy'

0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4

4003 12083 20566 30111 41768 57069 78230

8080 8483 9545 11657 15301 21161 1 3 7

After three lines of calculation, the y column serves a warning that the truncation error per step may have increased at that stage to about one- half unit in the last place retained. Thus (as might have been anticipated in advance from the increasing rate of growth of V 2y") the advantages of the more rapid calculation were short-lived, and the doubling of the spacing was ill-advised in the present case. However, the results of Table 6.4 may serve to illustrate the somewhat more complicated transition to a halved spacing, f In the present analysis, knowledge of 2/(1.3) would permit the determination of y"{ 1.3) and, consequently, Vy"{lA) and V2j/"(1.4), relative to the new spacing h = 0.1. Then an iteration, based on (6.12.6), could be initiated by estimating vy'(1.5) and proceding as was outlined in the preceding section. The value of y(1.3) could be obtained by an interpolation involving certain of the available calculated ordinates. Clearly, care should be taken to obtain this ordinate to the same degree of accuracy as the other ordinates. The use of a difference formula, for this purpose, would entail the calculation of differences of the ordinates themselves, but would be desirable, in order that the accuracy of the interpolation could be estimated. Another procedure consists in using the formulas derived in 5.7 to transform the tabulated differences Vy"(1.4) and V 2y"(1.4) to corresponding differences relative to the halved spacing. The ordinate 2/(1.3) can then be determined by rewriting ( 6.12.6) in the form Vn ~ Uyn+l + 2/n-l) - J h2 ~ V ^M-l + T^Vn'+l)(6.13.1)

^"+1

If the difference operators corresponding to the halved spacing are


f An obvious alternative consists in merely retaining additional differences in the relevant integration formulas (6.12.3) and (6.12.4). In the present case, however, it is assumed that retention of the advantages of the special formulas (6.12.5) and (6.12.6) is considered to be desirable.

NUMERICAL SOLUTION OF DIFFERENTIAL EQUATIONS

229

denoted by V' and V' 2, Eq. (5.7.4) yields the formulas


V' = srV +

iv + Tg-^ + tts^
2
3

71

tIts'V7

(6.13.2) and V'2 = iV 2 + |V 3 + AV + rlifV 6 + + rflrV7+ - , (6.13.3)

when A is replaced by V in (5.7.4), in accordance with the results of 5.7. The use of these formulas permits the calculation of the differences relative to x = 1.4 in the third line of Table 6.5, after which Vy" and y" are obtained in line two and y" in line one.

TABLE 6.5
X

V 1.38000 1.55071 1.74164

y" 1.65600 2.01592 2.43830

Vy" vy'

1.2 1.3 1,4

35992 42238 6246

A useful check on the accuracy of the modified differences is then afforded by a comparison of the value of t/"( 1.2) so obtained with that previously obtained in the direct calculation of Table 6.4. The ordinate
7/(1.3)

is next calculated from (6.13.1). Then if, say, V 2y"( 1.5) is

estimated approximately as being equal to V2j/"(1.4), the line


1.5 | 1.9570J I 2.92314 | 48484 6246

(6.13.4)

is obtained

(from

right to left),

the first

approximation to2/(1.5) being

obtained by use of (6.12.6). When y"{ 1.5) and its differences are recalculated (from left to right), the next approximation to yil.S) is obtained from (6.12.6) as 1.95702, and the final form of this line of the calculation reads as follows:
1.5 | 1.95702 [ 2.93553 | 49723 7487

| as a

(6.13.5) predictor in

Sufficient data are calculable.

now available for the

use of (6.12.5)

the next step, if this is desired, after which entries in the y column are again Appropriate modifications of this procedure are easily devised in other cases. 6.14. Use of Higher Derivatives. It is possible to derive a variety of formulas, for the numerical integration of differential equations, which will involve values of certain higher derivatives of the unknown function. In particular, the Euler-Maclaurin sum formula (5.9.1) can be ex

230

INTRODUCTION

TO

NUMERICAL ANALYSIS

pressed in the form

3/+l - Vn-P = Hiy'n+l + y'n + y'n-1 + + yn-p+2 + ?/Lp+l +


h2 ft4

- J2 ^"+1 "
/l6

+ 720

^"+1

- 30240 to+i - 2/-p) + , (6.14.1)

where the error committed by truncation with the term of order h2k is (p + l)h times the term of order h2k+2 with the contents of the relevant parentheses replaced by y(2t+3) (), where x n- p < < x +1. Thus, for example, with p = h
2 /+1 = Vn + 2 ( y'n+l + y'n) ~ JTj W+l ~ V"^ + 72 0 V'^
0

we have the formula h5


( 6 1 4 ' 2 )

of closed type, which may be used with any convenient predictor formula (preferably also with an error of order h5) as in the methods discussed previously. Formula (6.14.2) can be obtained also as a special case of the so-called Hermite interpolation formula, to be discussed in 8.2, and can also be derived by a method of undetermined coefficients, in which we write

Vn+i Vn + h(aoy' n+1 + aiy' n) + A2(^oJ/^i + Piy") + E, so that E = 0 if y{x) is a


constant, and determine a0, ai, /So, and /Si in such a way that E = 0 also when y(x) = x, x 2, x 3, and x i , and hence for any polynomial of degree four or less. For this purpose, it is convenient and nonrestrictive to take h = tions become &o + ai 1, 2ao + 2(/So + /Si) = 1, 3ao + 6/3o = 1, 4o:o ~r 12/So = 1, and yield o = at = i and /So = /Si = TS , in accordance with (6.14.2). The error term can then be determined by the methods of 5.11 and 5.12, if the formula is first rewritten in the equivalent form /0l/'(s) ds = i[f (0) +/'(1)] + ALT(0) - /"(I)] + E, where Reference to 5.12 then gives E=
7r(s)/'[0,0,l,l,s] 1

and x n = 0, so that the relevant equa-

/(s)

= y(x n

+ sh).

ds, ir(s) = s2(s - l)2,

and, since TT(s) does not change sign, there follows

~ ^4!^ J 0 ds where
0

tit/v (;) Trsr^52/v (a:Ti + yh) =

< tj < 1, and hence x n < < x n+1.

NUMERICAL SOLUTION OF DIFFERENTIAL EQUATIONS

231

In the same way, a formula of open type, involving only yn+i, y n-\, y' n, y'n- n yn> y'n-i, can be obtained in the form 9h2 yn+1 = yn-1 + 2% Li + ~ (2y; + </"_>) + % ir(t), (6.14.3) and can be used as a predictor in connection with (6.14.2). 9/)5

an

Since (6.14.2) affords an accuracy which is generally better than that associated with the result of retaining fourth-order terms in the Taylor expansion bh3 h4 /i5 yn+ 1 = yn + hy'n+\y';+ y'" + ^ ~ '({), it is often useful in starting the solution when a procedure of fourth order is appropriate and when the calculation of values of y"' and yiv is to be avoided. The formula yx = y0 -f hy' a + vWy'J can be used for a prediction in the first step, after which (6.14.3) is available. When the differential equation is of second order, Eqs. (6.14.2) and (6.14.3) are to be supplemented by the two equations obtained by replacing y by u, where u y'. Formulas of higher-order accuracy may be obtained if derivatives of order three or more are also employed. A useful class of formulas, associated with the name of Obrechkoff, can be derived by an inverse method in which we first seek a formula for j<t>(x) dx with an error expressed in the form

E =

wy\ Jo zr{x ~ ^C2r)(z) dx (6-14-4)

where r is an arbitrarily prescribed integer. If we integrate by parts r times, there follows immediately

^wr\f 0

0<r)(z)

s?lxT(h ~ x ) r ]

dx

'

since the integrated terms vanish at both limits, and r additional integrations by parts yield the result

*-

(-1)_1 (*) * - mt

p.

i-1

+ (-l)*-1^*-1^)] (6.14.5)

which supplies the required formula after a transposition. If we write 4>(x) = y'{x), and translate the origin to x n, the result

Você também pode gostar