ChronoEngine:Unit COSIMULATION

From ChronoWiki

(Redirected from Unit COSIMULATION)
Jump to: navigation, search




Build depends:


Run depends:

Instrument Control Toolbox

Main developers:

Alessandro Tasora

This is an optional unit that enables co-simulation capabilities in Chrono::Engine. Read the introduction to units for a technical background on the modularity of the Chrono::Engine project.



The unit_COSIMULATION allows users to use the Simulink product to simulate subsystems that interact with Chrono::Engine mechanisms. The Simulink technology is well known for its ease of use: it is a graphical tool built on top of Matlab that allows the building of control systems, pneumatic and hydraulic circuits, drivetrains, electrical power systems, etc. By adopting a co-simulation approach, you can simulate, for example, an excavator bow with Chrono::Engine and its hydraulic subsystems with Simulink. This unit is meant to provide a way to interface Chrono::Engine and Simulink.

Here are the main features:

  • easy C++ functions to send/receive datagrams using TCP/IP sockets from Chrono::Engine
  • a CEcosimulation.mdl block is provided, to be inserted in your Simulink models as an interface to C::E
  • examples are provided.


  • To run applications based on this unit:
  • To build this unit:
    • you must have a socket library (both Linux and Windows have these by default and you should not need to install any library)

Building instructions

  • Repeat the instructions for the full installation, but when you see the CMake window, you must add the following steps:
  • Set the ENABLE_UNIT_COSIMULATION as 'on', then press 'Configure' (to refresh the variable list)
  • Press 'Configure' again, then 'Generate', and proceed as usual in the installation instructions.

After the successfull compilation, the Unit_COSIMULATION library is built and installed in your directory of binary files.


Although this unit is meant to interface with Simulink, the Simulink and Matlab APIs are not needed during the compilation, and the Unit_Matlab is not mandatory too. In fact the interface to Simulink is based on TCP/IP sockets only; actually such interface could be used to do cosimulation with other software that supports TCP socked communication, such as Amesim or Dymola. Anyway, currently, only examples and files for Simulink are provided.

Personal tools