PKanalix
Auto Light Dark
Auto Light Dark

Custom models

With the compartmental analysis task in PKanalix, you can write your own custom model in the mlxtran language. To load an existing model, click on BROWSE in the Model sub-tab, and to write a new model from scratch, click NEW MODEL button.

Custom models are only available with PKanalix versions 2023 and later.

PKanalix screenshot of the CA task, MODEL sub-tab, with an empty Model file panel. The BROWSE button, to load an existing model file, and the NEW MODEL button, to write a model from scratch, are highlighted. LOAD FROM LIBRARY sits between them.


You can also first choose a model form the library and then edit it directly in the Model tab afterwards by clicking on the button EDIT MODEL, which opens the interactive editor.

PKanalix screenshot of the interactive model editor opened with EDIT MODEL on the library model oral1_1cpt_kaVCl.txt in the CA task MODEL sub-tab. The toolbar shows CHECK SYNTAX, zoom in, zoom out, undo, redo and two file buttons, then CANCEL, SAVE AND APPLY and an open menu with Save as and apply and Save as. The editable mlxtran code is below, and Mapping links DV to Cc.


In the editing mode, there are several features that help with model writing in mlxtran. These include syntax coloring, detecting syntax errors, and zooming the editing window. In addition, autocomplete offers function and keyword suggestions for the mlxtran language and variable names.


Model editor toolbar with CHECK SYNTAX, zoom in, zoom out, undo and redo buttons, two file icons, then CANCEL, SAVE AND APPLY and a menu button for more save options.


You can save a new model and automatically apply it to a current project by clicking SAVE & APPLY. To save a model with a different name, use SAVE AS & APPLY or SAVE AS. Note that models from the library cannot be overwritten.

Merging two library models

In MonolixSuite application there is a dedicated application to write and edit models: mlxEditor. This functionality is integrated directly in the interface, as described above, but you can also use mlxEditor independently of PKanalix.  The following video shows an example how to merge two models using mlxEditor.


Writing a model from scratch

The following video describes how to write a custom model. Note that this video uses the old version of mlxEditor, but the functionality is the same.


Understanding error messages

The error messages generated when syntax errors occur in the model are informative and help to easily correct the model. This video explains the most common error messages.




Last updated: