chemostat: Chemostat Model

Description Usage Format See Also Examples

Description

simecol example: Model of continuos culture of microorganisms (chemostat).

Usage

1

Format

An S4 object according to the odeModel specification. The object contains the following slots:

main

the differential equations for substrate (S) and cells (X).

parms

a vector with the named parameters of the model:

vm

maximum growth rate of the cells,

km

half saturation constant,

Y

yield coefficient (conversion factor of substrate into cells).

D

dilution rate,

S0

substrate concentration in the inflow.

times

simulation time and integration interval.

init

vector with start values for substrate (S) and cells (X).

To see all details, please have a look into the implementation below.

See Also

simecol-package, sim, parms, init, times.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
##============================================
## Basic Usage:
##   work with the example
##============================================
data(chemostat)
plot(sim(chemostat))

parms(chemostat)["D"] <- 0.9 
plot(sim(chemostat))



##============================================
## Implementation:
##   The code of the chemostat model
##============================================
chemostat <- new("odeModel",
  main = function(time, init, parms, inputs = NULL) {
    with(as.list(c(init, parms)), {
      mu  <- vm * S/(km + S)              # Monod equation
      dx1 <- mu * X - D * X               # cells, e.g. algae
      dx2 <-  D *(S0 - S) - 1/Y * mu * X  # substrate, e.g. phosphorus
      list(c(dx1, dx2))
    })
  },
  parms = c(
    vm = 1.0,           # max growth rate, 1/d
    km = 2.0,           # half saturation constant, mumol / L
    Y  = 100,           # cells /mumol Substrate
    D  = 0.5,           # dilution rate, 1/d
    S0 = 10             # substrate in inflow, mumol / L
  ),
  times = c(from=0, to=40, by=.5),
  init  = c(X=10, S=10), # cells / L; Substrate umol / L
  solver = "lsoda"
)

simecol documentation built on June 3, 2018, 5:07 p.m.