Merge pull request #1064 from PyPSA/post-disc-master
post-discretization of lines and links
This commit is contained in:
commit
c81b3f1300
@ -770,11 +770,23 @@ solving:
|
|||||||
# io_api: "direct" # Increases performance but only supported for the highs and gurobi solvers
|
# io_api: "direct" # Increases performance but only supported for the highs and gurobi solvers
|
||||||
# options that go into the optimize function
|
# options that go into the optimize function
|
||||||
track_iterations: false
|
track_iterations: false
|
||||||
min_iterations: 4
|
min_iterations: 2
|
||||||
max_iterations: 6
|
max_iterations: 3
|
||||||
transmission_losses: 2
|
transmission_losses: 2
|
||||||
linearized_unit_commitment: true
|
linearized_unit_commitment: true
|
||||||
horizon: 365
|
horizon: 365
|
||||||
|
post_discretization:
|
||||||
|
enable: false
|
||||||
|
line_unit_size: 1700
|
||||||
|
line_threshold: 0.3
|
||||||
|
link_unit_size:
|
||||||
|
DC: 2000
|
||||||
|
H2 pipeline: 1200
|
||||||
|
gas pipeline: 1500
|
||||||
|
link_threshold:
|
||||||
|
DC: 0.3
|
||||||
|
H2 pipeline: 0.3
|
||||||
|
gas pipeline: 0.3
|
||||||
|
|
||||||
constraints:
|
constraints:
|
||||||
CCL: false
|
CCL: false
|
||||||
|
@ -14,6 +14,14 @@ options,,,
|
|||||||
-- transmission_losses,int,[0-9],"Add piecewise linear approximation of transmission losses based on n tangents. Defaults to 0, which means losses are ignored."
|
-- transmission_losses,int,[0-9],"Add piecewise linear approximation of transmission losses based on n tangents. Defaults to 0, which means losses are ignored."
|
||||||
-- linearized_unit_commitment,bool,"{'true','false'}",Whether to optimise using the linearized unit commitment formulation.
|
-- linearized_unit_commitment,bool,"{'true','false'}",Whether to optimise using the linearized unit commitment formulation.
|
||||||
-- horizon,--,int,Number of snapshots to consider in each iteration. Defaults to 100.
|
-- horizon,--,int,Number of snapshots to consider in each iteration. Defaults to 100.
|
||||||
|
-- post_discretization,,,
|
||||||
|
-- -- enable,bool,"{'true','false'}",Switch to enable post-discretization of the network. Disabled by default.
|
||||||
|
-- -- line_unit_size,MW,float,Discrete unit size of lines in MW.
|
||||||
|
-- -- line_threshold,,float,The threshold relative to the discrete line unit size beyond which to round up to the next unit.
|
||||||
|
-- -- link_unit_size,MW,float,Discrete unit size of links in MW by carrier (given in dictionary style).
|
||||||
|
-- -- -- {carrier},,,
|
||||||
|
-- -- link_threshold,,float,The threshold relative to the discrete link unit size beyond which to round up to the next unit by carrier (given in dictionary style).
|
||||||
|
-- -- -- {carrier},,,
|
||||||
constraints ,,,
|
constraints ,,,
|
||||||
-- CCL,bool,"{'true','false'}",Add minimum and maximum levels of generator nominal capacity per carrier for individual countries. These can be specified in the file linked at ``electricity: agg_p_nom_limits`` in the configuration. File defaults to ``data/agg_p_nom_minmax.csv``.
|
-- CCL,bool,"{'true','false'}",Add minimum and maximum levels of generator nominal capacity per carrier for individual countries. These can be specified in the file linked at ``electricity: agg_p_nom_limits`` in the configuration. File defaults to ``data/agg_p_nom_minmax.csv``.
|
||||||
-- EQ,bool/string,"{'false',`n(c| )``; i.e. ``0.5``-``0.7c``}",Require each country or node to on average produce a minimal share of its total consumption itself. Example: ``EQ0.5c`` demands each country to produce on average at least 50% of its consumption; ``EQ0.5`` demands each node to produce on average at least 50% of its consumption.
|
-- EQ,bool/string,"{'false',`n(c| )``; i.e. ``0.5``-``0.7c``}",Require each country or node to on average produce a minimal share of its total consumption itself. Example: ``EQ0.5c`` demands each country to produce on average at least 50% of its consumption; ``EQ0.5`` demands each node to produce on average at least 50% of its consumption.
|
||||||
|
|
@ -43,6 +43,11 @@ Upcoming Release
|
|||||||
|
|
||||||
* Allow dictionary for the config aviation_demand_factor.
|
* Allow dictionary for the config aviation_demand_factor.
|
||||||
|
|
||||||
|
* Add option to post-discretize line and link capacities based on unit sizes and
|
||||||
|
rounding thresholds specified in the configuration under ``solving: options:
|
||||||
|
post_discretization:`` when iterative solving is enables (``solving: optiosn:
|
||||||
|
skip_iterations: false``). This option is disabled by default.
|
||||||
|
|
||||||
* Group existing capacities to the earlier grouping_year for consistency with optimized capacities.
|
* Group existing capacities to the earlier grouping_year for consistency with optimized capacities.
|
||||||
|
|
||||||
* Update data bundle:
|
* Update data bundle:
|
||||||
|
@ -11,7 +11,7 @@ dependencies:
|
|||||||
- pip
|
- pip
|
||||||
|
|
||||||
- atlite>=0.2.9
|
- atlite>=0.2.9
|
||||||
- pypsa>=0.26.1
|
- pypsa>=0.28
|
||||||
- linopy
|
- linopy
|
||||||
- dask
|
- dask
|
||||||
|
|
||||||
|
@ -919,9 +919,12 @@ def solve_network(n, config, solving, **kwargs):
|
|||||||
elif skip_iterations:
|
elif skip_iterations:
|
||||||
status, condition = n.optimize(**kwargs)
|
status, condition = n.optimize(**kwargs)
|
||||||
else:
|
else:
|
||||||
kwargs["track_iterations"] = (cf_solving.get("track_iterations", False),)
|
kwargs["track_iterations"] = cf_solving["track_iterations"]
|
||||||
kwargs["min_iterations"] = (cf_solving.get("min_iterations", 4),)
|
kwargs["min_iterations"] = cf_solving["min_iterations"]
|
||||||
kwargs["max_iterations"] = (cf_solving.get("max_iterations", 6),)
|
kwargs["max_iterations"] = cf_solving["max_iterations"]
|
||||||
|
if cf_solving["post_discretization"].pop("enable"):
|
||||||
|
logger.info("Add post-discretization parameters.")
|
||||||
|
kwargs.update(cf_solving["post_discretization"])
|
||||||
status, condition = n.optimize.optimize_transmission_expansion_iteratively(
|
status, condition = n.optimize.optimize_transmission_expansion_iteratively(
|
||||||
**kwargs
|
**kwargs
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user