| solve_mcsim {pksensi} | R Documentation | 
Solve PK Model Through GNU MCSim
Description
Solve the differential equations of time-dependent quantity/concentration in different tissues/compartments through GNU MCSim.
Usage
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
)
Arguments
| x | a list of storing information in the defined sensitivity function. | 
| mName | a string giving the name of the model or C file (without extension). | 
| infile.name | a character to assign the name of input file. | 
| outfile.name | a character to assign the name of output file. | 
| setpoint.name | a character to assign the name of file for parameter matrix. | 
| params | a character to assign the testing parameters. | 
| vars | a character or a vector to assign the selected output(s). | 
| times | a numeric vector to define the given time point(s). | 
| condition | a character to set the specific parameter value in the input file. | 
| generate.infile | a logical value to automatically generate the input file. | 
| tell | a logical value to automatically combine the result y to decoupling simulation x. | 
| rtol | an argument passed to the integrator (default 1e-6). | 
| atol | an argument passed to the integrator (default 1e-6). | 
| monte_carlo | a numeric value to define the sample size in Monte Carlo simulation. | 
| dist | a vector of distribution names corresponding to  | 
| q.arg | a list of shape parameters in the sampling distribution ( | 
| parallel | a numeric value to assign the number of cores in parallel computing (default is set to 1). | 
| mod | a list of model and parameters information that is used in solving differential equation. | 
Details
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.
Value
The output result is the 4-dimension array with c(model evaluations, replications, time-points, output variables).
Functions
-  solve_mcsim(): Numerical analysis for the PK model by GNU MCSim.
-  generate_infile(): Generate the GNU MCSim input file.
Examples
## Not run: 
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)
## End(Not run)