A Matlab class that generates an ecological community assembly by adding species in function of their trophic relation.
The class in defined in the file NTCommunity.m
which contain the Community constructor (master community). This community has a set of parameter that describe the interaction model of the Community.
Call:
NT_community(Tr,cp,fcp,mu,fmu,cm,fcm,am,fam,dnt,an,fan,rit,mit,fas,mnti,nbf,sg,sgd,tsp,msp,max_r,tr_cal,res,dr,bc)
The inputs defines model and interaction type of the community matrix, and conditions of the grow rates:
Tr
Input trophic matrix, can be define by the Generalized Niche Model Stouffer et. alTr_init.m
cp
Fraction of added competitive interactions of the Communityfcp
Force of mutual interactions of the Communitymu
Fraction of added mutual interactions of the Communityfmu
Force of competitive interaction of the Communitycm
Fraction of added comensal interactions of the Communityfcm
Force of comensal interactions of the Communityam
Fraction added of anmensal interactions of the Communityfam
Force of anmensal interactions of the Communityan
Fraction of added trophic interaction of the Community (that aren't inTr
)fan
Force of added trophic interaction of the Communitydnt
Function for preferential added interaction position (normalized tropic level domain)rit
Range (standard deviation) of the distance between interact species of added interactions , in units of normalized trophic levelmit
Mean of the distance between interact species of added interactions , in units of normalized trophic levelfas
Asymmetric forcemnti
Coefficients mean of added interactionsnbf
Non basal diagonal factorsg
Non diagonal values standard deviationsgd
Diagonal values standard deviationtsp
Non-same interaction spending time factor (0 only same type spending , 1 all type spendig)msp
Overall spendig time factor (1 non-spending time model, 0 Holling type-1 model)max_r
Maximum value of grow-rate (imposition for LP-optimization)min_mort
Minimum value of non basal grow-rate (imposition for LP-optimization)tr_cal
Bool value to force resilience of the trophic initial community (tophic skeleton community)res
Resilience for the trophic initial community (iftr_cal
istrue
)dr
Range of acceptance for resilience(res
dr
, iftr_cal
istrue
)bc
basal Competition (bool value, that if it's true, add competition between basal species)
Our goal is analize the stablitiy and feasibility of matrix a bases dynamics ecology system model. Where the vector biomases a determined by:
Here is known as Community Matrix, and as grow rate.
In first instance, initial tropic interactions are obtained form the Tr
matrix, this will be defined as trophic skeleton. The number of species correspond to the Tr
matrix dimension. A requirement for Tr
is to be fully connected. Interactions are added by type, proportional to values cp
, mu
, cm
, am
,an
according to the total connectance . The position of interactions are randomly choose proportional to an function depends on the trophic levels if the interacting species. This function correspond to:
where is the normalized trophic level (Livine) of species , correspond to the dfn
function (matlab @
call), and and correspond to mit
and rit
respectively. In the adding interactions process, the basal species of Tr
are preserved. Finally the bool value bc
add competition between basal species.
The non-diagonal community matrix coefficients are defined by holling type I model:
is the set of all connected species with (that interact with ), and is the set of species that have same type interaction of with considering this, tp
and msp
. Coefficients and are random generated from an beta distribution multiplied by an median factor: with , here mnti
and sg
. In case that is a predation interacion, . are force of interacion, this values are taken form fcp
,fmu
, fcm
, fam
and fan
. Interactions that belongs to the Tr
matrix don't have force factor.
The diagonal elements of community matrix are randomly genereted by normal distribution with mean one and standard deviation = sgd
: . We add an bool variable nbf
that makes diagonal values for basal species zero.
Our aim is to have local stability of the community. For this it's necessary that the biomasses change rate be cero, i.e.:
so we have:
represents stability point of biomasses. At this point we have freedom of choise for the grow rates and so (biomasses), due there are related by lineal transformation. To solve this, we search the feasibility via an LP-optimization that maximize the minimal of biomasses , holding the related equality, boundig the grow rates via a Chebyshov norm, and lower bound non-basal grow rates . Here min_mort
and max_r
.
Resilience is equal to minus the maximum eigenvalue of the Jacobean evaluated at the stability point :
So, if then the community is locally stable, if then is locally unstable.
We first calculate the resilience and feasibility of the trophic skeleton community matrix, associated to their interactions (without considering added interactions). If tr_cal
= true
the program it will calculate resilience until res
dr
is reached (this step it's a little tricky because it enters in a while loop, and the program maybe can't exit the loop. It's better use tr_cal
=false
). After this, the rest interactions are adeed and feasibility and resilience calculated.
The output constitute a structure that contain a set of properties and variables that builds the community, The strucutre is sparatre by type data:
adj
Adjoint matrix of the communitycom
Community matrix ()tr
Trophic matrixtr_i
Trophic skeletontp
Type interaction matrixcoef_C
matrix coeficientscoef_b
matrix coeficients
Nv
Trophic levels vector () Livineesp
Species index vectorX
Biomasses vector at stability ()R
Grow rate vector ()k
Vector of percentage of interaction Wootton & Stoufferk_p
Vector of percentage of positive interaction Wootton & Stoufferk_m
Vector of percentage of negative interaction Wootton & Stoufferm
Vector of mean population interaction strength Wootton & Stoufferm_p
Vector of mean positive population interaction strength Wootton & Stoufferm_m
Vector of mean negative population interaction strength Wootton & Stouffera
Vector of mean percapita interaction strength Wootton & Stouffera_p
Vector of mean percapita population interaction strength Wootton & Stouffera_m
Vector of mean percapita population interaction strength Wootton & Stouffer
cp
Porcentage of competitive interactionsmu
Porcentage of mutual interactionsam
Porcentage of amensal interactionscm
Porcentage of comensal interactionsan
Porcentage of trophic interactionsres
Community resilience ()res_tr
Trophic skeleton community resilence ()con
Community connectancecon_tr
Trophic skeleton community connectanceme
Average total interaction faced for one species Barbier & Arnoldime_tr
Average total interaction faced for one species of trophic skeleton community Barbier & Arnoldigama
Carring capacity deviation Barbier & Arnoldivar
Total interaction deviation faced for one species Barbier & Arnoldivar_tr
Total interaction deviation faced for one species of trophic skeleton community Barbier & Arnoldieta
reciprocal interaction effect Barbier & Arnoldieta_tr
reciprocal interaction effect of trophic skeleton community Barbier & Arnoldibas
number of basal species of the communityL
minimal of biomassesL_tr
minimal of biomasses of the trophic skeleton community
mst
True if community is a aster one (first constructed)est
True if community is locally stableF
True if community is feasiblebc
True if there are competition between basal species
Call: Sc=NT_SubComunity_init_Links(C,S)
S
Number of desire species on sub-communityC
Master community Class object
Constructions of sub-community starts from the master community (first initialized community). The process of assembly begins by taking an basal species. Once achieved this, candidates to add are direct predators of present species or new basal ones. This algorithm iterates until the S
species are reached. The grow rates of the sub-community are directly taken from the master community C
grow rates, as a subset of the present species. Sub-Community matrix is constructed in the same way as the master community, but only considering the susbet species in the sub-community. Then biomasses is calculated via the known lineal transformation () and finally all other properties (resilience, min of biomasses, etc.).
Returns a class object as constructor NT_community
Call: Sc=NT_SubComunity_add_Links(Si,C,S)
S
Number of desire species to addC
Master community Class objectSi
Sub-community Class object
Constructor of sub-community starting of the sub-community Si
adding S
desired species from master community C
.
Has the same procedure as NT_SubCommunity_init_Links
Returns a class object as constructor NT_community