Skip to contents

Create an object of class fw_model.

Usage

fw_model(A, B, R)

fw_get_model(model = c("lv_fr1"))

Arguments

A

interaction matrix. A square matrix describing interactions of the system (see details).

B

biomass vector.

R

reproduction/mortality vector.

model

model to be used.

Value

An object of class fw_problem which is a named list of 4 elements:

  • A: interaction matrix

  • B: biomass vector

  • R: mortality rate vector

  • model: the underlying model

Details

So far there is only one model supported, a general Lotka-Volterra with a linear response.

Functions

  • fw_get_model(): get model

Examples

A <- rbind(c(-1, -1), c(1, 0))
R <- c(0.1, -0.05)
B <- c(0.5, 0.25)
fw_model(A, B, R)
#> $A
#>      [,1] [,2]
#> [1,]   -1   -1
#> [2,]    1    0
#> 
#> $B
#> [1] 0.50 0.25
#> 
#> $R
#> [1]  0.10 -0.05
#> 
#> $model
#> function (t, y, pars) 
#> {
#>     return(list((pars$A %*% y + pars$R) * y))
#> }
#> <bytecode: 0x55d8a1a71cd0>
#> <environment: namespace:fwebinfr>
#> 
#> $leading_ev
#> [1] 0.367635
#> 
#> attr(,"class")
#> [1] "fw_model"