Learn R Programming

SimInf (version 5.1.0)

V: Extract the continuous state variables

Description

The result matrix for the real-valued continuous state. V[, j] contains the real-valued state of the system at tspan[j]. The dimension of the matrix is \(N_n\)dim(ldata)[1] \(\times\) length(tspan).

Usage

V(model)

# S4 method for SimInf_model V(model)

Arguments

model

The model to extract the result matrix from.

Value

The continuous state variables

Examples

Run this code
# NOT RUN {
## Create an 'SISe' model with 6 nodes and initialize
## it to run over 10 days.
u0 <- data.frame(S = 100:105, I = 1:6)
model <- SISe(u0 = u0, tspan = 1:10, phi = rep(0, 6),
    upsilon = 0.02, gamma = 0.1, alpha = 1, epsilon = 1.1e-5,
    beta_t1 = 0.15, beta_t2 = 0.15, beta_t3 = 0.15, beta_t4 = 0.15,
    end_t1 = 91, end_t2 = 182, end_t3 = 273, end_t4 = 365)

## Run the model
result <- run(model, threads = 1, seed = 7)

## Extract the continuous state variables in each node at the
## time-points in tspan. In the 'SISe' model, V represent the
## environmental infectious pressure phi.
V(result)
# }

Run the code above in your browser using DataLab