Skip to main content
Skip table of contents

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.

image-20240703-150407.png

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.

image-20240703-150521.png

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.

image-20240703-150547.png

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.

https://www.youtube.com/watch?v=jGm-mR1GgwM

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.

https://www.youtube.com/watch?v=9-q_yuyPAm4

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.

https://youtu.be/HgJ1jBECXPE

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.