Accelerate

model Accelerate "Forced movement of a flange according to an acceleration signal"
    extends Modelica.Mechanics.Rotational.Interfaces.PartialElementaryOneFlangeAndSupport2;

    SI.Angle phi(start = 0, fixed = true, stateSelect = StateSelect.prefer) "Rotation angle of flange with respect to support";
    SI.AngularVelocity w(start = 0, fixed = true, stateSelect = StateSelect.prefer) "Angular velocity of flange with respect to support";
    SI.AngularAcceleration a "Angular acceleration of flange with respect to support";
    Modelica.Blocks.Interfaces.RealInput a_ref(unit = "rad/s2") "Absolute angular acceleration of flange with respect to support as input signal"
        annotation (Placement(transformation(extent = {
            {-140, -20}, 
            {-100, 20}})));
equation
    a = a_ref;
    a = der(w);
    w = der(phi);
    phi = flange.phi - phi_support;

    annotation (
        Documentation(info = "<html>\n<p>\nThe input signal <strong>a</strong> defines an <strong>angular acceleration</strong>\nin [rad/s2]. Flange <strong>flange</strong> is <strong>forced</strong> to move relative to flange support with\nthis acceleration. The angular velocity <strong>w</strong> and the rotation angle\n<strong>phi</strong> of the flange are automatically determined by integration of\nthe acceleration.\n</p>\n<p>\nThe input signal can be provided from one of the signal generator\nblocks of the block library Modelica.Blocks.Sources.\n</p>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Rectangle(
                    lineColor = {64, 64, 64},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.HorizontalCylinder,
                    extent = {
                        {-100, -20}, 
                        {100, 20}}), 
                Line(points = {
                    {-30, -32}, 
                    {30, -32}}), 
                Line(points = {
                    {0, 52}, 
                    {0, 32}}), 
                Line(points = {
                    {-29, 32}, 
                    {30, 32}}), 
                Line(points = {
                    {0, -32}, 
                    {0, -100}}), 
                Text(
                    lineColor = {0, 0, 255},
                    extent = {
                        {-150, 60}, 
                        {150, 100}},
                    textString = "%name"), 
                Text(
                    extent = {
                        {-140, -60}, 
                        {-40, -30}},
                    lineColor = {128, 128, 128},
                    horizontalAlignment = TextAlignment.Right,
                    textString = "a_ref")}));
end Accelerate;