Quickly generate an FMU from command line
Project description
qfmu is a python package to generate continuous-time
, LTI
system FMUs from command line.
Installation
Install qfmu
through PyPI
pip install qfmu
Noted that a C compiler is required
msvc
for Windowsgcc
for Linuxclang
for MacOS
Features
Currently, qfmu is able to generate fmus that are compliant with FMI2 standard.
The following models are supported:
Model | ME | CS |
---|---|---|
State Space | ✔️ | ✔️ |
Transfer Function | ✔️ | ✔️ |
PID | ✔️ | ✔️ |
Noted that only continuous-time models are supported currently.
Usage
Examples
Generate a continuous-time state space FMU.
qfmu ss -A "[[1,2],[3,4]]" -B "[[1],[2]]" -C "[[1,0],[0,1]]" -x0 "[3.14, 6]" -o ./q.fmu
If qfmu
is installed properly, you should see a q.fmu
file generated in your current working directory.
A
,B
,C
matrices are provided asJSON
stringsD
matrix is automatically inferred as azero
matrix with the correct size.
If you have fmpy
installed, you can run fmpy info q.fmu
to see detailed model information.
Model Info
FMI Version 2.0
FMI Type Model Exchange, Co-Simulation
Model Name q
Description None
Platforms c-code, linux64
Continuous States 2
Event Indicators 0
Variables 10
Generation Tool qfmu
Generation Date 2023-10-08 21:24:32.733857
Default Experiment
Stop Time 1.0
Tolerance 0.0001
Variables (input, output)
Name Causality Start Value Unit Description
u1 input 0.0 Model input 1
y1 output Model output 1
y2 output Model output 2
Generate a continuous-time transfer function FMU
qfmu tf --num "[1]" --den "[1,1]" -o ./q.fmu
Generate a continuous-time PID controller FMU
qfmu pid --kp=3.0 --ki=1 -o ./q.fmu
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.