VoltageSource

model VoltageSource "Constant multiphase AC voltage"
    import Modelica.ComplexMath.j;
    import Modelica.ComplexMath.exp;

    extends Interfaces.Source;

    parameter Modelica.SIunits.Frequency f(start = 1) "Frequency of the source";
    parameter Modelica.SIunits.Voltage V[m](start = fill(1, m)) "RMS voltage of the source";
    parameter Modelica.SIunits.Angle phi[m] = -Modelica.Electrical.MultiPhase.Functions.symmetricOrientation(m) "Phase shift of the source";
equation
    v = {V[k] * exp(j * phi[k]) for k in 1:m};
    omega = 2 * Modelica.Constants.pi * f;

    annotation (
        Icon(graphics = {
            Line(
                points = {
                    {-50, 0}, 
                    {50, 0}},
                color = {85, 170, 255}), 
            Line(
                points = {
                    {-70, 30}, 
                    {-70, 10}},
                color = {85, 170, 255}), 
            Line(
                points = {
                    {-80, 20}, 
                    {-60, 20}},
                color = {85, 170, 255}), 
            Line(
                points = {
                    {60, 20}, 
                    {80, 20}},
                color = {85, 170, 255})}),
        Documentation(info = "<html>\n\n<p>\nThis model describes <em>m</em> constant voltage sources, specifying the complex voltages by the RMS voltages and the phase shifts\n(defaults are\n<a href=\"modelica://Modelica.Electrical.MultiPhase.Functions.symmetricOrientation\">-symmetricOrientation</a>).\n<em>m</em> <a href=\"modelica://Modelica.Electrical.QuasiStationary.SinglePhase.Sources.VoltageSource\">single phase VoltageSources</a> are used.\n</p>\n\n<h4>See also</h4>\n\n<p>\n<a href=\"modelica://Modelica.Electrical.QuasiStationary.SinglePhase.Sources.VoltageSource\">SinglePhase.VoltageSource</a>,\n<a href=\"modelica://Modelica.Electrical.QuasiStationary.MultiPhase.Sources.VariableVoltageSource\">VariableVoltageSource</a>,\n<a href=\"modelica://Modelica.Electrical.QuasiStationary.MultiPhase.Sources.CurrentSource\">CurrentSource</a>,\n<a href=\"modelica://Modelica.Electrical.QuasiStationary.MultiPhase.Sources.VariableCurrentSource\">VariableCurrentSource</a>\n</p>\n</html>"));
end VoltageSource;