Page 1 of 1

lookup

Posted: Fri Mar 08, 2013 1:12 pm
by oludot5
hi there,

Please, is there a way I can create a lookup to accept the time step as the input?say, for example, A= 8 for time 1, A= 6 for time 2.....

Re: lookup

Posted: Fri Mar 08, 2013 1:36 pm
by Administrator
Try this (you will need to add more x/y pairs if you want a lookup for every time in the model).

Code: Select all

lookup table ( (1,8) , (2,6) )

Re: lookup

Posted: Fri Mar 08, 2013 2:39 pm
by tomfid

Re: lookup

Posted: Fri Mar 08, 2013 5:02 pm
by oludot5
tnx, but what variable name do I give the time step (round of simulation) in the lookup function...I still dont get how the lookup variable will accept each iterative time count as the input to produce the lookup output

Re: lookup

Posted: Fri Mar 08, 2013 5:47 pm
by Administrator
Is this what you mean?

Code: Select all

lookup table ( (1,8) , (2,6) )

lookup result = lookup table ( time )

Re: lookup

Posted: Sat Mar 09, 2013 8:36 am
by oludot5
thanks!

Re: lookup

Posted: Sun Mar 10, 2013 10:04 pm
by tomfid
Since Vensim is oriented toward continuous time simulation, there is no variable for the iteration number (or round) of the simulation. There's Time, which is sliced into TIME STEPs. If your TIME STEP = 1, it's easy to work out the "round", though this its typically not a good choice to rely on such a discrete count, because it will change if you change TIME STEP, which one should generally do as a test for numerical stability. Certainly there are times where discrete time is useful, but it can be tricky to rely on it in general.