Page 95 - Standard Handbook Of Petroleum & Natural Gas Engineering
P. 95
84 Mathematics
2. Boundary value problems where conditions are specified at two (or, rarely,
more) values of the independent variable.
(The solution of boundary value problems depends to a great degree on the
ability to solve initial value problems.) Any nLh-order initial value problem can
be represented as a system of n coupled first-order ordinary differential equa-
tions, each with an initial condition. In general
-_ dy2 - f,(y,,y,, f . .,y. ,t)
dt
and
YJO) = Y,(]? y2(0) = Y?(]’ . . ?Y,,(O) = Y,,,,
The Euler method, while extremely inaccurate, is also extremely simple. This
method is based on the definition of the derivative
or
Y,, = Y, + f1Ax
where f, = f(xL,y,) and y(x = a) = ylI (initial condition).
Discretization error depends on the step size, i.e., if Ax, + 0, the algorithm
would theoretically be exact. The error for Euler method at step N is 0 N(Ax)~
and total accumulated error is 0 (Ax), that is, it is a first-order method.
The modified Euler method needs two initial values yII and y1 and is given by
Y” = y,.n + f”.1(2Ax) + 0 (W2
If ye is given as the initial value, yI can be computed by Euler’s method, or
more accurately as
AYA = f(X,,,Y,,)AX
YI = Yo + AY.,
f, = f(XI>Y,)
and
Ayh = f,Ax