Documentation for Delay Information gives false examples

Use this forum to post Vensim related questions.
Post Reply
gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Documentation for Delay Information gives false examples

Post by gwr » Wed Nov 13, 2019 6:03 pm

Hi,

I noted that the online documentation for Delay Information gives the following examples:

Image

The examples SS1 and SS2 are wrong imo: The delay time should step up at time = 40 and thus the delayed input should be held starting at that point in time until more recent information becomes available at time = 40 + 30 = 70 for SS1. Conversely, for SS2, the jump should be at time = 40. Is the documentation up-to-date?

Unfortunately, I am only using Vensim DSS 6.3 occasionally, so I cannot check the most recent release of Vensim. (Vensim DSS 6.3 will exactly reproduce the examples cited above, though, and thus does have a bug imo)

Best regards,
Guido

tomfid
Administrator
Posts: 2782
Joined: Wed May 24, 2006 4:54 am

Re: Documentation for Delay Information gives false examples

Post by tomfid » Wed Nov 13, 2019 6:42 pm

I haven't looked at the code yet, but I think there's a method to the madness. The delay is treated like a queue of variable length. When the delay changes duration, it shortens or lengthens the queue, but it doesn't rewrite the existing values. So, values reflecting the new pipeline duration don't begin to appear until a time equal to the change in delay duration has elapsed.

This seems like it might have been a storage-minimizing programming convenience at one time, but I agree that it's a bit bonkers as an operational representation of reality. I'll look into an upgrade. This would probably require a different function.

This has not changed in 8.0.6.

gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: Documentation for Delay Information gives false examples

Post by gwr » Wed Nov 13, 2019 8:00 pm

Thanks, for acknowledging the false behavior, Tom - not everybody does. ;-)

Writing information delays with variable delay times is tricky imo: Holding the information we have when the delay time increases (delayed information will then be older than what we already know) makes the implicit assumption, that we are aware of the increase in delay time. That assumption may not always hold and thus I find that a strict formulation, e.g a Delay Fixed with variable delay time that will have a step down in the example SS1 may also make sense in some situations.

tomfid
Administrator
Posts: 2782
Joined: Wed May 24, 2006 4:54 am

Re: Documentation for Delay Information gives false examples

Post by tomfid » Wed Nov 13, 2019 8:21 pm

gwr wrote:
Wed Nov 13, 2019 8:00 pm
Thanks, for acknowledging the false behavior, Tom - not everybody does. ;-)
Hey, no politics in the forum! ;-)

tomfid
Administrator
Posts: 2782
Joined: Wed May 24, 2006 4:54 am

Re: Documentation for Delay Information gives false examples

Post by tomfid » Wed Nov 13, 2019 8:46 pm

In Ventity, the equivalent function has access to the full time series history of the input, and therefore when the delay changes, it simply (instantaneously) shifts the lookup to a different point.

I think the key question here is, what real-world phenomenon are we trying to represent? The Ventity version makes sense for something like a change in the reference point for some value, due to a change in administrative rules. The Vensim version would have to be something more arcane, more like an increase in the speed of postage, causing newer letters to begin overtaking older ones.

gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: Documentation for Delay Information gives false examples

Post by gwr » Wed Nov 13, 2019 9:17 pm

Why not have both versions? I just decided to have both versions using Modelica (where changes are also instantaneous as events per definition are not consuming time).

Let’s assume, that you are looking at stock information and all you can see is the next tick - but you never see what time it is from. If the time for reporting changes, you may note a discontinuity, but you also may not. All you see is stock values, that all of a sudden are older (or younger) than those you had before - without you knowing.

On the other hand, were I to write letters containing information (or e-mail) you would know, when the letters are older or younger from the time stamp on the envelope - so you keep the one with a later time stamp.

This is a bit constructed, but it carries the point, that there may well be reasons for perceiving or not perceiving a time stamp together with the information received.

gwr
Senior Member
Posts: 209
Joined: Sun Oct 04, 2009 8:40 pm
Vensim version: DSS

Re: Documentation for Delay Information gives false examples

Post by gwr » Thu Nov 14, 2019 12:23 pm

To make this self-contained:

The correct outputs (at least correct with regard to the behavior that should be expected from reading the Delay Information documentation) for the examples given in the documentation are:

Image

Image

Interestingly, I got the following message from Tony Kennedy when I at first approached him via e-mail:
The sample model that ships with Vensim is behaving as expected.
I downloaded the Delay Information.mdl from the website and found, that it is still the same as the one that shipped with Vensim DSS 6.3 and has the following structure:

Image

Here the input variables would be defined as follows (in Vensim):

Code: Select all

delayTime= WITH LOOKUP (
	Time,
		([(0,0)-(100,20)],(0,10),(20,10),(30,20),(60,20),(70,10),(100,10) ))
	~	Day
	~		|

information=
	RAMP(1, 0, 100)
	~	boxes/Day
	~		|
Please check for yourself, whether the Vensim output that "shipps with Vensim" really is matching the following output:

Image

The model output from Vensim DSS 6.3 certainly is not "behaving as expected"... ;-)

Post Reply