Page 1 of 1
Delay
Posted: Tue May 04, 2010 2:29 pm
by Steven
I have a problem with the delay:
DELAY FIXED((0.4*input), 20, (0.1*input))
The Type is Level and the input rises every year.
After the run of a simulation the output is rising after 20 years, but not before the 20 years. But I want that it rises all the time.
Do you have a solution for my problem!?
Thanks a lot for your help!
Posted: Tue May 04, 2010 4:18 pm
by tomfid
The problem is that the DELAY functions initialize the internal state of the delay (which is basically a chain of a bunch of levels) to a constant rather than some presumed historical profile of the inflow. One solution would be to create an explicit chain of levels, which you could then initialize as needed. Another option - probably easier - would be to override the output of the delay for the first 20 years of your simulation. For example:
output = IF THEN ELSE( time-INITIAL TIME < delayDuration, historic input, dynamic delay)
historic input = (whatever you think the profile should be)
dynamic delay = DELAY FIXED( input, delayDuration, initVal )
initVal could be whatever you want, since the IF in the output equation will override it anyway.
Tom
Posted: Wed May 05, 2010 9:54 am
by bob@vensim.com
You can also use DELAY CONVEYOR which allows you to specify the time profile of the initial contents of the delay using a Lookup function.
Of course the simplest solution is
output = INTEG((input - output)/smooth time,input)
but this is a first order not a fixed delay.
Posted: Wed May 05, 2010 9:59 pm
by Steven
Thanks a lot for your solution!
Steven