36
2. Modeling in STELLA
Given the number of equations in each of the models of this book , and
given the use of state-of-the art computers, computation time is often not
much of an issue. But if your computer is slow and your model is large, the
choice of DTand solution method may have a significant impact on computation time. Your choice of DTand solution method will likely depend on
the level of accuracy that you are willing or able to sacrifice for computation
time. A rule of thumb for this choice is to continue to decrease DT(or at a
given DT, switch to a more accurate solution method) until the changes in
the results of your model fall within an acceptable limit. If for example you
reduce the DTofyour model from .25 to .125, and the results of your model
differ by less than a percent , while your input parameters are accurate only
to about ± 5% and the model takes now twice as long to run, you may decide that cutting the DTwas not worth the extra computational effort.
If your model is defined over discrete time, then you should choose a DT
that is consistent with the length of the discrete time step . Experiment then
with the choice of solution method to improve model accuracy.
Let us return to the whale model of the previous section and investigate
the sensitivity of the model results to the frequency at which we update the
stock WHALES in that model. Assume that the specification of this model
presumes that the equations are defined over continuous time. The equations for REPRODUCTION and MORTALITY are thus differential equations
(albeit they will be solved for DT> 0 and therefore be treated by STELLA as
difference equations). For the model runs above , DTwas set to .25. Generally speaking, a smaller DTieads to more accurate numerical calculation for
updating state variables and, therefore, a more accurate answer. Also remember that, if the flow equations need to be understood as differential
equations, DT needs to be sufficiently small.
Choose Time Specs from the RUN menu to change DT. Change DTto reflect ever smaller periods until the change in the critical variable is within
acceptable tolerances . Start with a DT = 1 and reduce it to 0.5, 0.25,
0.125 ... for subsequent runs, each time cutting it into half of its previous
value . Before each run, take note of the values of your state variable at the
end of the previous run, as STELLA will erase the graphs if the DT is
changed. To lock graphs, and thus not lose model results when you change
the DT, click on the lock in the lower right-hand comer of the graph pad .
This preserves the results. Then double-click on the graph pad to open its
dialog box , click on the upward-pointing triangle to generate a new page
for the graph pad, and select the variablets) to be plotted. Now, one page
of the graph pad contains the results for one choice of DT, the other contains the results after changing DT.
To get an even more accurate reading of your model results at each point
in time, create a table. Choose the table icon in STELLA, place it in the
model diagram, double-click anywhere on the table and select WHALES as
the input, then double-click on the head of the column where it reads
"WHALES" and choose "Free Float" as the "Precision." With this specifica-
2. Modeling in STELLA
Given the number of equations in each of the models of this book , and
given the use of state-of-the art computers, computation time is often not
much of an issue. But if your computer is slow and your model is large, the
choice of DTand solution method may have a significant impact on computation time. Your choice of DTand solution method will likely depend on
the level of accuracy that you are willing or able to sacrifice for computation
time. A rule of thumb for this choice is to continue to decrease DT(or at a
given DT, switch to a more accurate solution method) until the changes in
the results of your model fall within an acceptable limit. If for example you
reduce the DTofyour model from .25 to .125, and the results of your model
differ by less than a percent , while your input parameters are accurate only
to about ± 5% and the model takes now twice as long to run, you may decide that cutting the DTwas not worth the extra computational effort.
If your model is defined over discrete time, then you should choose a DT
that is consistent with the length of the discrete time step . Experiment then
with the choice of solution method to improve model accuracy.
Let us return to the whale model of the previous section and investigate
the sensitivity of the model results to the frequency at which we update the
stock WHALES in that model. Assume that the specification of this model
presumes that the equations are defined over continuous time. The equations for REPRODUCTION and MORTALITY are thus differential equations
(albeit they will be solved for DT> 0 and therefore be treated by STELLA as
difference equations). For the model runs above , DTwas set to .25. Generally speaking, a smaller DTieads to more accurate numerical calculation for
updating state variables and, therefore, a more accurate answer. Also remember that, if the flow equations need to be understood as differential
equations, DT needs to be sufficiently small.
Choose Time Specs from the RUN menu to change DT. Change DTto reflect ever smaller periods until the change in the critical variable is within
acceptable tolerances . Start with a DT = 1 and reduce it to 0.5, 0.25,
0.125 ... for subsequent runs, each time cutting it into half of its previous
value . Before each run, take note of the values of your state variable at the
end of the previous run, as STELLA will erase the graphs if the DT is
changed. To lock graphs, and thus not lose model results when you change
the DT, click on the lock in the lower right-hand comer of the graph pad .
This preserves the results. Then double-click on the graph pad to open its
dialog box , click on the upward-pointing triangle to generate a new page
for the graph pad, and select the variablets) to be plotted. Now, one page
of the graph pad contains the results for one choice of DT, the other contains the results after changing DT.
To get an even more accurate reading of your model results at each point
in time, create a table. Choose the table icon in STELLA, place it in the
model diagram, double-click anywhere on the table and select WHALES as
the input, then double-click on the head of the column where it reads
"WHALES" and choose "Free Float" as the "Precision." With this specifica-
