Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/NTNU-IHB/FMI4j
FMI4j is a software package for dealing with Functional Mockup Units (FMUs) on the JVM
https://github.com/NTNU-IHB/FMI4j
co-simulation fmi fmi-standard fmu java kotlin model-exchange
Last synced: 3 months ago
JSON representation
FMI4j is a software package for dealing with Functional Mockup Units (FMUs) on the JVM
- Host: GitHub
- URL: https://github.com/NTNU-IHB/FMI4j
- Owner: NTNU-IHB
- License: mit
- Created: 2017-11-24T14:07:34.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T15:56:55.000Z (almost 2 years ago)
- Last Synced: 2024-06-22T14:39:49.537Z (5 months ago)
- Topics: co-simulation, fmi, fmi-standard, fmu, java, kotlin, model-exchange
- Language: Java
- Homepage:
- Size: 59.2 MB
- Stars: 29
- Watchers: 4
- Forks: 16
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-fmi - FMI4j - Java/Kotlin library for dealing with FMUs on the JVM platform. [MIT] (FMI 2 / Libraries)
README
# FMI4j
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg?style=flat)](https://github.com/NTNU-IHB/FMI4j/issues)[![CI](https://github.com/NTNU-IHB/FMI4j/workflows/Build/badge.svg)](https://github.com/NTNU-IHB/FMI4j/actions)
[![Gitter](https://badges.gitter.im/NTNU-IHB/FMI4j.svg)](https://gitter.im/NTNU-IHB/FMI4j?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)FMI4j is a software package for dealing with Functional Mock-up Units (FMUs) on the Java Virtual Machine (JVM), written in [Kotlin](https://kotlinlang.org/).
FMI4j supports import of both [FMI](http://fmi-standard.org/) 1.0 and 2.0 for **Co-simulation**. For **Model Exchange** version 2.0 is supported.
Compared to other FMI libraries targeting the JVM, FMI4j is **considerably faster** due to the fact that we use JNI instead of JNA.
Considering FMI-import, a significant speedup (2-5x) compared to other open-source FMI implementations for the JVM should be expected.Maven artifacts are available through [Central](https://search.maven.org/search?q=g:info.laht.fmi4j)
***
```java
class Demo {
void main(String[] args) {
Fmu fmu = Fmu.from(new File("path/to/fmu.fmu")); //URLs are also supported
FmuSlave slave = fmu.asCoSimulationFmu().newInstance();slave.simpleSetup();
double t = 0;
double stop = 10;
double stepSize = 1.0/100;
while(t <= stop) {
if (!slave.doStep(t, stepSize)) {
break;
}
t += stepSize;
}
slave.terminate(); //or close, try with resources is also supported
fmu.close();
}
}
```Would you rather build FMUs using a JVM language? Check out [FMU4j](https://github.com/markaren/FMU4j)!
Or maybe build FMUs using Python? Check out [PythonFMU](https://github.com/NTNU-IHB/PythonFMU)!
Or would you rather simulate FMUs using C++? Check out [FMI4cpp](https://github.com/NTNU-IHB/FMI4cpp)!
Need to distribute your FMUs? [FMU-proxy](https://github.com/NTNU-IHB/FMU-proxy) to the rescue!
Need a complete co-simulation framework with SSP support? Check out [Vico](https://github.com/NTNU-IHB/Vico)