
Numerical Computation 39
Solution of First Order Ordinary Differential Equations
We express a first order equation as:
dy = f(x, y) (1-113)
dx
and we require a solution y(x) that satisfies Equation 1-113 and one
initial condition. Here, we can subdivide the interval in the independent
variable in x into steps over which a solution is required (a,b). The value
of the exact solution y(x) is then approximated at N+I evenly spaced
values of x; i.e., (x 0, Xl,... X,_l, Xn). The step size, h, is expressed as:
and
x i =x 0+ih, i=0,1 .... n
If we let the true solution y(x) be y(xi), and the computed approxima-
tions of y(x) at these same points be Yi, so that
Yi = y(xi)
then, the exact derivative dy/dx can be approximated by f(xi,Yi) and rep-
resented as fi such that
fi -- f(xi,
Y~)
- f(xi, Y(Xi))
(1-114)
The difference between the computed value Yi and the true value
Y(Xi)
is
~i
and can be expressed as:
~i =
Yi - Y(Xi) (1-115)
ei is the local truncation error.
Taylor Series Expansion
We can develop a relation between x and y by finding the coefficients
of the Taylor series. Expanding y about the point x - x 0, we obtain
y(x) = y(x 0) + f'(Xo)(X - x0) +
f"(x o )(x - x o )2
2!
f"(x0)(x - x0)3
+ +... (1-116)
3!