roseau.load_flow.models.buses#

Module Contents#

Classes#

Bus

A multi-phase electrical bus.

class Bus(id: Id, *, phases: str, geometry: shapely.geometry.base.BaseGeometry | None = None, potentials: ComplexArrayLike1D | None = None, min_voltage: float | None = None, max_voltage: float | None = None)#

Bases: roseau.load_flow.models.core.Element

A multi-phase electrical bus.

Bus constructor.

Parameters:
  • id – A unique ID of the bus in the network buses.

  • phases – The phases of the bus. A string like "abc" or "an" etc. The order of the phases is important. For a full list of supported phases, see the class attribute allowed_phases.

  • geometry – An optional geometry of the bus; a Geometry that represents the x-y coordinates of the bus.

  • potentials – An optional array-like of initial potentials of each phase of the bus. If given, these potentials are used as the starting point of the load flow computation. Either complex values (V) or a Quantity of complex values.

  • min_voltage – An optional minimum voltage of the bus (V). It is not used in the load flow. It must be a phase-neutral voltage if the bus has a neutral, phase-phase otherwise. Either a float (V) or a Quantity of float.

  • max_voltage – An optional maximum voltage of the bus (V). It is not used in the load flow. It must be a phase-neutral voltage if the bus has a neutral, phase-phase otherwise. Either a float (V) or a Quantity of float.

property phases: str#

The phases of the bus.

property potentials: Q_[ComplexArray]#

An array of initial potentials of the bus (V).

property res_potentials: Q_[ComplexArray]#

The load flow result of the bus potentials (V).

property res_voltages: Q_[ComplexArray]#

The load flow result of the bus voltages (V).

If the bus has a neutral, the voltages are phase-neutral voltages for existing phases in the order [Van, Vbn, Vcn]. If the bus does not have a neutral, phase-phase voltages are returned in the order [Vab, Vbc, Vca].

property min_voltage: Q_[float] | None#

The minimum voltage of the bus (V) if it is set.

property max_voltage: Q_[float] | None#

The maximum voltage of the bus (V) if it is set.

property res_violated: bool | None#

Whether the bus has voltage limits violations.

Returns None if the bus has no voltage limits are not set.

property short_circuits: list[dict[str, Any]]#

Return the list of short-circuits of this bus.

allowed_phases: Final#

The allowed phases for a bus are:

  • P-P-P or P-P-P-N: "abc", "abcn"

  • P-P or P-P-N: "ab", "bc", "ca", "abn", "bcn", "can"

  • P-N: "an", "bn", "cn"

voltage_phases() list[str]#

The phases of the voltages.

propagate_limits(force: bool = False) None#

Propagate the voltage limits to galvanically connected buses.

Galvanically connected buses are buses connected to this bus through lines or switches. This ensures that these voltage limits are only applied to buses with the same voltage level. If a bus is connected to this bus through a transformer, the voltage limits are not propagated to that bus.

If this bus does not define any voltage limits, calling this method will unset the limits of the connected buses.

Parameters:

force – If False (default), an exception is raised if connected buses already have limits different from this bus. If True, the limits are propagated even if connected buses have different limits.

get_connected_buses() Iterator[Id]#

Get IDs of all the buses galvanically connected to this bus.

These are all the buses connected via one or more lines or switches to this bus.

res_voltage_unbalance() Q_[float]#

Calculate the voltage unbalance on this bus according to the IEC definition.

Voltage Unbalance Factor:

\(VUF = \frac{|V_n|}{|V_p|} * 100 (\%)\)

Where \(V_n\) is the negative-sequence voltage and \(V_p\) is the positive-sequence voltage.

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.

add_short_circuit(*phases: str, ground: Ground | None = None) None#

Add a short-circuit by connecting multiple phases together optionally with a ground.

Parameters:
  • phases – The phases to connect.

  • ground – If a ground is given, the phases will also be connected to the ground.