{"id":13702922,"url":"https://github.com/modelica/Reference-FMUs","last_synced_at":"2025-05-05T07:30:33.971Z","repository":{"id":39992199,"uuid":"233620811","full_name":"modelica/Reference-FMUs","owner":"modelica","description":"Functional Mock-up Units for development, testing and debugging","archived":false,"fork":false,"pushed_at":"2025-04-14T12:36:05.000Z","size":4978,"stargazers_count":173,"open_issues_count":47,"forks_count":67,"subscribers_count":20,"default_branch":"main","last_synced_at":"2025-04-14T13:29:26.806Z","etag":null,"topics":["fmi","fmi-standard","hacktoberfest"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/modelica.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2020-01-13T14:56:46.000Z","updated_at":"2025-04-14T12:36:09.000Z","dependencies_parsed_at":"2023-10-23T14:52:58.175Z","dependency_job_id":"e1049d1d-f5b2-434c-a8a3-9d2768593560","html_url":"https://github.com/modelica/Reference-FMUs","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modelica%2FReference-FMUs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modelica%2FReference-FMUs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modelica%2FReference-FMUs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/modelica%2FReference-FMUs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/modelica","download_url":"https://codeload.github.com/modelica/Reference-FMUs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252458316,"owners_count":21751014,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fmi","fmi-standard","hacktoberfest"],"created_at":"2024-08-02T21:00:46.319Z","updated_at":"2025-05-05T07:30:30.379Z","avatar_url":"https://github.com/modelica.png","language":"JavaScript","funding_links":[],"categories":["FMI 3"],"sub_categories":["Tools"],"readme":"# Reference FMUs\n\nA set of hand-coded FMUs for development, testing and debugging of the [Functional Mock-up Interface](https://fmi-standard.org/).\n\n- [BouncingBall](BouncingBall) - a bouncing ball model with state events\n- [Dahlquist](Dahlquist) - Dahlquist test equation\n- [Feedthrough](Feedthrough) - all variable types\n- [Resource](Resource) - load data from a file\n- [Stair](Stair) - a counter with time events\n- [StateSpace](StateSpace) - arrays and structural parameters\n- [VanDerPol](VanDerPol) - Van der Pol test equation\n\nUse the [fmusim](fmusim) executable to simulate an FMU:\n\n```commandline\n\u003e fmusim --help\nUsage: fmusim [OPTION]... [FMU]\nSimulate a Functional Mock-up Unit and write the output to result.csv.\n\n  --help                           display this help and exit\n  --interface-type [me|cs]         the interface type to use\n  --tolerance [TOLERANCE]          relative tolerance\n  --start-time [VALUE]             start time\n  --stop-time [VALUE]              stop time\n  --output-interval [VALUE]        set the output interval\n  --start-value [name] [value]     set a start value\n  --output-variable [name]         record a specific variable\n  --input-file [FILE]              read input from a CSV file\n  --output-file [FILE]             write output to a CSV file\n  --log-fmi-calls                  log FMI calls\n  --fmi-log-file [FILE]            set the FMI log file\n  --solver [euler|cvode]           the solver to use\n  --early-return-allowed           allow early return\n  --event-mode-used                use event mode\n  --record-intermediate-values     record outputs in intermediate update\n  --initial-fmu-state-file [FILE]  file to read the serialized FMU state\n  --final-fmu-state-file [FILE]    file to save the serialized FMU state\n\nExample:\n\n  fmusim BouncingBall.fmu  simulate with the default settings\n```\n\nYou can download the pre-built Reference FMUs and fmusim executables from [releases](https://github.com/modelica/Reference-FMUs/releases).\n\n## CSV file structure\n\n`fmusim` uses CSV (comma separated values) files with the following structure as input and output format.\n\n- The file must be UTF-8 encoded.\n- The first line contains the names of the columns.\n- Each column name must match a variable name of the respective FMU.\n- Names that contain commas (`,`) must be surrounded by double quotes (`\"`).\n- The first column is the independent variable.\n- The values of the first column must be monotonically increasing.\n- Every line is terminated by a newline character (`\\n`).\n- Every column is separated by a comma (`,`).\n- Every line must have the same number of columns.\n- The values must be stored in the same format as the start values of the respective variables in the `modelDescription.xml`.\n- `String` and `Binary` variables can only be scalars or arrays with only one element.\n- String values must be surrounded by double quotes (`\"`).\n\nExample:\n\n```xml\n\u003cModelVariables\u003e\n    \u003cFloat64 name=\"time\" causality=\"independent\"/\u003e\n    \u003cFloat64 name=\"Float64 array\"\u003e\n        \u003cDimension valueReference=\"2\"/\u003e\n    \u003c/Float64\u003e\n    \u003cBoolean name=\"Boolean array\"\u003e\n        \u003cDimension valueReference=\"4\"/\u003e\n    \u003c/Boolean\u003e\n    \u003cBinary name=\"Binary scalar\"/\u003e\n\u003c/ModelVariables\u003e\n```\n\n```\ntime,\"Float64 array\",\"Boolean array\",\"Binary scalar\"\n0,1e-2 -1,0 false 1 true,666f6f\n0.1,0.02 -2,1 false 0 true,aa6f6f\n0.5,0.03 -3,1 true 0 false,66bb6f\n```\n\n## Repository structure\n\n`\u003cmodel\u003e`\n- `config.h` - model specific types and definitions\n- `FMI{1CS|1ME|2|3}.xml` - model descriptions\n- `model.c` - implementation of the model\n\n`include`\n- `fmi{|2|3}Functions.h` - FMI header files\n- `model.h` - generic model interface\n- `cosimulation.h` - generic co-simulation interface\n\n`src`\n- `fmi{1|2|3}Functions.c` - FMI implementations\n- `cosimulation.c` - generic co-simulation\n\n`examples`\n- `*.c` - various FMI 3.0 import examples\n- `Examples.cmake` - CMake configuration for the example projects\n\n`fmusim`\n- sources of the `fmusim` executable\n\n## Build the FMUs\n\nTo build the FMUs you need [CMake](https://cmake.org/) and a supported [build tool](https://cmake.org/cmake/help/latest/manual/cmake-generators.7.html) e.g. Visual Studio \u0026GreaterEqual; 2013 , Xcode or make:\n\n- download or clone the repository\n\n- open the [CMakeGUI](https://cmake.org/runningcmake/)\n\n- click `Browse Source...` and select the cloned or downloaded and extracted repository (that contains `CMakeLists.txt`)\n\n- click `Browse Build...` and select the folder where you want build the FMUs\n\n- click `Configure` and select the generator for your IDE / build tool\n\n- select the `FMI_VERSION` you want to build and optionally the `FMI_TYPE` (only for FMI 1.0)\n\n- click `Generate` to generate the project files\n\n- click `Open Project` or open the project in your build tool\n\n- build the project\n\nThe FMUs will be in the `dist` folder inside the selected build folder.\n\n## Building fmusim\n\nTo build the `fmusim` executable, run the `build/build_*.py \u003cplatform\u003e` Python scripts (where `\u003cplatform\u003e` is the platform to build for, e.g. `x86_64-windows`) and enable `WITH_FMUSIM` before generating the CMake project.\n\n## License and attribution\n\nCopyright \u0026copy; 2024, Modelica Association Project \"FMI\".\nAll rights reserved.\nThe code is released under the [2-Clause BSD License](LICENSE.txt).\n\nThe [Reference FMUs](https://github.com/modelica/Reference-FMUs) are a fork of the [Test FMUs](https://github.com/CATIA-Systems/Test-FMUs) by Dassault Syst\u0026egrave;mes, which are a fork of the [FMU SDK](https://github.com/qtronic/fmusdk) by QTronic, both released under the 2-Clause BSD License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodelica%2FReference-FMUs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmodelica%2FReference-FMUs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmodelica%2FReference-FMUs/lists"}