Skip to main content
Skip table of contents

Writing your own model

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 on this page. You can also copy-paste models from the typical models section.

In the “Model” tab, you can click on “New model” to open the editor integrated within Simulx, 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 “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 Simulx. The model shown as example corresponds to the model included in the Monolix demo 8.case_studies/hcv_project.mlxtran.

 

fig_doc_smlx_model.png

 

  • 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.

  • the [INDIVIDUAL] section can be generated automatically starting with version 2024 by clicking “+ ADD INDIVIDUAL”. This will add an [INDIVIDUAL] section with all parameters in the model with a lognormal distribution and random effects.

2024-10-30_14h03_50.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.