Database Reference
In-Depth Information
X
(
t
)=
X
(
t
DT
)+
F
(
t
,
X
(
t
) , · )
DT
(1.2)
Given an initial value X(0), we can calculate X(t) at any point in time as the sum of
all the flows that occurred over all the small time steps DT between t = 0 and t:
t
i
)+
X
(
t
)=
X
(
0
0 F
(
t
,
X
(
t
) , · )
DT
(1.3)
=
For example, in these models the number of SICK individuals today is a function of
the population size one small time step earlier and the net additions that took place
over that time step. This is the essence of equation (1.2). Equation (1.3) states that
the number of SICK individuals after 140 days is the original population size plus
all the net additions over the entire course of 140 days.
In these models, we chose DT = .25 and we specified in the Time Specs menu
the “Numeric Method” to be Euler's method. Choosing Euler's method means that
we used an equivalent to equation (1.2) to update the population size four times over
the course of each day (see, for example, equation (1.3)).
Besides Euler's method, two other numeric solution techniques are available in
STELLA. One of them is Runge-Kutta 2. With this method, stocks are updated in
two steps as follows. First, a net flow F1 over the interval DT is calculated as with
Euler's method:
F1
=
F
(
t
,
X
(
t
) , · )
DT
(1.4)
Next, a second estimate F2 is generated by moving a small time step DT into the
future:
F2
=
F
(
t
+
DT
,
X
(
t
)+
F1
, · )
DT
(1.5)
These two estimates are then used to calculate the stock X(t) as
X
(
t
)=
X
(
t
DT
)+
1
/
2
(
F1
+
F2
)
(1.6)
The second alternative to Euler's method that is available in STELLA for numeric
approximation of flows and the updating of stocks is Runge-Kutta 4. Analogously to
Runge-Kutta 2, Runge-Kutta 4 uses a set of four intermediate estimates to calculate
F(t, X(t),
· )
:
F1
=
F
(
t
,
X
(
t
) , · )
DT
(1.7)
F2
=
F
(
t
+
DT
/
2
,
X
(
t
)+
1
/
2F1
, · )
DT
(1.8)
F3
=
F
(
t
+
DT
/
2
,
X
(
t
)+
1
/
2F2
, · )
DT
(1.9)
F4
=
F
(
t
,
X
(
t
)+
F3
, · )
DT
(1.10)
A weighted sum of those four estimates is then used to calculate the stock:
X
(
t
)=
X(t-DT)
+
1
/
6
(
F1
+
2
F2
+
2
F3
+
F4
)
(1.11)
Numeric solution techniques such as the ones described above are often also
called solution algorithms. How do these three algorithms compare with each other,
and how does the choice of algorithm influence model results? Before we give an
Search WWH ::




Custom Search