Defining Variables over time

Use this forum to post Vensim related questions.
Post Reply
fel-vene
Junior Member
Posts: 10
Joined: Mon Dec 07, 2009 1:36 pm

Defining Variables over time

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

Post by Administrator »

A lookup table might be the easiest thing here.

Tony.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post 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))
fel-vene
Junior Member
Posts: 10
Joined: Mon Dec 07, 2009 1:36 pm

Post 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?
Felipe Venegas
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

Post 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).
fel-vene
Junior Member
Posts: 10
Joined: Mon Dec 07, 2009 1:36 pm

Post 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!
Felipe Venegas
Post Reply