StepVoltage

model StepVoltage "Step voltage source"
    parameter SI.Voltage V(start = 1) "Height of step";

    extends Interfaces.VoltageSource(redeclare Modelica.Blocks.Sources.Step signalSource(final height = V));

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {-70, -70}, 
                        {0, -70}, 
                        {0, 70}, 
                        {69, 70}},
                    color = {192, 192, 192})}),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Polygon(
                    points = {
                        {-80, 90}, 
                        {-88, 68}, 
                        {-72, 68}, 
                        {-80, 90}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-80, 68}, 
                        {-80, -80}},
                    color = {192, 192, 192}), 
                Line(
                    points = {
                        {-80, -18}, 
                        {0, -18}, 
                        {0, 50}, 
                        {80, 50}},
                    thickness = 0.5), 
                Line(
                    points = {
                        {-90, -70}, 
                        {82, -70}},
                    color = {192, 192, 192}), 
                Polygon(
                    points = {
                        {90, -70}, 
                        {68, -62}, 
                        {68, -78}, 
                        {90, -70}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Text(
                    extent = {
                        {70, -80}, 
                        {94, -100}},
                    lineColor = {160, 160, 164},
                    textString = "time"), 
                Text(
                    extent = {
                        {-21, -72}, 
                        {25, -90}},
                    lineColor = {160, 160, 164},
                    textString = "startTime"), 
                Line(
                    points = {
                        {0, -17}, 
                        {0, -71}},
                    color = {192, 192, 192},
                    pattern = LinePattern.Dash), 
                Text(
                    extent = {
                        {-68, -36}, 
                        {-22, -54}},
                    lineColor = {160, 160, 164},
                    textString = "offset"), 
                Line(
                    points = {
                        {-13, 50}, 
                        {-13, -17}},
                    color = {192, 192, 192}), 
                Polygon(
                    points = {
                        {0, 50}, 
                        {-19, 50}, 
                        {0, 50}},
                    lineColor = {192, 192, 192},
                    pattern = LinePattern.Dash), 
                Polygon(
                    points = {
                        {-13, -17}, 
                        {-16, -4}, 
                        {-10, -4}, 
                        {-13, -17}, 
                        {-13, -17}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Polygon(
                    points = {
                        {-13, 50}, 
                        {-16, 37}, 
                        {-9, 37}, 
                        {-13, 50}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Text(
                    extent = {
                        {-68, 26}, 
                        {-22, 8}},
                    lineColor = {160, 160, 164},
                    textString = "V"), 
                Polygon(
                    points = {
                        {-13, -69}, 
                        {-16, -56}, 
                        {-10, -56}, 
                        {-13, -69}, 
                        {-13, -69}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-13, -18}, 
                        {-13, -70}},
                    color = {192, 192, 192}), 
                Polygon(
                    points = {
                        {-13, -18}, 
                        {-16, -31}, 
                        {-9, -31}, 
                        {-13, -18}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Text(
                    extent = {
                        {-67, 93}, 
                        {-2, 67}},
                    lineColor = {160, 160, 164},
                    textString = "v = p.v - n.v")}),
        Documentation(
            revisions = "<html>\n<ul>\n<li><em> 1998   </em>\n       by Christoph Clauss<br> initially implemented<br>\n       </li>\n</ul>\n</html>",
            info = "<html>\n<p>This voltage source uses the corresponding signal source of the Modelica.Blocks.Sources package. Care for the meaning of the parameters in the Blocks package. Furthermore, an offset parameter is introduced, which is added to the value calculated by the blocks source. The startTime parameter allows to shift the blocks source behavior on the time axis.</p>\n</html>"));
end StepVoltage;