Using DT in Model Equations
Posted: Tue Apr 16, 2002 4:16 pm
Jim Hines reasoning behind the prejudice against infinitesimal quantities
in mathematics
is interesting. However, Im not sure that it hits the nail on the head when
it comes to
the predjudices towards DT in System Dynamics.
The reason for our saying things like "dt is artificial", "never use dt in
an equation" or
"dt is only a technical parameter" within system dynamics equations is
somewhat more
rational. The computer simulation carried out in System Dynamics is at the
most fundamental level
often taken to be concerned with the solution of a system of differential
(or if you want
integral) equations.
(I dont actually think its fair to say that everyone agrees with this
statement, Sterman states
it explicitly in Business Dynamics, Forrester hints at it in Industrial
Dynamics and
Pugh and Richardson avoid the issue altogether in their Introduction to
System Dynamics Modelling.
However, its certainly a popular statement in the SD literature, indeed my
present bedtime reading
Competitive Strategy Dynamics by Kim Warren makes mention of the
differential equations basis of
System Dynamics.)
The algorithms used by the software (most commonly the Euler algorithm) seek
to solve this
system in a numerical fashion (most differential equations of interest to a
system dynamicist
are insoluble analytically).
We do this by discretizing the equation, that is dividing the solution
interval up into many dt
segments and applying an algorithm to get from a solution at point t to the
solution at point t+dt.
(A sensible algorithm can be determined by demanding several properties not
least of which is that
the numerical solution we find tends towards the actual solution of the
differential equations as
dt tends to zero. This can be a tricky business, but the Euler algorithm
manages this, under certain
assumptions, even if sometimes the convergence is slow.)
The actual solution to the set of differential equations that defines our
simulation is clearly independent
of dt (since dt has NOTHING to do with these equations). Since this actual
solution is what we are attempting to find
the simulation results should also be independent of dt (except insofar as
the numerical solution tends
towards the true solution as we decrease dt, which we observe in SD as a
result of the unchanging patterns
of behaviour as we halve dt). This also explains why dt should never appear
in our equations since the differential
equations we are attempting to solve cannot contain dt, which has no meaning
outside the numerical method.
Usage of dt in the equation Flow(t)=-MIN(....,S(t-dt)/dt) is merely taking
advantage of integration error
(since the explicit time constant in the second part of this equation is dt,
by standard SD thinking on time
constants we should expect integration error) to empty this stock in our
difference equations. It is simple
to see why since the Euler method does this: S(t)=S(t-dt)+dt*F(t) so
S(t)=S(t-dt)-dt*S(t-dt)/dt giving S(t)=0.
This formulation isnt independent of integration method, when using
Runge-Kutta it works very
differently (try it!, although the solution will still tend to zero, it
wont ever actually become zero).
All of this use of dt, of course, invalidates the underlying assumption that
we are seeking to solve differential equations.
The dictum that says that this is an acceptable use of dt appears to me to
be based mathematically on nothing better
than an assertion.
I believe Jim is right, and that time is ripe to reassess the place of dt in
System Dynamics. Why do we bother with all this differential
equations/integral calculus nonsense if we
never bother to check that our numerical methods are appropriate OR if the
equations we seek to solve have a
unique solution?
Id be really interested to hear what other people have to say on this
issue.
Neil Douglas
Consultant
Powersim Consulting
ndouglas@powersim.com
in mathematics
is interesting. However, Im not sure that it hits the nail on the head when
it comes to
the predjudices towards DT in System Dynamics.
The reason for our saying things like "dt is artificial", "never use dt in
an equation" or
"dt is only a technical parameter" within system dynamics equations is
somewhat more
rational. The computer simulation carried out in System Dynamics is at the
most fundamental level
often taken to be concerned with the solution of a system of differential
(or if you want
integral) equations.
(I dont actually think its fair to say that everyone agrees with this
statement, Sterman states
it explicitly in Business Dynamics, Forrester hints at it in Industrial
Dynamics and
Pugh and Richardson avoid the issue altogether in their Introduction to
System Dynamics Modelling.
However, its certainly a popular statement in the SD literature, indeed my
present bedtime reading
Competitive Strategy Dynamics by Kim Warren makes mention of the
differential equations basis of
System Dynamics.)
The algorithms used by the software (most commonly the Euler algorithm) seek
to solve this
system in a numerical fashion (most differential equations of interest to a
system dynamicist
are insoluble analytically).
We do this by discretizing the equation, that is dividing the solution
interval up into many dt
segments and applying an algorithm to get from a solution at point t to the
solution at point t+dt.
(A sensible algorithm can be determined by demanding several properties not
least of which is that
the numerical solution we find tends towards the actual solution of the
differential equations as
dt tends to zero. This can be a tricky business, but the Euler algorithm
manages this, under certain
assumptions, even if sometimes the convergence is slow.)
The actual solution to the set of differential equations that defines our
simulation is clearly independent
of dt (since dt has NOTHING to do with these equations). Since this actual
solution is what we are attempting to find
the simulation results should also be independent of dt (except insofar as
the numerical solution tends
towards the true solution as we decrease dt, which we observe in SD as a
result of the unchanging patterns
of behaviour as we halve dt). This also explains why dt should never appear
in our equations since the differential
equations we are attempting to solve cannot contain dt, which has no meaning
outside the numerical method.
Usage of dt in the equation Flow(t)=-MIN(....,S(t-dt)/dt) is merely taking
advantage of integration error
(since the explicit time constant in the second part of this equation is dt,
by standard SD thinking on time
constants we should expect integration error) to empty this stock in our
difference equations. It is simple
to see why since the Euler method does this: S(t)=S(t-dt)+dt*F(t) so
S(t)=S(t-dt)-dt*S(t-dt)/dt giving S(t)=0.
This formulation isnt independent of integration method, when using
Runge-Kutta it works very
differently (try it!, although the solution will still tend to zero, it
wont ever actually become zero).
All of this use of dt, of course, invalidates the underlying assumption that
we are seeking to solve differential equations.
The dictum that says that this is an acceptable use of dt appears to me to
be based mathematically on nothing better
than an assertion.
I believe Jim is right, and that time is ripe to reassess the place of dt in
System Dynamics. Why do we bother with all this differential
equations/integral calculus nonsense if we
never bother to check that our numerical methods are appropriate OR if the
equations we seek to solve have a
unique solution?
Id be really interested to hear what other people have to say on this
issue.
Neil Douglas
Consultant
Powersim Consulting
ndouglas@powersim.com