The model file is an ASCII text file that contains the model definition statements. It must follow the general form:
mdl(variables){
statements
}
where mdl is the assigned model name. All models are called test by default, but can be renamed. The (variables) parentheses are normally empty () but they can contain a list of variables when the model is used in trial simulation. See the “Modeling Syntax” section for details of the available statements.
The model file for the Theophylline example is shown below. See “Theophylline PML example” for an annotated example.
fm3theophx.mdl
fm1theo(){
# Theophylline model example coding
# One compartment model with first order absorption
# Single dose at time=0, explicit concentration prediction formula
covariate(dose,time)
fixef(
tvlKa=c(, 0.5,)
tvlKe=c(, -2.5,)
tvlCl=c(, -3.0,)
)
ranef(
diag(nlKa, nlCl)=c(1.0 1.0)
)
stparm(
Ka=exp(tvlKa+nlKa)
Ke=exp(tvlKe)
)
V=Cl/Ke
cpred=dose
*Ka
/(V*(Ka-Ke))
*(exp(-Ke*time)-exp(-Ka*time))
error(eps1=c(.5))
observe(cObs=cpred+eps1)
}
This is an example model file of a well-known model, and it shows how to code an explicit closed-form single-dose solution. Note that any text string that is initiated by '#' is treated as a comment and does not affect model execution. Later examples show how to create models using differential equations, which are more adaptable to multiple dosing regimens and to trial simulation.
The example above shows a style in which indentation is used consistently throughout. This makes the model self-outlining for readability, and indicates a careful discipline, which makes errors less likely.
Including files in the generated C++ code
If one or more of the following statements appear in the PML outside of the model definition:
include(“MyIncludeFile.h”)
test(){ # model definition
…
}
where MyIncludeFile.h is the name of any C-style include file (enclosed in double quotes), it results in the following code being inserted near the top of the generated C++ file Model.cpp:
#include(“MyIncludeFile.h”)
This can be useful for purposes such as allowing access to additional functions that might be included in the compile-and-link step for models.
Legal Notice | Contact Certara
© Certara USA, Inc. All rights reserved.