Learn R Programming

seeds (version 0.9.1)

nominalSol: Calculate the nominal solution of the model

Description

After an model is defined it can be evaluated. This returns the numerical solution for the state equation before hidden inputs are calculated.

Usage

nominalSol(odeModel)

# S4 method for odeModel nominalSol(odeModel)

Arguments

odeModel

a object of the class ode model describing the experiment

Value

a matrix with the numeric solution to the nominal ode equation

Examples

Run this code
# NOT RUN {
lotka_voltera <- function (t, x, parameters) {
with(as.list(c(x,parameters)), {
 dx1 = x[1]*(alpha - beta*x[2])
  dx2 = -x[2]*(gamma - delta*x[1])
 return(list(c(dx1, dx2)))
})
}

pars <- c(alpha = 2, beta = .5, gamma = .2, delta = .6)
init_state <- c(x1 = 10, x2 = 10)
time <- seq(0, 100, by = 1)
lotVolModel = odeModel(func = lotka_voltera, parms = pars, times = time, y = init_state)
nominalSol(lotVolModel) 

# }

Run the code above in your browser using DataLab