**Single phase two connectors AC system**

This package declares the functions that are used to implement the AC single phase models.

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

Name | Description |
---|---|

j | Return vector rotated by 90 degrees |

rotate | Rotate a vector of an angle Theta (anti-counterclock) |

product | Multiply two complex numbers represented by vectors x[2] and y[2] |

divide | Divide two complex numbers represented by vectors x[2] and y[2] |

thetaRel | Return absolute angle of rotating system as offset to thetaRef |

thetaRef | Return absolute angle of rotating reference system |

phase | Return phase |

phaseVoltages | Return phase to neutral voltages |

phaseCurrents | Return phase currents |

phasePowers | Return phase powers |

phasePowers_vi | Return phase powers |

systemVoltage | Return system voltage as function of phase voltages |

systemCurrent | Return system current as function of phase currents |

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 |

jj | Vectorized version of j |

**Return vector rotated by 90 degrees**

Extends from (Return vector rotated by 90 degrees).

Type | Name | Default | Description |
---|---|---|---|

Real | x[n] |

Type | Name | Description |
---|---|---|

Real | y[n] |

redeclare function extends j "Return vector rotated by 90 degrees"
algorithm
y := {-x[2], x[1]};
end j;

**Rotate a vector of an angle Theta (anti-counterclock)**

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

Type | Name | Default | Description |
---|---|---|---|

Real | x[n] | ||

Angle | theta | [rad] |

Type | Name | Description |
---|---|---|

Real | y[n] |

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];
end rotate;

**Multiply two complex numbers represented by vectors x[2] and y[2]**

Extends from (Multiply two vectors).

Type | Name | Default | Description |
---|---|---|---|

Real | x[n] | ||

Real | y[n] |

Type | Name | Description |
---|---|---|

Real | z[n] |

redeclare function extends product
"Multiply two complex numbers represented by vectors x[2] and y[2]"
algorithm
z := {x[1]*y[1] - x[2]*y[2], x[1]*y[2] + x[2]*y[1]};
end product;

**Divide two complex numbers represented by vectors x[2] and y[2]**

Extends from (Divide two vectors).

Type | Name | Default | Description |
---|---|---|---|

Real | x[n] | ||

Real | y[n] |

Type | Name | Description |
---|---|---|

Real | z[n] |

redeclare function extends divide
"Divide two complex numbers represented by vectors x[2] and y[2]"
algorithm
z := {x[1]*y[1] + x[2]*y[2], x[2]*y[1] - x[1]*y[2]}/(y[1]^2 + y[2]^2);
end divide;

**Return absolute angle of rotating system as offset to thetaRef**

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

Type | Name | Default | Description |
---|---|---|---|

Angle | theta[m] | [rad] |

Type | Name | Description |
---|---|---|

Angle | thetaRel | [rad] |

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

**Return absolute angle of rotating reference system**

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

Type | Name | Default | Description |
---|---|---|---|

Angle | theta[m] | [rad] |

Type | Name | Description |
---|---|---|

Angle | thetaRef | [rad] |

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

**Return phase**

Type | Name | Default | Description |
---|---|---|---|

Real | x[n] |

Type | Name | Description |
---|---|---|

Angle | phase | [rad] |

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

**Return phase to neutral voltages**

Extends from (Return phase to neutral voltages).

Type | Name | Default | Description |
---|---|---|---|

Voltage | V | system voltage [V] | |

Angle | phi | 0 | phase angle [rad] |

Type | Name | Description |
---|---|---|

Voltage | v[n] | phase to neutral voltages [V] |

redeclare function extends phaseVoltages
"Return phase to neutral voltages"
algorithm
v := {V*cos(phi), V*sin(phi)};
end phaseVoltages;

**Return phase currents**

Extends from (Return phase currents).

Type | Name | Default | Description |
---|---|---|---|

Current | I | system current [A] | |

Angle | phi | 0 | phase angle [rad] |

Type | Name | Description |
---|---|---|

Current | i[n] | phase currents [A] |

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

**Return phase powers**

Extends from (Return phase powers).

Type | Name | Default | Description |
---|---|---|---|

ActivePower | P | active system power [W] | |

Angle | phi | 0 | phase angle [rad] |

Type | Name | Description |
---|---|---|

Power | p[n] | phase powers [W] |

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

**Return phase powers**

Extends from (Return phase powers).

Type | Name | Default | Description |
---|---|---|---|

Voltage | v[n] | phase voltages [V] | |

Current | i[n] | phase currents [A] |

Type | Name | Description |
---|---|---|

Power | p[n] | phase powers [W] |

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

**Return system voltage as function of phase voltages**

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

Type | Name | Default | Description |
---|---|---|---|

Voltage | v[n] | [V] |

Type | Name | Description |
---|---|---|

Voltage | V | [V] |

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;

**Return system current as function of phase currents**

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

Type | Name | Default | Description |
---|---|---|---|

Current | i[n] | [A] |

Type | Name | Description |
---|---|---|

Current | I | [A] |

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;

**Return total power as function of phase powers**

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

Type | Name | Default | Description |
---|---|---|---|

Voltage | v[n] | phase voltages [V] | |

Current | i[n] | phase currents [A] |

Type | Name | Description |
---|---|---|

ActivePower | P | active system power [W] |

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

Automatically generated Mon May 4 10:19:58 2015.