LBL logo

Buildings.Electrical.PhaseSystems.ThreePhase_dq0

AC system in dqo representation

Information

This package declares the functions that are used to implement the AC three-phase balanced models using the DQ0 representation.

Extends from PartialPhaseSystem (Base package of all phase systems).

Package Content

Name Description
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.j j Rotation(pi/2) of vector around {0,0,1} and projection on North plane
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.rotate rotate Rotate a vector of an angle theta (anti-counterclock)
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.jj jj Vectorized version of j
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.thetaRel thetaRel Return absolute angle of rotating system as offset to thetaRef
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.thetaRef thetaRef Return absolute angle of rotating reference system
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phase phase Return phase
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phaseVoltages phaseVoltages Return phase to neutral voltages
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phaseCurrents phaseCurrents Return phase currents
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phasePowers phasePowers Return phase powers
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phasePowers_vi phasePowers_vi Return phase powers
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.systemVoltage systemVoltage Return system voltage as function of phase voltages
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.systemCurrent systemCurrent Return system current as function of phase currents
Buildings.Electrical.PhaseSystems.ThreePhase_dq0.activePower activePower Return total power as function of phase powers
Inherited
phaseSystemName="UnspecifiedPhaseSystem" Name of the phase system represented by the package
n Number of independent voltage and current components
m Number of reference angles
Current Current for connector
Voltage Voltage for connector
ReferenceAngle Reference angle for connector
Buildings.Electrical.PhaseSystems.PartialPhaseSystem.product product Multiply two vectors
Buildings.Electrical.PhaseSystems.PartialPhaseSystem.divide divide Divide two vectors

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.j Buildings.Electrical.PhaseSystems.ThreePhase_dq0.j

Rotation(pi/2) of vector around {0,0,1} and projection on North plane

Information

Extends from (Return vector rotated by 90 degrees).

Inputs

TypeNameDefaultDescription
Realx[n]  

Outputs

TypeNameDescription
Realy[n] 

Modelica definition

redeclare function extends j "Rotation(pi/2) of vector around {0,0,1} and projection on North plane" algorithm y := cat(1, {-x[2], x[1]}, zeros(size(x,1)-2)); end j;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.rotate Buildings.Electrical.PhaseSystems.ThreePhase_dq0.rotate

Rotate a vector of an angle theta (anti-counterclock)

Information

Extends from (Rotate a vector of an angle theta (anti-counterclock)).

Inputs

TypeNameDefaultDescription
Realx[n]  
Angletheta [rad]

Outputs

TypeNameDescription
Realy[n] 

Modelica definition

redeclare function extends rotate "Rotate a vector of an angle theta (anti-counterclock)" algorithm y[1] := cos(theta)*x[1] - sin(theta)*x[2]; y[2] := sin(theta)*x[1] + cos(theta)*x[2]; y[3] := x[3]; end rotate;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.jj Buildings.Electrical.PhaseSystems.ThreePhase_dq0.jj

Vectorized version of j

Information

Extends from Modelica.Icons.Function (Icon for functions).

Inputs

TypeNameDefaultDescription
Realxx[:, :] array of voltage or current vectors

Outputs

TypeNameDescription
Realyy[size(xx, 1), size(xx, 2)]array of rotated vectors

Modelica definition

redeclare function jj "Vectorized version of j" extends Modelica.Icons.Function; input Real[:,:] xx "array of voltage or current vectors"; output Real[size(xx,1),size(xx,2)] yy "array of rotated vectors"; algorithm yy := cat(1, {-xx[2,:], xx[1,:]}, zeros(size(xx,1)-2, size(xx,2))); end jj;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.thetaRel Buildings.Electrical.PhaseSystems.ThreePhase_dq0.thetaRel

Return absolute angle of rotating system as offset to thetaRef

Information

Extends from (Return absolute angle of rotating system as offset to thetaRef).

Inputs

TypeNameDefaultDescription
Angletheta[m] [rad]

Outputs

TypeNameDescription
AnglethetaRel[rad]

Modelica definition

redeclare function extends thetaRel "Return absolute angle of rotating system as offset to thetaRef" algorithm thetaRel := theta[1]; end thetaRel;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.thetaRef Buildings.Electrical.PhaseSystems.ThreePhase_dq0.thetaRef

Return absolute angle of rotating reference system

Information

Extends from (Return absolute angle of rotating reference system).

Inputs

TypeNameDefaultDescription
Angletheta[m] [rad]

Outputs

TypeNameDescription
AnglethetaRef[rad]

Modelica definition

redeclare function extends thetaRef "Return absolute angle of rotating reference system" algorithm thetaRef := theta[2]; end thetaRef;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phase Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phase

Return phase

Information

Extends from (Return phase).

Inputs

TypeNameDefaultDescription
Realx[n]  

Outputs

TypeNameDescription
Anglephase[rad]

Modelica definition

redeclare function extends phase "Return phase" algorithm phase := atan2(x[2], x[1]); end phase;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phaseVoltages Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phaseVoltages

Return phase to neutral voltages

Information

Extends from (Return phase to neutral voltages).

Inputs

TypeNameDefaultDescription
VoltageV system voltage [V]
Anglephi0phase angle [rad]

Outputs

TypeNameDescription
Voltagev[n]phase to neutral voltages [V]

Modelica definition

redeclare function extends phaseVoltages "Return phase to neutral voltages" protected Voltage neutral_v = 0; algorithm v := {V*cos(phi), V*sin(phi), sqrt(3)*neutral_v}/sqrt(3); end phaseVoltages;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phaseCurrents Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phaseCurrents

Return phase currents

Information

Extends from (Return phase currents).

Inputs

TypeNameDefaultDescription
CurrentI system current [A]
Anglephi0phase angle [rad]

Outputs

TypeNameDescription
Currenti[n]phase currents [A]

Modelica definition

redeclare function extends phaseCurrents "Return phase currents" algorithm i := {I*cos(phi), I*sin(phi), 0}; end phaseCurrents;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phasePowers Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phasePowers

Return phase powers

Information

Extends from (Return phase powers).

Inputs

TypeNameDefaultDescription
ActivePowerP active system power [W]
Anglephi0phase angle [rad]

Outputs

TypeNameDescription
Powerp[n]phase powers [W]

Modelica definition

redeclare function extends phasePowers "Return phase powers" algorithm p := {P, P*tan(phi), 0}; end phasePowers;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phasePowers_vi Buildings.Electrical.PhaseSystems.ThreePhase_dq0.phasePowers_vi

Return phase powers

Information

Extends from (Return phase powers).

Inputs

TypeNameDefaultDescription
Voltagev[n] phase voltages [V]
Currenti[n] phase currents [A]

Outputs

TypeNameDescription
Powerp[n]phase powers [W]

Modelica definition

redeclare function extends phasePowers_vi "Return phase powers" algorithm p := {v[1:2]*i[1:2], -j(v[1:2])*i[1:2], v[3]*i[3]}; end phasePowers_vi;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.systemVoltage Buildings.Electrical.PhaseSystems.ThreePhase_dq0.systemVoltage

Return system voltage as function of phase voltages

Information

Extends from (Return system voltage as function of phase voltages).

Inputs

TypeNameDefaultDescription
Voltagev[n] [V]

Outputs

TypeNameDescription
VoltageV[V]

Modelica definition

redeclare function extends systemVoltage "Return system voltage as function of phase voltages" algorithm V := Modelica.Fluid.Utilities.regRoot(v*v, delta= 1e-5); end systemVoltage;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.systemCurrent Buildings.Electrical.PhaseSystems.ThreePhase_dq0.systemCurrent

Return system current as function of phase currents

Information

Extends from (Return system current as function of phase currents).

Inputs

TypeNameDefaultDescription
Currenti[n] [A]

Outputs

TypeNameDescription
CurrentI[A]

Modelica definition

redeclare function extends systemCurrent "Return system current as function of phase currents" algorithm I := Modelica.Fluid.Utilities.regRoot(i*i, delta= 1e-5); end systemCurrent;

Buildings.Electrical.PhaseSystems.ThreePhase_dq0.activePower Buildings.Electrical.PhaseSystems.ThreePhase_dq0.activePower

Return total power as function of phase powers

Information

Extends from (Return total power as function of phase powers).

Inputs

TypeNameDefaultDescription
Voltagev[n] phase voltages [V]
Currenti[n] phase currents [A]

Outputs

TypeNameDescription
ActivePowerPactive system power [W]

Modelica definition

redeclare function extends activePower "Return total power as function of phase powers" algorithm P := v[1]*i[1]; end activePower;

http://simulationresearch.lbl.gov/modelica