Hi
I have a text file, which contains around 40 parameter value for each timestep. My intension is to read those data at every timestep during the simulation period. If anyone can help me to findout, how to read those data in Vensim from the Matrix format.
Best
Khaled
matrix
-
- Super Administrator
- Posts: 4626
- Joined: Wed Mar 05, 2003 3:10 am
Re: matrix
There is a section in the Vensim documentation that should help you, search for "Importing Data".
It might also help if you show us the format of the data you want to import. There is not much we can recommend/suggest if we cannot see what you are trying to do.
Tony.
It might also help if you show us the format of the data you want to import. There is not much we can recommend/suggest if we cannot see what you are trying to do.
Tony.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: matrix
Hi Tony
Thanks for the quick response. However, Vensim manual dosent't have much information that I am asking for.
In every time step I will get a text file and need to read those in matrix format while simulation is going on . What do you think?
Thanks for the quick response. However, Vensim manual dosent't have much information that I am asking for.
In every time step I will get a text file and need to read those in matrix format while simulation is going on . What do you think?
-
- Super Administrator
- Posts: 4626
- Joined: Wed Mar 05, 2003 3:10 am
Re: matrix
Does the text file change every time step?
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
-
- Super Administrator
- Posts: 4626
- Joined: Wed Mar 05, 2003 3:10 am
Re: matrix
If the text file does change every time step, you will need to write some external functions to do this.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: matrix
If you want to use a different text file every time step, but the files themselves don't change during the simulation, you could do one of the following:
- import each text file to a separate data variable; then have a switch in the model that chooses the appropriate variable at each time step (this would probably be a lot easier using arrays)
- aggregate all of your text files into a spreadsheet with multiple tabs, and access the data with the GET XLS functions
- import each text file to a separate data variable; then have a switch in the model that chooses the appropriate variable at each time step (this would probably be a lot easier using arrays)
- aggregate all of your text files into a spreadsheet with multiple tabs, and access the data with the GET XLS functions
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Re: matrix
Hi Tony
Thanks for the reply. Actually its a single *.txt file which is updated in each time step. It seems that I have to use external function but couldn't figure it out. Do you have any advice for me?
Thanks again
Thanks for the reply. Actually its a single *.txt file which is updated in each time step. It seems that I have to use external function but couldn't figure it out. Do you have any advice for me?
Thanks again
-
- Super Administrator
- Posts: 4626
- Joined: Wed Mar 05, 2003 3:10 am
Re: matrix
What was the problem you couldn't work out?
There is sample external function code that ships with Vensim.
Search for the files
VENEXT.DEF
VENEXT.C
VENEXT6.DSP
VENEXT6.DSW
VENEXT6.DSW is a Microsoft Visual Studio workspace. Open it and build the DLL. VENEXT.C is commented to show what to do to build functions.
Tony.
There is sample external function code that ships with Vensim.
Search for the files
VENEXT.DEF
VENEXT.C
VENEXT6.DSP
VENEXT6.DSW
VENEXT6.DSW is a Microsoft Visual Studio workspace. Open it and build the DLL. VENEXT.C is commented to show what to do to build functions.
Tony.
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
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Units are important!
http://www.bbc.co.uk/news/magazine-27509559
Re: matrix
What are you trying to accomplish? How is an updated .txt file being generated in sync with the model, if you aren't already using an external function?
Tom
Tom
/*
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/
Advice to posters (it really helps us to help you)
http://www.ventanasystems.co.uk/forum/v ... f=2&t=4391
Blog: http://blog.metasd.com
Model library: http://models.metasd.com
Bookmarks: http://delicious.com/tomfid/SystemDynamics
*/