Reporting Monthly and Annual Data from a Daily Timestep Model
In some cases, you may have a model with relatively fine temporal discretization (e.g., daily), but you are interested in time-averaged results at a courser level of temporal discretization (e.g., monthly and/or annual). This model takes a generic daily signal (in this case a rate), computes the cumulative monthly and annual values (the integral of the rate over the month and year), and outputs the monthly/annual data to a matrix. No links to external spreadsheets are used for this example.
This model integrates (accumulates) a daily signal over a period of 5 years and returns monthly and annual sums in vector and matrix formats. A new array was created and named "month_count", which represents the 12 months of the simulation year. The reason the array "Months" was not used is because those are labeled with the names of the months and the starting month of the simulation might not be January. If the starting month is October, then month_count 1 = October and month_count 12 = September. If you want to run a model for more than 5 years, simply change the array "years" to have an equal number of years to the simulation years. Much of the work is being done in the populate_matrix element, where a matrix is being stuffed with values conditionally.
Download the model file
Screen capture of the model:
See AlsoOutputting Monthly Data from a Model With Daily Timesteps (Spreadsheet Link)
Other general GoldSim models
Other Water Resources models