diff --git a/README.md b/README.md index b925884..10f03cf 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,11 @@ The following models are supported: *Noted* that only continuous-time models are supported currently. +## Usage + ## Examples -Generate a continuous-time state space FMU +Generate a continuous-time state space FMU. ```bash qfmu ss -A "[[1,2],[3,4]]" -B "[[1],[2]]" -C "[[1,0],[0,1]]" -x0 "[3.14, 6]" -o ./q.fmu @@ -45,6 +47,9 @@ qfmu ss -A "[[1,2],[3,4]]" -B "[[1],[2]]" -C "[[1,0],[0,1]]" -x0 "[3.14, 6]" -o If `qfmu` is installed properly, you should see a `q.fmu` file generated in your current working directory. +- `A`, `B`, `C` matrices are provided as `JSON` strings +- `D` matrix is automatically inferred as a `zero` matrix with the correct size. + If you have `fmpy` installed, you can run `fmpy info q.fmu` to see detailed model information. ``` diff --git a/examples/README.md b/examples/README.md index 6665891..a6bab9b 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,12 +1,22 @@ -# qfmu examples +# qfmu -## Compatibility Info +[qfmu](https://github.com/hyumo/qFMU) is a python package to generate `continuous-time`, `LTI` system FMUs from command line. -All FMUs have been exported by qFMU. The uploaded FMUs are free to be shared for cross-check purposes. +## FMU Export compatibility Info + +- All example FMUs have been exported by `qFMU` (see [build.py](scripts/build.py)) +- All example FMUs contain multi-platform binaries (`win64`, `linux64`, `darwin64`) +- All example FMUs are free to be shared for cross-check purposes | model | win64 | linux64 | darwin64 | |----------------- |------- |--------- |---------- | | FirstOrder.fmu | ME,CS | ME,CS | ME,CS | | SecondOrder.fmu | ME,CS | ME,CS | ME,CS | | SISO.fmu | ME,CS | ME,CS | ME,CS | -| MIMO.fmu | ME,CS | ME,CS | ME,CS | \ No newline at end of file +| MIMO.fmu | ME,CS | ME,CS | ME,CS | + +### Validation Info + +Validation tools + +- FMPy 0.3.16 \ No newline at end of file diff --git a/examples/scripts/build.py b/examples/scripts/build.py index 4e11209..88a3fa0 100644 --- a/examples/scripts/build.py +++ b/examples/scripts/build.py @@ -122,6 +122,15 @@ def build_ss( df[f"u{i+1}"].iloc[df.index > len(df) / 5] = 1.0 df.to_csv(in_csv_filename, index=False) + # Validate + ret = subprocess.run([ + "fmpy", + "validate", + str(fmu_filename), + ]).returncode + if ret != 0: + raise Exception("Validation failed") + # Simulate sim_cmd = [ "fmpy", diff --git a/setup.cfg b/setup.cfg index b11abec..e85b1d0 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.2.6 +current_version = 0.2.7 commit = False tag = False diff --git a/setup.py b/setup.py index 8d83180..e7a2c1a 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,6 @@ install_requires=install_requires, extras_require={"dev": dev_requires}, url="https://github.com/hyumo/qfmu", - version="0.2.6", + version="0.2.7", zip_safe=False, ) diff --git a/src/qfmu/__init__.py b/src/qfmu/__init__.py index 9cb042b..890cd8c 100644 --- a/src/qfmu/__init__.py +++ b/src/qfmu/__init__.py @@ -4,7 +4,7 @@ __author__ = """Hang Yu""" __email__ = "yuhang.neu@gmail.com" -__version__ = "0.2.6" +__version__ = "0.2.7" __module_path__ = pathlib.Path(__file__).parent __template_path__ = __module_path__ / "codegen" / "templates"