Skip to content

Latest commit

 

History

History
54 lines (30 loc) · 3.23 KB

README.md

File metadata and controls

54 lines (30 loc) · 3.23 KB

XInTheLoop Library

XInTheLoop is a Modelica library for interfacing a model with an external system for continuous interaction during simulation of the model. The external system in this case is a software tightly coupled with e.g. a physical process hardware, some user interface, another model simulation, a computational service, or some other software service.

OpenModelica v1.23 win64 DOI

Note that this library might also work with other Modelica frameworks and at other platforms that win64, but that is not tested during development.

Use the DOI number above when citing all (including future) versions of this library. When clicking the DOI link, it will resolve to the DOI information of the currently latest version, and the same page also contains a section with DOI numbers to use for each released version when citing one particular version.

Library Description

A generic UDP based protocol is developed to exchange values between the Modelica model and the external system in both directions at regular intervals.

Together with a set of generic support blocks, it should be easy to implement your own blocks for interfacing one particular external system.

The external system can be developed in any language/framework that support UDP communication. An included Python script for debugging the UDP communication can be used as inspiration.

Site1 Example

The Site1 example is a test model and interfacing blocks for one particular external FCS system containing a fuel cell, a DC-to-DC-converter, a battery, and a variable load.

Dependencies

  • Modelica v4.0.0
  • Modelica_DeviceDrivers v2.1.1

Known Issue

Due to a bug in OMEdit v1.20 for Windows, models using this library from that OMEdit version need to add -lws2_32 to the C/C++ Compiler Flags (Optional) in the General tab of Simulation Setup to compensate for the bug as described in modelica-3rdparty/Modelica_DeviceDrivers#369.

The bug is still present in OMEdit v1.23.1 for Windows.

Development

The base of this library has been developed as part of the Virtual-FCS project. The main library VirtualFCS can be used to build advanced FCS models, and then combined with this library to include an external system in the loop.

This library has been further developed as part of the StasHH project.

Contact

Funding

  • The Virtual-FCS project has received funding from the Fuel Cells and Hydrogen 2 Joint Undertaking (now Clean Hydrogen Partnership) under Grant Agreement No. 875087.
  • The StasHH project has received funding from the same Joint Undertaking under Grant Agreement No. 101005934.
  • This Joint Undertaking receives support from the European Union's Horizon 2020 Research and Innovation Program, Hydrogen Europe and Hydrogen Europe Research.

License

This library is shared under an MIT license. For more information, please see the LICENSE file.