You are here

Submodel to generate monthly values within model operating at annual time scale

Hi there

I am trying to formulate a submodel to generate monthly soil moisture values. Each monthly value is based on the previous month's value and then the amount  of water tranpired and precipitation from the previous month. The monthly soil moisture content is an input into the equation for water transpired for the same month however. To overcome the circular argument for soil moisture and water transpired have used influence arrows for values generated in the same time step from monthly water transpired to each monthly soil moisture content.  Do I need to make the arrows between each of the successive months be set for values generated in the same time step too as this is operating on a monthly scale and my overall model is on an annual scale?

 

Also, since the January value will be set from December in the previous year, should I use the last() function?

 

Thanks

Katy

Forums: 

 

Are you trying to model the monthly soil moisture without using a compartment? The easiest way to model this would be to use a compartment with precipitation as a flow in and transpiration as a flow out. The compartment then handles the monthly soil moisture value as based on the previous month's value. You would put all the model elements that you want to work in a monthly time step in a sub-model and set that sub-model to use time index 2 (assuming the outer model is running in the default time step 1).

Diagram of Submodel to generate monthly values within model operating at annual time scale

Equations

Model Desktop1
    Enumerated types: []

Submodel monthly
    Time step index: 2
    Enumerated types: []
 
Compartment   water
    Initial value = 10
   
    Rate of change =  + precip - transp
 
Flow   precip
    precip =         rand_var(0,120)
   
 
Flow   transp
    transp =         water*rand_var(0,1)
   

Results