rodeo-class: 'rodeo' Class

Description Fields Class methods See Also Examples

Description

This documents the rodeo class to represent an ODE-based model. See the rodeo-package main page or type help(package="rodeo") for an introduction to the package of the same name.

Fields

prosTbl

A data frame with fields 'name', 'unit', 'description', and 'expression' defining the process rates.

stoiTbl

A data frame with fields 'variable', 'process', and 'expression' reprenting the stoichiometry matrix in data base format.

varsTbl

A data frame with fields 'name', 'unit', 'description' declaring the state variables of the model. The declared names become valid identifiers to be used in the expression fields of prosTbl or stoiTbl.

parsTbl

A data frame of the same structure as vars declaring the parameters of the model. The declared names become valid identifiers to be used in the expression fields of prosTbl or stoiTbl.

funsTbl

A data frame of the same structure as vars declaring any functions referenced in the expression fields of prosTbl or stoiTbl.

dim

Integer vector specifying the spatial dimensions.

vars

Numeric vector, holding values of state variables.

pars

Numeric vector, holding values of parameters.

Class methods

For most of the methods below, a separate help page is available describing its arguments and usage.

See Also

See the rodeo-package main page or type help(package="rodeo") to find the documentation of any non-class methods contained in the rodeo package.

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
# Bacteria growth in a continuous flow culture
library("deSolve")

# Creation of model object
data(vars, pars, funs, pros, stoi)
model <- rodeo$new(vars, pars, funs, pros, stoi, dim=c(1))

# Parameters, initial values
model$setPars(c(mu=0.8, half=0.1, yield= 0.1, vol=1000, flow=50, sub_in=1))
model$setVars(c(bac=0.01, sub=0))

# Implementation of functions declared in 'funs'
monod <- function(c,h) {c/(c+h)}

# Creation of derivatives function
code <- model$generate(name="derivs", lang="r")
derivs <- eval(parse(text=code))

# Integration
times <- 0:96
out <- deSolve::ode(y=model$getVars(), times=times, func=derivs,
  parms=model$getPars())
colnames(out) <- c("time", model$namesVars(), model$namesPros())
plot(out)

Example output



rodeo documentation built on March 28, 2021, 1:09 a.m.