PotentialSensor

model PotentialSensor "Sensor to measure the potential"
    extends Modelica.Icons.RotationalSensor;

    Interfaces.PositivePin p "pin to be measured"
        annotation (Placement(transformation(extent = {
            {-110, -10}, 
            {-90, 10}})));
    Modelica.Blocks.Interfaces.RealOutput phi(unit = "V") "Absolute voltage potential as output signal"
        annotation (Placement(transformation(extent = {
            {100, -10}, 
            {120, 10}})));
equation
    phi = p.v;
    p.i = 0;

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Text(
                    extent = {
                        {-29, -11}, 
                        {30, -70}},
                    textString = "V"), 
                Line(
                    points = {
                        {-70, 0}, 
                        {-90, 0}},
                    color = {0, 0, 255}), 
                Line(
                    points = {
                        {100, 0}, 
                        {70, 0}},
                    color = {0, 0, 127}), 
                Text(
                    extent = {
                        {-150, 80}, 
                        {150, 120}},
                    textString = "%name",
                    lineColor = {0, 0, 255})}),
        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>The potential sensor converts the voltage of a node (with respect to the ground node) into a real valued signal. It does not influence the current sum at the node which voltage is measured, therefore, the electrical behavior is not influenced by the sensor.</p>\n</html>"));
end PotentialSensor;