I’m using this chapter as a place to provide miscellaneous information that might not have an obvious place to live. I’d call this a FAQ, but not all of the questions are asked frequently or at all.
0.11.1, you can interrupt a long simulation
Esc, the standard way to pass an interrupt signal
mrgsolve will stop every so often to look for the interrupt signal.
You can control the frequency with which
mrgsolve looks for the interrupt
signal through an argument to
mrgsim (default: 256 simulation records).
Increase to check less frequently, increase to check more frequently (this might
be needed for a model where a large amount of work is required to advance one
step) or set to negative number to never check.
Compiler flags can be passed to your model by setting
$ENV. For example
will compile your model according to
C++11 standard (but note that there is a
special plugin that will do this automatically for you; see Section
Yes, you can do this by invoking the
CXX11 plugin (Section 9.4).
There are three approaches
tad argument to mrgsim()
To get time after dose into your output you can call
mrgsim(mod, tad = TRUE)
and the output will have a
tad column. Note this does not let you interact
tad value inside your model.
Simple calculation in the model
Most applications will call
self.tad() (Section @ref(self.tad)). For example
[ main ] double tad = self.tad();
More complicated calculation in the model
You can get more control and track
tad in a specific compartment by using
tad plugin. See Section 9.3 for details.
The model can fail to compile for a variety of reasons, including an error
C++ code or inability of R to find the compiler and other pieces of
the tool chain.
mod <- mread(..., recover = TRUE)
If your model has
C++ syntax problems, the errors should be printed on the
console. If you possibly have problems with the compiler or the rest of the
toolchain, take a look at the
pkgbuild package, which provides some helpful
tools, especially if you are working on a Windows platform
No; do not run mrgsolve on a network drive. Your R installation, mrgsolve installation, and R working directory should be on a local hard disk.
No; do not run mrgsolve in a synced folder for cloud services like OneDrive, GoogleDrive, DropBox etc. Your R installation, mrgsolve installation, and R working directory should be on a local hard disk.