Time series data into Vensim

Use this forum to post Vensim related questions.
Post Reply
SionC
Member
Posts: 39
Joined: Tue Nov 18, 2008 8:44 am

Time series data into Vensim

Post by SionC »

Hi,

I would like to read time series data into Vensim. The model is subscripted and the text file I have does not contain all the variables. What is the best approach for getting the data in?

As a simple example I have this data in a text file:

Time 0 1 2 3 4 5
Variable [AAA] 1 3 5 2 5
Variable [CCC] 3 5 2 5 6

(ie Variable [BBB] is missing)

I tried converting this data into a VDF file and then using the GET VDF DATA, but Vensim wants Variable [BBB] to be present. Similarly, the GET DIRECT DATA function wants all the variables to be there as you only specify the first row with the data in it. The other complication is that I do not know what order the variables will be in and what will be missing. This is why I has hoping the GET VDF DATA function would work as Vensim queries the .vdf file.

Any help very appreciated!
tomfid
Administrator
Posts: 3808
Joined: Wed May 24, 2006 4:54 am

Re: Time series data into Vensim

Post by tomfid »

When there are missing elements, the best option is to use the Model>Import Data options to create a vdf from your text file.
Administrator
Super Administrator
Posts: 4589
Joined: Wed Mar 05, 2003 3:10 am

Re: Time series data into Vensim

Post by Administrator »

SionC wrote: Fri Oct 30, 2020 4:09 pmI tried converting this data into a VDF file and then using the GET VDF DATA, but Vensim wants Variable [BBB] to be present.
Really? It should import without issues and then just say data missing if you try and run.
Advice to posters seeking help (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391

Units are important!
http://www.bbc.co.uk/news/magazine-27509559
SionC
Member
Posts: 39
Joined: Tue Nov 18, 2008 8:44 am

Re: Time series data into Vensim

Post by SionC »

Hi,

Thanks for the super quick responses! :)

I have attached my test model. I get the following errors when I run it:

ERROR: The variable Variable[aaa] not found in file TestDataImportForum.vdfx.
ERROR: Unable to get data values for Data Variable[aaa].
ERROR: Failed to make live links to data - aborting simulation.
ERROR: Unable to correctly load in exogenous values - aborting.

I am prepared to be told that there is something really simple that I am getting wrong!
Attachments
TestModel.zip
(1.61 KiB) Downloaded 172 times
tomfid
Administrator
Posts: 3808
Joined: Wed May 24, 2006 4:54 am

Re: Time series data into Vensim

Post by tomfid »

Short answer is, don't use GET VDF. Make the variable an ordinary data variable (not a data equation) and specify the data file on the Advanced tab of the simulation control dialog.

https://www.vensim.com/documentation/usr16.htm
https://www.vensim.com/documentation/ref_data.htm
tomfid
Administrator
Posts: 3808
Joined: Wed May 24, 2006 4:54 am

Re: Time series data into Vensim

Post by tomfid »

TestModel2.zip
(4.05 KiB) Downloaded 233 times
SionC
Member
Posts: 39
Joined: Tue Nov 18, 2008 8:44 am

Re: Time series data into Vensim

Post by SionC »

Wonderful - Thanks!
Post Reply