Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Documentation of Sector Demand Response #507

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,641 changes: 1,037 additions & 604 deletions docs/source/_static/pypsa-usa.drawio

Large diffs are not rendered by default.

Binary file removed docs/source/_static/sectors/natural-gas.png
Binary file not shown.
Binary file added docs/source/_static/sectors/pypsa-dr-soc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/sectors/pypsa-dr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/source/_static/sectors/pypsa-sectors.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/source/_static/sectors/service-demand.png
Binary file not shown.
Binary file modified docs/source/_static/transport/endogenous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/source/_static/transport/exogenous.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions docs/source/configtables/sector_industrial.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ industrial_sector ,,,Options when implementing the industrial sector
-- -- gas_furnace,,"bool {true, false}",Include natural gas furnaces
-- -- coal_furnace,,"bool {true, false}",Include coal boilers
-- -- heat_pump,,"bool {true, false}",Include heat pumps
-- demnand_response,,,Demand response options for the service sector.
-- -- shift,percentage,"float {0 <=, >= 100} or 'inf'",Allowable load to be shifted per snapshot. Set to 0 to turn off demand response. Set to 'inf' to not enforce capacity limits.
-- -- marginal_cost,$/MWh,float {0 <=},Cost to store one unit of energy for one hour.
3 changes: 3 additions & 0 deletions docs/source/configtables/sector_service.csv
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@ service_sector,,,Options when implementing the service sector (Residential and C
-- loads,,,Loads to include. Electricity is always modelled.
-- -- heating,--,"bool {true, false}",Include heating loads.
-- -- cooling,--,"bool {true, false}",Include cooling loads. Heating must be included to also include cooling
-- demnand_response,,,Demand response options for the service sector.
-- -- shift,percentage,"float {0 <=, >= 100} or 'inf'",Allowable load to be shifted per snapshot. Set to 0 to turn off demand response. Set to 'inf' to not enforce capacity limits.
-- -- marginal_cost,$/MWh,float {0 <=},Cost to store one unit of energy for one hour.
3 changes: 3 additions & 0 deletions docs/source/configtables/sector_transport.csv
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ transport_sector ,,,Options when implementing the transport sector
-- -- rail,,"bool {true, false}",Include passenger and freight rail
-- -- air,,"bool {true, false}",Include passenger air travel
-- -- boat,,"bool {true, false}",Include domestic marine shipping.
-- demnand_response,,,Demand response options for the service sector.
-- -- shift,percentage,"float {0 <=, >= 100} or 'inf'",Allowable load to be shifted per snapshot. Set to 0 to turn off demand response. Set to 'inf' to not enforce capacity limits.
-- -- marginal_cost,$/MWh,float {0 <=},Cost to store one unit of energy for one hour.
91 changes: 91 additions & 0 deletions docs/source/data-sectors.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
(data-sector-coupling)=
# Sector Coupling

Full energy system models can be run through PyPSA-USA. This page gives an overview of the functionality to run sector-coupled energy models.

## Overview

Sector coupled models are built ontop of the power sector representation. This means all assumptions[^1], including spatial and temporal options, implemented to bild the electricity sector are shared in sector coupled studies.

When running sector coupled studies, four end use sectors are added to the system. These include residential, commercial, industrial, and transportation. Each of these sectors will always have electrical loads. Then, based on user configuration options, heating, cooling, or fossil fuel loads may be added to the system. Moreover, the natural gas network is added to track imports/exports, storage levels, methane leaks, and endogenously solve for natural gas cost.

```{important}
Functionality to turn off heating, cooling, and lpg loads are still under development. Currently, models always run with all loads.
```

A high level overview of how all sectors interact is shown in Figure below.

:::{figure-md} sector-res
<img src="./_static/sectors/pypsa-sectors.png" width="600px">

Simple representation of the sectoral interactions in PyPSA-USA
:::

[^1]: With the exception of CO2 emission targets.

## Emission Targets

Sector coupled studies implement emission limits different from power sector studies. The difference comes from allowing different sectors to decarbonize at different rates. Often hard-to-decarbonize sectors, like particular industrial applications, will have slower decarbonization targets compared to sectors with commercialized solutions (like electric vehicles). See the [configuration page](./config-sectors.md#carbon-limits) for details on how to implement these emission targets.

## Demand Response

Demand response is implemented the same for all end-use sectors, so it is covered here. Demand response is energy carrier agnostic, and can be applied to any end use demand. For example, both electrical loads and space-heating can participate in demand response.

### PyPSA Implementation

A price based demand respose program is impelemnted in PyPSA-USA. Demand can be shifted, either forward or backwards, and stored for any period of time. For each hour energy is stored, a cost is incurred to the system at a per-unit level (ie. $/MhW). PyPSA has out-of-the-box functionality to implement price based demand response programs. See the [`marginal_cost_storage`](https://pypsa.readthedocs.io/en/latest/user-guide/components.html#) parameter exposed for `Store` and `StorageUnit` components. To use this functionality to provide both forwards and backwards demand response, the following schematic is implemented.

:::{figure-md} demand-response
<img src="./_static/sectors/pypsa-dr.png" width="500px">

Demand response implementation in PyPSA-USA sectors
:::

Forward and backwards demand shifting is implemented seperatly for correct cost accounting. The need for this is shown in the following image. In backwards demand response, demand can be shifted to earlier points in time, allowing the model to store energy. However, for forward demand response, energy must be made available before it is generated by the system. This is done with a `Store` acting as a source (ie. negative storage levels) and a negative cost to store energy - this results in an increase in the objective cost to store energy.

:::{figure-md} dr-state-of-charge
<img src="./_static/sectors/pypsa-dr-soc.png" width="700px">

Schematic showing forwards and backwards demand response
:::

```{important}
Demand response in the transportation sector is applied at an aggregated vehicle level. This means all road vehicle types participate follow the same demand response charasteristics (ie. demand response can not be split out so only light-duty vehicles participate). This is due to endogenous investments including both electric and gasoline vehicles.
```

### Capacity Constraints

Capacity constraints limit how much energy can be delievered through demand response at any point in time. To implement this, a custom constraint is implemented as shown below.

\begin{align*}
&\ \text{let:} \\
&\ \hspace{1cm} t\in T \hspace{1cm} \text{Set of snapshots} \\
&\ \hspace{1cm} n\in N \hspace{1cm} \text{Set of buses} \\
&\ \hspace{1cm} d_{n,t} = \text{Load at time } t \text{ and bus } n \\
&\ \hspace{1cm} s_{n,t} = \text{Allowable shiftable load per unit of } d_{n,t} \\
&\ \hspace{1cm} dr_{n,t} = \text{Discharge of demand response at time } t \text{ and bus } n \\
&\ s.t. \\
&\ \hspace{1cm} d_{n,t} \times s_{n,t} \leq dr_{n,t} \hspace{0.5cm} \forall_{\text{n,t}}\\
\end{align*}

This is not applied directly to the `Link` object via the `p_nom` paprameter to be consistent with the transport sector. Within the transport sector, demand response is applied to the aggregation bus due to endogenous investment options. Therefore, knowing how much electrical load to be shifted at each timestep is not possible before solving. For the transport sector, the following constraint is added. See the [transportation section](./data-transportation.md) schematics for details on where demand reponse is applied.

\begin{align*}
&\ \text{let:} \\
&\ \hspace{1cm} t\in T \hspace{1cm} \text{Set of snapshots} \\
&\ \hspace{1cm} n\in N \hspace{1cm} \text{Set of buses} \\
&\ \hspace{1cm} v\in V \hspace{1cm} \text{Set of electric vehicle links} \\
&\ \hspace{1cm} p_{n,t,v} = \text{Flow at time } t \text{ and bus } n \text{ and link } v \\
&\ \hspace{1cm} s_{n,t} = \text{Allowable shiftable load per unit of } d_{n,t} \\
&\ \hspace{1cm} dr_{n,t} = \text{Discharge of demand response at time } t \text{ and bus } n \\
&\ s.t. \\
&\ \hspace{1cm} \sum_{v}(p_{n,t,v}) \times s_{n,t} - dr_{n,t} \geq 0 \hspace{0.5cm} \forall_{\text{n,t}}\\
\end{align*}

## Further Information

Each sector has a dedicated page giving information on data sources, implementation details, and assumptions. See the corresponding page linked below.
- [Natural Gas](./data-naturalgas.md)
- [Servince Sector](./data-services.md)
- [Industrial Sector](./data-industrial.md)
- [Transportation Sector](./data-transportation.md)
1 change: 1 addition & 0 deletions docs/source/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ data-generators
data-renewables
data-costs
data-policies
data-sectors
data-naturalgas
data-services
data-industrial
Expand Down