Extends from Modelica.Icons.Library (Icon for library).
Name | Description |
---|---|
SpacePhasor | Physical transformation: three phase <-> space phasors |
Rotator | Rotates space phasor |
Type | Name | Default | Description |
---|---|---|---|
Real | turnsRatio | 1 |
Type | Name | Description |
---|---|---|
PositivePlug | plug_p | |
NegativePlug | plug_n | |
PositivePin | zero | |
NegativePin | ground | |
SpacePhasor | spacePhasor |
model SpacePhasor "Physical transformation: three phase <-> space phasors" constant Integer m=3 "number of phases"; constant Real pi=Modelica.Constants.pi; parameter Real turnsRatio=1; Modelica.SIunits.Voltage v[m] "instantaneous phase voltages"; Modelica.SIunits.Current i[m] "instantaneous phase currents"; protected parameter Real TransformationMatrix[ 2, m]=2/m* {{cos(+(k - 1)/m*2*pi) for k in 1:m}, {+sin(+(k - 1)/m*2*pi) for k in 1:m}}; parameter Real InverseTransformation[m, 2]= {{cos(-(k - 1)/m*2*pi), -sin(-(k - 1)/m*2*pi)} for k in 1:m};public Modelica.Electrical.MultiPhase.Interfaces.PositivePlug plug_p(final m=m); Modelica.Electrical.MultiPhase.Interfaces.NegativePlug plug_n(final m=m); Modelica.Electrical.Analog.Interfaces.PositivePin zero; Modelica.Electrical.Analog.Interfaces.NegativePin ground; Modelica.Electrical.Analog.Basic.Ground gnd; Interfaces.SpacePhasor spacePhasor; equation v/turnsRatio = plug_p.pin.v - plug_n.pin.v; i*turnsRatio = +plug_p.pin.i; i*turnsRatio = -plug_n.pin.i; zero.v = 1/m*sum(v); spacePhasor.v_ = TransformationMatrix *v; //v = fill(zero.v,m) + InverseTransformation*spacePhasor.v_; -zero.i = 1/m*sum(i); -spacePhasor.i_ = TransformationMatrix *i; //-i = fill(zero.i,m) + InverseTransformation*spacePhasor.i_;connect(gnd.p, ground); end SpacePhasor;
Type | Name | Description |
---|---|---|
SpacePhasor | spacePhasor_a | |
SpacePhasor | spacePhasor_b | |
input RealInput | angle |
model Rotator "Rotates space phasor" constant Real pi=Modelica.Constants.pi; protected Real RotationMatrix[2,2] = {{+cos(-angle),-sin(-angle)},{+sin(-angle),+cos(-angle)}}; //Real InverseRotator[2,2] = {{+cos(+angle),-sin(+angle)},{+sin(+angle),+cos(+angle)}};public Interfaces.SpacePhasor spacePhasor_a; Interfaces.SpacePhasor spacePhasor_b; Modelica.Blocks.Interfaces.RealInput angle; equation spacePhasor_b.v_ = RotationMatrix*spacePhasor_a.v_; //spacePhasor_a.v_ = InverseRotator*spacePhasor_b.v_; spacePhasor_b.i_ + RotationMatrix*spacePhasor_a.i_ = zeros(2); //spacePhasor_a.i_ + InverseRotator*spacePhasor_b.i_ = zeros(2);end Rotator;