Page 1 of 1
Defining Variables over time
Posted: Wed Jan 06, 2010 11:22 pm
by fel-vene
Hello
I have a very simple question:
¿How do I make a variable to take certain values over time?
For example:
Variable 1 = 5
Variable 2 = 6
Variable 3 = 10
Variable A = during the first period of simulation (e.g. 1 day) takes the value of Variable 1 (5), during the second interval takes the value of Variable 2 (6) and during the last interval takes the value of Variable 3 (10)
thank you!!:D
Posted: Wed Jan 06, 2010 11:29 pm
by Administrator
A lookup table might be the easiest thing here.
Tony.
Posted: Thu Jan 07, 2010 11:23 am
by bob@vensim.com
You can use somthing like
var = IF THEN ELSE(time >= last period, v3,
IF THEN ELSE(time >= second period, v2,v1))
Posted: Fri Jan 08, 2010 12:48 am
by fel-vene
Thank you guys!!
I am going to implement them right now in my model (in a smaller intance), but before it brings me another question:
If I want to assign one value for each day to a variable (and my model runs 120 days) I dont know if there is a faster way to do it. The values itself are not important because next I am going to optimize them under certain policies and hopefuly Vensim will help me to find the "best" values for that variable to take each day...
Any ideas?
Posted: Fri Jan 08, 2010 12:28 pm
by bob@vensim.com
For this use VECTOR LOOKUP with Time/Unit Time as the input and a subscript with 120 values - one for each day. This may not optimize very well (lot of parameters, underconstrained, no continuity requirements).
Posted: Fri Jan 08, 2010 7:11 pm
by fel-vene
Thank you very much Bob,
I am not sure of how to use Vector lookups and I was hoping that maybe there was another possibility of not using this function but I am seeing that there is not much a choise.
If you can help me with this, please comment on a thread I post today about Lookup functions.... I would really appreaciate it!