Near state events, the solver will take a shortened time step in order to align the step with the event. This can be beneficial for preserving accuracy near events; however, the time variable does not seem to update according to the step size causing an incorrect result from Dymola:
Here is the Modelica code to reproduce the problem:
model Unnamed
Modelica.Blocks.Sources.Trapezoid ramp(
period=1,
rising=0.1,
falling=0.1)
annotation (Placement(transformation(extent={{-52,20},{-32,40}})));
Modelica.Blocks.Continuous.FirstOrder firstOrder(T=0.001)
annotation (Placement(transformation(extent={{-20,20},{0,40}})));
Modelica.Blocks.Sources.Pulse pulse(period=0.1222)
annotation (Placement(transformation(extent={{-40,-20},{-20,0}})));
equation
connect(firstOrder.u, ramp.y)
annotation (Line(points={{-22,30},{-31,30}}, color={0,0,127}));
annotation (uses(Modelica(version="3.2.2")), experiment(
Interval=0.001,
__Dymola_fixedstepsize=0.001,
__Dymola_Algorithm="Euler"));
end Unnamed;
Is there a way to disable the event handling in Dymola and keep the Euler time step fixed? Or better, cause the time variable to properly update. Thanks
There are two parts:
/DFindEvent_=0
for Visual Studio - I believe it should be-DFindEvent_=0
for gcc.However, in many cases this will cause less accurate handling of events, which will cause problems, e.g., clutches not fully locking in mechanical systems.