ControlledIdealClosingSwitch

model ControlledIdealClosingSwitch "Controlled ideal electrical closer"
    parameter SI.Voltage level = 0.5 "Switch level";

    extends Modelica.Electrical.Analog.Interfaces.IdealSwitch;

    Modelica.Electrical.Analog.Interfaces.Pin control "Control pin: control.v > level switch closed, otherwise switch open"
        annotation (Placement(transformation(
            origin = {0, 100},
            extent = {
                {-10, -10}, 
                {10, 10}},
            rotation = 90)));
equation
    off = control.v < level;
    control.i = 0;

    annotation (
        defaultComponentName = "switch",
        Documentation(
            info = "<html>\n<p>\nThe switching behaviour of the controlled ideal closing switch is controlled by the control pin: off = control.v &lt; level<br>\nFor further details, see partial model <a href=\"modelica://Modelica.Electrical.Analog.Interfaces.IdealSwitch\">IdealSwitch</a>.\n</p>\n\n</html>",
            revisions = "<html>\n<ul>\n<li><em>February 7, 2016   </em>\n       by Anton Haumer<br> extending from partial IdealSwitch<br>\n       </li>\n<li><em> March 11, 2009   </em>\n       by Christoph Clauss<br> conditional heat port added<br>\n       </li>\n<li><em> 1998   </em>\n       by Christoph Clauss<br> initially implemented<br>\n       </li>\n</ul>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    visible = useHeatPort,
                    points = {
                        {0, -100}, 
                        {0, 25}},
                    color = {127, 0, 0},
                    pattern = LinePattern.Dot)}));
end ControlledIdealClosingSwitch;