Page 1 of 1
"GET DATA AT TIME" function
Posted: Wed Jul 20, 2022 1:53 pm
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!
Re: "GET DATA AT TIME" function
Posted: Wed Jul 20, 2022 1:55 pm
by Administrator
What do you need to do exactly? Get data at time is only useful to get values from external datasets.
Re: "GET DATA AT TIME" function
Posted: Wed Jul 20, 2022 2:10 pm
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
Re: "GET DATA AT TIME" function
Posted: Wed Jul 20, 2022 7:34 pm
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:
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.
Re: "GET DATA AT TIME" function
Posted: Thu Jul 21, 2022 1:42 pm
by JoseG
Many thanks Tom. I will check it out