Troubleshooting OpenModelica Simulation

Common Simulation Issues

This table describes some of the common issues that can prevent a model being simulated.  Check the output in the 'Build' tab of the System Output window. The messages are dumped from the OpenModelica compiler (omc.exe), which normally points you to the lines of the Modelica source code. This will help you pick up most of the errors.

The number of equations is less than the number of variables. You might have forgotten to set some of the properties to be SimConstant, which means the value doesn't change during simulation. You might have to provide the SimConstant property values before the simulation is started. (Set the values through Simulation Data Set.)

The Blocks that are typing to Ports might not contain conserved properties. If, for example, a Block 'ChargePort' contains two parts - 'v : Voltage' and 'i: Current' - the property 'i : Current' should be defined as SimVariable with the attribute 'isConserved' set to 'True'.

SimConstants might not have default values - they should be provided with them.

A SimVariable might not have an initial value to start with - one should be provided.

The properties might be typed by elements (Blocks or Value Type) external to the configured Package; use a Package Import connector to fix this.