Common Errors

From Mechanomy Composer Wiki
Jump to navigation Jump to search

Common Errors when running Modelica models[edit]

Modelica models have a lot of moving parts and can fail inelegantly. Here is a list of common messages and some pointers on their root cause.

Syntax Errors[edit]

The model syntax can get a little tricky, missing punctuation or control statements will quickly stop the simulation.

Semicolon lines[edit]

Every line that declares a variable (between model ModelName and equation) must be terminated with a semicolon. Some examples:

Boolean flying; //basic declaration
Boolean flying(fixed=true, start=true) "true, if ball is flying"; //providing initialization options and a variable description
Boolean flying(fixed=true, start=true) "true, if ball is flying"  //missing a semicolon, simulation fails


Modeling Errors[edit]

These often present as having too few or too many equations for the number of variables present in the model.

Simulation Errors[edit]