Skip to main content
Skip table of contents

Writing a model from scratch

If the models present in the libraries do not suit your needs, you can write a model yourself. You can either start completely from scratch or adapt a model existing in the libraries. In both cases, the syntax of the Mlxtran language is detailed in: Model syntax: mlxtran language. You can also copy-paste models from the pages of model examples.

In the “Structural model” tab, you can click on “New model” to open the editor integrated within Monolix, and start writing your own model. The new model contains a convenient template defining the main blocks, input parameters and output variables. When you are done, click on the “Create model” button to save your new model as a .txt file. After saving, the model is automatically loaded in the project.

The figure below shows how to use the editor integrated within the interface of Monolix. The model shown as example corresponds to the model included in the Monolix demo 8.case_studies/hcv_project.mlxtran.

workfow_newmodel_2-20240531-145218.png

You can even create your own library of models. An example of a basic library which includes several viral kinetics model is available in the demos 8.case_studies/model.

A button “Check syntax” is available to check that there is no syntax error in the model. In case of an error, informative messages are displayed to help correct the error. The syntax check is also automatically applied before saving the model so that only a model with a valid syntax can be saved.

2022-01-04_15h08_39-20240531-145306.png

Understanding the error messages

The error messages generated when syntax errors are present in the model are very informative and quickly help to get the model right. The most common error messages are explained in detail in this video.

https://www.youtube.com/watch?v=HgJ1jBECXPE

Using the external editor

This video shows how to write a new structural model with the mlxEditor application, that could only be used as a separate applications in versions of MonolixSuite prior to 2021R1:

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

JavaScript errors detected

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

If this problem persists, please contact our support.