Content page for the submodel templates that Robert, Mark and Jonathan will make for the 29th Feb.
There is a lot of overlap with Tips and tricks that we will try to sort out at the meeting Wednesday 27 Feb.
We decided that Tips and tricks (How to) should refer to a template if available
I've used version 5 so far so should redo them [jonthanm].
The actual template should probably be a fragment
Robert wrote:
My approach is based on instantiating only those parts of the template which are critical to its functioning. All other bits are left red. This is a signal to the user, so they can see which bits they ned to tie in to their own model.
I think there is a separate issue about having a working example for each template, but I think that the template itself should oblige the user to instantiate non-template parts.
Complex templates should have a full working example as users will probably have to play with a working example to be able to use the template, e.g. ABM templates.
Jonathan's model templates.
This template represents an agent or individual moving over a surface represented by a grid, for example, animals (agents) moving through vegetation represented by a grid to air parcels moving over a surface in a Langrangian model.
Attachment | Size |
---|---|
AgentInPatch.png | 25.13 KB |
AgentInPatch.sml | 370.11 KB |
This very simple template of just 5 elements (2 input parameters and 3 variables) is a scheme for roughly estimating the average temperature during the day and during the night.
Excerpt from PnET
Aber, J.D. and C.A. Federer. 1992. A generalized, lumped-parameter model of photosynthesis, evapotranspiration and net primary production in temperate and boreal forest ecosystems. Oecologia 92:463-474
Variable Tave
Tave = (tmin+tmax)/2.0
Variable Tday
Tday = (tmax+Tave)/2.0
Variable Tnight
Tnight = (Tave+tmin)/2.0
Variable tmax
tmax = Variable parameter
Minimum = -50, Maximum = 50
Variable tmin
tmin = Variable parameter
Minimum = -50, Maximum = 50
Attachment | Size |
---|---|
TdayTnightFromTmaxTmin.png | 8.71 KB |
TdayTnightFromTmaxTmin.sml | 42.83 KB |
These are Robert's templates.
My approach is based on instantiating only those parts of the template which are critical to its functioning. All other bits are left red. This is a signal to the user, so they can see which bits they ned to tie in to their own model.
I think there is a separate issue about having a working example for each template, but I think that the template itself should oblige the user to instantiate non-template parts.
This model addresses the following problem:
You have a physical container with two substances, say water and salt. You know the expression which governs the flow of water out of the container, and need to work out the rate at which salt flows out.
Assuming that the salt in the outflow is at the same concentration as the salt in the container, the answer is to work out the salt concentration in the container, then use this, along with the water outflow, to calculate the rate of salt outflow.
Note that a single physical container is modelled using two Simile compartments.
In the template, the two substances are represented by substance1 (water) and substance2 (salt).
This template can be daisy-chained, to represent a chain of containers. This can represent, for example, a food chain, where substance1 is biomass, and substance2 is some trace substance, e.g. DDT. In this case, you would almost certainly want to have a separate outflow from each container, but only from the substance1 compartment, representing the loss of biomass through metabolic respiration, with the DDT being left behind. This would result in an increase in the concentration of DDT as youmove along the food chain.
Attachment | Size |
---|---|
concentration_dependent_outflow_diagram.gif | 3.46 KB |
This template is for modelling the flow of some substance between multiple layers. A typical application would be for modelling the flow of, for example, water or heat between soil layers.
The basic idea is to have a multiple-instance submodel for the layers, with each instance representing a single layer. Each layer has a single compartment (stock) representing the amount of substance in that layer. At least two flows are associated with teh compartment, an inflow representing the rate at which the substance flows into the layer from the layer above, and an outflow representing the rate at which the substance flows into the layer below.
I say "at least two flows...", because the modeller might choose to add additonal flows, e.g. for rainfall into the first layer and drainage flow out of the last layer. Alternatively, the inflow into the top layer can be considered to be rainfall, and the outflow from the bottom layer can be considered to be drainage out of the system.
We need to link the outflows and inflows of neighbouring layers together, so that the inflow of layer i+1 is set equal to the outflow of layer i (counting the top layer as number 1). There are two ways of doing this. One method is to use an array variable outside the submodel: this should be illustrated in another template. In this template, however, we use an association submodel to link neighbouring layers together. This has considerable benefits when there are many layers, since Simile needs to handle only as many values as there are interflows between layers.
Below/condition = layer_number_lower==layer_number_upper+1
Below/interflow = outflow_lower
Layer/inflow = sum({interflow_upper})
Attachment | Size |
---|---|
flow_between_layers_diagram.gif | 5.08 KB |