Learn R Programming

mrgsolve (version 0.8.9)

mread_cache: Read a model specification file.

Description

mread reads and parses a mrgsolve model specification file, builds the model, and returns a model object for simulation.

Usage

mread_cache(model, project = getwd(), code = NULL, soloc = tempdir(),
  quiet = FALSE, preclean = FALSE, ...)

mread(model = character(0), project = getwd(), code = NULL, udll = TRUE, ignore.stdout = TRUE, raw = FALSE, compile = TRUE, audit = TRUE, quiet = getOption("mrgsolve_mread_quiet", FALSE), check.bounds = FALSE, warn = TRUE, soloc = tempdir(), preclean = FALSE, ...)

Arguments

model

model name

project

location of the model specification file an any headers to be included

code

a character string with model specification code to be used instead of a model file

soloc

directory where model shared object is stored

quiet

don't print messages when compiling

preclean

logical; if TRUE, compilation artifacts are cleaned up first

...

passed along

udll

use unique name for shared object

ignore.stdout

passed to system call for compiling model

raw

if TRUE, return a list of raw output

compile

logical; if TRUE, the model will be built

audit

check the model specification file for errors

check.bounds

check boundaries of parameter list

warn

logical; if TRUE, print warning messages that may arise

Model Library

mrgsolve comes bundled with several precoded PK, PK/PD, and other systems models that are accessible via the mread interface.

Models available in the library include:

  • PK models: pk1cmt, pk2cmt, pk3cmt, tmdd

  • PKPD models: irm1, irm2, irm3, irm4, emax, effect

  • Other models: viral1, viral2

When the library model is accessed, mrgsolve will compile and load the model as you would for any other model. It is only necessary to reference the correct model name and point the project argument to the mrgsolve model library location via modlib.

For more details, see modlib_pk, modlib_pkpd, modlib_tmdd, modlib_viral, and modlib_details for more information about the state variables and parameters in each model.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
code <- '
$PARAM CL = 1, VC = 5
$CMT CENT
$ODE dxdt_CENT = -(CL/VC)*CENT;
'

mod <- mcode("ex_mread",code)

mod

mod %>% init(CENT=1000) %>% mrgsim %>% plot


mod <- mread("irm3", modlib())

mod
# }

Run the code above in your browser using DataLab