RealExpression

block RealExpression "Set output signal to a time varying Real expression"
    Modelica.Blocks.Interfaces.RealOutput y = 0 "Value of Real output"
        annotation (
            Dialog(group = "Time varying output signal"),
            Placement(transformation(extent = {
                {100, -10}, 
                {120, 10}})));

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = false,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Rectangle(
                    extent = {
                        {-100, 40}, 
                        {100, -40}},
                    fillColor = {235, 235, 235},
                    fillPattern = FillPattern.Solid,
                    borderPattern = BorderPattern.Raised), 
                Text(
                    extent = {
                        {-96, 15}, 
                        {96, -15}},
                    textString = "%y"), 
                Text(
                    extent = {
                        {-150, 90}, 
                        {150, 50}},
                    textString = "%name",
                    lineColor = {0, 0, 255})}),
        Documentation(info = "<html>\n<p>\nThe (time varying) Real output signal of this block can be defined in its\nparameter menu via variable <strong>y</strong>. The purpose is to support the\neasy definition of Real expressions in a block diagram. For example,\nin the y-menu the definition \"if time &lt; 1 then 0 else 1\" can be given in order\nto define that the output signal is one, if time &ge; 1 and otherwise\nit is zero. Note, that \"time\" is a built-in variable that is always\naccessible and represents the \"model time\" and that\nvariable <strong>y</strong> is both a variable and a connector.\n</p>\n</html>"));
end RealExpression;