Skip to content

Link

Use the Link class to represent a power link with a given active power capacity (p_nom), in order to optimize its active power over time (LinkOptimizationDynamicResults.p0 or LinkOptimizationDynamicResults.p1).

Use the ExtendableLink class to represent a hypothetical link with an active power capacity that is flexible, in order to also optimize the active power capacity (ExtendableLinkOptimizationStaticResults.p_nom_opt).

Use the CommittableLink class to represent a link with unit commitment (start-up and shut-down) constraints, in order to also optimize when the link is operating (CommittableLinkOptimizationDynamicResults.status).

API Reference

Link, ExtendableLink, and CommittableLink all inherit from the BaseLink parent class.

Bases: PNomExtendableComponent[T]

Links are used for controllable directed flows between two or more buses with a flexible energy carriers (e.g. HVDC links, converters, conversions between carriers).

PyPSA user guide for this component.

bus0: str = Field(min_length=1)

Name of origin bus to which link is attached.

bus1: str = Field(min_length=1)

Name of first destination bus to which link is attached. Further destination buses can be specified in additional_bus_connections.

carrier: str | None = Field(default=None, min_length=1)

Carrier of the link describing its technology (e.g. gas boiler, electrolyser, HVDC link).

efficiency: float | Series[T] = Field(default=1.0, gt=0.0, le=1.0)

Efficiency of energy transfer from bus0 to bus1. Can be time-dependent (e.g. to represent temperature-dependent heat pump COP).

active: bool = True

Whether to consider the component in basic functionality or not.

build_year: int | None = None

Build year.

lifetime: float | None = Field(default=None, gt=0.0)

Lifetime.

p_nom_extendable: bool

Switch to allow capacity p_nom to be extended.

p_set: float | Series[T] | None = None

The dispatch set point for p0 of the link (for optimisation and power flow).

p_min_pu: float | Series[T] = Field(default=0.0, ge=(-1.0), le=1.0)

Minimal dispatch per unit of p_nom for the link. Can also be negative.

p_max_pu: float | Series[T] = Field(default=1.0, ge=(-1.0), le=1.0)

Maximal dispatch per unit of p_nom for the link. Can also be negative.

marginal_cost: float | Series[T] = Field(default=0.0, ge=0.0)

Marginal cost of 1 MWh consumption from bus0 (e.g. including variable operation and maintenance costs of an electrolyser but excluding electricity costs).

marginal_cost_quadratic: float | Series[T] = Field(default=0.0, ge=0.0)

Quadratic marginal cost for 1 MWh of consumption from bus0.

length: float = Field(default=0.0, ge=0.0)

Length of the link. Useful for calculating capital_cost for HVDC connections.

terrain_factor: float = Field(default=1.0, ge=1.0)

Terrain factor for increasing capital_cost calculated from length.

committable: bool

Apply unit commitment constraints. This is only possible with p_nom_extendable=False.

ramp_limit_up: float | Series[T] | None = Field(default=None, gt=0.0, le=1.0)

Maximum increase from one snapshot to the next, per unit of p_nom. Does not consider snapshot weightings.

ramp_limit_down: float | Series[T] | None = Field(default=None, gt=0.0, le=1.0)

Maximum decrease from one snapshot to the next, per unit of p_nom. Does not consider snapshot weightings.

Bases: BaseLink[T]

p_nom: float | None = Field(default=None, gt=0.0)

Limit of power which can pass through link (in units of bus0).

Bases: BaseLink[T]

p_nom_mod: float = Field(default=0.0, ge=0.0)

Unit size of link module (e.g. fixed blocks of 100 MW).

p_nom_min: float = Field(default=0.0, ge=0.0)

Minimum value of p_nom_opt.

p_nom_max: float | None = Field(default=None, gt=0.0)

Maximum value of p_nom_opt.

p_nom_set: float | None = Field(default=None, ge=0.0)

Set value of p_nom_opt.

capital_cost: float | Series[T] = Field(default=0.0, ge=0.0)

Fixed period costs of extending p_nom by 1 MW (unit of bus0), including periodized investment costs and periodic fixed O&M costs (e.g. annuitized investment costs). Any length factor must already be included here.

Bases: Link[T]

start_up_cost: float = Field(default=0.0, ge=0.0)

Cost to start up the link.

shut_down_cost: float = Field(default=0.0, ge=0.0)

Cost to shut down the link.

stand_by_cost: float | Series[T] = Field(default=0.0, ge=0.0)

Stand-by cost for operating the link. This cost is incurred whenever the status is 1 (including when dispatch decision is zero).

min_up_time: int = Field(default=0, ge=0)

Minimum number of snapshots for status to be 1. Does not consider snapshot weightings.

min_down_time: int = Field(default=0, ge=0)

Minimum number of snapshots for status to be 0. Does not consider snapshot weightings.

up_time_before: int = 1

Number of snapshots that the link was online before network.snapshots start. Only used if min_up_time>0. Does not consider snapshot weightings.

down_time_before: int = 0

Number of snapshots that the link was offline before network.snapshots start. Only used if min_down_time>0. Does not consider snapshot weightings.

ramp_limit_start_up: float | None = Field(default=None, gt=0.0, le=1.0)

Maximum increase at start up, per unit of p_nom. Ignored if None.

ramp_limit_shut_down: float | None = Field(default=None, gt=0.0, le=1.0)

Maximum decrease at shut down, per unit of p_nom. Ignored if None.

LinkBaseDynamicResults

Bases: BaseDynamicResults

p0: pandas.DataFrame

Power at bus0 (positive if link is withdrawing from bus0).

p1: pandas.DataFrame

Power at bus1 (positive if link is withdrawing from bus1).

LinkOptimizationDynamicResults

Bases: LinkBaseDynamicResults

mu_lower: pandas.DataFrame

Shadow price of lower p_nom limit \(-F \leq f\). Always non-negative.

mu_upper: pandas.DataFrame

Shadow price of upper p_nom limit \(f \leq F\). Always non-negative.

mu_p_set: pandas.DataFrame

Shadow price of fixed dispatch p_set.

mu_ramp_limit_up: pandas.DataFrame

Shadow price of upper ramp up limit.

mu_ramp_limit_down: pandas.DataFrame

Shadow price of lower ramp down limit.

CommittableLinkOptimizationDynamicResults

Bases: LinkOptimizationDynamicResults

status: pandas.DataFrame

Status in the snapshot (1 is on, 0 is off).

start_up: pandas.DataFrame

Whether the unit was started in the snapshot (1 is yes, 0 is no).

shut_down: pandas.DataFrame

Whether the unit was shut down in the snapshot (1 is yes, 0 is no).

LinkPfDynamicResults

LinkNonlinearPfDynamicResults