"GET DATA AT TIME" function

Use this forum to post Vensim related questions.
Post Reply
JoseG
Junior Member
Posts: 7
Joined: Mon Jul 06, 2020 8:19 am
Vensim version: PLE+

"GET DATA AT TIME" function

Post by JoseG »

Hi,

Is there any workaround to use the "GET DATA AT TIME" function? I have the PLE+ version and this function is not available.

Thanks in advance!
Administrator
Super Administrator
Posts: 4573
Joined: Wed Mar 05, 2003 3:10 am

Re: "GET DATA AT TIME" function

Post by Administrator »

What do you need to do exactly? Get data at time is only useful to get values from external datasets.
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
JoseG
Junior Member
Posts: 7
Joined: Mon Jul 06, 2020 8:19 am
Vensim version: PLE+

Re: "GET DATA AT TIME" function

Post by JoseG »

I am trying to model the dynamics of inoculum production of a fungal pathogen over the course of several cropping seasons. At the end of a given cropping season, the amount of inoculum is determined by the number of infected plants, and that inoculum will decay with time following an negative exponential funcion. My approach to model this is with one stock and two flows (one inflow and one outflow). The inflow represents the inoculum production:
production=inoculum rate*infected population

The outflow represents the decay of the inoculum as time pases:
decay=max inoculum*exp(mortality rate*time)

The stock (inoculum) equals production-decay

I am trying to set max inoculum as the value of the stock inoculum at a certain time within a given cropping season. I don't want to set max inoculum as a fix number because the value of inoculum will change from one cropping season to another, so i am looking for a function that gets the value of inoculum stock at a certain time within a cropping season
tomfid
Administrator
Posts: 3804
Joined: Wed May 24, 2006 4:54 am

Re: "GET DATA AT TIME" function

Post by tomfid »

GET DATA AT TIME wouldn't work for this anyway. Data isn't responsive to the simulation, so you can use it to chain one model to the next, but not for some kind of internal feedback.

What you want is SAMPLE IF TRUE, but that's not available in PLE either. However, you can implement it with a stock, as long as you're using Euler integration at least.

In this sample model, I've done it 3 different ways:
SAMPLE alternative 1.mdl
(3.33 KiB) Downloaded 89 times
The main difference between this and the function call is that there's a lag of one time step due to the stock integration. I suspect that's a non-issue for your case.
JoseG
Junior Member
Posts: 7
Joined: Mon Jul 06, 2020 8:19 am
Vensim version: PLE+

Re: "GET DATA AT TIME" function

Post by JoseG »

Many thanks Tom. I will check it out
Post Reply