Solve time-dependent quantities/concentrations of different variables in PK model through the imported ode function in deSolve package. It can also be used to solve the function with analytical solution.

solve_fun(
x,
time = NULL,
initParmsfun = "initParms",
initState,
dllname = NULL,
func = "derivs",
initfunc = "initmod",
outnames,
method = "lsode",
rtol = 1e-08,
atol = 1e-12,
model = NULL,
lnparam = F,
vars = NULL,
tell = T,
...
)

## Arguments

x a list of storing information in the defined sensitivity function. a vector to define the given time sequence. a character for the given specific initial parameter function. a vector that define the initial values of state variables for the ODE system. a string giving the name of the shared library (without extension) that contains the compiled function. the name of the function in the dynamically loaded shared library. the name of the initialization function (which initialises values of parameters), as provided in dllname. the names of output variables calculated in the compiled function func. method used by integrator (deSolve). argument passed to integrator (deSolve). argument passed to integrator (deSolve). the defined analytical equation with functional output. a logical value that make the statement of the log-transformed parameter (default FALSE). a character for the selected output. a logical value to automatically combine the result y to decoupling simulation x. additional arguments for deSolve::ode method.

## References

Soetaert, K. E., Petzoldt, T., & Setzer, R. W. (2010). Solving differential equations in R: package deSolve. Journal of Statistical Software, 33(9), 1–25.

pksim

## Examples

  q <- "qunif"
q.arg <- list(list(min = 0.6, max = 1.0),
list(min = 0.5, max = 1.5),
list(min = 0.02, max = 0.3),
list(min = 20, max = 60))

params <- c("F","KA","KE","V")

set.seed(1234)
x <- rfast99(params = params, n = 200, q = q, q.arg = q.arg, rep = 20)

time <- seq(from = 0.25, to = 12.25, by = 0.5)
y <- solve_fun(x, model = FFPK, time = time, vars = "output")
#> Starting time: 2021-07-07 11:07:47#> Ending time: 2021-07-07 11:07:47
pksim(y) # Visualize uncertainty of model output