Transformers#

Definition#

Roseau Load Flow can model single-phase, center-tapped and three-phase transformers.

Transformer parameters#

Transformers are modeled with the following parameters:

  • \(U_{1,\mathrm{nom.}}\): the phase-to-phase nominal voltage of the high voltages side (in V). This parameter is called uhv in the code.

  • \(U_{2,\mathrm{nom.}}\): the phase-to-phase nominal voltage of the low voltages side (in V). This parameter is called ulv in the code.

  • \(S_{\mathrm{nom.}}\): the nominal power of the transformer (in VA). This parameter is called sn in the code.

  • \(i_0\): the current during off-load test (in %). This parameter is called i0 in the code.

  • \(P_0\): the losses during off-load test (in W). This parameter is called p0 in the code.

  • \(P_{\mathrm{sc}}\): the losses during short-circuit test (in W). This parameter is called psc in the code.

  • \(V_{\mathrm{sc}}\): the voltage on LV side during short-circuit test (in %). This parameter is called vsc in the code.

For three-phase transformers, the windings configuration is also required. See the dedicated page of three-phase transformers for more details.

These parameters come from off-load and short-circuit tests. Internally, these parameters are converted into a series impedance \(\underline{Z_2}\) and the magnetizing admittance \(\underline{Y_{\mathrm{m}}}\).

First, we define the following quantities:

  • \(i_{1,\mathrm{nom.}}=\dfrac{S_{\mathrm{nom.}}}{U_{1,\mathrm{nom.}}}\): the nominal current of the winding on the primary side of the transformer

  • \(i_{2,\mathrm{nom.}}=\dfrac{S_{\mathrm{nom.}}}{U_{2,\mathrm{nom.}}}\): the nominal current of the winding on the secondary side of the transformer.

Off-load test#

We note \(P_0\) the losses and \(i_1^0\) the current in the primary winding of the transformer during this test. The following values can be computed:

\[\begin{split}\begin{aligned} i_0&=100\cdot \frac{i_1^0}{i_{1,\mathrm{nom.}}} \qquad \text{(in %)} \\ S_0 &= U_0\cdot i_1^0 = U_{1,\mathrm{nom.}}\cdot (i_0\cdot i_{1,\mathrm{nom.}}) = i_0\cdot S_{\mathrm{nom.}} \qquad \text{(in VA)}\\ R_{\mathrm{iron}} &= \dfrac{U_{1,\mathrm{nom.}}^2}{P_0} \qquad \text{(in Ohm)}\\ L_{\mathrm{m}} &= \dfrac{U_{1,\mathrm{nom.}}^2}{\omega\sqrt{S_0^2-P_0^2}} \text{(in H)} \end{aligned}\end{split}\]

Then, \(\underline{Y_{\mathrm{m}}}\) can be deduced:

\[\begin{split}\underline{Y_{\mathrm{m}}} = \left\{ \begin{aligned} \frac{1}{R_{\mathrm{iron}}} + \frac{1}{j\omega L_{\mathrm{m}}} & \qquad \text{if } S_0 > P_0 \\ \frac{1}{R_{\mathrm{iron}}} & \qquad \text{otherwise} \end{aligned} \right.\end{split}\]

Short-circuit test#

We note \(P_{\mathrm{sc}}\) the losses, \(U_{2,\mathrm{sc}}\) the voltage on LV side during this test. The following values can be computed:

\[\begin{split}\begin{aligned} V_{\mathrm{sc}}&= 100\cdot \frac{U_{2,\mathrm{sc}}}{U_{2,\mathrm{nom.}}} \qquad \text{(in %)} \\ Z_2&=\frac{U_{2,\mathrm{sc}}}{i_{2,\mathrm{nom.}}}=U_{2,\mathrm{sc}}\cdot\frac{U_{2,\mathrm{nom.}}}{ S_{\mathrm{nom.}}} =V_{\mathrm{sc}}\cdot\frac{U_{2,\mathrm{nom.}}^2}{S_{\mathrm{nom.}}} \qquad \text{(in Ohm)}\\ R_2&=\frac{P_{\mathrm{sc}}}{i_{2,\mathrm{nom.}}^2} = \frac{P_{\mathrm{sc}}\cdot U_{2,\mathrm{nom.}}^2}{ S_{\mathrm{nom.}}^2} \qquad \text{(in Ohm)} \\ X_2&= L_2\cdot\omega = \sqrt{Z_2^2-R_2^2} \qquad \text{(in Ohm)} \end{aligned}\end{split}\]

Then, \(\underline{Z_2}\) can be deduced:

\[\underline{Z_2} = R_2+j\cdot X_2\]

Usage#

To define the parameters of the transformers, use the TransformerParameters class. It takes as arguments the elements described in the previous section and converts them into the series impedance and the magnetizing admittance. The type argument of the constructor can take the following values:

  • "single" to model a single-phase transformer

  • "center" to model a center-tapped transformer

  • Any windings ("Dd0", "Dz6", etc.) to model a three-phase transformer.

from roseau.load_flow import TransformerParameters, Q_

# The transformer parameters for a single-phase transformer
single_phase_transformer_parameters = TransformerParameters(
    id="single_phase_transformer_parameters",
    type="single",  # <--- single-phase transformer
    uhv=Q_(20, "kV"),
    ulv=Q_(400, "V"),
    sn=Q_(160, "kVA"),
    p0=Q_(300, "W"),
    i0=Q_(1.4, "%"),
    psc=Q_(2000, "W"),
    vsc=Q_(4, "%"),
)

# The transformer parameters for a three-phase transformer
three_phase_transformer_parameters = TransformerParameters(
    id="three_phase_transformer_parameters",
    type="Dyn11",  # <--- three-phase transformer with delta primary and wye secondary
    uhv=Q_(20, "kV"),
    ulv=Q_(400, "V"),
    sn=Q_(160, "kVA"),
    p0=Q_(300, "W"),
    i0=Q_(1.4, "%"),
    psc=Q_(2000, "W"),
    vsc=Q_(4, "%"),
)

# The transformer parameters for a center-tapped transformer
center_tapped_transformer_parameters = TransformerParameters(
    id="center_tapped_transformer_parameters",
    type="center",  # <--- center-tapped transformer
    uhv=Q_(20, "kV"),
    ulv=Q_(400, "V"),
    sn=Q_(160, "kVA"),
    p0=Q_(300, "W"),
    i0=Q_(1.4, "%"),
    psc=Q_(2000, "W"),
    vsc=Q_(4, "%"),
)

A catalogue of transformer parameters is available. More details here.

Available models#

The following transformer models are available in Roseau Load Flow:

API Reference#

class TransformerParameters(id: int | str, type: str, uhv: float | Quantity[float], ulv: float | Quantity[float], sn: float | Quantity[float], p0: float | Quantity[float], i0: float | Quantity[float], psc: float | Quantity[float], vsc: float | Quantity[float], max_power: float | Quantity[float] | None = None)

Bases: Identifiable, JsonMixin, CatalogueMixin[DataFrame]

Parameters that define electrical models of transformers.

TransformerParameters constructor.

Parameters:
  • id – A unique ID of the transformer parameters, typically its canonical name.

  • type – The type of transformer parameters. It can be “single” for single-phase transformers, “center” for center-tapped transformers, or the name of the windings such as “Dyn11” for three-phase transformers. Allowed windings are “D” for delta, “Y” for wye (star), and “Z” for zigzag.

  • uhv – Phase-to-phase nominal voltages of the high voltages side (V)

  • ulv – Phase-to-phase nominal voltages of the low voltages side (V)

  • sn – The nominal power of the transformer (VA)

  • p0 – Losses during off-load test (W)

  • i0 – Current during off-load test (%)

  • psc – Losses during short-circuit test (W)

  • vsc – Voltages on LV side during short-circuit test (%)

  • max_power – The maximum power loading of the transformer (VA). It is not used in the load flow.

property uhv: Quantity[float]

Phase-to-phase nominal voltages of the high voltages side (V)

property ulv: Quantity[float]

Phase-to-phase nominal voltages of the low voltages side (V)

property sn: Quantity[float]

The nominal power of the transformer (VA)

property p0: Quantity[float]

Losses during off-load test (W)

property i0: Quantity[float]

Current during off-load test (%)

property psc: Quantity[float]

Losses during short-circuit test (W)

property vsc: Quantity[float]

Voltages on LV side during short-circuit test (%)

property max_power: Quantity[float] | None

The maximum power loading of the transformer (VA) if it is set.

to_zyk() tuple[Quantity[complex], Quantity[complex], Quantity[float], float]

Compute the transformer parameters z2, ym, k and orientation mandatory for some models.

Where:
  • z2: The series impedance of the transformer (Ohms).

  • ym: The magnetizing admittance of the transformer (Siemens).

  • k: The transformation ratio.

  • orientation: 1 for direct winding, -1 for reverse winding.

Returns:

The parameters (z2, ym, k, orientation).

classmethod from_dict(data: dict[str, Any], *, include_results: bool = True) Self

Create an element from a dictionary created with to_dict().

Note

This method does not work on all classes that define it as some of them require additional information to be constructed. It can only be safely used on the ElectricNetwork, LineParameters and TransformerParameters classes.

Parameters:
  • data – The dictionary containing the element’s data.

  • include_results – If True (default) and the results of the load flow are included in the dictionary, the results are also loaded into the element.

Returns:

The constructed element.

classmethod catalogue_path() Path

Get the path to the catalogue.

classmethod catalogue_data() DataFrame

Get the catalogue data.

classmethod from_catalogue(id: str | Pattern[str] | None = None, manufacturer: str | Pattern[str] | None = None, range: str | Pattern[str] | None = None, efficiency: str | Pattern[str] | None = None, type: str | Pattern[str] | None = None, sn: float | Quantity[float] | None = None, uhv: float | Quantity[float] | None = None, ulv: float | Quantity[float] | None = None) Self

Build a transformer parameters from one in the catalogue.

Parameters:
  • id – The id of the transformer to get from the catalogue. It can be a regular expression.

  • manufacturer – The name of the manufacturer to get. It can be a regular expression.

  • range – The name of the product range to get. It can be a regular expression.

  • efficiency – The efficiency of the transformer get. It can be a regular expression.

  • type – The type of the transformer to get. It can be a regular expression.

  • sn – The nominal power of the transformer to get.

  • uhv – The primary side voltage of the transformer to get.

  • ulv – The secondary side voltage of the transformer to get.

Returns:

The selected transformer. If several transformers fitting the filters are in the catalogue, an error is raised.

classmethod get_catalogue(id: str | Pattern[str] | None = None, manufacturer: str | Pattern[str] | None = None, range: str | Pattern[str] | None = None, efficiency: str | Pattern[str] | None = None, type: str | Pattern[str] | None = None, sn: float | Quantity[float] | None = None, uhv: float | Quantity[float] | None = None, ulv: float | Quantity[float] | None = None) DataFrame

Get the catalogue of available transformers.

You can use the parameters below to filter the catalogue. If you do not specify any parameter, all the catalogue will be returned.

Parameters:
  • id – An optional manufacturer to filter the output. It can be a regular expression.

  • manufacturer – An optional manufacturer to filter the output. It can be a regular expression.

  • range – An optional product range to filter the output. It can be a regular expression.

  • efficiency – An optional efficiency to filter the output. It can be a regular expression.

  • type – An optional type of the transformer. It can be a regular expression.

  • sn – An optional nominal power of the transformer to filter the output.

  • uhv – An optional primary side voltage to filter the output.

  • ulv – An optional secondary side voltage to filter the output.

Returns:

The catalogue data as a dataframe.

classmethod extract_windings(string: str) tuple[str, str, int]

Extract the windings and phase displacement from a given string

Parameters:

string – The string to parse.

Returns:

The first winding, the second winding, and the phase displacement

class Transformer(id: int | str, bus1: Bus, bus2: Bus, *, parameters: TransformerParameters, tap: float = 1.0, phases1: str | None = None, phases2: str | None = None, geometry: BaseGeometry | None = None)

Bases: AbstractBranch

A generic transformer model.

The model parameters are defined using the parameters argument.

Transformer constructor.

Parameters:
  • id – A unique ID of the transformer in the network branches.

  • bus1 – Bus to connect the first extremity of the transformer.

  • bus2 – Bus to connect the first extremity of the transformer.

  • tap – The tap of the transformer, for example 1.02.

  • parameters – Parameters defining the electrical model of the transformer. This is an instance of the TransformerParameters class and can be used by multiple transformers.

  • phases1 – The phases of the first extremity of the transformer. A string like "abc" or "abcn" etc. The order of the phases is important. For a full list of supported phases, see the class attribute allowed_phases. All phases must be present in the connected bus. By default determined from the transformer type.

  • phases2 – The phases of the second extremity of the transformer. See phases1.

  • geometry – The geometry of the transformer.

allowed_phases: Final = frozenset({'ab', 'abc', 'abcn', 'abn', 'an', 'bc', 'bcn', 'bn', 'ca', 'can', 'cn'})

The allowed phases for a transformer are:

  • P-P-P or P-P-P-N: "abc", "abcn" (three-phase transformer)

  • P-P or P-N: "ab", "bc", "ca", "an", "bn", "cn" (single-phase transformer or primary of center-tapped transformer)

  • P-P-N: "abn", "bcn", "can" (secondary of center-tapped transformer)

property tap: float

The tap of the transformer, for example 1.02.

property parameters: TransformerParameters

The parameters of the transformer.

property max_power: Quantity[float] | None

The maximum power loading of the transformer (in VA).

property res_violated: bool | None

Whether the transformer power exceeds the maximum power (loading > 100%).

Returns None if the maximum power is not set.