Add sectors
Add basic EV loads and chargers to a PyPSA network.
add_carrier_if_missing(n, carrier_name)
Add a carrier to the network if it doesn't already exist.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Network
|
PyPSA network to modify. |
required |
carrier_name
|
str
|
Name of the carrier to add. |
required |
Source code in workflow/scripts/add_sectors.py
attach_simple_ev(n, p_set, nodes, options, ev_type)
Attach electric vehicle demand and charging links to the PyPSA network.
This function implements an EV demand model with a fixed charging profile.
For each node, it creates:
• an EV load bus,
• a Load component representing the EV charging demand time series,
• and a charger Link connecting the AC bus to the EV load bus.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n
|
Network
|
Network to modify in place. |
required |
p_set
|
DataFrame
|
EV charging demand time series (MW), indexed by snapshots and with nodes as columns. |
required |
nodes
|
Index
|
AC buses where EV components are added. |
required |
options
|
dict
|
EV configuration parameters, including: - annual_consumption (float): annual energy demand per vehicle (MWh/year) - charge_rate (float): charger power rating per vehicle (MW) - share_charger (float): fraction of vehicles that can charge simultaneously |
required |
ev_type
|
str
|
EV category for component naming (e.g., "passenger", "freight"). |
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
Modifies the network in place. |