loading and running fmi-standard FMUs in .NET
The binary package is available from NuGet as a .NETStandard2.1 lib.
This is a limited implementation of the fmi-standards.
Available features :
The features are verified with the reference FMUs.
using var model = Model.Load("BouncingBall.fmu");
var height = model.Variables["h"];
var velocity = model.Variables["v"];
double h = 60.0, v = 0.0;
using var instance = model.CreateCoSimulationInstance("demo");
instance.WriteReal((height, h), (velocity, v));
instance.StartTime(0.0);
while (h > 0 || Math.Abs(v) > 0)
{
var values = instance.ReadReal(height, velocity).ToArray();
h = values[0];
v = values[1];
instance.AdvanceTime(0.1);
}
These GIFs were created with
FMI 2.0 | FMI 3.0 |
---|---|