Hi,
I have a model with a data variable called profile, which is taken from an Excel using GET XLS DATA function. I want to get data point from this profile for each single year, which will be passed to another variable in the same model. In other words, for any single year, only 1 data point taken from the profile is needed.
I tried to GET DATA AT TIME but it returns constant values throughout the whole period. I also tried SAMPLE IF TRUE but, while it does capture the data point for each year, however the value of that data point is held constant for the remaining period (rather than drops to zero).
The graphs for the profile and results from GET DATA AT TIME and SAMPLE IF TRUE are attached, for reference.
Could someone point me in the right direction please? Many thanks.
WZ
Capture single data points from a data variable
-
- Senior Member
- Posts: 105
- Joined: Wed Oct 25, 2017 3:52 pm
- Vensim version: PRO
Capture single data points from a data variable
- Attachments
-
- Fraction per year (using SAMPLE IF TRUE).png (90 KiB) Viewed 2842 times
-
- Fraction per year (using GET DATA AT TIME).png (15.09 KiB) Viewed 2842 times
-
- Profile.png (11.3 KiB) Viewed 2842 times
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Capture single data points from a data variable
I don't understand what you want to do.
GET DATA AT TIME should get the value if it comes in from Excel.
GET DATA AT TIME should get the value if it comes in from Excel.
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
-
- Senior Member
- Posts: 105
- Joined: Wed Oct 25, 2017 3:52 pm
- Vensim version: PRO
Re: Capture single data points from a data variable
Thanks. I want to get the fraction per year, i.e. those horizontal lines in the first graph shall all disappear. For each single year, it is a pulse, i.e. just one data point. The peripheral of these pulse is like the curve shown in the third graph (profile).
Administrator wrote:I don't understand what you want to do.
GET DATA AT TIME should get the value if it comes in from Excel.
-
- Senior Member
- Posts: 105
- Joined: Wed Oct 25, 2017 3:52 pm
- Vensim version: PRO
Re: Capture single data points from a data variable
Sorry I did not make myself clear enough. The fraction per year is a subscripted variable. Each subscript correspond to one year (one time step). So, for example, for year 10, fraction per year [year 10] should have only one single data point, something like 0.001; for year 10, fraction per year [year 45] should have only one single data point, something like 0.025; and so on. When putting all these data points together in one graph, their shape looks like the bell shape - the original profile.
WayneZhou2009 wrote:Thanks. I want to get the fraction per year, i.e. those horizontal lines in the first graph shall all disappear. For each single year, it is a pulse, i.e. just one data point. The peripheral of these pulse is like the curve shown in the third graph (profile).
Administrator wrote:I don't understand what you want to do.
GET DATA AT TIME should get the value if it comes in from Excel.
-
- Super Administrator
- Posts: 4590
- Joined: Wed Mar 05, 2003 3:10 am
Re: Capture single data points from a data variable
So why is GET DATA AT TIME not working for you?WayneZhou2009 wrote: When putting all these data points together in one graph, their shape looks like the bell shape - the original profile.
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: Capture single data points from a data variable
Wrap the GET DATA AT TIME in INITIAL and use the Bar Histogram to display it?
/*
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
*/