FMI/FMU co-simulation toolbox for PathSim
Project description
FMI/FMU co-simulation toolbox for PathSim
Homepage • Documentation • GitHub
PathSim-FMI extends the PathSim
simulation framework with block wrappers around the
Functional Mock-up Interface (FMI 2.0 / 3.0).
Drop an .fmu file into a PathSim simulation as either a co-simulation slave
or as a model-exchange system driven by PathSim's own integrators. Built on
top of FMPy.
Blocks
| Block | Description | Key Parameters |
|---|---|---|
CoSimulationFMU |
Wrap a Co-Simulation FMU, advanced on a fixed grid dt via fmi*DoStep |
fmu_path, dt, start_values |
ModelExchangeFMU |
Wrap a Model-Exchange FMU, integrated by PathSim's solver of choice | fmu_path, start_values |
Both blocks build on FMUWrapper, a lower-level version-agnostic wrapper
around FMPy (FMI 2.0 / 3.0) that you can use directly if you need finer
control than the block API offers.
Install
pip install pathsim-fmi
In the PathView web app: install fails on purpose (the FMU runtime needs to
load a native binary via ctypes, which Pyodide can't provide). Use the
standalone PathView desktop app or any local Python environment.
Quick Example
from pathsim import Simulation, Connection
from pathsim.blocks import Scope
from pathsim_fmi import ModelExchangeFMU
fmu = ModelExchangeFMU("VanDerPol.fmu")
sco = Scope(labels=["x0", "x1"], sampling_period=0.02)
sim = Simulation(
blocks=[fmu, sco],
connections=[
Connection(fmu[0], sco[0]),
Connection(fmu[1], sco[1]),
],
dt=0.01,
)
sim.run(5.0)
sco.plot()
Development
pip install -e ".[test]" fmpy ruff mypy
ruff check src/ tests/ # lint
ruff format src/ tests/ # format
mypy src/pathsim_fmi # type check
pytest tests/ -v # run tests
The test suite uses the official Modelica Reference-FMUs
under tests/data/reference/ for portable smoke tests, plus a handful of
legacy FMUs (under tests/data/) carried over from pathsim-core. The legacy
FMUs ship darwin64 binaries that are x86_64 only, so the corresponding
tests are auto-skipped on Apple Silicon; CI on Linux runs the full suite.
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pathsim_fmi-0.1.1.tar.gz.
File metadata
- Download URL: pathsim_fmi-0.1.1.tar.gz
- Upload date:
- Size: 3.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0c282539260031912174163ac4750459136ab1383cc615b0e7d5852965987fc
|
|
| MD5 |
ae7780f83287e6f36674f590df4c394c
|
|
| BLAKE2b-256 |
90aceaa8f44f83c6fb2101a8f9d442dacc8a2afa25c6ec1891ab4254983ff7ff
|
Provenance
The following attestation bundles were made for pathsim_fmi-0.1.1.tar.gz:
Publisher:
publish.yml on pathsim/pathsim-fmi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pathsim_fmi-0.1.1.tar.gz -
Subject digest:
b0c282539260031912174163ac4750459136ab1383cc615b0e7d5852965987fc - Sigstore transparency entry: 1643037295
- Sigstore integration time:
-
Permalink:
pathsim/pathsim-fmi@d2531dc0b97bd7820ddc5b9bdf4af529b7eab57d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/pathsim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d2531dc0b97bd7820ddc5b9bdf4af529b7eab57d -
Trigger Event:
release
-
Statement type:
File details
Details for the file pathsim_fmi-0.1.1-py3-none-any.whl.
File metadata
- Download URL: pathsim_fmi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d141e5ad69bccf0e419bd4758e02392a403926d3b42cc35326bd4bba20b3d01
|
|
| MD5 |
885faec0fd654d5071e8005a51a8b939
|
|
| BLAKE2b-256 |
abc3eaca1810991f83f9d937bd62517f7d22c1b33764bb7448928119761c9207
|
Provenance
The following attestation bundles were made for pathsim_fmi-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on pathsim/pathsim-fmi
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pathsim_fmi-0.1.1-py3-none-any.whl -
Subject digest:
7d141e5ad69bccf0e419bd4758e02392a403926d3b42cc35326bd4bba20b3d01 - Sigstore transparency entry: 1643037380
- Sigstore integration time:
-
Permalink:
pathsim/pathsim-fmi@d2531dc0b97bd7820ddc5b9bdf4af529b7eab57d -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/pathsim
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d2531dc0b97bd7820ddc5b9bdf4af529b7eab57d -
Trigger Event:
release
-
Statement type: