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,
    trait_input,
    θ_type,
    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. Each plant species gets an equal share of the initial biomass. The height is set to half of the maximum height of the species. The above- and belowground biomass are calculated based on the aboveground biomass proportion abps.

Traits can be either specified manually, or they will be generated with a bivariate Gaussian mixture model with full covariance matrices. For each species either the first or the second Gaussian distribution is used to generate the log/logit-transformed traits. The traits are then backtransformed to the original scale and the units are added. If the proportion of the leaf mass of the total plant mass lbps is larger than 0.95 % of the proportion of the aboveground mass of the total mass abps, lbps is set to 0.95 % of abps. The Gaussian mixture model was fitted to the data with the function BayesianGaussianMixture of Pedregosa et al. (2011) to a set of grassland species that was found in Germany in the Biodiversity Exploratories. Here, you can get an overview of the transformation of the traits:

traitdescriptiontransformation
slasspecific leaf area [m² g⁻¹]log
maxheightspotential plant height [m]log
lncsleaf nitrogen content per leaf dry mass [mg g⁻¹]log
rsasroot surface area per belowground biomass [m² g⁻¹]log
amcsarbuscular mycorrhizal colonisation rate [-]logit
abpsaboveground dry mass per plant dry mass [-]logit
lbpsleaf dry mass per plant dry mass [-]logit

API

GrasslandTraitSim.initialization Function
julia
initialization(
;
    input_obj,
    p,
    prealloc,
    trait_input,
    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

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

Generate random traits for the simulation.

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