rxnrate: Solving the right side of the gLV equations

View source: R/rxnrate.R

rxnrateR Documentation

Solving the right side of the gLV equations

Description

This function calculates the right side of the gLV equation.

Usage

rxnrate(State, parms)

Arguments

State

Vector with a CoDa composition

parms

Matrix. Each row has the parameters of each differential equation. following our example, parms has the parameters placed as follows:

r1 a11 a12 a13
r2 a21 a22 a23
r3 a31 a32 a33

Details

For instance, if we want to solve the following gLV equations:

\frac{dx_{1}(t)}{dt}=r_{1}\cdot x_{1}(t)+x_{1}(t)\cdot[a_{11}\cdot x_{1}(t)+a_{12}\cdot x_{2}(t)+a_{13}\cdot x_{3}(t)]

\frac{dx_{2}(t)}{dt}=r_{2}\cdot x_{2}(t)+x_{2}(t)\cdot[a_{21}\cdot x_{1}(t)+a_{22}\cdot x_{2}(t)+a_{23}\cdot x_{3}(t)]

\frac{dx_{3}(t)}{dt}=r_{3}\cdot x_{3}(t)+x_{3}(t)\cdot[a_{31}\cdot x_{1}(t)+a_{32}\cdot x_{2}(t)+a_{33}\cdot x_{3}(t)]

This function returns a vector with the value of:

r_{1}\cdot x_{1}(t)+x_{1}(t)\cdot[a_{11}\cdot x_{1}(t)+a_{12}\cdot x_{2}(t)+a_{13}\cdot x_{3}(t)]

r_{2}\cdot x_{2}(t)+x_{2}(t)\cdot[a_{21}\cdot x_{1}(t)+a_{22}\cdot x_{2}(t)+a_{23}\cdot x_{3}(t)]

r_{3}\cdot x_{3}(t)+x_{3}(t)\cdot[a_{31}\cdot x_{1}(t)+a_{32}\cdot x_{2}(t)+a_{33}\cdot x_{3}(t)]

Value

Returns a vector with the value of the right side of the gLV equations.

Examples



cinit1<-c(x1<-0.7,x2<-0.2,x3<-0.1)
parms1= cbind(c(0.1,0.2,-0.1),c(-0.2,0.1,-0.1),c(0.3,0.2,0.3),c(0.1,0.22,0.2))
rxnrate(cinit1,parms1)


CoDaLoMic documentation built on April 12, 2025, 2:18 a.m.