Skip to contents

Administer a infusion (with duration being fixed) inside a rxode2 model

Usage

infuseDur(amt, dur, cmt = 1, ii = 0, addl = 0, ss = 0)

Arguments

amt

Numeric dose amount (for dose events) or 0 for observations. When rate > 0 this is interpreted as the total infusion amount and the infusion duration is amt / rate.

dur

Numeric infusion duration.

cmt

Integer compartment number (1-based) to which the dose is applied. Default is 1

ii

Numeric inter-dose interval. Used together with addl to schedule repeat doses at time, time + ii, time + 2*ii, ..., time + addl*ii. Also required when ss > 0. Default 0

addl

Integer number of additional doses beyond the first. The total number of doses pushed is addl + 1, spaced ii apart. Each dose is pushed as a standalone event (not as a periodic schedule in the event table).

ss

Integer steady-state flag applied to the first dose only (addl repetitions always use ss = 0).

0

No steady-state (default).

1

Steady-state additive: add SS solution to current state.

2

Steady-state replace: replace current state with SS solution.

Value

This function is only meaningful inside an rxode2 model; it returns NULL invisibly if called from R directly (after signaling an error).

Details

Behavior inside a model

infuseDur() is evaluated at every output time point (when the solver is exactly at a scheduled event time). The pushed event is inserted into the individual's event timeline and the solver visits it now or at the specified future time.

The number of events that may be pushed per individual is limited by the maxExtra argument of rxSolve(). When maxExtra = 0 (the default) there is no limit. Exceeding the limit causes an error.

Past-time pushes (where time < t) are silently ignored and counted; a warning is issued after solving.

See also

Author

Matthew L. Fidler

Examples

# \donttest{
# 50 unit infusion over 5 time units into central at t = 12
f <- function() {
  ini({
    ka <- 0.5; cl <- 1; v <- 10
  })
  model({
    mtime(at) <- 12
    d/dt(depot) <- -ka * depot
    d/dt(central) <- ka * depot - cl / v * central
    cp <- central / v
    if (t >= at && t < at + 0.5) infuseDur(50, 5, central)
  })
}
s <- rxSolve(f, et(amt = 100) |> et(0:24))
#>  
#>  
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
#>  
#>  
s[s$time >= 11 & s$time <= 14, ]
#>    time at       cp      depot  central
#> 12   11 12 4.109804 0.40867653 41.09804
#> 13   12 12 3.733943 0.24787470 37.33943
#> 14   12 12 3.733943 0.24787470 37.33943
#> 15   13 12 4.339480 0.15034386 43.39480
#> 16   14 12 4.883756 0.09118831 48.83756
# }