Load a model into a symengine environment
Usage
rxS(
x,
doConst = TRUE,
promoteLinSens = FALSE,
envir = parent.frame(),
pkTime = FALSE
)Arguments
- x
rxode2 object
- doConst
Load constants into the environment as well.
- promoteLinSens
Promote solved linear compartment systems to sensitivity-based solutions.
- envir
default is
NULL; Environment to put symengine variables in.- pkTime
When
TRUE,timein statements that do not depend on a state is loaded asrx_time_pk, defined byrx_time_pk~tin..lhs0, so it stays separate from thetimeind/dt()after those statements are inlined;rxSolve(..., nonmem = TRUE)then reads it as the record time. Only for callers that write..lhs0into the model they build.
See also
Other Symbolic tools:
rxSymEngineCacheReset(),
rxToSE()
Examples
# \donttest{
pk <- function() {
model({
d/dt(depot) <- -ka * depot
d/dt(central) <- ka * depot - cl / v * central
})
}
s <- rxS(pk)
#>
#>
#> ℹ parameter labels from comments are typically ignored in non-interactive mode
#> ℹ Need to run with the source intact to parse comments
# the d/dt() lines as loaded
s$..ddt
#> [1] "d/dt(depot)=-ka*depot" "d/dt(central)=ka*depot-cl*central/v"
# each derivative is a symengine expression; differentiate it in the env
with(s, D(rx__d_dt_central__, ka))
#> (Symbol) depot
# }
