roseau.load_flow.models.transformers
#
Package Contents#
Classes#
Parameters that define electrical models of transformers. |
|
A generic transformer model. |
- class TransformerParameters(id: Id, type: 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], max_power: float | Q_[float] | 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.
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 max_power: Q_[float] | None#
The maximum power loading of the transformer (VA) if it is set.
- to_zyk() tuple[Q_[complex], Q_[complex], Q_[float], float] #
Compute the transformer parameters
z2
,ym
,k
andorientation
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: 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 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 | Q_[float] | None = None, uhv: float | Q_[float] | None = None, ulv: float | Q_[float] | None = None) typing_extensions.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 | 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:
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.
- class Transformer(id: Id, bus1: Bus, bus2: Bus, *, parameters: TransformerParameters, tap: float = 1.0, phases1: str | None = None, phases2: str | None = None, 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
.geometry – The geometry of the transformer.
- property parameters: TransformerParameters#
The parameters of the transformer.
- property res_violated: bool | None#
Whether the transformer power exceeds the maximum power (loading > 100%).
Returns
None
if the maximum power is not set.
- 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)