Capture single data points from a data variable

Use this forum to post Vensim related questions.
Post Reply
WayneZhou2009
Senior Member
Posts: 105
Joined: Wed Oct 25, 2017 3:52 pm
Vensim version: PRO

Capture single data points from a data variable

Post by WayneZhou2009 »

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
Attachments
Fraction per year (using SAMPLE IF TRUE).png
Fraction per year (using SAMPLE IF TRUE).png (90 KiB) Viewed 2827 times
Fraction per year (using GET DATA AT TIME).png
Fraction per year (using GET DATA AT TIME).png (15.09 KiB) Viewed 2827 times
Profile.png
Profile.png (11.3 KiB) Viewed 2827 times
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Capture single data points from a data variable

Post by Administrator »

I don't understand what you want to do.

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
WayneZhou2009
Senior Member
Posts: 105
Joined: Wed Oct 25, 2017 3:52 pm
Vensim version: PRO

Re: Capture single data points from a data variable

Post by WayneZhou2009 »

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.
WayneZhou2009
Senior Member
Posts: 105
Joined: Wed Oct 25, 2017 3:52 pm
Vensim version: PRO

Re: Capture single data points from a data variable

Post by WayneZhou2009 »

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.
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: Capture single data points from a data variable

Post by Administrator »

WayneZhou2009 wrote: When putting all these data points together in one graph, their shape looks like the bell shape - the original profile.
So why is GET DATA AT TIME not working for you?
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
tomfid
Administrator
Posts: 3806
Joined: Wed May 24, 2006 4:54 am

Re: Capture single data points from a data variable

Post by tomfid »

Wrap the GET DATA AT TIME in INITIAL and use the Bar Histogram to display it?
Post Reply