﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
4229	Augmented bouncing ball model falls through if exported and imported as FMU	Bernhard Thiele	Adeel Asghar	"The following bouncing ball model

{{{#!modelica
model BouncingBall
  parameter Real e=0.7 ""coefficient of restitution"";
  parameter Real g=9.81 ""gravity acceleration"";
  Real h(start=1) ""height of ball"";
  Real v ""velocity of ball"";
  Boolean flying(start=true) ""true, if ball is flying"";
equation
  der(h) = v;
  der(v) = if flying then -g else 0;
  flying = not (h <= 0 and v <= 0);
  when h <= 0.0 then
    reinit(v, -e*pre(v));
  end when;
end BouncingBall;
}}}

avoids the well-known ""fall-through"" effect by the additional logic around the `flying` flag.

However if one exports and imports the model by the following MOS script, the ball will fall through.

{{{
bb_file_path :=realpath(""BouncingBall.mo"");
loadFile(bb_file_path);
translateModelFMU(BouncingBall);

bb_fmu_file_path := realpath(""BouncingBall.fmu"");
imported_fmu_mo_file := importFMU(""BouncingBall.fmu"");
loadFile(imported_fmu_mo_file);
simulate(BouncingBall_me_FMU, stopTime=3.0,outputFormat=""csv"");
}}}

[[Image(bouncingballplot.png)]]"	defect	new	high	Future	FMI				Peter Fritzson alejandro.danos@… rd.castro@… Martin Sjölund Lennart Ochel Willi Braun
