time deley

Use this forum to post Vensim related questions.
Post Reply
oludot5
Member
Posts: 23
Joined: Thu Aug 16, 2012 12:01 pm
Vensim version: PLE+

time deley

Post by oludot5 »

Hi, a bit of help needed pls. In this model example, the levels "incomings" "worked" and posted work ideally need not be levels but for some behavioral explanation I made them to be. Therefore, I need to analyze the behavior of these levels concurrently.is there anyway I can remove the time delays of the rates into the succeeding levels so all the levels have an output at time on the output display1 e.g in my model at time =1 worked = 36 and posted work = 32.4 , instead of this happening at times 2 and 3 respectively. I know this is theoretically not correct, I however need it for some explanations.Thanks
Attachments
example.mdl
(20.04 KiB) Downloaded 272 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: time deley

Post by tomfid »

You can violate diagramming conventions by using an auxiliary (i.e. instantaneous) variable and showing it with a box on the diagram.

Either,

- right-click an auxiliary on the diagram, and change its shape to "box"

or,

- in a level variable, using the equation editor, change the variable type to "auxiliary"
oludot5
Member
Posts: 23
Joined: Thu Aug 16, 2012 12:01 pm
Vensim version: PLE+

Re: time deley

Post by oludot5 »

many thanks Tom, however, I tried it as u described in the attached model but still have a problem. The first boxed axillary variable still sees "rate" as an outflow,which I would have though shouldn't be so since "goat" is technically not a level anymore Because of this, the equation of "goat" requires relationship with "rate". Is there anyway this "rate " can be disregarded as an outflow,while still being present in the model??Thanks a lot
Attachments
level to auxillary.mdl
(1.55 KiB) Downloaded 276 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: time deley

Post by tomfid »

There are two options - use the :IGNORE: keyword, or just use the variable in the equation, multiplied by zero - for example,

fakeStock = inputA*inputB + 0*ignoredRate
oludot5
Member
Posts: 23
Joined: Thu Aug 16, 2012 12:01 pm
Vensim version: PLE+

Re: time deley

Post by oludot5 »

tnx for d reply, however, the ignored rate is a function of the fake stock so I still get errors "simultaneous equations involving "rate" and "cow" is not used in the model
Attachments
level to auxillary.mdl
(1.79 KiB) Downloaded 271 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: time deley

Post by tomfid »

You could probably break the simultaneity by using 0*SMOOTHi(input,1,1) instead of just input. The smooth contains an internal level, and initializing it to a constant will break the simultaneity.
oludot5
Member
Posts: 23
Joined: Thu Aug 16, 2012 12:01 pm
Vensim version: PLE+

Re: time deley

Post by oludot5 »

Could you pls help with d smooth function usage in the context of the model example?I have tried it as u explained but am still getting the errors...sorry for being a pain...appreciate.
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: time deley

Post by tomfid »

level to auxillary-2.mdl
(1.86 KiB) Downloaded 349 times
oludot5
Member
Posts: 23
Joined: Thu Aug 16, 2012 12:01 pm
Vensim version: PLE+

Re: time deley

Post by oludot5 »

GOD bless u
maziar
Junior Member
Posts: 2
Joined: Fri Jul 19, 2013 5:29 am
Vensim version: PLE

Re: time deley

Post by maziar »

Dear Tom,
I also have such a problem. In my model, I should have a rate which inserts flow to a level.
I could not understand why there is delay between rate and level (the level behaves ONE Timestep after rate).

In contrast to "oludot5", I should use the level here because I need to save the accumulated values here.

Is there any way to avoid this imposed delay? Or fixing it or adjust it? This delay propagates through my model because I have several Interconnecting rates and level.

Thank you very much
Attachments
Rate 2 Lelel DELAY.PNG
Rate 2 Lelel DELAY.PNG (19.95 KiB) Viewed 7745 times
Rate 2 Lelel DELAY.mdl
(1.8 KiB) Downloaded 265 times
tomfid
Administrator
Posts: 3811
Joined: Wed May 24, 2006 4:54 am

Re: time deley

Post by tomfid »

A time step lag in state updates is a pretty fundamental property of ODE systems, not to mention real physical systems. What are you trying to model that requires cascading instantaneous updates?
LAUJJL
Senior Member
Posts: 1427
Joined: Fri May 23, 2003 10:09 am
Vensim version: DSS

Re: time deley

Post by LAUJJL »

Hi

If you want to avoid the level delay, which in my cases happens very often use the joined simplistic model.

But be careful if you use the value of the level at the end of the period, to calculate some other auxiliaries. You must verify that it does represent correctly the reality.

I generally use this possibility as a supplemeentary information that does not participate to the overall dynamic of the system and if I decide to do it nevertheless it is with extreme care.

By doing it, you take the risk of reversing the time causality, and make the future influence the present. Or you need to replace the future by an expected future, whch is allright.

Regards.

JJ
Attachments
avoiding_level_delay.mdl
(1.83 KiB) Downloaded 263 times
maziar
Junior Member
Posts: 2
Joined: Fri Jul 19, 2013 5:29 am
Vensim version: PLE

Re: time deley

Post by maziar »

tomfid wrote:A time step lag in state updates is a pretty fundamental property of ODE systems, not to mention real physical systems. What are you trying to model that requires cascading instantaneous updates?
Dear Tom,
I do apologize due to my delay in answer.

Due to your question regarding my model (which needed that Level act simultaneously when Rate injected without TIME STEP lag.
Here I have three activities:

Both Activities A and Activity B that their start is triggers by a Mile Stone Called “Mile stone i”. The “Initial Pulse” variable acts at the start of simulation.
Both Activities A and Activity B should finish then Activity C can start. In other words, the relation between them is FS (Finish to Start). So we suppose a mile stone than triggers Activity C when assured both Activity A and Activity B finished. Here, I need to synthesis a memory which helps to alarm just when the latest Activity (B or C) finished.
I tried to define a Level which accumulate Pulses from Activity A and B (two pulse with amplitude=1) and just when the Level reaches “2” model understands that the time is to trigger Activity C. so the Output Rate “Mile Stone i+1” activates and do Empty the Level by a pulse. This pulse has a dual role:
1-To Trigger Activity C to Starting.
2-To empty the Level. It needed to be empty at each processing cycle to be ready for next processing cycle.

Other steps are not under question the Activity C acts as its delay imposed to it. To starting A and B for next Cycle, they needed to be informed by “Mile stone i”.
As you see the TIME STEP lag is imposed. I agree that in many real systems we have delay between rate and it’s following Level. But here I need to define a Finish to Start relation.
Is there any other way to avoid such imposed delays?

The trick which LAUJJL Introduced is represented bellow the main model. Which my problem remains in other side. As you see in the Graph 2. How can I generate a pulse just when variable “” gets the peak?
The peak, here, is not an event and it has duration!
Attachments
Finish to Start relation 01.mdl
(4.3 KiB) Downloaded 250 times
Capture.PNG
Capture.PNG (55.82 KiB) Viewed 7647 times
Post Reply