Solve the differential equations of time-dependent quantity/concentration in different tissues/compartments through GNU MCSim.
solve_mcsim(
x,
mName,
infile.name = NULL,
outfile.name = NULL,
setpoint.name = NULL,
params = NULL,
vars = NULL,
times = NULL,
condition = NULL,
generate.infile = T,
tell = T,
rtol = 1e-06,
atol = 1e-06,
monte_carlo = NULL,
dist = NULL,
q.arg = NULL,
parallel = 1
)
generate_infile(
mod = NULL,
infile.name = NULL,
outfile.name = NULL,
params = NULL,
vars,
times,
condition,
rtol = 1e-06,
atol = 1e-06,
monte_carlo = NULL,
dist = NULL,
q.arg = NULL
)
a list of storing information in the defined sensitivity function.
a string giving the name of the model or C file (without extension).
a character to assign the name of input file.
a character to assign the name of output file.
a character to assign the name of file for parameter matrix.
a character to assign the testing parameters.
a character or a vector to assign the selected output(s).
a numeric vector to define the given time point(s).
a character to set the specific parameter value in the input file.
a logical value to automatically generate the input file.
a logical value to automatically combine the result y to decoupling simulation x.
an argument passed to the integrator (default 1e-6).
an argument passed to the integrator (default 1e-6).
a numeric value to define the sample size in Monte Carlo simulation.
a vector of distribution names corresponding to <distribution-name>
in GNU MCSim.
a list of shape parameters in the sampling distribution (dist
).
a numeric value to assign the number of cores in parallel computing (default is set to 1).
a list of model and parameters information that is used in solving differential equation.
The output result is the 4-dimension array with c(model evaluations, replications, time-points, output variables).
This function allows users to use external data file that assigned in setpoint.name
as parameter matrix.
If you want to use it, be sure to define n
and setpoint.name
.
solve_mcsim()
: Numerical analysis for the PK model by GNU MCSim.
generate_infile()
: Generate the GNU MCSim input file.
if (FALSE) {
pbtk1cpt_model()
mName <- "pbtk1cpt"
compile_model(mName)
q <- "qunif"
q.arg <- list(list(min = 0.4, max = 1.1),
list(min = 0.1, max = 0.4),
list(min = 1.0, max = 3.0))
params <- c("vdist", "ke", "kgutabs")
set.seed(1234)
x <- rfast99(params = params, n = 200, q = q, q.arg = q.arg, rep = 20)
infile.name <- "example.in"
outfile.name <- "example.csv"
vars <- "Ccompartment"
t <- seq(from = 0.25, to = 12.25, by = 0.5)
y <- solve_mcsim(x, mName = mName, infile.name = infile.name,
setpoint.name = "setpoint.dat",
outfile.name = outfile.name, params = params, vars = vars, time = t,
condition = "Agutlument = 10")
pksim(y)
}