Graphics Programs Reference
In-Depth Information
so that Eq. (a) becomes
c 1
y ) h
n
F
F
( h 3 ) d)
y ( x
+
h )
=
y ( x )
+
( c 0 +
c 1 ) F ( x
,
y ) h
+
x ph
+
qh
y i F i ( x
,
+ O
i
=
1
Comparing Eqs. (c) and (d), we find that theyare identical if
1
2
1
2
c 0 +
c 1 =
1 c 1 p
=
c 1 q
=
(e)
Because Eqs. (e) representthree equations in four unknownparameters, wecanassign
any valuetooneoftheparameters.Some of the popular choices and the names
associatedwith the resulting formulas are:
c 0 =
0
c 1 =
1
p
=
1
/
2 q
=
1
/
2
ModifiedEuler's method
c 0 =
1
/
2
c 1 =
1
/
2
p
=
1
q
=
1
Heun's method
c 0 =
1
/
3
c 1 =
2
/
3
p
=
3
/
4 q
=
3
/
4 Ralston's method
All these formulas areclassifiedas second-order Runge-Kuttamethods, with nofor-
mula having a numericalsuperiority over the others.Choosing the modified Euler's
method , wesubstitute the corresponding parameters into Eq. (a)toyield
F x
y ) h
h
2 ,
h
2 F ( x
y ( x
+
h )
=
y ( x )
+
+
y
+
,
(f )
This integration formula can beconveniently evaluatedbythe following sequence of
operations
K 1 =
h F ( x
,
y )
h F x
2 K 1
h
2 ,
1
K 2 =
+
y
+
(7.9)
y ( x
+
h )
=
y ( x )
+
K 2
Second-ordermethods are seldomusedincomputer application. Most program-
mers preferintegration formulasoforder four, which achieve a givenaccuracywith
less computational effort.
y' ( x )
Figure 7.2. Graphical representation of modifiedEuler
formula.
f ( x + h /2, y + K 1 /2)
h /2
h /2
f ( x,y )
x
x
x + h
Figure 7.2 displays the graphical interpretation of modifiedEuler'sformula fora
single differentialequation y =
,
y ). The first of Eqs. (7.9) yields an estimate of
y at the midpoint of the panel by Euler'sformula: y ( x
f ( x
+
h
/
2)
=
y ( x )
+
f ( x
,
y ) h
/
2
=
Search WWH ::




Custom Search