pypsa.optimization.optimize.OptimizationAccessor.optimize_transmission_expansion_iteratively

pypsa.optimization.optimize.OptimizationAccessor.optimize_transmission_expansion_iteratively#

OptimizationAccessor.optimize_transmission_expansion_iteratively(snapshots: Sequence | None = None, msq_threshold: float = 0.05, min_iterations: int = 1, max_iterations: int = 100, track_iterations: bool = False, line_unit_size: float | None = None, link_unit_size: dict | None = None, line_threshold: float | None = None, link_threshold: dict | None = None, fractional_last_unit_size: bool = False, **kwargs: Any) tuple[str, str]#

Iterative linear optimization updating the line parameters for passive AC and DC lines. This is helpful when line expansion is enabled. After each successful solving, line impedances and line resistance are recalculated based on the optimization result. If warmstart is possible, it uses the result from the previous iteration to fasten the optimization.

Parameters:
  • snapshots (list or index slice) – A list of snapshots to optimise, must be a subset of n.snapshots, defaults to n.snapshots

  • msq_threshold (float, default 0.05) – Maximal mean square difference between optimized line capacity of the current and the previous iteration. As soon as this threshold is undercut, and the number of iterations is bigger than ‘min_iterations’ the iterative optimization stops

  • min_iterations (integer, default 1) – Minimal number of iteration to run regardless whether the msq_threshold is already undercut

  • max_iterations (integer, default 100) – Maximal number of iterations to run regardless whether msq_threshold is already undercut

  • track_iterations (bool, default False) – If True, the intermediate branch capacities and values of the objective function are recorded for each iteration. The values of iteration 0 represent the initial state.

  • line_unit_size (float, default None) – The unit size for line components. Use None if no discretization is desired.

  • link_unit_size (dict-like, default None) – A dictionary containing the unit sizes for link components, with carrier names as keys. Use None if no discretization is desired.

  • line_threshold (float, default 0.3) – The threshold relative to the unit size for discretizing line components.

  • link_threshold (dict-like, default 0.3 per carrier) – The threshold relative to the unit size for discretizing link components.

  • fractional_last_unit_size (bool, default False) – Whether only multiples of the unit size or in case of a maximum capacity fractions of unit size is allowed.

  • **kwargs – Keyword arguments of the n.optimize function which runs at each iteration