Only in the special case of LCCODE, can the equation be solved
analytically to obtain a closed-form solution as discussed above.
In the general case of nonlinear ODE systems, the closed-form
solutions no longer exist, and we can only solve such an equation
numerically based on a given initial condition
.
We first consider solving a first order ODE which can be
written in the explicit form:
![$\displaystyle y'(t)=\frac{d}{dt}y(t)=f(t,y(t))$](img466.svg) |
(179) |
This ODE can be solved iteratively, by estimating its next
value
from the previous one
:
where
is the step size,
,
is a value between 0 and
, and
![$\displaystyle \frac{\Delta y}{h}=\frac{y(t+h)-y(t)}{h}
=y'(t+ch),\;\;\;\;\;\;\;(0\le c\le 1)$](img474.svg) |
(181) |
is the slope of the secant of the function
through
the two
and
, which, according to the
mean value theorem, is equal to the derivative of the
function at some point
inside the interval
.
However, as the slope
of the secant is unknown,
all methods considered below approximate
from
based on certain estimated slope of the secant between
and
:
![$\displaystyle y(t+h)\approx \hat{y}(t+h)=y(t)+h\; \hat{y'}(t+ch)$](img478.svg) |
(182) |
The goal is to minimize the error, represented as a kth power
function of the step size
:
error![$\displaystyle =\vert y(t+h)-\hat{y}(t+h)\vert\propto O(h^k)$](img479.svg) |
(183) |
As
is small, the higher the order
of the error term,
the more accurate a method is.
Eq. (180) can be expressed as an iteration:
![$\displaystyle y_{n+1}=y_n+h\,y'(t_n+ch)=y_n+h\,f(t_n+ch, y(t_n+ch))$](img482.svg) |
(184) |
where
,
,
,
, and
.
We further note that the increment
in Eq. (180) can also be obtained as an
integration based on the given
, by the
method of
Newton-Cotes quadrature:
![$\displaystyle \Delta y=y(t+h)-y(t)=\int_t^{t+h} y'(\tau)\,d\tau
\approx\sum_{i=0}^n c_i y'(t_i)=\sum_{i=0}^n c_i f(t_i,y(t_i))$](img489.svg) |
(185) |
However, we note that in these equations, function values
such
and
are
unknown and need to be estimated so that the error is minimized.