Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

tgrid

Create a simtime object


Description

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

Usage

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

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

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

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

## S4 method for signature 'tgrid'
show(object)

## S4 method for signature 'tgrids'
show(object)

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

Arguments

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

...

passed on to other methods

x

tgrid object

object

passed to show

Examples

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')

## End(Not run)

mrgsolve

Simulate from ODE-Based Models

v0.11.1
GPL (>= 2)
Authors
Kyle T Baron [aut, cre] (<https://orcid.org/0000-0001-7252-5656>), Bill Gillespie [ctb], Charles Margossian [ctb], Devin Pastoor [ctb], Bill Denney [ctb] (<https://orcid.org/0000-0002-5759-428X>), Dilawar Singh [ctb], Felicien Le Louedec [ctb] (<https://orcid.org/0000-0003-3699-2729>), Timothy Waterhouse [ctb] (<https://orcid.org/0000-0002-0954-9660>), Metrum Research Group [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.