Skip to main content

Simulate Functional Mock-up Units (FMUs) in Python

Project description

FMPy is a free Python library to simulate Functional Mock-up Units (FMUs) that…

  • supports FMI 1.0 and 2.0

  • supports Co-Simulation and Model Exchange

  • runs on Windows, Linux and macOS

  • can validate FMUs

  • provides fixed and variable-step solvers

  • is pure Python (with ctypes)

Installation

To install the latest release from PyPI or update an existing installation type:

python -m pip install --upgrade fmpy

or, to install the latest development version:

python -m pip install --upgrade https://github.com/CATIA-Systems/FMPy/archive/develop.zip

Simulate an FMU on the command line

To simulate Rectifier.fmu and plot the results download the FMU for your platform and run the following command in the folder where you downloaded the FMU:

python -m fmpy.simulate Rectifier.fmu --show-plot

Rectifier.fmu

Windows (32-bit)

Windows (64-bit)

Linux (32-bit)

Linux (64-bit)

macOS

Rectifier_result.png

To get more information about the available options type:

python -m fmpy.simulate --help

Simulate an FMU in Python

For an example of how to simulate an FMU in Python see coupled_clutches.py. To run the script type:

python -m fmpy.examples.coupled_clutches

Connect an FMU to custom input

The custom_input.py example shows how to use the FMU class directly to build a custom simulation loop and how to get and set model variables to control the simulation.


© 2017 Dassault Systèmes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

FMPy-0.1.0-py2.py3-none-any.whl (638.6 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page