Page 1 of 1
Save Data for later use
Posted: Tue Jun 26, 2007 5:38 pm
by jonnieb
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
Posted: Wed Jun 27, 2007 10:13 am
by bob@vensim.com
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
Posted: Wed Jun 27, 2007 7:33 pm
by jonnieb
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
Posted: Wed Jun 27, 2007 8:35 pm
by bob@vensim.com
Hi Jon,
Work through Chapter 17 of the USer's Guide. After that you can try the above equation to see if you can get them to work - note this requires Pro or DSS.
Posted: Thu Jun 28, 2007 7:44 am
by jonnieb
Hi Bob,
ahh, we only work with the students version. So there will be no possibility to use it.
Posted: Thu Jun 28, 2007 10:25 am
by bob@vensim.com
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