Skip to content

Model description overview

Click on the links to view detailed documentation:

On this site you can find a rather technical overview of the procedure.

Solve the difference equation

The main function to solve the difference equations and get the solution is solve_prob.

API

GrasslandTraitSim.solve_prob Function
julia
solve_prob(; input_obj, p, prealloc, callback)

Solve the model for one site.

All input variables are explained in a tutorial: How to prepare the input data to start a simulation

There is also a tutorial on the model output: How to analyse the model output

source

Initialization

The initial conditions of the state variables are set.

API

GrasslandTraitSim.initialization Function
julia
initialization(; input_obj, p, prealloc, callback)

Initialize the simulation object. The function is called once at the beginning of the simulation within solve_prob.

source
GrasslandTraitSim.set_initialconditions! Function
julia
set_initialconditions!(; container)

Set the initial conditions for the state variables.

source

Main loop

For each time step the function one_day! is executed and called from main_loop!.

API

GrasslandTraitSim.main_loop! Function
julia
main_loop!(; container)

Run the main loop for all days. Calls the function one_day! for each day and set the calculated density differences to the output variables.

source
GrasslandTraitSim.one_day! Function
julia
one_day!(; t, container)

Calculate differences of all state variables for one time step (one day).

source