Save Data for later use

Use this forum to post Vensim related questions.
Post Reply
jonnieb
Junior Member
Posts: 4
Joined: Thu Jun 14, 2007 9:24 pm

Save Data for later use

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

Post 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
jonnieb
Junior Member
Posts: 4
Joined: Thu Jun 14, 2007 9:24 pm

Post 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? :cool:

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

Post 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.
jonnieb
Junior Member
Posts: 4
Joined: Thu Jun 14, 2007 9:24 pm

Post by jonnieb »

Hi Bob,

ahh, we only work with the students version. So there will be no possibility to use it.
bob@vensim.com
Senior Member
Posts: 1107
Joined: Wed Mar 12, 2003 2:46 pm

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