Skip to content

Conversation

@cpschau
Copy link
Contributor

@cpschau cpschau commented May 22, 2025

This PR extends the functionality for fixing foreign investments in multi-scenario model setups:

  • Investment fixing mechanism:
    Users can fix investments for components outside Germany to match the optimal values from a reference scenario by setting fix_foreign_investments:enable to true. The reference scenario is specified via fix_foreign_investments:reference_scenario. As a consequence, the reference network is solved prior to the other scenarios.

    For components with slack=0 and both nom_min and nom_max enabled in the config, the nominal capacity is set exactly to the reference value and the component is made non-extendable (_extendable=False), thereby removing its investment variable from the optimization.

Otherwise, lower and/or upper bounds are applied based on the reference value, adjusted by slack and floor/ceil rounding to tolerate numerical inaccuracies.

  • Scope:
    Only extendable components fully outside Germany and the EU are affected.

  • Solar potential constraint adjustment:
    In solve_network, the solar potential constraint now applies only to German buses when fix_foreign_investments is enabled and the run is not the reference scenario. This prevents numerical inconsistencies for fixed foreign investments.

  • Testing:

The feature was tested using the following scenario config:

KN2045_Mix:
# Default scenario, defined in pypsa.de.yaml

KN2045_Mix_0.1solarCAPEX_fixed:
  adjustments:
    sector:
      factor:
        Generator:
          solar:
            capital_cost: 0.1
KN2045_Mix_10solarCAPEX_fixed:
  adjustments:
    sector:
      factor:
        Generator:
          solar:
            capital_cost: 10.0

KN2045_Mix_0.1solarCAPEX_notfixed:
  fix_foreign_investments:
    enable: false
  adjustments:
    sector:
      factor:
        Generator:
          solar:
            capital_cost: 0.1
KN2045_Mix_10solarCAPEX_notfixed:
  fix_foreign_investments:
    enable: false
  adjustments:
    sector:
      factor:
        Generator:
          solar:
            capital_cost: 10.0

Furthermore, following adjustments were made in config.de.yaml:

  planning_horizons:
  - 2030
  - 2045
clustering:
  temporal:
    resolution_sector: 24H

The sequential optimization was tested successfully fixing the capacities to the exact reference values and also setting an upper and a lower bound with a slack of 0.001. However, during the testing phase the 1:1 fixing could lead to convergence issues in the solver due to the mismatch between line flows and line parameters taken over from the reference network.
Therefore, downstream iterations on the AC-DC network optimization setting the parameter solving:options:skip_iterations to false combined with a small slack are recommended to resolve these issues.

Here are the tracked network KPIs for the exact fixing ( slack=0, nom_min and nom_max enabled, skipping additional iterations):
Screenshot from 2025-07-14 17-41-20

  • Workflow with target rule ariadne_all completes without errors
  • The logic of export_ariadne_variables has been adapted to the changes
  • One or several figures that validate the changes in the PR have been posted as a comment
  • A brief description of the changes has been added to Changelog.md
  • The latest main has been merged into the PR
  • The config has a new prefix of the format YYYYMMDDdescriptive_title

cpschau pushed a commit that referenced this pull request Jul 14, 2025
report decentral heat in primary energy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants