The coupling surface#
The coupling surface is the one file of the library (a
fragment) that every other fragment is written against. The surface
lists total_cost under given, and its objective minimises
total_cost.
An open-source power system framework (PyPSA) gives each
class of component, such as Generator, a column of bus labels, and sums the
classes into Bus-nodal_balance. Here Bus_nodal_balance is the same however
many fragments merge joins.
description: >-
The coupling surface every component in this library is written against: one
flow per port, one balance per bus, and one cost to minimise. A component is
wired to a port, the port to a bus, and the balance contains no component class.
A flow is positive where the port injects into its bus. A component that
costs something adds its cost to `total_cost`.
given:
expressions:
total_cost: { dims: [], description: what running the system costs }
dimensions:
snapshot: { dtype: datetime, description: dispatch periods }
bus: { dtype: str, description: network nodes }
port: { dtype: str, description: "the connections components make, one label per connection" }
relations:
Port_bus: { key: port, values: bus }
variables:
Port_p:
dims: [snapshot, port]
description: what a port puts into its bus in a snapshot, negative for a withdrawal
constraints:
Bus_nodal_balance:
description: "`Bus-nodal_balance` — what the ports on a bus put in sums to zero"
dims: [snapshot, bus]
expression: sum(Port_p, over=port, by=Port_bus[bus]) == 0
objective:
sense: minimize
expression: total_cost
The coupling surface every component in this library is written against: one flow per port, one balance per bus, and one cost to minimise. A component is wired to a port, the port to a bus, and the balance contains no component class. A flow is positive where the port injects into its bus. A component that costs something adds its cost to total_cost.
Given#
| Symbol | Meaning |
|---|---|
| \(\mathit{total\_cost}\) | total_cost (scalar), an expression another file defines — what running the system costs |
Sets#
| Symbol | Meaning |
|---|---|
| \(\mathcal{N}\) | index \(n\) — bus with \(\mathrm{Port\_bus}: \mathcal{J} \to \mathcal{N}\) — network nodes |
| \(\mathcal{J}\) | index \(j\) — port with \(\mathrm{Port\_bus}: \mathcal{J} \to \mathcal{N}\) — the connections components make, one label per connection |
| \(\mathcal{T}\) | index \(t\) — snapshot — dispatch periods |
Variables#
| Symbol | Meaning |
|---|---|
| \(f\) | Port_p over \(\mathcal{J} \times \mathcal{T}\) — what a port puts into its bus in a snapshot, negative for a withdrawal |
Variable domains#
Port_p
Objective#
Subject to#
Bus_nodal_balance
See also
- Generators and Loads, for the two component files written against this surface
- The composed spec, for what
mergereturns for the three files - Compose a spec from several files, for the same shape with fewer names