﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
1687	MassWithStopAndFriction simulation error	Martin Sjölund	Martin Sjölund	"{{{loadString(""model ActuatorMechanics 
  Modelica.Mechanics.Translational.Sources.Force force; 
  Modelica.Mechanics.Translational.Components.MassWithStopAndFriction mass(m=1,F_prop=0,F_Coulomb=10, smax=0.1, smin=0, L=0.01); 
  Modelica.Mechanics.Translational.Components.Spring spring(c=1000); 
  Modelica.Mechanics.Translational.Components.Fixed fixed; 
  Modelica.Mechanics.Translational.Sensors.PositionSensor sens_pos; 
equation 
  connect(force.flange, mass.flange_a); 
  connect(mass.flange_b, spring.flange_a); 
  connect(spring.flange_b, fixed.flange); 
  connect(sens_pos.flange, mass.flange_a); 
  force.f = 100; 
end ActuatorMechanics;"");
loadModel(Modelica);
instantiateModel(ActuatorMechanics);
simulate(ActuatorMechanics);
plot({mass.s,mass.stopped})}}}

Note that smax=0.1, smin=0 but our mass.s goes outside this limit. The reason seems to be that
{{{  when mass.stopped <> 0 then
    reinit(mass.s, if mass.stopped < 0 then mass.smin + mass.L / 2.0 else mass.smax + (-mass.L) / 2.0);
    if not initial() or Real(mass.stopped) * mass.v > 0.0 then
      reinit(mass.v, 0.0);
    end if;
  end when;}}}
is never executed. The C-code looks empty for these equations to me, but that might just be that I don't know enough about event generation.

http://stackoverflow.com/questions/9125218/on-the-using-of-masswithstopandfriction-and-hard-stops-in-openmodelica
http://openmodelica.org/index.php/forum/topic?id=513
and sent to openmodelicainterest"	defect	closed	high				fixed		Martin Sjölund Willi Braun
