IdealThyristor

model IdealThyristor "Ideal thyristor"
    extends Modelica.Electrical.Analog.Interfaces.IdealSemiconductor;

    Modelica.Blocks.Interfaces.BooleanInput fire annotation (Placement(
        transformation(
            origin = {100, 120},
            extent = {
                {-20, -20}, 
                {20, 20}},
            rotation = 270),
        iconTransformation(
            extent = {
                {-20, -20}, 
                {20, 20}},
            rotation = 270,
            origin = {100, 120})));
equation
    off = s < 0 or pre(off) and not fire;

    annotation (
        defaultComponentName = "thyristor",
        Documentation(
            info = "<html>\n<p>\nThis is an ideal thyristor, for details see partial model <a href=\"modelica://Modelica.Electrical.Analog.Interfaces.IdealSemiconductor\">IdealSemiconductor</a><br>\nThe thyristor is conducting if voltage &gt; Vknee AND fire = true.<br>\nIf fire gets false, the current has to fall below Vknee*Goff, then the thyristor gets locking.</p>\n</html>",
            revisions = "<html>\n<ul>\n<li><em>February 7, 2016   </em>\n       by Anton Haumer<br> extending from partial IdealSemiconductor<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>Mai 7, 2004   </em>\n       by Christoph Clauss and Anton Haumer<br> Vknee added<br>\n       </li>\n<li><em>some years ago   </em>\n       by Christoph Clauss<br> realized<br>\n       </li>\n</ul>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {40, 50}, 
                        {60, 30}},
                    color = {0, 0, 255}), 
                Line(
                    visible = useHeatPort,
                    points = {
                        {0, -100}, 
                        {0, -20}},
                    color = {127, 0, 0},
                    pattern = LinePattern.Dot), 
                Line(
                    points = {
                        {30, 20}, 
                        {58, 48}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {100, 90}, 
                        {100, 100}},
                    color = {0, 0, 255})}),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {20, 10}, 
                        {70, 40}},
                    thickness = 0.5)}));
end IdealThyristor;