lookup

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+

lookup

Post 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.....
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: lookup

Post 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) )
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
tomfid
Administrator
Posts: 3816
Joined: Wed May 24, 2006 4:54 am

Re: lookup

Post by tomfid »

oludot5
Member
Posts: 23
Joined: Thu Aug 16, 2012 12:01 pm
Vensim version: PLE+

Re: lookup

Post 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
Administrator
Super Administrator
Posts: 4626
Joined: Wed Mar 05, 2003 3:10 am

Re: lookup

Post by Administrator »

Is this what you mean?

Code: Select all

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

lookup result = lookup table ( time )
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
oludot5
Member
Posts: 23
Joined: Thu Aug 16, 2012 12:01 pm
Vensim version: PLE+

Re: lookup

Post by oludot5 »

thanks!
tomfid
Administrator
Posts: 3816
Joined: Wed May 24, 2006 4:54 am

Re: lookup

Post 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.
Post Reply