Negative Levels

This forum contains all archives from the SD Mailing list (go to http://www.systemdynamics.org/forum/ for more information). This is here as a read-only resource, please post any SD related questions to the SD Discussion forum.
Locked
G P Richardson
Junior Member
Posts: 5
Joined: Fri Mar 29, 2002 3:39 am

Negative Levels

Post by G P Richardson »

Id go a step further than Jim Hines and run the risk of distressing my
friend Geoff by suggesting that one should almost never write the
MIN(Level/DT,...) equations he offers.

Best practice, it seems to me, is to try to capture the mechanism in
reality that is responsible for preventing the accumulation from
continuing to decline even though theres nothing left. In practice such
a mechanism would probably be captured, as Jim suggests, in a nonlinear
graphical function (table function) whose slope and shape would reflect
the level of aggregation in the accumulation.

The only type of structure that seems to fit the MIN(Level/DT,...)
formulation is something like pouring water out of a pitcher -- it rushes
out and stops abruptly. Inventories, workforces, production resources,
cash balances, and so on dont have such dynamics, precisely because when
such stocks decline they set up pressures (which should be modeled) that
more gradually constrain their outflows. Some physical systems (like
pitchers) may be captured well by such a MIN formulation, but I would
think that most stock-and-flow processes involving aggregations of people
or resources or averages would be misrepresented if modeled that way. I
think best practice is to avoid formulations like this that look more like
computer programing than social system modeling.

And at the risk of annoying another good friend, Barry Richmond, Ill note
that this issue is the reason I have long objected to the default in
STELLA/kThink that prevents a stock from going negative. (Im greatly
pleased that recent releases allow the user to change the default.) I
think software should not substitute for the thinking one ought to do to
understand the mechanisms, the pressures in reality that are constraining
an outflow when its stock gets small.

But its a debatable topic, worth discussion over a very good beer, as
Goeff and I have done more than once, I believe...

...George

-----------------------------------------------------------------------
George P. Richardson
G.P.Richardson@Albany.edu
Chair of Public Administration and Policy http://www.albany.edu/~gpr
Rockefeller College of Public Affairs and Policy Phone: 518-442-5258
University at Albany - SUNY, Albany, NY 12222 Fax: 518-442-5298
-----------------------------------------------------------------------
"geoff coyle"
Senior Member
Posts: 94
Joined: Fri Mar 29, 2002 3:39 am

Negative Levels

Post by "geoff coyle" »

Jim Hines sent a very helpful comment on my negative levels note. Its very
agreeable when a colleague goes to such trouble and we could clearly have a
very nice debate on this. Jims message was:

>Your formulations are very nice. But, isnt it **usually** true that
>non-negativity formulations involving "dt" are "short cuts"? In our
>aggregated models, isnt a table function usually part of conceptually
>better solution? A common example would be where an "effect of stockOuts"
>(which is a function of inventory/desired inventory), gradually curtails
>sales as the inventory declines - representing the fact that when
>inventories are a little too low, some products (but not all) will be
>unavailable.
>
>Experienced folks often use shortcuts like you described (though maybe not
>such elegant ones!), because they are pressed for time, screen space, or
for
>visual simplicity. The question is: When should they go to the trouble of
>creating the conceptually more correct structure?
>


True, non-linearities are often used as Jim describes. Such an approach was
not ruled out when I wrote

A DOUT.K=XXXX where XXXX is whatever determines DOUT, as XXXX could
obviously involve a non-linearity.

Im not sure about a non-linearity being more correct. As Jay once wrote
(like much in SD Forrester said it first and said it best) in a proper
model the decision functions correspond to those in the real system (quoted
from memory) and a non-linearity is a guesstimate as to what the decision
function is. It can involve a large measure of uncertainty as I discussed in
my keynote in New Zealand and I really must make the time to submit that for
consideration by SDR! There is of course, nothing wrong with
non-linearities, I use them quite frequently, but I am coming to the view
that it is possible to be a bit too rash with them though not, obviously, if
you are a virtuoso like Jim. With the method Jim suggests, my /DT technique
is a bit of belt and braces for one outflow but there is still a problem
with two outflows from one level, which is where the student query arose.

I can see the problem with screen space and it is, in my experience, one of
the drawbacks of the iconic packages that one must create a symbol and links
for every detail of the model. Inevitably that will give complicated
diagrams. One model I know requires about 120 pages to print the diagram. I
still like dear old DYNAMO and its relatives which allow one to draw an
influence diagram at a level which includes all the main features and carry
the detail into the equations without cluttering the diagram.

Anyway, thanks for the comments, Jim.

Regards,

Geoff

geoff.coyle@btinternet.com
Professor Geoff Coyle
Consultant in System Dynamics and Strategic Analysis
Tel: (44) 01793 782817 Fax: 01793 783188
Khalid Saeed
Senior Member
Posts: 79
Joined: Fri Mar 29, 2002 3:39 am

Negative Levels

Post by Khalid Saeed »

George,

Thank you for your very succinct respnonse. Having experimented over an
extended period of time with models that showed chaos
out of modeling errors, in particular from clumsy first order control
on outflows from stocks, I
could not agree more.

Khalid
From: Khalid Saeed <saeed@WPI.EDU>
JHomer609@cs.com
Junior Member
Posts: 6
Joined: Fri Mar 29, 2002 3:39 am

Negative Levels

Post by JHomer609@cs.com »

Geoff Coyle writes:
> Im not sure about a non-linearity being more correct. As Jay once wrote
> (like much in SD Forrester said it first and said it best) in a proper
> model the decision functions correspond to those in the real system
(quoted
> from memory) and a non-linearity is a guesstimate as to what the decision
> function is.

I agree. This issue of whether to use a nonlinearity to constrain outflows
as the stock declines, as opposed to letting the stock go abruptly to zero,
is a common one. My usual approach is to consider whether the stock and the
outflows are essentially homogeneous or heterogeneous. Consider the flow of
shipments out of a warehouse inventory which is no longer being replenished
for some reason.
- Heterogeneous stock: If the inventory consists of multiple SKUs or
product lines, it is highly unlikely that they will all stock out
simultaneously; in this case, a nonlinear function can be used to approximate
the gradual decline of the entire inventory toward zero.
- Heterogeneous outflow: If some customer accounts have a higher priority
than others, then one may delay shipment on current low-priority orders, in
the expectation that additional high-priority orders may soon arrive. In
this case, too, a nonlinear function would be appropriate for approximating
the inventorys gradual decline to zero.
- Homogeneous stock and outflow: The inventory consists of a single
product line, and all customer orders are considered equal. Here, the
nonlinearity is probably not appropriate, since the inventory would hit zero
abruptly in real life. (Similar to pouring water out of a pitcher, to use a
previously cited example.) A situation more likely to be found in an
operations-level model than in a more aggregated strategic model.

Jack Homer
Voorhees, NJ, USA
From: JHomer609@cs.com
Guenther Ossimitz
Junior Member
Posts: 17
Joined: Fri Mar 29, 2002 3:39 am

Negative Levels

Post by Guenther Ossimitz »

The discussion about negative values of stocks was very
enlighting for me. Just a few remarks:

1) The whole issue reminds me of an old mathematicians joke:
"If there are 3 people in a room, and 5 persons
leave that room there have to be two persons to
enter again so that the room is empty."

2) To eliminate the possibility of negative stock
values, just because such values are unrealistic
prevents models from behaving unrealistic. I think
this is bad because unrealistic behavior of models
is a useful indicator that something is wrong with the
model. Using technical tricks (of any kind) to prevent
unrealistic behavior doesnt make models more
realistic, it just covers the unrealistic behavior from
evidence, just like adding flavor to indigestible stuff
doesnt make good nutrition. Allow the stocks to become
negative: only then you can be happy when they dont.

3) Nelson Repennings view of SD models as basically
continouous (and DT just as an indication of our inability to
evaluate systems continuously) is true for many, but not for all
application contexts. There are quite a number of contexts
where a "natural" DT > 0 is given: consider any deliverance
models where products are delivered say once a day every
morning; many production processes have naturally induced cycles
(eg. in farming, where one cant harvest the apples continually
over the year), which make it plausible to set DT= 1cycle.
In many cases DT represents a kind of "natural delay"
which makes Eulers integration method perfectly legitime
(like in interest models, where interest is paid only once
a year and not as a continuous flow). A similar assumption
might lead to DT=1 month for an income-expense model,
assuming that people are paid monthly and spend the money
within the next month after earnig it.

4) Wayne Wakelands binary "furnace on-off 0-1 stock" is
really a great idea - if you want such a thing at all in a
SD - model. Of course a flow of 1/DT is the only possiblity
to maintain such a stock. however, it is easy to prevent
the 1/DT division of the switching rates if one wants
to: just create a stock with the levels 0="off" and DT="on"
instead of 1="on". Since DT > 0, this binary 0-DT switch is
as good as a 0-1 switch and can easily be switched by
flows of the amount 1. Of course when applying the value
of the stock, you have to take into account that "on" is
represented by DT and not by 1, which might make the
equations there a bit more complicated. The 0-DT switch
might also have a better numerical stability than the
0-1 switch, especially when 1/DT is some weird fraction
in the binary number system.

Greetings

--
Dr. Guenther OSSIMITZ
University of Klagenfurt
A-9020 Klagenfurt, Univ.str. 65 Austria/Europe
mail:
ossimitz@bigfoot.com
home: http://go.just.to/ossimitz
"geoff coyle"
Senior Member
Posts: 94
Joined: Fri Mar 29, 2002 3:39 am

Negative Levels

Post by "geoff coyle" »

Well, my innocent little attempt to help a student in distress has triggered
off a bit of a storm.

George Richardson and Nelson Repenning both tell me that the proper
formulation is a table function. Maybe it is or maybe not and, as my good
friend George suggests, it is a matter for debate and beer does help.
Certainly, table functions are very useful things; I use them all the time,
or at any rate when I have some idea of what the shape of the function is.
Often I dont, and I then worry about the possibly huge uncertainties I
might be
introducing into the model. I know that the standard reply is to change the
table shape and test for sensitivity but if I dont have any evidence one
way or the other I am just playing guessing games.

Nelson Repenning goes a lot further and suggests that I dont understand the
significance of DT. I hope, in fact, that I understand its INsignificance.
he says that it is nearly always an error to have DT on the RHS of a rate
(or auxiliary) equation and stresses that each parameter should have a
real-world meaning. I absolutely agree.

In my book I REPEATEDLY use the phrase the model should do the same things
as the real system and for the same reasons. I also state that It is,
therefore, a FUNDAMENTAL ERROR to use DT on the RHS of a rate or auxiliary
equation. Those equations describe information and actions in the real
system; the real system does not contain DT so the equations describing the
systems workings must not contain DT. There are two exceptions to this
rule, which we shall encounter in Chapter 5. That could not be much
clearer! It is also what Nelson himself says, so there is no real
disagreement.

HOWEVER, people do make errors and levels do go negative. I see some
horrible models out there!

Repennings formulation for two outflows is neat if one knows the minimum
times to remove inventory. Even if one did, they are likely to be very small
and, perhaps, much smaller than other delays in the model. That violates the
principle of not mixing small and large delays in the same model. In any
case, the time taken to remove from inventory and deliver to the customer is
not the criterion. It is the time taken to record that a given item has been
earmarked for a customer and is not available for sale that matters. That
cannot be more than a couple of hours at most which is an irrelevant delay.

Repenning suggests a small simulation and thats always a good idea. I am
not, however, convinced that his formula would guarantee a non-negative
level. Mine does.


Obviously, as is well known, if DT is halved the behaviour of the model
should not change appreciably. That is still true with LEV/DT as all that
happens is that the value doubles for half the time, the net effect being
the draining of LEV so there is no appreciable change to the model. If DT=0
then, in theory, as Nelson points out, there is an infinite rate but it only
lasts for zero time. That is a hairy area of maths!

What worries me about this debate is the explicit statement that there is
one correct way to do SD. I would hate that to imply that all else is
heresy. George wisely (as usual) says that these are matters of debate and I
agree. There is no objective proof nor, I hope, is there an SD equivalent of
the 39 Articles of the Church of England to which one must subscribe in
order to belong, though even the dear old C of E is more accommodating these
days. Maybe we should make the Archbishop of Canterbury our honorary
president (Jack, only kidding!)


Nelson also had a remark about what was widely accepted as good practice.
Corollary; anyone who holds different views is not a good practitioner. I
dont think he meant that.

Maybe other people will want to put in their two pennorth of wisdom but I
regret that I cant spend any more time on this.

Regards,

Geoff

geoff.coyle@btinternet.com
Professor Geoff Coyle
Consultant in System Dynamics and Strategic Analysis
Tel: (44) 01793 782817 Fax: 01793 783188
"Pelham Barton"
Newbie
Posts: 1
Joined: Fri Mar 29, 2002 3:39 am

Negative Levels

Post by "Pelham Barton" »

Bill Braun
Senior Member
Posts: 73
Joined: Fri Mar 29, 2002 3:39 am

Negative Levels

Post by Bill Braun »

Hi Jim,

>Your formulations are very nice. But, isnt it **usually** true that
>non-negativity formulations involving "dt" are "short cuts"? In our
>aggregated models, isnt a table function usually part of conceptually
>better solution? A common example would be where an "effect of stockOuts"
>(which is a function of inventory/desired inventory), gradually curtails
>sales as the inventory declines - representing the fact that when
>inventories are a little too low, some products (but not all) will be
>unavailable.

Could you expand on this. I can conceive of a scenario where the inventory
approaches zero at a relatively constant rate. E.g., production is at a
given level and is suddenly curtailed by a strike. Prior to the strike,
management a) ramped up production and b) advertised heavily.

At the time of the strike, inventory is higher than the mean usually
targeted. After some delay, the effect of advertising kicks in. Assume
(admitting this may not be true) that advertising elicits a steady
sustained demand over a period of time at least long enough to exhaust
inventory. As people consume the product, inventory dwindles to zero.

Would it not be valid in this scenario to simply confirm that there is
still product in inventory (test for zero) before showing that the product
can be shipped?

>Experienced folks often use shortcuts like you described (though maybe not
>such elegant ones!), because they are pressed for time, screen space, or for
>visual simplicity. The question is: When should they go to the trouble of
>creating the conceptually more correct structure?

As a related note (in hopes of eliciting comment) I am largely self taught
through "playing" with models and reading Forrester, Richardson, Pugh,
Roberts, SD Review, Sterman and Morecroft, etc. For as long as I can
remember Ive relied on equations such as Goeffs (without necessarily
knowing why). In light of your comments, it occurs to me that modeling is
NOT where you want to claim that youd rather be lucky than good!

Best regards,

Bill Braun
From: Bill Braun <medprac@hlthsys.com>
Nelson Repenning
Junior Member
Posts: 10
Joined: Fri Mar 29, 2002 3:39 am

Negative Levels

Post by Nelson Repenning »

>Id go a step further than Jim Hines and run the risk of distressing my
>friend Geoff by suggesting that one should almost never write the
>MIN(Level/DT,...) equations he offers.

Ill even go a step further than george. While I completely agree with
Georges discussion that a table function would be preferable in most
cases, the formulation violates an even more basic principle and should
never be used except in a very few special cases:


The basic principle that is violated is that all variables in an SD model
should represent real things-arbitrary fudge factors are not allowed. As a
general principle (with one caveat to be discussed below) the simulation
time step (DT from this point forward) should never appear in rate
equations that are conceptualized as continuous flows. The crux issue here
is the difference between the assumptions that SD makes in developing
models and the set of assumptions that are used in solving those models.

SD models are typically formulated in continuous time (they are
differential, not difference equations). Thus, SD is premised on the
assumption that time does not pass in discrete intervals. Of course,
except for linear models and a few non-linear ones, there are no analytical
solutions to such systems, so simulation is used to characterize the
dynamics. DT is a part of simulation method and captures (loosely) the
accuracy with which the approximated system captures the underlying
differential equations. DT does not, however, have a real world analog,
its existence stems solely from the inability to solve non-linear models.

Thus, it is incorrect for DT to ever appear in a rate equation (when that
rate is conceptualized as a continuous flow) because it violates one of the
most fundamental principles of System Dynamics: every parameter in a model
should have a real world meaning. If a system is conceptualized in
continuous time, then DT can never satisfy this requirement, the two
assumptions are fundamentally inconsistent.

Further, this is not solely an abstract point, failure to understand the
role of DT can lead to numerous modeling errors. For example, the previous
email proposed a formulation like the following:

Outflow=MIN(level/DT,indicated outflow)

In this formulation DT represents the minimum time required to deplete the
level. As such it has a real world meaning, and represents a particular
delay in the system, the minimum time to take inventory out of the
warehouse, for example. It is conceptually incorrect to represent this as
DT, it should be an explicit variable. It creates practical problems
because when one runs the standard divide DT in half and see if your
results change test, one is implicitly assuming that the minimum depletion
time is now half of what it once was. It is dangerous and bad practice to
have delay within your model change as you try to simulate the system more
accurately. Further, from a theoretical perspective, the modeler should be
free to make DT arbitrairily small (approaching a limit of zero), and
clearly as one does this, the formulation violates our basic understanding
of the real system--a shipment flow cannot be infinitely large.

Of course the standard rejoinder here is, well, it probably doesnt matter
in most cases. I think this position is intellectually indefensible. The
central assumption of SD is that we cannot reliably anticipate the behavior
of a non-linear system in advance of simulating it. Almost every feature
of what is considered to be good practice in SD can be interpreted as
representing the details of the system as faithfully as possible because we
cannot determine what matters a priori. Thus, relying on intuition to
say a particular formulation will play no role in generating dynamics is
inconsistent with the fields reason for being. More specifically, in
non-linear systems, small changes can, on occasion, make a very big
difference.

The only caveat to this principle that i can think of is when the minimum
depletion time in the real system is much smaller than DT. Then, one is
forced, for numerical reasons, to use DT rather than the true delay.
However, I think this technique should only be used by modelers over the
age of twenty-one (in SD years) or with the supervision of a qualified
parent or legal guardian.

A second problem with using DT in continuous time rate equations is
actually provided by Coyle himself. In his email he considers the problem
of a stock with two outlows:

Outflow A=Min(level/DT,indicated outflow A)
Outflow B=Min(level/DT, indicated outflow B)

He correctly points out that this formulation can cause the stock to go
negative. He then proposes to solve the problem by multiplying each flow
by itself measured as a percentage of the total outflow. Such a
formulation is only appropriate in the special case where the minimum
depletion time is shorter than DT. otherwise a better formulation is:

Outflow A=Min(level/Minimum Depletion Time for A,indicated outflow A)
Outflow B=Min(level/Minimum Depletion Time for B, indicated outflow B)

With this formulation, as long as DT is a sufficiently small fraction of
the time constant, the stock will remain positive (if you havent done it
before, I found it useful to demonstrate this to myself by hand simulating
a few iterations).

i believe this formulation is preferable to Coyles suggestion because

1) the assumed delays do not change with changes in the accuracy of the
numerical method
2) each parameter has a real world analog
3) the formulation better represents the real world system, people leave
until their are none left. there seems to be little justification for the
proportional allocation mechanism.

Importantly, it is the use of DT that necessitates this second, ad hoc,
addition which would not be needed otherwise.


nelson





--------------------------------------------------------------
Nelson P. Repenning
Robert N. Noyce Career Development Assistant Professor
Operations Management/System Dynamics Group
Alfred P. Sloan School of Management, MIT
30 Wadsworth St, E53-339
Cambridge, MA 02139
phone: 617258-6889 fax:617258-7579 e-mail:
nelsonr@mit.edu
http://web.mit.edu/nelsonr/www
Locked