Adapter for FMUs (ME or CS) in mosaik
Project description
This mosaik-fmi adapter allows to couple FMUs, which are based on the FMI standard (https://fmi-standard.org) with mosaik.
Installation
mosaik-fmi is based on the FMI++ library, which can be found at https://fmipp.sourceforge.io/
The FMI++ python interface is used, which can be found at https://github.com/AIT-IES/py-fmipp. See this page also for details about installation and requirements of the python interface.
Test
The tests for Co-Simulation and ModelExchange in test_fmuAdapter.py don’t work together yet and have to be called separately (by commenting out the respective other one in @pytest.mark.parametrize(“fmi_type,fmu_dir”).
The FMU for the test is based on https://github.com/qtronic/fmusdk.
How to Use
Specify simulator configurations within your scenario script:
sim_config = { 'FMI': { 'python': 'mosaik_fmi.mosaik_fmi:FmuAdapter', }, ... }
Initialize the FMU Simulator:
fmu_sim = world.start('FMI', integrator='dp', work_dir='path/to/the/fmu/directory', fmu_name='FMU_name', fmi_version='2', fmi_type='cs', logging_on=False, instance_name='FMU_name', step_size=60*60)
Instantiate FMU model entity:
fmu_entity = fmu_sim.FMU_name.create(1, input_1=1.0, # FMU input variable input_2=2.0, # All variables are listed in modelDescription.xml ... )
Connect FMU output to another simulator’s input:
world.connect(fmu_entity[0], other_simulator,'fmu_output_1', 'simulator_input_1')
Getting help
If you need help, please visit the mosaik-users mailing list .
Changelog
0.2 – 2022-02-23
Fix: FMI model identifier instead of model name needed to create FMU using fmipp
0.1 – 2020-08-14
Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file mosaik_fmi-0.2.tar.gz
.
File metadata
- Download URL: mosaik_fmi-0.2.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec0bff0aa341b1c2108050414e8e13a2070e77a74d10c1c57943c2f8660fe217 |
|
MD5 | 949eeb873d672e6074d63a0a4b195054 |
|
BLAKE2b-256 | 24caa05794a1f2ca0e16b2dc8037925a78a8fb5b63232d01e9a8b04a3cbe9b43 |
Provenance
File details
Details for the file mosaik_fmi-0.2-py3-none-any.whl
.
File metadata
- Download URL: mosaik_fmi-0.2-py3-none-any.whl
- Upload date:
- Size: 15.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccc59bbb97ea7a27f1ce875381b0196448d0dc93b1f890da58a04bbd71d976ee |
|
MD5 | 07ace742858ee45f1258eceda183baae |
|
BLAKE2b-256 | 5e82f7251a3329a7162b3e99b71eb968055754ec1f4107789c56ce4ffb9d081e |