Composite Modeling and Co-Simulation


In this section, we will explore simple composite models consisting of two FMUs. The first example is the classic dual mass oscillator, followed by the quarter car model. These examples illustrate the workflow and highlight the differences between strongly and weakly coupled systems.

1. Dual Mass Oscillator



example Exercise
Generate FMUs for System1 and System2 of the dual mass oscillator example. Then, connect the FMUs and export the composite model as an SSP file. Use the generated SSP file to simulate the composite model. Compare results for co-simulation and model exchange coupling.


Step-by-Step Instructions



  1. Download and Import the Model 
    • Download the Modelica file from the link above.
    • Import it into OMEdit.
    • Generate FMUs for System1 and System2 (DualMassOscillator).
    • Choose either Model Exchange or Co-Simulation, depending on your scenario.
    • Optionally, export both variants simultaneously to allow selection at import, as demonstrated with the Bouncing Ball example earlier.
  2. Model the SSP System 
    • Choose between graphical modeling using OMEdit or a scripting approach using Lua or Python.
    • Import both FMUs into a system.
    • Connect the appropriate input/output connectors.
  3. Export or Simulate 



Model Exchange vs. Co-Simulation



  • Model Exchange: Shared solver across FMUs.
    • Pros: Higher accuracy and efficiency.
    • Cons: Requires compatible solvers.
  • Co-Simulation: Independent solvers for each FMU.
    • Pros: Flexibility with tools.
    • Cons: Delayed communication between simulation units.



2. Quarter Car Model



example Exercise
Generate FMUs for Chassis and Wheel of the quarter car package. Then, connect the FMUs and add a road profile, e.g. road.csv. Export the composite model as an SSP file. Use the generated SSP file to simulate the composite model. Compare results for co-simulation and model exchange coupling.


The package also provides two different modeling approaches: Displacement-Displacement coupling and Displacement-Force coupling. Particularly for co-simulation, the coupling method is crucial and can significantly impact model performance.