RelAccSensor

model RelAccSensor "Ideal sensor to measure the relative angular acceleration between two flanges"
    extends Rotational.Interfaces.PartialRelativeSensor;

    SI.Angle phi_rel "Relative angle between two flanges (flange_b.phi - flange_a.phi)";
    SI.AngularVelocity w_rel "Relative angular velocity between two flanges";
    Modelica.Blocks.Interfaces.RealOutput a_rel(unit = "rad/s2") "Relative angular acceleration between two flanges as output signal"
        annotation (Placement(transformation(
            origin = {0, -110},
            extent = {
                {10, -10}, 
                {-10, 10}},
            rotation = 90)));
equation
    0 = flange_a.tau;
    a_rel = der(w_rel);
    phi_rel = flange_b.phi - flange_a.phi;
    w_rel = der(phi_rel);

    annotation (
        Documentation(info = "<html>\n<p>\nMeasures the <strong>relative angular acceleration a_rel</strong> between two flanges\nin an ideal way and provides the result as output signal <strong>a_rel</strong>\n(to be further processed with blocks of the Modelica.Blocks library).\n</p>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Text(
                    extent = {
                        {20, -116}, 
                        {160, -86}},
                    textString = "a_rel"), 
                Line(
                    points = {
                        {0, -100}, 
                        {0, -70}},
                    color = {0, 0, 127})}));
end RelAccSensor;