PSUmodeling / Cycles

Cycles agroecosystem model
https://psumodeling.github.io/Cycles/
Other
12 stars 0 forks source link

Daily simulations for reactive management #34

Open zuzuba opened 2 years ago

zuzuba commented 2 years ago

Hi there,

I am using Cycles to explore different reactive management policies. Ideally, I would like to simulate the growth process for a given time interval (e.g. a day or a week), check the current status of the crop, and make a management decision (e.g. N fertilization) based on that. This is different from the current management specification where everything must be determined prior to the beginning of the simulation.

Is there a way to achieve this by, for example, simulating for a single week, modifying the management file and resuming the simulation from where it was?

Thanks a lot for your help!

kemanian commented 2 years ago

Zuzuba,

with the model as is, you can use the option reinit file to force new inputs into any soil layer. But it does not allow a conditional decision as you want to. You can get around it, but using the automatic N option, see what it does, and then redo the simulation by forcing a similar management through the reinit file. The only conditional management option that is available for users is planting (temperature, soil moisture), and that gives you an idea on where we are going with this.

The full set of conditional management is something that we need to implement for public use, but we have not had that sustained demand yet for such service. We have internal Cycles versions that handle some other conditional management.

What are you using the model for if you can share? We may consider expanding the set of conditional management options.

Armen

On Wed, Nov 24, 2021 at 9:27 AM zuzuba @.***> wrote:

Hi there,

I am using Cycles to explore different reactive management policies. Ideally, I would like to simulate the growth process for a given time interval (e.g. a day or a week), check the current status of the crop, and make a management decision (e.g. N fertilization) based on that. This is different from the current management specification where everything must be determined prior to the beginning of the simulation.

Is there a way to achieve this by, for example, simulating for a single week, modifying the management file and resuming the simulation from where it was?

Thanks a lot for your help!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PSUmodeling/Cycles/issues/34, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACQMHAEGYUSRMURDRAKXXITUNTY6HANCNFSM5IWGWR4A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

zuzuba commented 2 years ago

Hi Armen,

Thanks a lot for the reply and sorry for my delay.

I am trying to use reinforcement learning to learn management policies by interacting with the simulator. As you say, this can be done off the shelf when it comes to planting by specifying the temperature and moisture conditions. However, this is not possible with operations such as tillage, irrigation, and fertilization.

In my application, I have two scenarios: single and multi year management. Single-year is the fast scenario that allows me to try out new ideas quickly, while multi-year is the real benchmark. So far, I am focusing on the first.

In my understanding of Cycles, the reinit file allows resetting the soil condition to specific values as they were obtained from another simulation. However, the minimum simulation length is one year. In this sense, the strategy with the reinit file can be useful for the multi-year setting. Nonetheless, it does not seem like it can be used to implement reactive policies for the single-year case as I would always need to simulate the whole year.

A naive way of simulating a single year with a reactive policy and a time unit of one week is to run 52 simulations sequentially. After running the n^th simulation, I can read from the output files the condition of the crop, the weather, and the soil at the end of week n, use this information to make management decisions, write a new operation file and restart the simulation to advance to week n+1 and repeat. One obvious improvement is to avoid repeating the simulation in case the management decision is "do nothing" and simply read the values for week n+1 from the output files to advance. Despite this small improvement, this process is still quite wasteful and I am wondering if there is a better way to do this.

Thanks a lot.

Matteo

shiyuning commented 2 years ago

Hi Matteo @zuzuba ,

Thanks for your suggestion. We will add the capability of simulating sub-annually and restarting the model in the next version. By the way, the model supports automatic irrigation, which you can try now. Future development will add automatic fertilizer application based on soil conditions and crop development.

Your research sounds really interesting and we would be very interested to learn the outcome! We will be glad to help.

Cheers,

Yuning