Discrete v Continuous models

[Martin Taylor 2007.06.02.08.51]

This morning there is a thread on the System Dynamics mailing list dealing with the difference between discrete and continuous models, which I thought might be useful to copy here.

I realize that the serious PCT modellers understand the situation, and use techniques to avoid the oscillatory artefacts to which discrete models can be prone, but nevertheless, John Sterman's contribution to this thread seems to me to be the most lucid explanation of the issue that I have seen. It might also be useful to others who want to get into the modelling business.

Initially, I intended to send just Sterman's message, but I think putting the all together is more useful. If you read only one of these four messages, make it Sterman's.

Martin

=============From the System Dynamics Mailing List=================

Posted by "Welch, Cory" <Cory_Welch@nrel.gov>

I am currently engaged in a debate regarding continuous-time vs.
discrete-time modeling. As a result, I came across two articles that
claim a first order difference equation (they use the logistic equation
as an example) is capable of a) oscillation, and b) chaotic behavior. As
any good system dynamicist knows, this is of course impossible. These
articles are referenced countless times in ecology literature.

At first glance, it seems to me that the articles are mistakenly
interpreting instability resulting from using discrete time rather than
continuous time as "true" oscillation.

First, I am wondering whether I am correct in my interpretation.

Second, I wonder anyone on this list knows of a published rebuttal
specific to the contentions set forth in these articles (I am aware of
the discussion on oscillation in Business Dynamics).

Finally, if anyone can point me toward publications regarding the merits
of continuous-time vs. discrete time modeling, it would be greatly
appreciated.

Best regards,

Cory Welch

Articles referred to above:
Robert M. May "Simple mathematical models with very complicated
dynamics" Nature, Vol 261, June 10, 1976, pp. 459-467.

Robert M. May, George F. Oster "Bifurcations and Dynamic Complexity in
Simple Ecological Models" The American Naturalist, Vol. 110, No. 974
(Jul. - Aug., 1976), pp. 573-599

···

==================================================
Posted by John Sterman <jsterman@MIT.EDU>

A continuous time first-order system of the form

1. dx/dt = f(x)

cannot oscillate, whether it is linear or nonlinear. The system has
only one eigenvalue, so can never oscillate (even if it is
nonlinear). To get oscillation in continuous time requires at least
2 state variables. To get chaos in continuous time requires at least
three states and particular nonlinearities.

A discrete-time first-order system (mapping) of the form

2. x(t+1) = F(x(t))

can oscillate and, if it is nonlinear in a particular way, can
generate period doublings, chaos, and other interesting dynamics.

One way to think about this is to reformulate the discrete-time map
in continuous time. The difference-equation formulation implies that
there is a time delay of 1 "period" in the feedback loop from x to
its rate of change. Further, that delay is a "pipeline" delay:
output(t) = intput(t-L), where L is the length of the delay, in this
case, one "period". The pipeline delay is the limit of the Erlang
delay family as the order of the Erlang delay goes to infinity (it is
thus also called an infinite-order delay). Consequently, the
continuous time equivalent of the discrete-time mapping eq. 2. is
actually an infinite-order system. Such a system can oscillate of
course and can generate chaos etc.

Difference equations became popular (in economics, at least) because
economic data are typically published at regular intervals such as
quarterly or annually, and it was convenient for econometric
estimation to model economic dynamics as proceeding in discrete
steps. However, while difference equations are often useful, one
must be careful because there is an irreducible time delay of at
least 1 period in every feedback loop. If the length of this period
is long relative to the time constants for the real-world processes
being modeled, the result can be the introduction of spurious
dynamics (e.g., oscillations caused by the time step). Further, any
more complex delays must be integer multiples of the "period" between
time steps in the difference equations. This is often inappropriate
and inconsistent with the data.

It's generally better practice to model the dynamics of a system
continuously, explicitly representing relevant time delays as the
data suggest, including their mean and distribution, rather than
assuming a pipeline delay of 1 period in the updating of every state
variable.

John Sterman
Posted by John Sterman <jsterman@MIT.EDU>
posting date Fri, 1 Jun 2007 07:39:50 -0400

==================================================

Posted by yaman barlas <ybarlas@boun.edu.tr>

Dear Cory;

It IS possible for a 1st order time-discrete model (i.e difference) equation to
oscillate. It does NOT even have to be non-linear. Here is a short proof: take the
simplest linear, constant-coefficient, 1st order equation x(k+1) = ax(k).
Now try an a value between -1 and 0. You will get damped oscillations. For
a<-1, you will get growing oscillations. You may want to play with different
a's.

As for the interpretation: there is NO numerical stability/error problem here
at all. When you iterate this first order model, what you obtain is actually its
EXACT mathematical behavior. So, the true behavior of a first order
time-discrete system can be oscillatory.

What we are used to hear in SD community ('first order systems can not
oscillate') assumes the model is continuous.

It is great that you brought this up. The implication of this important
difference between continuous and discrete systems is that we must be careful
and EXPLICIT in our assumption in this respect. When we build a continuous
model, we must mean it and must never use arbitrary/careless dt values. (Such
dt values would imply some 'arbitrary' discrete-time models, with potentially
very different dynamics). Similarly, when we build time-discrete models and use
dt=1, we must again mean it and know the fact that would be delaing with quite
different dynamics. Time continuous and discrete models are quite different
creatures.

About your final question on chaos in the first order discrete logistic model,
yes, it is well known with this property. (The articles you refer to are very
important classics). Since this particular model is non-linear, it CAN exhibit
strange attractors and chaos, even though it is first order. Again, here is an
example: The simplest discrete logistic equation is: x(k+1) = ax(k)(1-x(k)).
It is known to start exhibiting near chaotic behavior, after a=3.8 and becoming
wilder and wilder as it approaches 4. Perhaps you may want to play with it?
best wishes,
Yaman Barlas
---------------------------------------------------------------------------
Professor, Industrial Engineering Dept.
Bogazici University,
34342 Bebek, Istanbul, TURKEY
Posted by yaman barlas <ybarlas@boun.edu.tr>
posting date Fri, 1 Jun 2007 19:44:18 +0300
_______________________________________________

================================================================

Posted by Scott Rockart <srockart@duke.edu>

Hi Cory,

Tu (Dynamical Systems, 2nd edition 1994, Springer-Verlag) has a nice concise discussion of limit cycles and chaotic behavior in difference and differential equations which makes specific use of the logistic equation as an example (see section 10.3). His discussion supports rather than refutes the conclusions that both oscillation and chaos are possible in the first order difference equations, but notes that continuous functions must be at least second order for limit cycles and third order for chaos.
Sterman makes similar points (omitting proofs) on page 290 of Business Dynamics (see footnote). In light of that, the debate seems to be whether and when the behavior of the difference equations reflect the behavior of the systems of interest rather than merely reflecting integration errors.

Best,

Scott
Posted by Scott Rockart <srockart@duke.edu>
posting date Fri, 01 Jun 2007 16:17:34 -0400
_______________________________________________

[From Bill Powers (2007.06.02.1047 MDT)]

Martin Taylor 2007.06.02.08.51 –

Thanks for the copies of posts on discrete vs. continuous models. As you
note, we discovered most of this long ago – I even wrote something about
it in the 1979 “Spadework” paper, and at least hinted at it in
B:CP.

One point that Sterman doesn’t address directly is that when we use
digital computers, we are forced to use discrete models even though we’re
trying to model a continuous system. I started out in analog computing
before any digital computers were available to me, so this problem didn’t
arise: the analog computer itself is a continuous system unless you get
down to the quantum level. The System Dynamics people have been
somewhat protected from this problem because they have been using
programs like Stella and Vensim, which are basically analog computers
emulated on a digital computer, with most of the problems of
“computational oscillations” taken care of behind the scenes.
As long as changes require several iterations to take place, so
“dt” is negligible, the digital model can be made to look
continuous.

Best,

Bill P.

[From Fred Nickols (2007.06.02.1658 EDT)] --

[From Bill Powers (2007.06.02.1047 MDT)]

Martin Taylor 2007.06.02.08.51 --

Thanks for the copies of posts on discrete vs. continuous models. As
you note, we discovered most of this long ago -- I even wrote
something about it in the 1979 "Spadework" paper, and at least hinted
at it in B:CP.

One point that Sterman doesn't address directly is that when we use
digital computers, we are forced to use discrete models even though
we're trying to model a continuous system. I started out in analog
computing before any digital computers were available to me, so this
problem didn't arise: the analog computer itself is a continuous
system unless you get down to the quantum level. The System Dynamics
people have been somewhat protected from this problem because they
have been using programs like Stella and Vensim, which are basically
analog computers emulated on a digital computer, with most of the
problems of "computational oscillations" taken care of behind the
scenes. As long as changes require several iterations to take place,
so "dt" is negligible, the digital model can be made to look continuous.

I, too, grew up on analog computers - the old MK1A Rangekeeper was my first. Made by the Ford Instrument Company, it was an electro-mechanical marvel, complete with gears, cams, resolvers and miles and miles of spaghetti wiring. The digital computer stayed out of the fire control arena for many years - the compute time for a static solution was at first too long - and then, as I recall, the compute time was okay but smoothing was a problem. Remember, there was a 10 ton gun mount waiting anxiously for the gun orders that were the primary output of those computers. Then, the door was magically opened: missiles appeared. The missile launcher needed merely to be point in a direction that would land it in the CW beam (those were "beam rider" missiles). Digital computers worked just fine. They took over the gun mounts, too. But, as Bill notes above, the digital computer can be made to look continuous (i.e., that good old gun mount can't tell the difference - and the missil!
e launc
her never could). So thanks for the reminder, Bill. For my part, I've always wondered how those discrete models affected the thinking of those who use them - in ways that might be different from those who use analog or continuous models.

FWIW, I once had a heated argument with an accountant. He was praising the modern digital computer and its ability to support accounting efforts. I told him I thought those accounting problems were child's play and that he ought to try the fire control problem (for a high-speed airborne target) if he wanted some complexity. His comeback was that if a mere technician (me) could grasp that problem and operate, maintain and repair the computers that worked it, it couldn't possible have any serious degree of complexity. Oh well...

Regards,

Fred Nickols
nickols@att.net