Modelica.Electrical.Machines.SpacePhasors.Functions

Functions for space phasor transformation

Information


This package contains space phasor transformation functions for use in calculations:

Extends from Modelica.Icons.Library (Icon for library).

Package Content

NameDescription
Modelica.Electrical.Machines.SpacePhasors.Functions.ToSpacePhasor ToSpacePhasor Conversion: three phase -> space phasor
Modelica.Electrical.Machines.SpacePhasors.Functions.FromSpacePhasor FromSpacePhasor Conversion: space phasor -> three phase
Modelica.Electrical.Machines.SpacePhasors.Functions.Rotator Rotator Rotates space phasor
Modelica.Electrical.Machines.SpacePhasors.Functions.ToPolar ToPolar Converts a space phasor to polar coordinates
Modelica.Electrical.Machines.SpacePhasors.Functions.FromPolar FromPolar Converts a space phasor from polar coordinates


Modelica.Electrical.Machines.SpacePhasors.Functions.ToSpacePhasor Modelica.Electrical.Machines.SpacePhasors.Functions.ToSpacePhasor

Conversion: three phase -> space phasor

Information


Transformation of three phase values (voltages or currents) to space phasor and zero sequence value:
y[k] = X0 + {cos(-(k - 1)/m*2*pi),-sin(-(k - 1)/m*2*pi) * X[Re,Im]
were y designates three phase values, X[Re,Im] designates the space phasor and X0 designates the zero sequence system.

Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
Realx[3]  

Outputs

TypeNameDescription
Realy[2] 
Realy0 

Modelica definition

function ToSpacePhasor "Conversion: three phase -> space phasor"
  extends Modelica.Icons.Function;
  constant Integer m=3 "number of phases";
  constant Real pi=Modelica.Constants.pi;
  input Real x[3];
  output Real y[2];
  output Real y0;
algorithm 
  y := zeros(2);
  for k in 1:m loop
    y := y + 2/m*{+cos((k - 1)/m*2*pi), +sin(+(k - 1)/m*2*pi)}*x[k];
  end for;
  y0 := 1/m*sum(x);
end ToSpacePhasor;

Modelica.Electrical.Machines.SpacePhasors.Functions.FromSpacePhasor Modelica.Electrical.Machines.SpacePhasors.Functions.FromSpacePhasor

Conversion: space phasor -> three phase

Information


Transformation of space phasor and zero sequence value to three phase values (voltages or currents):
Y0 = sum(x[k])/m
Y[Re,Im] = sum(2/m*{cos((k - 1)/m*2*pi),sin((k - 1)/m*2*pi)}*x[k])
were x designates three phase values, Y[Re,Im] designates the space phasor and Y0 designates the zero sequence system.

Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
Realx[2]  
Realx0  

Outputs

TypeNameDescription
Realy[3] 

Modelica definition

function FromSpacePhasor "Conversion: space phasor -> three phase"
  extends Modelica.Icons.Function;
  constant Integer m=3 "number of phases";
  constant Real pi=Modelica.Constants.pi;
  input Real x[2];
  input Real x0;
  output Real y[3];
algorithm 
  for k in 1:m loop
    y[k] := x0 + {cos(-(k - 1)/m*2*pi),-sin(-(k - 1)/m*2*pi)}*x;
  end for;
end FromSpacePhasor;

Modelica.Electrical.Machines.SpacePhasors.Functions.Rotator Modelica.Electrical.Machines.SpacePhasors.Functions.Rotator

Rotates space phasor

Information


Rotates a space phasor (voltage or current) by the angle provided by input argument "angle" from one coordinate system into another:
y[Re,Im] := {{+cos(-angle),-sin(-angle)},{+sin(-angle),+cos(-angle)}}*x[Re,Im]
where y[Re,Im] designates the space phasor in the new coordinate system (twisted by angle against old coordinate system) and y[Re,Im] designates the space phasor in the old coordinate system.

Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
Realx[2]  
Angleangle [rad]

Outputs

TypeNameDescription
Realy[2] 

Modelica definition

function Rotator "Rotates space phasor"
  extends Modelica.Icons.Function;
  input Real x[2];
  input Modelica.SIunits.Angle angle;
  output Real y[2];
protected 
  Real RotationMatrix[2,2] = {{+cos(-angle),-sin(-angle)},{+sin(-angle),+cos(-angle)}};
algorithm 
  y := RotationMatrix*x;
end Rotator;

Modelica.Electrical.Machines.SpacePhasors.Functions.ToPolar Modelica.Electrical.Machines.SpacePhasors.Functions.ToPolar

Converts a space phasor to polar coordinates

Information


Converts a space phasor from rectangular coordinates to polar coordinates, providing angle=0 for {0,0}.

Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
Realx[2]  

Outputs

TypeNameDescription
Realabsolute 
Angleangle[rad]

Modelica definition

function ToPolar "Converts a space phasor to polar coordinates"
  extends Modelica.Icons.Function;
  constant Real small=Modelica.Constants.small;
  input Real x[2];
  output Real absolute;
  output Modelica.SIunits.Angle angle;
algorithm 
  absolute := sqrt(x[1]^2 + x[2]^2);
  angle := if absolute <= small then 0 else Modelica.Math.atan2(x[2], x[1]);
/*
  if absolute <= small then
    angle := 0;
  else
    if x[2] >= 0 then
      angle :=  Modelica.Math.acos(x[1]/absolute);
    else
      angle := -Modelica.Math.acos(x[1]/absolute);
    end if;
  end if;
*/
end ToPolar;

Modelica.Electrical.Machines.SpacePhasors.Functions.FromPolar Modelica.Electrical.Machines.SpacePhasors.Functions.FromPolar

Converts a space phasor from polar coordinates

Information


Converts a space phasor from polar coordinates to rectangular coordinates.

Extends from Modelica.Icons.Function (Icon for a function).

Inputs

TypeNameDefaultDescription
Realabsolute  
Angleangle [rad]

Outputs

TypeNameDescription
Realx[2] 

Modelica definition

function FromPolar "Converts a space phasor from polar coordinates"
  extends Modelica.Icons.Function;
  constant Real pi=Modelica.Constants.pi;
  constant Real small=Modelica.Constants.small;
  input Real absolute;
  input Modelica.SIunits.Angle angle;
  output Real x[2];
algorithm 
  x := absolute*{cos(angle),sin(angle)};
end FromPolar;

HTML-documentation generated by Dymola Sun Jan 17 21:10:55 2010.