Hi,
i built a model in which i would like to save the demand data, to look it up later in time. What i want to achieve is a function which delivers the demand data of a recent period.
E.g..:
The demand data in period 4 was 150.
In period 6, i would like to get this demand data to use it in my model.
I have the problem that i cannot use fixed delays because i would like to lookup various delay times.
Is there any possibility to save the data for every period and lookup every dataset later in time?
Best,
Jon
Save Data for later use
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
Hi Jon,
There is no function to do this during a simulation but you could simply create a vector of delayed values with an equation such as
lag : (lag1-lag100) ~~|
delayed var[lag] = INTEG(0,:NA:) ~~|
lag control = SHIFT IF TRUE(delayed var[lag1],1,ELMCOUNT(lag),0,variable of interest) ~~|
value at time = VECTOR ELM MAP(delayed var[lag],time - time at whcih value is desired) ~~|
you may need to play with that a little to get timing right (+- 1 on the VECTOR ELM MAP) but it should work.
Then
There is no function to do this during a simulation but you could simply create a vector of delayed values with an equation such as
lag : (lag1-lag100) ~~|
delayed var[lag] = INTEG(0,:NA:) ~~|
lag control = SHIFT IF TRUE(delayed var[lag1],1,ELMCOUNT(lag),0,variable of interest) ~~|
value at time = VECTOR ELM MAP(delayed var[lag],time - time at whcih value is desired) ~~|
you may need to play with that a little to get timing right (+- 1 on the VECTOR ELM MAP) but it should work.
Then
Hi Bob!
Thanks for your reply and answer. I´m sorry, but i work for the first time with vensim for a project for my studies and didn´t get how i could use this vector.
Is there any possibility to write the data in a graph and read it out of there, with time variable on the x-axis and data variable on the y-axis? So that i´m able to read out data(time)? If not, maybe you could explain the vector thing for me as a newbie?
Regards,
Jon
Thanks for your reply and answer. I´m sorry, but i work for the first time with vensim for a project for my studies and didn´t get how i could use this vector.
Is there any possibility to write the data in a graph and read it out of there, with time variable on the x-axis and data variable on the y-axis? So that i´m able to read out data(time)? If not, maybe you could explain the vector thing for me as a newbie?
Regards,
Jon
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
-
- Senior Member
- Posts: 1107
- Joined: Wed Mar 12, 2003 2:46 pm
I can't think of a practical way to do what you want without subscripts - you also may want to rethink why you are trying to do this. It is not something that would commonly be used. For System Dynamics models using a SMOOTH on past behavior almost always gives good results with little fuss. I would also recommend looking at the molecules http://www.vensim.com/molecule.html