126 4 Dynamical Behaviour of Processes
a process are nonlinear, then it is either very difficult or impossible to find the
analytical solution. In such cases it is necessary to utilise numerical methods.
These procedures transform the original differential equations into difference
equations that can be solved iteratively on a computer. The drawback of
this type of solution is a loss of generality as numerical values of the initial
conditions, coefficients of the model, and its input functions must be specified.
However, in the majority of cases there does not exist any other approach as
a numerical solution of differential equations. The use of numerical methods
for the determination of process responses is called simulation. There is a
large number of simulation methods. We will explain Euler and Runge-Kutta
methods. The Euler method will be used for the explanation of principles of
numerical methods. The Runge-Kutta method is the most versatile approach
that is extensively used.
4.2.1 The Euler Method
Consider a process model in the form
dx(t)
dt
= f(t, x(t)),x(t
0
)=x
0
(4.22)
At first we transform this equation into its difference equation counterpart.
We start from the definition of a derivative of a function
dx
dt
= lim
Δt→0
x(t +Δt) −x(t)
Δt
(4.23)
if Δt is sufficiently small, the derivative can be approximated as
dx
dt
.
=
x(t +Δt) −x(t)
Δt
(4.24)
Now, suppose that the right hand side of (4.22) is constant over some interval
(t, t +Δt) and substitute the left hand side derivative from (4.24). Then we
can write
x(t +Δt) −x(t)
Δt
= f(t, x(t)) (4.25)
or
x(t +Δt)=x(t)+Δtf (t, x(t)) (4.26)
The assumptions that led to Eq. (4.26) are only justified if Δt is sufficiently
small. At time t = t
0
we can write
x(t
0
+Δt)=x(t
0
)+Δtf (t
0
,x(t
0
)) (4.27)
and at time t
1
= t
0
+Δt