GeneralTorqueToAngleAdaptor

model GeneralTorqueToAngleAdaptor "Signal adaptor for a rotational flange with angle, speed, and acceleration as outputs and torque as input (especially useful for FMUs)"
    extends Modelica.Blocks.Interfaces.Adaptors.FlowToPotentialAdaptor(final Name_p = "phi", final Name_pder = "w", final Name_pder2 = "a", final Name_f = "tau", final Name_fder = "der(tau)", final Name_fder2 = "der2(tau)", final use_fder = false, final use_fder2 = false, final p(unit = "rad"), final pder(unit = "rad/s"), final pder2(unit = "rad/s2"), final f(unit = "N.m"), final fder(unit = "N.m/s"), final fder2(unit = "N.m/s2"));

    Modelica.Mechanics.Rotational.Interfaces.Flange_a flange annotation (Placement(transformation(extent = {
        {-30, -10}, 
        {-10, 10}})));
equation
    u = flange.tau "input = flow = torque";
    y = flange.phi "output = potential = angle";

    annotation (
        defaultComponentName = "torqueToAngleAdaptor",
        Documentation(info = "<html>\n<p>\nAdaptor between a flange connector and a signal representation of the flange.\nThis component is used to provide a pure signal interface around a Rotational model\nand export this model in form of an input/output block,\nespecially as FMU (<a href=\"https://www.fmi-standard.org\">Functional Mock-up Unit</a>).\nThis adaptor has torque as input and angle, angular velocity and angular acceleration as output signals.\n</p>\n</html>"),
        Icon(graphics = {
            Rectangle(
                extent = {
                    {-20, 100}, 
                    {20, -100}},
                lineColor = {95, 95, 95},
                radius = 10,
                lineThickness = 0.5)}));
end GeneralTorqueToAngleAdaptor;