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 primary side (in V). This parameter is called
up
in the code.\(U_{2,\mathrm{nom.}}\): the phase-to-phase nominal voltage of the secondary side (in V). This parameter is called
us
in the code.\(S_{\mathrm{nom.}}\): the nominal power of the transformer (in VA). This parameter is called
sn
in the code.\(Z_2\): the series impedance located at the secondary side of the transformer. It represents non-ideal transformer losses due to winding resistance and leakage reactance.
\(Y_m\): the magnetizing admittance located at the primary side of the transformer. It represents non-ideal transformer losses due to core magnetizing inductance and iron losses.
\(Z_2\) and \(Y_m\) parameters come from open-circuit and short-circuit tests. They can be obtained using the following tests results:
\(i_0\): the current during open-circuit test (in %). This parameter is called
i0
in the code.\(P_0\): the losses during open-circuit 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.
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.
Open-circuit and short-circuit tests¶
Open-circuit 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:
Then, \(\underline{Y_{\mathrm{m}}}\) can be deduced:
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:
Then, \(\underline{Z_2}\) can be deduced:
Import from OpenDSS¶
Transformer parameters can also be created using an OpenDSS transformer parameters. Only two-winding
three-phase transformers are currently supported. For more information and an example, see the
TransformerParameters.from_open_dss()
method.
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 vg
argument of the constructor can take the
following values:
"Ii0"
or"Ii6"
to model a single-phase transformer, in-phase or 180° phase shift respectively"Iii0"
or"Iii6"
to model a center-tapped transformer, in-phase or 180° phase shift respectively"Dd0"
,"Dyn11"
, etc. to model a three-phase transformer with different winding configurations
import roseau.load_flow as rlf
# The transformer parameters for a single-phase transformer
transformer_params_1ph = rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="transformer_params_1ph",
vg="Ii0", # <--- single-phase transformer
uhv=rlf.Q_(20, "kV"),
ulv=rlf.Q_(400, "V"),
sn=rlf.Q_(160, "kVA"),
p0=rlf.Q_(300, "W"),
i0=rlf.Q_(1.4, "%"),
psc=rlf.Q_(2000, "W"),
vsc=rlf.Q_(4, "%"),
)
assert transformer_params_1ph.type == "single-phase"
# Alternatively, if you have z2 and ym already:
# transformer_params_1ph = rlf.TransformerParameters(
# id="transformer_params_1ph",
# vg="Ii0",
# uhv=rlf.Q_(20, "kV"),
# ulv=rlf.Q_(400, "V"),
# sn=rlf.Q_(160, "kVA"),
# z2=rlf.Q_(0.0125+0.038j, "ohm"),
# ym=rlf.Q_(7.5e-7-5.5e-6j, "S"),
# )
# The transformer parameters for a three-phase transformer
transformer_params_3ph = rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="transformer_params_3ph",
vg="Dyn11", # <--- three-phase transformer with delta primary and wye secondary
uhv=rlf.Q_(20, "kV"),
ulv=rlf.Q_(400, "V"),
sn=rlf.Q_(160, "kVA"),
p0=rlf.Q_(300, "W"),
i0=rlf.Q_(1.4, "%"),
psc=rlf.Q_(2000, "W"),
vsc=rlf.Q_(4, "%"),
)
assert transformer_params_3ph.type == "three-phase"
# The transformer parameters for a center-tapped transformer
transformer_params_ct = rlf.TransformerParameters.from_open_and_short_circuit_tests(
id="transformer_params_ct",
vg="Iii0", # <--- center-tapped transformer
uhv=rlf.Q_(20, "kV"),
ulv=rlf.Q_(400, "V"),
sn=rlf.Q_(160, "kVA"),
p0=rlf.Q_(300, "W"),
i0=rlf.Q_(1.4, "%"),
psc=rlf.Q_(2000, "W"),
vsc=rlf.Q_(4, "%"),
)
assert transformer_params_ct.type == "center-tapped"
# Available vector groups:
print(rlf.TransformerParameters.allowed_vector_groups)
# "Dd0", "Dd6", ..., "Ii0", "Ii6", "Iii0", "Iii6",
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: Id, *, vg: str, uhv: float | Q_[float], ulv: float | Q_[float], sn: float | Q_[float], z2: complex | Q_[complex], ym: complex | Q_[complex], manufacturer: str | None = None, range: str | None = None, efficiency: str | None = None)
Bases:
roseau.load_flow.utils.Identifiable
,roseau.load_flow.utils.JsonMixin
,roseau.load_flow.utils.CatalogueMixin[pandas.DataFrame]
Parameters that define electrical models of transformers.
TransformerParameters constructor.
- Parameters:
id – A unique ID of the transformer parameters, typically its canonical name.
vg –
The vector group of the transformer.
For three-phase transformers,
Dyn11
denotes a delta-wye connection with -30° phase displacement. Allowed windings areD
for delta,Y
for wye,Z
for zigzag.For single-phase transformers,
Ii0
denotes a normal in-phase connection andIi6
denotes an inverted connection.For center-tapped transformers,
Iii0
denotes a normal in-phase connection andIii6
denotes an inverted connection.uhv – Rated phase-to-phase voltage of the HV side (V)
ulv – Rated no-load phase-to-phase voltage of the LV side (V)
sn – The nominal power of the transformer (VA)
z2 – The series impedance located at the secondary side of the transformer.
ym – The magnetizing admittance located at the primary side of the transformer.
manufacturer – The name of the manufacturer for the transformer. Informative only, it has no impact on the load flow. It is filled automatically when the parameters when imported from the catalogue.
range – The product range for the transformer as defined by the manufacturer. Informative only, it has no impact on the load flow. It is filled automatically when the parameters when imported from the catalogue.
efficiency – The efficiency class of the transformer. Informative only, it has no impact on the load flow. It is filled automatically when the parameters when imported from the catalogue. The efficiency class used in the catalogue follows the Eco-Design requirements as defined by the EN 50629 standard.
- allowed_vector_groups: Final
Allowed vector groups for transformers.
- property type: Literal['three-phase', 'single-phase', 'center-tapped']
The type of transformer parameters.
It can be
three-phase
,single-phase
orcenter-tapped
.
- property vg: str
The vector group of the transformer.
For three-phase transformers,
Dyn11
denotes a delta-wye connection with 30° lead phase displacement. Allowed windings areD
for delta,Y
for wye,Z
for zigzag.For single-phase transformers,
Ii0
denotes a normal in-phase connection andIi6
denotes an inverted connection.For center-tapped transformers,
Iii0
denotes a normal in-phase connection andIii6
denotes an inverted connection.
- property winding1: str
The primary winding of the transformer.
The following values are used: -
D
: a Delta connection -Y
orYn
: a Wye connection -Z
orZn
: a Zigzag connection -I
: single-phase
- property winding2: str
The secondary winding of the transformer.
The following values are used: -
d
: a Delta connection -y
oryn
: a Wye connection -z
orzn
: a Zigzag connection -i
: single-phase -ii
split-phase (i.e center-tapped)
- property phase_displacement: int
The phase rotation as indicated by the vector group.
- property orientation: float
1 for direct windings or -1 for reverse windings.
- Type:
The orientation of the transformer
- property manufacturer: str | None
The name of the manufacturer for the transformer.
Informative only, it has no impact on the load flow. It is filled automatically when the parameters are imported from the catalogue.
- property range: str | None
The product range for the transformer as defined by the manufacturer.
Informative only, it has no impact on the load flow. It is filled automatically when the parameters are imported from the catalogue.
- property efficiency: str | None
The efficiency class of the transformer.
Informative only, it has no impact on the load flow. It is filled automatically when the parameters imported from the catalogue. The efficiency class used in the catalogue follows the Eco-Design requirements as defined by the EN 50629 standard.
- classmethod from_power_factory(id: Id, *, tech: Literal[2, 'single-phase', 3, 'three-phase'], sn: float | Q_[float], uhv: float | Q_[float], ulv: float | Q_[float], vg_hv: str, vg_lv: str, phase_shift: int, uk: float | Q_[float], pc: float | Q_[float], curmg: float | Q_[float], pfe: float | Q_[float], manufacturer: str | None = None, range: str | None = None, efficiency: str | None = None) typing_extensions.Self
Create a transformer parameters object from PowerFactory “TypTr2” data.
Note that only two-winding three-phase transformers are currently supported.
- Parameters:
id – A unique ID of the transformer parameters.
tech – PwF parameter nt2ph (Technology). The technology of the transformer; either ‘single-phase’ or 2 for single-phase transformers or ‘three-phase’ or 3 for three-phase transformers.
sn – PwF parameter strn (Rated Power). The rated power of the transformer in (MVA).
uhv – PwF parameter utrn_h (Rated Voltage HV-Side). The rated phase-to-phase voltage of the transformer on the HV side.
ulv – PwF parameter utrn_l (Rated Voltage LV-Side). The rated phase-to-phase voltage of the transformer on the LV side.
vg_hv – PwF parameter tr2cn_h (Vector Group HV-Side). The vector group of the high voltage side. It can be one of ‘D’, ‘Y’, ‘Yn’, ‘Z’, ‘Zn’.
vg_lv – PwF parameter tr2cn_l (Vector Group LV-Side). The vector group of the low voltage side. It can be one of ‘d’, ‘y’, ‘yn’, ‘z’, ‘zn’.
phase_shift – PwF parameter nt2ag (Vector Group Phase Shift). The phase shift of the vector group in (degrees).
uk – PwF parameter uktr (Positive Sequence Impedance Short-Circuit Voltage). The positive sequence impedance i.e the voltage in (%) obtained from the short-circuit test.
pc – PwF parameter pcutr (Positive Sequence Impedance Copper Losses). The positive sequence impedance copper losses i.e the power in (kW) obtained from the short circuit test.
curmg – PwF parameter curmg (Magnetizing Impedance - No Load Current). The magnetizing current i.e. the current in (%) obtained from the no-load (open-circuit) test.
pfe – PwF parameter pfe (Magnetizing Impedance - No Load Losses). The magnetizing impedance i.e. the power losses in (kW) obtained from the no-load test.
manufacturer – The name of the manufacturer for the transformer. Informative only, it has no impact on the load flow.
range – The name of the product range for the transformer. Informative only, it has no impact on the load flow.
efficiency – The efficiency class of the transformer. Informative only, it has no impact on the load flow.
- Returns:
The corresponding transformer parameters object.
- classmethod from_open_dss(id: Id, *, conns: tuple[str, str], kvs: tuple[float, float] | FloatArrayLike1D, kvas: float | Q_[float] | tuple[float, float] | FloatArrayLike1D, leadlag: str, xhl: float, loadloss: float | Q_[float] | None = None, noloadloss: float | Q_[float] = 0, imag: float | Q_[float] = 0, rs: float | Q_[float] | tuple[float, float] | FloatArrayLike1D | None = None, manufacturer: str | None = None, range: str | None = None, efficiency: str | None = None) typing_extensions.Self
Create a transformer parameters object from OpenDSS “Transformer” data.
Note that only two-winding three-phase transformers are currently supported.
- Parameters:
id – The unique ID of the transformer parameters.
conns – OpenDSS parameter: Conns. Connection of the windings. One of {wye | ln} for wye connected banks or {delta | ll} for delta (line-line) connected banks.
kvs – OpenDSS parameter: KVs. Rated phase-to-phase voltage of the windings, kV. This is a sequence of two values equivalent to (Up, Us).
kvas – OpenDSS parameter: KVAs. Base kVA rating (OA rating) of the windings. Note that only one value is accepted as only two-winding transformers are accepted.
xhl – OpenDSS parameter: XHL. Percent reactance high-to-low (winding 1 to winding 2).
loadloss – OpenDSS parameter: %Loadloss. Percent Losses at rated load. Causes the %r values (cf. the %Rs parameter) to be set for windings 1 and 2.
noloadloss – OpenDSS parameter: %Noloadloss. Percent No load losses at nominal voltage. Default is 0. Causes a resistive branch to be added in parallel with the magnetizing inductance.
imag – OpenDSS parameter: %Imag. Percent magnetizing current. Default is 0. An inductance is used to represent the magnetizing current. This is embedded within the transformer model as the primitive Y matrix is being computed.
leadlag – OpenDSS parameter: LeadLag. {Lead | Lag | ANSI | Euro} Designation in mixed Delta-wye connections signifying the relationship between HV to LV winding. Default is ANSI 30 deg lag, e.g., Dy1 of Yd1 vector group. To get typical European Dy11 connection, specify either “lead” or “Euro”.
rs – OpenDSS parameter: %Rs. [OPTIONAL] Percent resistance of the windings on the rated kVA base. Only required if loadloss is not passed. Note that if rs is used along with loadloss, they have to have equivalent values. For a two-winding transformer, %rs=[0.1, 0.1] is equivalent to %loadloss=0.2.
manufacturer – The name of the manufacturer for the transformer. Informative only, it has no impact on the load flow.
range – The name of the product range for the transformer. Informative only, it has no impact on the load flow.
efficiency – The efficiency class of the transformer. Informative only, it has no impact on the load flow.
- Returns:
The corresponding transformer parameters object.
Example usage:
# DSS command: `New transformer.LVTR Buses=[sourcebus, A.1.2.3] Conns=[delta wye] KVs=[11, 0.4] KVAs=[250 250] %Rs=0.00 xhl=2.5 %loadloss=0` tp = rlf.TransformerParameters.from_open_dss( id="dss-tp", conns=("delta", "wye"), kvs=(11, 0.4), kvas=(250, 250), # alternatively pass a scalar `kvas=250` leadlag="euro", # THE ONLY OPENDSS MODEL WE CURRENTLY SUPPORT xhl=2.5, loadloss=0, noloadloss=0, # default value used in OpenDSS imag=0, # default value used in OpenDSS rs=0, # redundant with `loadloss=0` )
- classmethod from_open_and_short_circuit_tests(id: Id, *, vg: str, uhv: float | Q_[float], ulv: float | Q_[float], sn: float | Q_[float], p0: float | Q_[float], i0: float | Q_[float], psc: float | Q_[float], vsc: float | Q_[float], manufacturer: str | None = None, range: str | None = None, efficiency: str | None = None) typing_extensions.Self
Create a TransformerParameters object using the results of open-circuit and short-circuit tests.
- Parameters:
id – A unique ID of the transformer parameters, typically its canonical name.
vg –
The vector group of the transformer.
For three-phase transformers,
Dyn11
denotes a delta-wye connection with -30° phase displacement. Allowed windings areD
for delta,Y
for wye,Z
for zigzag.For single-phase transformers,
Ii0
denotes a normal in-phase connection andIi6
denotes an inverted connection.For center-tapped transformers,
Iii0
denotes a normal in-phase connection andIii6
denotes an inverted connection.uhv – Rated phase-to-phase voltage of the HV side (V).
ulv – Rated no-load phase-to-phase voltage of the LV side (V).
sn – The nominal power of the transformer (VA).
p0 – Losses during open-circuit test (W).
i0 – Current during open-circuit test (%).
psc – Losses during short-circuit test (W).
vsc – Voltages on LV side during short-circuit test (%).
manufacturer – The name of the manufacturer for the transformer. Informative only, it has no impact on the load flow. It is filled automatically when the parameters when imported from the catalogue.
range – The product range for the transformer as defined by the manufacturer. Informative only, it has no impact on the load flow. It is filled automatically when the parameters when imported from the catalogue.
efficiency – The efficiency class of the transformer. Informative only, it has no impact on the load flow. It is filled automatically when the parameters when imported from the catalogue. The efficiency class used in the catalogue follows the Eco-Design requirements as defined by the EN 50629 standard.
- classmethod from_dict(data: JsonDict, *, include_results: bool = True) typing_extensions.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(name: str | Pattern[str] | None = None, *, manufacturer: str | Pattern[str] | None = None, range: str | Pattern[str] | None = None, efficiency: str | Pattern[str] | None = None, vg: str | Pattern[str] | None = None, sn: float | Q_[float] | None = None, uhv: float | Q_[float] | None = None, ulv: float | Q_[float] | None = None, id: Id | None = None) typing_extensions.Self
Build a transformer parameters from one in the catalogue.
- Parameters:
name – The name of the transformer to get from the catalogue. It can be a regular expression. The name is subject to change when the catalogue is updated. Prefer using the other filters.
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.
vg – The vector group of the transformer to get. It can be a regular expression.
sn – The nominal power of the transformer to get.
uhv – The rated phase-to-phase voltage of the HV side of the transformer to get.
ulv – The rated no-load phase-to-phase voltage of the LV side of the transformer to get.
id – A unique ID for the created line parameters object (optional). If
None
(default), the id of the created object will be its name in the catalogue. Note that this parameter is not used in the data filtering.
- Returns:
The selected transformer. If several transformers fitting the filters are in the catalogue, an error is raised.
- classmethod get_catalogue(name: str | Pattern[str] | None = None, *, manufacturer: str | Pattern[str] | None = None, range: str | Pattern[str] | None = None, efficiency: str | Pattern[str] | None = None, vg: str | Pattern[str] | None = None, sn: float | Q_[float] | None = None, uhv: float | Q_[float] | None = None, ulv: float | Q_[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:
name – An optional name 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.
vg – An optional vector group of the transformer. It can be a regular expression.
sn – An optional nominal power of the transformer to filter the output.
uhv – An optional rated high voltage to filter the output.
ulv – An optional rated no-load low voltage to filter the output.
- Returns:
The catalogue data as a dataframe.
- classmethod extract_windings(vg: str) tuple[str, str, int]
Extract the windings and phase displacement from a given vector group
- Parameters:
vg –
The vector group of the transformer.
For three-phase transformers,
Dyn11
denotes a delta-wye connection with -30° phase displacement. Allowed windings areD
for delta,Y
for wye,Z
for zigzag.For single-phase transformers,
Ii0
denotes a normal in-phase connection andIi6
denotes an inverted connection.For center-tapped transformers,
Iii0
denotes a normal in-phase connection andIii6
denotes an inverted connection.- Returns:
The first winding, the second winding, and the phase displacement.
- class Transformer(id: Id, bus1: roseau.load_flow.models.buses.Bus, bus2: roseau.load_flow.models.buses.Bus, *, parameters: roseau.load_flow.models.transformers.parameters.TransformerParameters, tap: float = 1.0, phases1: str | None = None, phases2: str | None = None, max_loading: float | Q_[float] = 1, geometry: shapely.geometry.base.BaseGeometry | None = None)
Bases:
roseau.load_flow.models.branches.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 attributeallowed_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
.max_loading – The maximum loading of the transformer (unitless). It is used with the sn of the
TransformerParameters
to compute themax_power()
,res_loading()
andres_violated()
of the transformer.geometry – The geometry of the transformer.
- allowed_phases: Final
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: roseau.load_flow.models.transformers.parameters.TransformerParameters
The parameters of the transformer.
- property res_violated: bool
Whether the transformer power loading exceeds its maximal loading.