roseau.load_flow.models.sources#

Module Contents#

Classes#

VoltageSource

A voltage source.

class VoltageSource(id: Id, bus: Bus, *, voltages: ComplexArrayLike1D, phases: str | None = None)#

Bases: roseau.load_flow.models.core.Element

A voltage source.

Voltage source constructor.

Parameters:
  • id – A unique ID of the voltage source in the network sources.

  • bus – The bus of the voltage source.

  • voltages – An array-like of the voltages of the source. They will be set on the connected bus. If the source has a neutral connection, the voltages are considered phase-to-neutral voltages, otherwise they are the phase-to-phase voltages. Either complex values (V) or a Quantity of complex values.

  • phases – The phases of the source. 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. All phases of the source, except "n", must be present in the phases of the connected bus. By default, the phases of the bus are used.

property phases: str#

The phases of the source.

property bus: Bus#

The bus of the source.

property voltages: Q_[ComplexArray]#

The voltages of the source (V).

property res_currents: Q_[ComplexArray]#

The load flow result of the source currents (A).

property res_potentials: Q_[ComplexArray]#

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

property res_powers: Q_[ComplexArray]#

The load flow result of the source powers (VA).

allowed_phases: Final#

The allowed phases for a voltage source are the same as for a bus.

voltage_phases() list[str]#

The phases of the source voltages.

disconnect() None#

Disconnect this voltage source from the network. It cannot be used afterwards.

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.