GithubHelp home page GithubHelp logo

threewaterm / reference-fmus Goto Github PK

View Code? Open in Web Editor NEW

This project forked from modelica/reference-fmus

0.0 0.0 0.0 1.31 MB

Functional Mock-up Units for development, testing and debugging

License: Other

Python 1.68% C 97.34% HTML 0.15% CMake 0.71% Yacc 0.05% Lex 0.07%

reference-fmus's Introduction

Reference FMUs

A set of hand-coded FMUs for development, testing and debugging of the Functional Mock-up Interface.

Use the fmusim executable to simulate an FMU:

> fmusim --help
Usage: fmusim [OPTION]... [FMU]
Simulate a Functional Mock-up Unit and write the output to result.csv.

  --help                           display this help and exit
  --interface-type [me|cs]         the interface type to use
  --tolerance [TOLERANCE]          relative tolerance
  --start-time [VALUE]             start time
  --stop-time [VALUE]              stop time
  --output-interval [VALUE]        set the output interval
  --start-value [name] [value]     set a start value
  --output-variable [name]         record a specific variable
  --input-file [FILE]              read input from a CSV file
  --output-file [FILE]             write output to a CSV file
  --log-fmi-calls                  log FMI calls
  --fmi-log-file [FILE]            set the FMI log file
  --solver [euler|cvode]           the solver to use
  --early-return-allowed           allow early return
  --event-mode-used                use event mode
  --record-intermediate-values     record outputs in intermediate update
  --initial-fmu-state-file [FILE]  file to read the serialized FMU state
  --final-fmu-state-file [FILE]    file to save the serialized FMU state

Example:

  fmusim BouncingBall.fmu  simulate with the default settings

You can download the pre-built Reference FMUs and fmusim executables from releases.

Repository structure

<model>

  • config.h - model specific types and definitions
  • FMI{1CS|1ME|2|3}.xml - model descriptions
  • model.c - implementation of the model

include

  • fmi{|2|3}Functions.h - FMI header files
  • model.h - generic model interface
  • cosimulation.h - generic co-simulation interface

src

  • fmi{1|2|3}Functions.c - FMI implementations
  • cosimulation.c - generic co-simulation

examples

  • *.c - various FMI 3.0 import examples
  • Examples.cmake - CMake configuration for the example projects

fmusim

  • sources of the fmusim executable

Build the FMUs

To build the FMUs you need CMake and a supported build tool e.g. Visual Studio ≥ 2013 , Xcode or make:

  • download or clone the repository

  • open the CMakeGUI

  • click Browse Source... and select the cloned or downloaded and extracted repository (that contains CMakeLists.txt)

  • click Browse Build... and select the folder where you want build the FMUs

  • click Configure and select the generator for your IDE / build tool

  • select the FMI_VERSION you want to build and optionally the FMI_TYPE (only for FMI 1.0)

  • click Generate to generate the project files

  • click Open Project or open the project in your build tool

  • build the project

The FMUs will be in the dist folder inside the selected build folder.

Building fmusim

To build the fmusim executable, run the ThirdParty/build_*.py Python scripts and enable WITH_FMUSIM before generating the CMake project.

License and attribution

Copyright © 2022, Modelica Association Project "FMI". All rights reserved. The code is released under the 2-Clause BSD License.

The Reference FMUs are a fork of the Test FMUs by Dassault Systèmes, which are a fork of the FMU SDK by QTronic, both released under the 2-Clause BSD License.

reference-fmus's People

Contributors

t-sommer avatar beutlich avatar clagms avatar klausschuch avatar andreas-junghanns avatar drzisga avatar ghannesen avatar spllr avatar maplesoft-fmigroup avatar martinotter avatar mblesken avatar nickbattle avatar ptaeuberds avatar pmai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.