roseau.load_flow.models.lines
#
Package Contents#
Classes#
An electrical line PI model with series impedance and optional shunt admittance. |
|
A general purpose switch branch. |
|
Parameters that define electrical models of lines. |
- class Line(id: Id, bus1: Bus, bus2: Bus, *, parameters: LineParameters, length: float | Q_[float], phases: str | None = None, ground: Ground | None = None, geometry: shapely.geometry.base.BaseGeometry | None = None)#
Bases:
roseau.load_flow.models.branches.AbstractBranch
An electrical line PI model with series impedance and optional shunt admittance.
Line constructor.
- Parameters:
id – A unique ID of the line in the network branches.
bus1 – The first bus (aka “from_bus”) to connect to the line.
bus2 – The second bus (aka “to_bus”) to connect to the line.
parameters – Parameters defining the electric model of the line using its impedance and shunt admittance matrices. This is an instance of the
LineParameters
class and can be used by multiple lines.length – The length of the line (in km).
phases – The phases of the line. A string like
"abc"
or"an"
etc. The order of the phases is important. For a full list of supported phases, see the class attributeallowed_phases
. All phases of the line must be present in the phases of both connected buses. By default, the phases common to both buses are used.ground – The ground element attached to the line if it has shunt admittance.
geometry – The geometry of the line i.e. the linestring.
- property parameters: LineParameters#
The parameters defining the impedance and shunt admittance matrices of line model.
- property z_line: Q_[ComplexArray]#
Impedance of the line (in Ohm).
- property y_shunt: Q_[ComplexArray]#
Shunt admittance of the line (in Siemens).
- property res_series_currents: Q_[ComplexArray]#
Get the current in the series elements of the line (in A).
- property res_series_power_losses: Q_[ComplexArray]#
Get the power losses in the series elements of the line (in VA).
- property res_shunt_currents: tuple[Q_[ComplexArray], Q_[ComplexArray]]#
Get the currents in the shunt elements of the line (in A).
- property res_shunt_power_losses: Q_[ComplexArray]#
Get the power losses in the shunt elements of the line (in VA).
- property res_power_losses: Q_[ComplexArray]#
Get the power losses in the line (in VA).
- property res_violated: bool | None#
Whether the line current exceeds the maximum current (loading > 100%).
Returns
None
if the maximum current is not set.
- allowed_phases: Final#
The allowed phases for a line are:
P-P-P or P-P-P-N:
"abc"
,"abcn"
P-P or P-P-N:
"ab"
,"bc"
,"ca"
,"abn"
,"bcn"
,"can"
P or P-N:
"a"
,"b"
,"c"
,"an"
,"bn"
,"cn"
N:
"n"
- class Switch(id: Id, bus1: Bus, bus2: Bus, *, phases: str | None = None, geometry: shapely.geometry.base.BaseGeometry | None = None)#
Bases:
roseau.load_flow.models.branches.AbstractBranch
A general purpose switch branch.
Switch constructor.
- Parameters:
id – A unique ID of the switch in the network branches.
bus1 – Bus to connect to the switch.
bus2 – Bus to connect to the switch.
phases – The phases of the switch. A string like
"abc"
or"an"
etc. The order of the phases is important. For a full list of supported phases, see the class attributeallowed_phases
. All phases of the switch must be present in the phases of both connected buses. By default, the phases common to both buses are used.geometry – The geometry of the switch.
- allowed_phases: Final#
The allowed phases for a switch are:
P-P-P or P-P-P-N:
"abc"
,"abcn"
P-P or P-P-N:
"ab"
,"bc"
,"ca"
,"abn"
,"bcn"
,"can"
P or P-N:
"a"
,"b"
,"c"
,"an"
,"bn"
,"cn"
N:
"n"
- class LineParameters(id: Id, z_line: ComplexArrayLike2D, y_shunt: ComplexArrayLike2D | None = None, max_current: float | None = None, line_type: LineType | None = None, conductor_type: ConductorType | None = None, insulator_type: InsulatorType | None = None, section: 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 lines.
LineParameters constructor.
- Parameters:
id – A unique ID of the line parameters, typically its canonical name.
z_line – The Z matrix of the line (Ohm/km).
y_shunt – The Y matrix of the line (Siemens/km). This field is optional if the line has no shunt part.
max_current – The maximum current loading of the line (A). The maximum current is optional, it is not used in the load flow but can be used to check for overloading. See also
Line.res_violated
.line_type – The type of the line (overhead, underground, twisted). The line type is optional, it is informative only and is not used in the load flow. This field gets automatically filled when the line parameters are created from a geometric model or from the catalogue.
conductor_type – The type of the conductor material (Aluminum, Copper, …). The conductor type is optional, it is informative only and is not used in the load flow. This field gets automatically filled when the line parameters are created from a geometric model or from the catalogue.
insulator_type – The type of the cable insulator (PVC, XLPE, …). The insulator type is optional, it is informative only and is not used in the load flow. This field gets automatically filled when the line parameters are created from a geometric model or from the catalogue.
- property line_type: LineType | None#
The type of the line. Informative only, it has no impact on the load flow.
- property conductor_type: ConductorType | None#
The type of the conductor material. Informative only, it has no impact on the load flow.
- property insulator_type: InsulatorType | None#
The type of the cable insulator. Informative only, it has no impact on the load flow.
- property section: Q_[float] | None#
The cross section area of the cable (in mm²). Informative only, it has no impact on the load flow.
- classmethod from_sym(id: Id, z0: complex | Q_[complex], z1: complex | Q_[complex], y0: complex | Q_[complex], y1: complex | Q_[complex], zn: complex | Q_[complex] | None = None, xpn: float | Q_[float] | None = None, bn: float | Q_[float] | None = None, bpn: float | Q_[float] | None = None, max_current: float | Q_[float] | None = None) typing_extensions.Self #
Create line parameters from a symmetric model.
- Parameters:
id – A unique ID of the line parameters, typically its canonical name.
z0 – Impedance - zero sequence - \(r_0+x_0\cdot j\) (ohms/km)
z1 – Impedance - direct sequence - \(r_1+x_1\cdot j\) (ohms/km)
y0 – Admittance - zero sequence - \(g_0+b_0\cdot j\) (Siemens/km)
y1 – Conductance - direct sequence - \(g_1+b_1\cdot j\) (Siemens/km)
zn – Neutral impedance - \(r_{\mathrm{n}}+x_{\mathrm{n}}\cdot j\) (ohms/km)
xpn – Phase to neutral reactance (ohms/km)
bn – Neutral susceptance (siemens/km)
bpn – Phase to neutral susceptance (siemens/km)
max_current – An optional maximum current loading of the line (A). It is not used in the load flow.
- Returns:
The created line parameters.
Notes
As explained in the Line parameters alternative constructor documentation, the model may be “degraded” if the computed impedance matrix is not invertible.
- classmethod from_geometry(id: Id, *, line_type: LineType, conductor_type: ConductorType | None = None, insulator_type: InsulatorType | None = None, section: float | Q_[float], section_neutral: float | Q_[float] | None = None, height: float | Q_[float], external_diameter: float | Q_[float], max_current: float | Q_[float] | None = None) typing_extensions.Self #
Create line parameters from its geometry.
- Parameters:
id – The id of the line parameters type.
line_type – Overhead or underground. See also
LineType
.conductor_type – Type of the conductor. If
None
,ACSR
is used for overhead lines andAL
for underground or twisted lines. See alsoConductorType
.insulator_type – Type of insulator. If
None
,XLPE
is used for twisted lines andPVC
for underground lines. See alsoInsulatorType
.section – Cross-section surface area of the phases (mm²).
section_neutral – Cross-section surface area of the neutral (mm²). If None it will be the same as the section of the other phases.
height – Height of the line (m). It must be positive for overhead lines and negative for underground lines.
external_diameter – External diameter of the cable (m).
max_current – An optional maximum current loading of the line (A). It is not used in the load flow.
- Returns:
The created line parameters.
- classmethod from_name_lv(name: str, section_neutral: float | Q_[float] | None = None, height: float | Q_[float] | None = None, external_diameter: float | Q_[float] | None = None, max_current: float | Q_[float] | None = None) typing_extensions.Self #
Method to get the electrical parameters of a LV line from its canonical name. Some hypothesis will be made: the section of the neutral is the same as the other sections, the height and external diameter are pre-defined, and the insulator is PVC.
- Parameters:
name – The name of the line the parameters must be computed. E.g. “U_AL_150”.
section_neutral – Surface of the neutral (mm²). If None it will be the same as the section of the other phases.
height – Height of the line (m). If None a default value will be used.
external_diameter – External diameter of the wire (mm). If None a default value will be used.
max_current – An optional maximum current loading of the line (A). It is not used in the load flow.
- Returns:
The corresponding line parameters.
Deprecated since version 0.6.0: Use
LineParameters.from_geometry()
instead.
- classmethod from_name_mv(name: str, max_current: float | Q_[float] | None = None) typing_extensions.Self #
Get the electrical parameters of a MV line from its canonical name (France specific model)
- Parameters:
name – The canonical name of the line parameters. It must be in the format lineType_conductorType_crossSection. E.g. “U_AL_150”.
max_current – An optional maximum current loading of the line (A). It is not used in the load flow.
- Returns:
The corresponding line parameters.
- classmethod from_catalogue(name: str | Pattern[str] | None = None, line_type: str | None = None, conductor_type: str | None = None, insulator_type: str | None = None, section: float | Q_[float] | None = None, id: Id | None = None) typing_extensions.Self #
Create line parameters from a catalogue.
- Parameters:
name – The name of the line parameters to get from the catalogue. It can be a regular expression.
line_type – The type of the line parameters to get. It can be
"overhead"
,"twisted"
, or"underground"
. See alsoLineType
.conductor_type – The type of the conductor material (Al, Cu, …). See also
ConductorType
.insulator_type – The type of insulator. See also
InsulatorType
.section – The cross-section surface area of the phases (mm²).
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.
- Returns:
The created line parameters.
- classmethod get_catalogue(name: str | Pattern[str] | None = None, line_type: str | None = None, conductor_type: str | None = None, insulator_type: str | None = None, section: float | Q_[float] | None = None) DataFrame #
Get the catalogue of available lines.
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 – The name of the line parameters to get from the catalogue. It can be a regular expression.
line_type – The type of the line parameters to get. It can be
"overhead"
,"twisted"
, or"underground"
. See alsoLineType
.conductor_type – The type of the conductor material (Al, Cu, …). See also
ConductorType
.insulator_type – The type of insulator. See also
InsulatorType
.section – The cross-section surface area of the phases (mm²).
- Returns:
The catalogue data as a dataframe.