Learn R Programming

mrgsolve (version 0.8.9)

stime,mrgmod-method: Create a simtime object.

Description

simtime objects allow the user to specify simulation start and end times, along with the simulation time step.

Usage

# S4 method for mrgmod
stime(x, ...)

tgrid(start = 0, end = 24, delta = 1, add = numeric(0), .offset = 0, .scale = 1, ...)

# S4 method for tgrid stime(x, ...)

# S4 method for tgrids stime(x, ...)

# S4 method for numeric stime(x, ...)

# S4 method for tgrid show(object)

# S4 method for tgrids show(object)

Arguments

x

tgrid object

...

passed on to other methods

start

simulation start time

end

simulation end time

delta

simulation time step

add

addition simulation times

.offset

the resulting set of times will be adjusted by this amount

.scale

the resulting set of times will be scaled by this factor

object

passed to show

Examples

Run this code
# NOT RUN {
peak <- tgrid(0,6,0.2)
sparse <- tgrid(0,24,4)

day1 <- c(peak,sparse)

design <- c(day1, day1+72, day1+240)

# }
# NOT RUN {
mod <- mrgsolve:::house()

out <- mod %>% ev(amt=1000, ii=24, addl=10) %>% mrgsim(tgrid=design)

plot(out,CP~., type='b')
# }

Run the code above in your browser using DataLab