RelSpeedSensor

model RelSpeedSensor "Ideal sensor to measure the relative speed"
    extends Translational.Interfaces.PartialRelativeSensor;

    SI.Position s_rel "Distance between the two flanges (flange_b.s - flange_a.s)";
    Modelica.Blocks.Interfaces.RealOutput v_rel(unit = "m/s") "Relative velocity between two flanges (= der(flange_b.s) - der(flange_a.s)) as output signal"
        annotation (Placement(transformation(
            extent = {
                {-10, -10}, 
                {10, 10}},
            rotation = 270,
            origin = {0, -110})));
equation
    0 = flange_a.f;
    s_rel = flange_b.s - flange_a.s;
    v_rel = der(s_rel);

    annotation (
        Documentation(
            info = "<html>\n<p>\nMeasures the <em>relative speed v</em> of a flange in an ideal way and provides the result as\noutput signals (to be further processed with blocks of the\nModelica.Blocks library).\n</p>\n\n</html>",
            revisions = "<html>\n<p><strong>Release Notes:</strong></p>\n<ul>\n<li><em>First Version from August 26, 1999 by P. Beater</em></li>\n</ul>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Text(
                    extent = {
                        {8, -68}, 
                        {42, -102}},
                    textString = "v"), 
                Line(
                    points = {
                        {0, -100}, 
                        {0, -61}},
                    color = {0, 0, 127})}));
end RelSpeedSensor;