FMPy


NameFMPy JSON
Version 0.3.26 PyPI version JSON
download
home_pageNone
SummarySimulate Functional Mock-up Units (FMUs) in Python
upload_time2025-08-22 13:49:10
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![PyPI](https://img.shields.io/pypi/dm/FMPy.svg?label=PyPI%20downloads)](https://pypi.org/project/FMPy/)

# FMPy

FMPy is a free Python library to simulate [Functional Mock-up Units (FMUs)](http://fmi-standard.org/) that...

- supports FMI 1.0, 2.0, and 3.0
- supports Co-Simulation and Model Exchange
- runs on Windows, Linux and macOS
- has a [command line](#simulate-an-fmu-on-the-command-line), [graphical user interface](#start-the-graphical-user-interface), and [web app](#start-the-web-app)
- creates [Jupyter Notebooks](#create-a-jupyter-notebook)
- compiles C code FMUs and generates [CMake](https://cmake.org/) projects for debugging

## Installation

Install from PyPI with `python -m pip install fmpy[complete]`

## Start the Graphical User Interface

You can start the FMPy GUI with `python -m fmpy.gui`

![FMPy GUI](docs/Rectifier_GUI.png)

## Simulate an FMU in Python

To follow this example download `Rectifier.fmu` for your platform by clicking on the respective link:
[Linux](https://github.com/modelica/fmi-cross-check/raw/master/fmus/2.0/cs/linux64/MapleSim/2018/Rectifier/Rectifier.fmu),
[macOS](https://github.com/modelica/fmi-cross-check/raw/master/fmus/2.0/cs/darwin64/MapleSim/2018/Rectifier/Rectifier.fmu),
[Windows](https://github.com/modelica/fmi-cross-check/raw/master/fmus/2.0/cs/win64/MapleSim/2018/Rectifier/Rectifier.fmu).
Change to the folder where you've saved the FMU and open a Python prompt.

```
>>> from fmpy import *
>>> fmu = 'Rectifier.fmu'
>>> dump(fmu)  # get information

Model Info

  FMI Version       2.0
  Model Name        Rectifier
  Description       Model Rectifier
  Platforms         win64
  Continuous States 4
  Event Indicators  6
  Variables         63
  Generation Tool   MapleSim (1267140/1267140/1267140)
  Generation Date   2017-10-04T12:07:10Z

Default Experiment

  Stop Time         0.1
  Step Size         1e-07

Variables (input, output)

Name                Causality          Start Value  Unit     Description
outputs             output        282.842712474619  V        Rectifier1.Capacitor1.v
>>> result = simulate_fmu(fmu)         # simulate the FMU
>>> from fmpy.util import plot_result  # import the plot function
>>> plot_result(result)                # plot two variables
```

![Rectifier Result](docs/Rectifier_result.png)

## Simulate an FMU on the command line

To get information about an FMU directly from the command line change to the folder where you've saved the
FMU and enter

```
fmpy info Rectifier.fmu
```

Simulate the FMU and plot the results

```
fmpy simulate Rectifier.fmu --show-plot
```

Get more information about the available options

```
fmpy --help
```

## Create a Jupyter Notebook

To create a [Jupyter](https://jupyter.org/) Notebook open an FMU in the FMPy GUI and select `Tools > Create Jupyter Notebook...` or run

```
fmpy create-jupyter-notebook Rectifier.fmu
```

on the command line and open the notebook in Jupyter with

```
jupyter notebook Rectifier.ipynb
```

![Web App](docs/Rectifier_Notebook.png)

## Start the Web App

The FMPy Web App is built with [Dash](https://plotly.com/dash/) and a great way to share your FMUs with anyone that has a web browser.
To start it run

```
python -m fmpy.webapp Rectifier.fmu
```

on the command line or use `--help` for more options.

![Web App](docs/Rectifier_WebApp.png)

## Advanced Usage

To learn more about how to use FMPy in you own scripts take a look at the
[coupled_clutches.py](src/fmpy/examples/coupled_clutches.py),
[custom_input.py](src/fmpy/examples/custom_input.py) and
[parameter_variation.py](src/fmpy/examples/parameter_variation.py) examples.

## Commercial Support

You're starting a project, need training or professional support?
Our partners at LTX Simulation are ready to help you.
Please send an e-mail to support@ltx.de for a quote.

------------------------------------

<p align="center">
    <a href="https://3ds.com/"><img src="docs/made-by-3ds.svg"/></a>
</p>

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "FMPy",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": null,
    "platform": null,
    "description": "[![PyPI](https://img.shields.io/pypi/dm/FMPy.svg?label=PyPI%20downloads)](https://pypi.org/project/FMPy/)\n\n# FMPy\n\nFMPy is a free Python library to simulate [Functional Mock-up Units (FMUs)](http://fmi-standard.org/) that...\n\n- supports FMI 1.0, 2.0, and 3.0\n- supports Co-Simulation and Model Exchange\n- runs on Windows, Linux and macOS\n- has a [command line](#simulate-an-fmu-on-the-command-line), [graphical user interface](#start-the-graphical-user-interface), and [web app](#start-the-web-app)\n- creates [Jupyter Notebooks](#create-a-jupyter-notebook)\n- compiles C code FMUs and generates [CMake](https://cmake.org/) projects for debugging\n\n## Installation\n\nInstall from PyPI with `python -m pip install fmpy[complete]`\n\n## Start the Graphical User Interface\n\nYou can start the FMPy GUI with `python -m fmpy.gui`\n\n![FMPy GUI](docs/Rectifier_GUI.png)\n\n## Simulate an FMU in Python\n\nTo follow this example download `Rectifier.fmu` for your platform by clicking on the respective link:\n[Linux](https://github.com/modelica/fmi-cross-check/raw/master/fmus/2.0/cs/linux64/MapleSim/2018/Rectifier/Rectifier.fmu),\n[macOS](https://github.com/modelica/fmi-cross-check/raw/master/fmus/2.0/cs/darwin64/MapleSim/2018/Rectifier/Rectifier.fmu),\n[Windows](https://github.com/modelica/fmi-cross-check/raw/master/fmus/2.0/cs/win64/MapleSim/2018/Rectifier/Rectifier.fmu).\nChange to the folder where you've saved the FMU and open a Python prompt.\n\n```\n>>> from fmpy import *\n>>> fmu = 'Rectifier.fmu'\n>>> dump(fmu)  # get information\n\nModel Info\n\n  FMI Version       2.0\n  Model Name        Rectifier\n  Description       Model Rectifier\n  Platforms         win64\n  Continuous States 4\n  Event Indicators  6\n  Variables         63\n  Generation Tool   MapleSim (1267140/1267140/1267140)\n  Generation Date   2017-10-04T12:07:10Z\n\nDefault Experiment\n\n  Stop Time         0.1\n  Step Size         1e-07\n\nVariables (input, output)\n\nName                Causality          Start Value  Unit     Description\noutputs             output        282.842712474619  V        Rectifier1.Capacitor1.v\n>>> result = simulate_fmu(fmu)         # simulate the FMU\n>>> from fmpy.util import plot_result  # import the plot function\n>>> plot_result(result)                # plot two variables\n```\n\n![Rectifier Result](docs/Rectifier_result.png)\n\n## Simulate an FMU on the command line\n\nTo get information about an FMU directly from the command line change to the folder where you've saved the\nFMU and enter\n\n```\nfmpy info Rectifier.fmu\n```\n\nSimulate the FMU and plot the results\n\n```\nfmpy simulate Rectifier.fmu --show-plot\n```\n\nGet more information about the available options\n\n```\nfmpy --help\n```\n\n## Create a Jupyter Notebook\n\nTo create a [Jupyter](https://jupyter.org/) Notebook open an FMU in the FMPy GUI and select `Tools > Create Jupyter Notebook...` or run\n\n```\nfmpy create-jupyter-notebook Rectifier.fmu\n```\n\non the command line and open the notebook in Jupyter with\n\n```\njupyter notebook Rectifier.ipynb\n```\n\n![Web App](docs/Rectifier_Notebook.png)\n\n## Start the Web App\n\nThe FMPy Web App is built with [Dash](https://plotly.com/dash/) and a great way to share your FMUs with anyone that has a web browser.\nTo start it run\n\n```\npython -m fmpy.webapp Rectifier.fmu\n```\n\non the command line or use `--help` for more options.\n\n![Web App](docs/Rectifier_WebApp.png)\n\n## Advanced Usage\n\nTo learn more about how to use FMPy in you own scripts take a look at the\n[coupled_clutches.py](src/fmpy/examples/coupled_clutches.py),\n[custom_input.py](src/fmpy/examples/custom_input.py) and\n[parameter_variation.py](src/fmpy/examples/parameter_variation.py) examples.\n\n## Commercial Support\n\nYou're starting a project, need training or professional support?\nOur partners at LTX Simulation are ready to help you.\nPlease send an e-mail to support@ltx.de for a quote.\n\n------------------------------------\n\n<p align=\"center\">\n    <a href=\"https://3ds.com/\"><img src=\"docs/made-by-3ds.svg\"/></a>\n</p>\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Simulate Functional Mock-up Units (FMUs) in Python",
    "version": "0.3.26",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "d4e3c6a1699b8868dd938cbda99601540c871c263cb41c320d553ca803a284df",
                "md5": "193829ea730133c0eaf76c591d4d4e2f",
                "sha256": "5a0077d0157bc8137022c6d0cc96f422086871ff26f0c1b04a7a1b85d81540b9"
            },
            "downloads": -1,
            "filename": "fmpy-0.3.26-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "193829ea730133c0eaf76c591d4d4e2f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 4972458,
            "upload_time": "2025-08-22T13:49:10",
            "upload_time_iso_8601": "2025-08-22T13:49:10.939663Z",
            "url": "https://files.pythonhosted.org/packages/d4/e3/c6a1699b8868dd938cbda99601540c871c263cb41c320d553ca803a284df/fmpy-0.3.26-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-22 13:49:10",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "fmpy"
}
        
Elapsed time: 2.92124s