Process maintenance#
This file states the maintenance rows of PyPSA's Process. It is one of the 25 whole specs of one topic each (fragments) that merge composes into the spec of examples/pypsa.yaml. Process_maint_window states that a unit is in maintenance exactly where an event it started covers the snapshot, through a sum by a relation.
given:
parameters:
Process_p_nom_extendable: { dims: [process], dtype: bool }
Process_p_nom_min: { dims: [scenario, process] }
Process_p_nom_max: { dims: [scenario, process] }
Process_committable: { dims: [process], dtype: bool }
Process_p_nom_mod: { dims: [process] }
Process_modules_installed: { dims: [scenario, process] }
Process_active: { dims: [snapshot, process], dtype: bool }
snapshot_weightings_generators: { dims: [snapshot] }
variables:
Process_status: { dims: [scenario, snapshot, process], domain: integer }
Process_p_nom_ext: { dims: [process] }
conditions:
Process_committed: { dims: [process, snapshot] }
dimensions:
scenario:
description: the futures dispatch is chosen in, each with a weight
snapshot:
description: dispatch periods
dtype: datetime
ordered: true
process:
description: generalised multi-port converters, each with an internal power that every port draws or delivers at its own rate
relations:
Process_maintenance_cover:
description: >-
the snapshots a maintenance event covers, by the snapshot it starts in,
data prep. In a scenario, they are the start and the snapshots after it,
until their generator weightings reach that scenario's
`maintenance_duration`. A process that is not maintainable has no rows
key: { scenario: scenario, process: process, start: snapshot, covered: snapshot }
missing: absent
parameters:
Process_maintainable:
description: >-
whether a process must be taken off for maintenance within the horizon:
in any scenario, as PyPSA takes the union over them
(`components.py:1000-1003`)
dims: [process]
dtype: bool
Process_maintenance_pu:
description: the share of the build a maintenance event takes off
dims: [scenario, process]
Process_maintenance_events:
description: how many maintenance events occur within the horizon
dims: [scenario, process]
dtype: int
Process_maintenance_duration:
description: >-
the hours of generator weightings one maintenance event covers, PyPSA's
`maintenance_duration`. It has no value where the process is not
maintainable. No row contains it. In data prep you turn it into
`Process_maintenance_cover` and `Process_maintenance_start_blocked`. The
assumptions state that it fits the horizon
dims: [scenario, process]
missing: absent
Process_maintenance_start_blocked:
description: >-
true where no maintenance event may start, data prep. The snapshots it
would cover there run past the end of the horizon or into one the
process is not active in. It is PyPSA's `active & ~valid`, from
`maintenance_duration` and the generator weightings
dims: [scenario, snapshot, process]
dtype: bool
variables:
Process_maintenance:
description: >-
`Process-maintenance` — whether a maintainable process is in maintenance:
continuous, and one exactly where an event covers the snapshot
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_active
missing: 0
bounds:
lower: 0
upper: 1
Process_maintenance_start:
description: "`Process-maintenance_start` — whether a maintenance event starts in this snapshot"
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_active
missing: 0
domain: binary
Process_maintenance_capacity:
description: >-
`Process-maintenance_capacity` — the chosen build while in maintenance,
zero otherwise: the product the `maintcap` rows linearise
dims: [scenario, snapshot, process]
where: Process_maint_ext
missing: 0
bounds:
lower: 0
Process_maintenance_status:
description: >-
`Process-maintenance_status` — the status while in maintenance, zero
otherwise: the product the `maint-status` rows linearise, so a unit in
maintenance may also be off
dims: [scenario, snapshot, process]
where: >-
Process_maintainable
AND Process_committed
AND NOT (Process_p_nom_extendable AND NOT (Process_p_nom_mod > 0))
missing: 0
bounds:
lower: 0
expressions:
Process_maintenance_modules:
description: >-
how many modules of a modular committable process can be on in
maintenance: its build cap in modules where the build is extendable,
and the modules installed where it is fixed (`constraints.py:588-594`)
dims: [scenario, process]
cases:
extendable: { when: Process_p_nom_extendable, expression: Process_p_nom_max / Process_p_nom_mod }
otherwise: Process_modules_installed
conditions:
Process_maint_ext:
description: >-
a maintainable process with an extendable build that is active in the
snapshot's period, unless it is committable and modular. These are the
maintenance rows against the chosen build
condition: >-
Process_maintainable
AND Process_p_nom_extendable
AND NOT (Process_committable AND Process_p_nom_mod > 0)
AND Process_active
constraints:
Process_maint_event_count:
description: "`Process-maint-event-count` — a maintainable process holds its number of maintenance events over the horizon"
dims: [scenario, process]
where: Process_maintainable
expression: sum(Process_maintenance_start, over=snapshot) == Process_maintenance_events
Process_maint_window:
description: >-
`Process-maint-window` — a process is in maintenance exactly where an
event it started covers the snapshot. Two events do not overlap, since
the maintenance status is at most one
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_active
expression: Process_maintenance == sum(Process_maintenance_start, over=start, by=Process_maintenance_cover[covered])
Process_maint_start_horizon:
description: "`Process-maint-start-horizon` — no event starts where it could not run its whole duration"
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_active AND Process_maintenance_start_blocked
expression: Process_maintenance_start == 0
Process_maintcap_upper:
description: >-
`Process-maintcap_upper` — the build taken off is at most the chosen build in
maintenance, and at most the build less its floor out of it
dims: [scenario, snapshot, process]
where: Process_maint_ext
expression: Process_maintenance_capacity <= Process_p_nom_ext - Process_p_nom_min * (1 - Process_maintenance)
Process_maintcap_upper_nommax:
description: "`Process-maintcap_upper_nommax` — out of maintenance, no build is taken off"
dims: [scenario, snapshot, process]
where: Process_maint_ext
expression: Process_maintenance_capacity <= Process_p_nom_max * Process_maintenance
Process_maintcap_lower_nommax:
description: "`Process-maintcap_lower_nommax` — in maintenance, the whole chosen build is taken off"
dims: [scenario, snapshot, process]
where: Process_maint_ext
expression: Process_maintenance_capacity >= Process_p_nom_ext - Process_p_nom_max * (1 - Process_maintenance)
Process_maintcap_lower_nommin:
description: "`Process-maintcap_lower_nommin` — in maintenance, at least the floor of the build is taken off"
dims: [scenario, snapshot, process]
where: Process_maint_ext AND Process_p_nom_min > 0
expression: Process_maintenance_capacity >= Process_p_nom_min * Process_maintenance
Process_maint_status_le_status:
description: "`Process-maint-status-le-status` — the status in maintenance is at most the status"
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_committed AND NOT Process_p_nom_extendable AND NOT (Process_p_nom_mod > 0)
expression: Process_maintenance_status <= Process_status
Process_maint_status_le_maint:
description: "`Process-maint-status-le-maint` — out of maintenance, the status in maintenance is zero"
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_committed AND NOT Process_p_nom_extendable AND NOT (Process_p_nom_mod > 0)
expression: Process_maintenance_status <= Process_maintenance
Process_maint_status_lb:
description: "`Process-maint-status-lb` — on and in maintenance, the status in maintenance is one"
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_committed AND NOT Process_p_nom_extendable AND NOT (Process_p_nom_mod > 0)
expression: Process_maintenance_status >= Process_status + Process_maintenance - 1
Process_maint_modstatus_le_status:
description: "`Process-maint-modstatus-le-status` — the modules on in maintenance are at most the modules on"
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_committed AND Process_p_nom_mod > 0
expression: Process_maintenance_status <= Process_status
Process_maint_modstatus_le_maint:
description: >-
`Process-maint-modstatus-le-maint` — out of maintenance, no module is on
in maintenance. In it, at most its modules in maintenance
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_committed AND Process_p_nom_mod > 0
expression: Process_maintenance_status <= Process_maintenance_modules * Process_maintenance
Process_maint_modstatus_lb:
description: "`Process-maint-modstatus-lb` — in maintenance, every module on is on in maintenance"
dims: [scenario, snapshot, process]
where: Process_maintainable AND Process_committed AND Process_p_nom_mod > 0
expression: Process_maintenance_status >= Process_status - Process_maintenance_modules * (1 - Process_maintenance)
assumptions:
Process_maintenance_events_positive:
holds: "Process_maintenance_events > 0"
where: "Process_maintainable"
description: >-
a maintainable process with no event schedules no maintenance. PyPSA
refuses it (`consistency.py:1541`)
Process_maintenance_duration_positive:
holds: "Process_maintenance_duration > 0"
where: "Process_maintainable"
description: >-
an event that covers no hours is no maintenance window. PyPSA refuses it
(`consistency.py:1531`)
Process_maintenance_duration_fits_the_horizon:
holds: "Process_maintenance_duration <= sum(snapshot_weightings_generators, over=snapshot)"
where: "Process_maintainable"
description: >-
one event longer than the horizon, in generator weightings, blocks every
start and makes the event count infeasible. PyPSA refuses it
(`consistency.py:1552`)
Process_maintenance_events_fit_the_horizon:
holds: "Process_maintenance_duration * Process_maintenance_events <= sum(snapshot_weightings_generators, over=snapshot)"
where: "Process_maintainable"
description: >-
the events together longer than the horizon, in generator weightings,
cannot all be scheduled. PyPSA refuses it (`consistency.py:1564`)
Process_maintenance_build_cap_is_finite:
holds: "Process_p_nom_max < inf"
where: "Process_maintainable AND Process_p_nom_extendable"
description: >-
the `maintcap` rows bound the chosen build in maintenance by
`p_nom_max`, so an infinite cap is an infinite coefficient. PyPSA
refuses it (`consistency.py:1576`)
Given#
| Symbol | Meaning |
|---|---|
| \(\mathrm{on}^{z}\) | Process_active over \(\mathcal{J} \times \mathcal{T}\), data another file declares |
| \(\mathrm{com}^{z}\) | Process_committable over \(\mathcal{J}\), data another file declares |
| \(\mathrm{N}^{z,\mathrm{fix}}\) | Process_modules_installed over \(\mathcal{J} \times \Xi\), data another file declares |
| \(\mathrm{ext}^{z}\) | Process_p_nom_extendable over \(\mathcal{J}\), data another file declares |
| \(\overline{\mathrm{z}}^{\mathrm{nom}}\) | Process_p_nom_max over \(\mathcal{J} \times \Xi\), data another file declares |
| \(\underline{\mathrm{z}}^{\mathrm{nom}}\) | Process_p_nom_min over \(\mathcal{J} \times \Xi\), data another file declares |
| \(\mathrm{z}^{\mathrm{mod}}\) | Process_p_nom_mod over \(\mathcal{J}\), data another file declares |
| \(\mathrm{w}^{\mathrm{gen}}\) | snapshot_weightings_generators over \(\mathcal{T}\), data another file declares |
| \(Z\) | Process_p_nom_ext over \(\mathcal{J}\) |
| \(u^{z}\) | Process_status over \(\mathcal{J} \times \Xi \times \mathcal{T}\) |
| \(\mathrm{on}^{z,\mathrm{com}}\) | Process_committed over \(\mathcal{J} \times \mathcal{T}\), a condition another file defines |
Sets#
| Symbol | Meaning |
|---|---|
| \(\mathcal{J}\) | index \(j\) — process with \(\mathrm{Process\_maintenance\_cover} \subseteq \mathcal{T} \times \mathcal{J} \times \Xi \times \mathcal{T}\), Process_maintenance_cover is absent where the data has no row — generalised multi-port converters, each with an internal power that every port draws or delivers at its own rate |
| \(\Xi\) | index \(\xi\) — scenario with \(\mathrm{Process\_maintenance\_cover} \subseteq \mathcal{T} \times \mathcal{J} \times \Xi \times \mathcal{T}\), Process_maintenance_cover is absent where the data has no row — the futures dispatch is chosen in, each with a weight |
| \(\mathcal{T}\) | index \(t\) — snapshot with \(\mathrm{Process\_maintenance\_cover} \subseteq \mathcal{T} \times \mathcal{J} \times \Xi \times \mathcal{T}\), Process_maintenance_cover is absent where the data has no row — dispatch periods |
Parameters#
| Symbol | Meaning |
|---|---|
| \(\mathrm{mnt}^{z}\) | Process_maintainable over \(\mathcal{J}\) — whether a process must be taken off for maintenance within the horizon: in any scenario, as PyPSA takes the union over them (components.py:1000-1003) |
| \(\tau^{z,\mathrm{mnt}}\) | Process_maintenance_duration over \(\mathcal{J} \times \Xi\), absent where the data has no row — the hours of generator weightings one maintenance event covers, PyPSA's maintenance_duration. It has no value where the process is not maintainable. No row contains it. In data prep you turn it into Process_maintenance_cover and Process_maintenance_start_blocked. The assumptions state that it fits the horizon |
| \(\mathrm{n}^{z,\mathrm{mnt}}\) | Process_maintenance_events over \(\mathcal{J} \times \Xi\) — how many maintenance events occur within the horizon |
| \(\gamma^{z}\) | Process_maintenance_pu over \(\mathcal{J} \times \Xi\) — the share of the build a maintenance event takes off |
| \(\mathrm{blk}^{z}\) | Process_maintenance_start_blocked over \(\mathcal{J} \times \Xi \times \mathcal{T}\) — true where no maintenance event may start, data prep. The snapshots it would cover there run past the end of the horizon or into one the process is not active in. It is PyPSA's active & ~valid, from maintenance_duration and the generator weightings |
Conditions#
| Symbol | Meaning |
|---|---|
| \(\mathrm{on}^{z,\mathrm{mnt,ext}}\) | Process_maint_ext over \(\mathcal{J} \times \mathcal{T}\) — a maintainable process with an extendable build that is active in the snapshot's period, unless it is committable and modular. These are the maintenance rows against the chosen build |
Variables#
| Symbol | Meaning |
|---|---|
| \(\mu^{z}\) | Process_maintenance over \(\mathcal{J} \times \Xi \times \mathcal{T}\), \(0\) where the mask leaves it out — Process-maintenance — whether a maintainable process is in maintenance: continuous, and one exactly where an event covers the snapshot |
| \(\mu^{z,\mathrm{nom}}\) | Process_maintenance_capacity over \(\mathcal{J} \times \Xi \times \mathcal{T}\), \(0\) where the mask leaves it out — Process-maintenance_capacity — the chosen build while in maintenance, zero otherwise: the product the maintcap rows linearise |
| \(\mu^{z,\mathrm{up}}\) | Process_maintenance_start over \(\mathcal{J} \times \Xi \times \mathcal{T}\), \(0\) where the mask leaves it out — Process-maintenance_start — whether a maintenance event starts in this snapshot |
| \(\mu^{z,u}\) | Process_maintenance_status over \(\mathcal{J} \times \Xi \times \mathcal{T}\), \(0\) where the mask leaves it out — Process-maintenance_status — the status while in maintenance, zero otherwise: the product the maint-status rows linearise, so a unit in maintenance may also be off |
Definitions#
| Symbol | Meaning |
|---|---|
| \(\mathrm{Process\_maintenance\_modules}\) | Process_maintenance_modules over \(\mathcal{J} \times \Xi\) — how many modules of a modular committable process can be on in maintenance: its build cap in modules where the build is extendable, and the modules installed where it is fixed (constraints.py:588-594) |
Conditions#
Process_maint_ext
Variable domains#
Process_maintenance
Process_maintenance_capacity
Process_maintenance_start
Process_maintenance_status
Definitions#
Process_maintenance_modules
Subject to#
Process_maint_event_count
Process_maint_modstatus_lb
Process_maint_modstatus_le_maint
Process_maint_modstatus_le_status
Process_maint_start_horizon
Process_maint_status_lb
Process_maint_status_le_maint
Process_maint_status_le_status
Process_maint_window
Process_maintcap_lower_nommax
Process_maintcap_lower_nommin
Process_maintcap_upper
Process_maintcap_upper_nommax
Assumptions#
Process_maintenance_build_cap_is_finite
Process_maintenance_duration_fits_the_horizon
Process_maintenance_duration_positive
Process_maintenance_events_fit_the_horizon
Process_maintenance_events_positive
See also
- PyPSA in 25 files, for how the fragments compose
- PyPSA in one file, for the same spec as one file, rung by rung