You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

This page describes how to simulate ElectricCircuit example model in Dymola.  Learn more about ElectricCircuit sample model >>

You can find the ElectricCircuit sample model in:

  • the modeling tool: Welcome window > Samples > Simulink and Modelica Transformation > ElectricCircuit.
  • the Installation directory: <modeling tool installation directory>\samples\SysML\Simulink and Modelica Transformation\ElectricCircuit.


To simulate the Circuit Modelica model


  1. Export the Circuit Block to Modelica file. How to >>
  2. Make sure the Dymola tool is installed. How to >>
  3. Start the Dymola.
  4. Click File > Open > Load... and select saved Circuit.mo file from your file directory. Circuit model is displayed in the Package Browser.

  5. In the Graphics tab toolbar, click  to check model for syntax and semantic errors. The result panel displays whether the model is ready for simulation.


  6. Setup the simulation run for the model:
        a. Select the 
    Simulation tab and in its toolbar click .

        b. In the Simulation Setup dialog, specify the Start time value to 0 and the Stop time value to 60 seconds (or any other reasonable amount of time; for this model, 60 seconds is enough).
        c. Click OK.

  7. In the Simulation tab toolbar, click

    When the simulation is completed, the output is displayed in the panel at the bottom and the Circuit variables are displayed in the Variable Browser.

  8. To see input and output of the Circuit model, select variables in the Variable Browser as follows: Circuit _Circuit c, i, rc, ri, s > iThruvDrop. The current (iThru) and voltage (vDrop) variable across each of the circuit’s 5 components are displayed on the Plot window: the capacitor (c), the inductor (i), the voltage source (v), and the resistors (rc, ri). In the example below, only  iThruvDrop of s variable are displayed.