Solve network myopic
Functions to add constraints and prepare the network for the solver.
Associated with the solve_network_myopic
rule in the Snakefile.
To be merged/consolidated with the solve_network
script.
add_battery_constraints(n)
Add constraint ensuring that charger = discharger, i.e. 1 * charger_size - efficiency * discharger_size = 0
Source code in workflow/scripts/solve_network_myopic.py
add_chp_constraints(n)
Add constraints to couple the heat and electricity output of CHP plants (using the cb and cv parameter). See the DEA technology cataloge
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the pypsa network object to which's model the constraints are added |
required |
Source code in workflow/scripts/solve_network_myopic.py
add_land_use_constraint(n, planning_horizons)
Add land use constraints for renewable energy potential. This ensures that the brownfield + greenfield vre installations for each generator technology do not exceed the technical potential.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n
|
Network
|
the network object to add the constraints to |
required |
planning_horizons
|
str | int
|
the planning horizon year as string |
required |
Source code in workflow/scripts/solve_network_myopic.py
add_retrofit_constraints(n)
Add constraints to ensure retrofit capacity is linked to the original capacity Args: n (pypsa.Network): the pypsa network object to which's model the constraints are added
Source code in workflow/scripts/solve_network_myopic.py
add_transmission_constraints(n)
Add constraint ensuring that transmission lines p_nom are the same for both directions, i.e. p_nom positive = p_nom negative
Source code in workflow/scripts/solve_network_myopic.py
extra_functionality(n, snapshots)
Collects supplementary constraints which will be passed to pypsa.linopf.network_lopf
.
If you want to enforce additional custom constraints, this is a good location to add them.
The arguments opts
and snakemake.config
are expected to be attached to the network.
Source code in workflow/scripts/solve_network_myopic.py
prepare_network(n, config, solve_opts=None)
Prepare the network for the solver Args: n (pypsa.Network): the pypsa network object solve_opts (dict): the solving options
Source code in workflow/scripts/solve_network_myopic.py
solve_network(n, config, solving, opts='', **kwargs)
perform the optimisation Args: n (pypsa.Network): the pypsa network object config (dict): the configuration dictionary solving (dict): the solving configuration dictionary opts (str): optional wildcards such as ll (not used in pypsa-china)