OpenModelica modelling Coulomb friction: Translation Error, post-optimization module findZeroCrossings (simulation) failed

前端 未结 4 1558
名媛妹妹
名媛妹妹 2021-01-23 11:44

I\'m trying to simulate Coulomb friction in Modelica. The basic concept is to check if relative velocity speed between to surfaces is less than a constant and the external force

4条回答
  •  失恋的感觉
    2021-01-23 12:34

    You can use noEvent on the conditions that might generate events in the function. Note that you don't need to extend the model with the function. It should actually not work (to extend a model from a function), but it seems we don't check for it.

    The model that compiles for me is below:

    package Friction
    
      function coulombFriction
        input Real relVel;
        input Real shearForce;
        input Real normalForce;
        input Real statfricco;
        input Real kinfricco;
        output Real fricForce;
      algorithm
        if noEvent(relVel==0) and noEvent(abs(shearForce)

提交回复
热议问题