model ConstantMagneticPotentialDifference "Source with constant magnetic potential difference"
extends Interfaces.PartialTwoPort;
parameter Modelica.SIunits.Frequency f(start = 1) "Frequency of the source";
parameter Modelica.SIunits.ComplexMagneticPotentialDifference V_m = Complex(re = 1, im = 0) "Complex magnetic potential difference";
Modelica.SIunits.MagneticPotentialDifference abs_V_m = Modelica.ComplexMath.'abs'(V_m) "Magnitude of complex magnetic potential difference";
Modelica.SIunits.Angle arg_V_m = Modelica.ComplexMath.arg(V_m) "Argument of complex magnetic potential difference";
Modelica.SIunits.ComplexMagneticFlux Phi "Complex magnetic flux";
Modelica.SIunits.MagneticPotentialDifference abs_Phi = Modelica.ComplexMath.'abs'(Phi) "Magnitude of complex magnetic flux";
Modelica.SIunits.Angle arg_Phi = Modelica.ComplexMath.arg(Phi) "Argument of complex magnetic flux";
equation
Connections.root(port_p.reference);
port_p.Phi + port_n.Phi = Complex(0, 0);
omega = 2 * Modelica.Constants.pi * f;
port_p.Phi = Phi;
port_p.V_m - port_n.V_m = V_m;
annotation (
defaultComponentName = "magVoltageSource",
Icon(
coordinateSystem(
preserveAspectRatio = false,
extent = {
{-100, -100},
{100, 100}}),
graphics = {
Ellipse(
extent = {
{-50, -50},
{50, 50}},
lineColor = {255, 127, 0},
fillColor = {255, 255, 255},
fillPattern = FillPattern.Solid),
Line(
points = {
{100, 0},
{50, 0}},
color = {255, 127, 0}),
Line(
points = {
{-50, 0},
{-100, 0}},
color = {255, 127, 0}),
Line(
points = {
{-50, 0},
{50, 0}},
color = {255, 127, 0}),
Text(
extent = {
{150, 108},
{-150, 68}},
lineColor = {0, 0, 255},
textString = "%name"),
Line(
points = {
{-80, 20},
{-60, 20}},
color = {255, 127, 0}),
Line(
points = {
{-70, 30},
{-70, 10}},
color = {255, 127, 0}),
Line(
points = {
{60, 20},
{80, 20}},
color = {255, 127, 0})}),
Documentation(info = "<html>\n<p>\nSource of constant magnetomotive force.\n</p>\n\n<h4>See also</h4>\n<p>\n<a href=\"modelica://Modelica.Magnetic.QuasiStatic.FundamentalWave.Sources.SignalMagneticPotentialDifference\">\nSignalMagneticPotentialDifference</a>,\n<a href=\"modelica://Modelica.Magnetic.QuasiStatic.FundamentalWave.Sources.ConstantFlux\">\nConstantFlux</a>,\n<a href=\"modelica://Modelica.Magnetic.QuasiStatic.FundamentalWave.Sources.SignalFlux\">\nSignalFlux</a>\n</p>\n</html>"));
end ConstantMagneticPotentialDifference;