Skip to content

pmaldona/com_assembly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Ecological Community Assembly

A Matlab class that generates an ecological community assembly by adding species in function of their trophic relation.

Contents

Class

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.

Constructor NT_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)

Inputs

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. al Tr_init.m
  • cp Fraction of added competitive interactions of the Community
  • fcp Force of mutual interactions of the Community
  • mu Fraction of added mutual interactions of the Community
  • fmu Force of competitive interaction of the Community
  • cm Fraction of added comensal interactions of the Community
  • fcm Force of comensal interactions of the Community
  • am Fraction added of anmensal interactions of the Community
  • fam Force of anmensal interactions of the Community
  • an Fraction of added trophic interaction of the Community (that aren't in Tr)
  • fan Force of added trophic interaction of the Community
  • dnt 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 level
  • mit Mean of the distance between interact species of added interactions , in units of normalized trophic level
  • fas Asymmetric force
  • mntiCoefficients mean of added interactions
  • nbf Non basal diagonal factor
  • sg Non diagonal values standard deviation
  • sgd Diagonal values standard deviation
  • tsp 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 (if tr_cal is true)
  • dr Range of acceptance for resilience(res dr, if tr_cal is true)
  • bc basal Competition (bool value, that if it's true, add competition between basal species)

Model

Our goal is analize the stablitiy and feasibility of matrix a bases dynamics ecology system model. Where the vector biomases a determined by:

img

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:

img

where is the normalized trophic level (Livine) of species , correspond to the dfn function (matlab @ call), and and correspond to mitand 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:

img

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.

Outputs

The output constitute a structure that contain a set of properties and variables that builds the community, The strucutre is sparatre by type data:

Matrices
  • adj Adjoint matrix of the community
  • com Community matrix ()
  • tr Trophic matrix
  • tr_i Trophic skeleton
  • tp Type interaction matrix
  • coef_C matrix coeficients
  • coef_b matrix coeficients
Vectors
Doubles
  • cp Porcentage of competitive interactions
  • mu Porcentage of mutual interactions
  • am Porcentage of amensal interactions
  • cm Porcentage of comensal interactions
  • an Porcentage of trophic interactions
  • res Community resilience ()
  • res_tr Trophic skeleton community resilence ()
  • con Community connectance
  • con_tr Trophic skeleton community connectance
  • me Average total interaction faced for one species Barbier & Arnoldi
  • me_trAverage total interaction faced for one species of trophic skeleton community Barbier & Arnoldi
  • gama Carring capacity deviation Barbier & Arnoldi
  • var Total interaction deviation faced for one species Barbier & Arnoldi
  • var_tr Total interaction deviation faced for one species of trophic skeleton community Barbier & Arnoldi
  • eta reciprocal interaction effect Barbier & Arnoldi
  • eta_tr reciprocal interaction effect of trophic skeleton community Barbier & Arnoldi
  • bas number of basal species of the community
  • L minimal of biomasses
  • L_tr minimal of biomasses of the trophic skeleton community
Bools
  • mst True if community is a aster one (first constructed)
  • est True if community is locally stable
  • F True if community is feasible
  • bc True if there are competition between basal species

Init assambly NT_SubCommunity_init_Links

Call: Sc=NT_SubComunity_init_Links(C,S)

Inputs

  • S Number of desire species on sub-community
  • C Master community Class object

Model

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.).

Outputs

Returns a class object as constructor NT_community

Add to assambly NT_SubComunity_add_Links

Call: Sc=NT_SubComunity_add_Links(Si,C,S)

Inputs

  • S Number of desire species to add
  • C Master community Class object
  • Si Sub-community Class object

Model

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

Outputs

Returns a class object as constructor NT_community

About

Ecological Community Assembly

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages