TwoPin is a partial class, which means that it is not possible to make instances of it but it can be extended.
Conditional expressions or equations describe discontinuous and conditional models. When writing conditional expressions no end if is needed. If the condition has more than two options then it is not enough with an else-statement to express this, so we have to add one or more elseif-statements.
Load the Modelica Standard Library in order to be able to import as below.
We construct a circuit with a diode.