pc_calculator {ecode}R Documentation

Variable Calculator In ODE Systems

Description

Calculate one or several variables during the simulation of an ODE system

Usage

pc_calculator(x, formula)

Arguments

x

the ODE system under consideration. An object of "eode" class.

formula

formula that specifies how to calculate the variable to be traced.

Value

an object of "pc" class with extra variables being attached.

Examples

eq1 <- function(x, y, r1 = 4, a11 = 1, a12 = 2) (r1 - a11 * x - a12 * y) * x
eq2 <- function(x, y, r2 = 1, a21 = 2, a22 = 1) (r2 - a21 * x - a22 * y) * y
x <- eode(dxdt = eq1, dydt = eq2, constraint = c("x<100", "y<100"))
pc <- eode_proj(x, value0 = pp(list(x = 0.2, y = 0.1)), N = 100)
pc_calculator(pc, formula = "z = x + y")

[Package ecode version 0.1.0 Index]