Skip to content

Fix description in stochastic optimization documentation#1452

Merged
Irieo merged 3 commits intoPyPSA:masterfrom
energyLS:doc-fix-stochastic
Dec 3, 2025
Merged

Fix description in stochastic optimization documentation#1452
Irieo merged 3 commits intoPyPSA:masterfrom
energyLS:doc-fix-stochastic

Conversation

@energyLS
Copy link
Copy Markdown
Contributor

@energyLS energyLS commented Nov 26, 2025

Changes proposed in this Pull Request

Fix the result interpretation regarding hydrogen storage. Previously it was telling hydrogen storage is increasing, whereas we can see from the results it is actually decreasing. This PR adjusts the description accordingly.

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in docs.
  • Unit tests for new features were added (if applicable).
  • A note for the release notes docs/release-notes.md of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

Fix the result interpretation regarding hydrogen storage
@Irieo Irieo self-assigned this Nov 27, 2025
@Irieo
Copy link
Copy Markdown
Contributor

Irieo commented Nov 27, 2025

@energyLS thanks for catching this. It seems the text wasn't updated after changes between the working and released docs versions.

Since we are at it, I had a thought that we could parametrise this example to be simpler and more intuitive. In the current stochastic risk-neutral setup, the model yields slightly less solar, more wind, and about three times more electrolysis, which is close to optimization noise. The risk_aversion extension then shows that the cheapest hedge is to overbuild solar and pair it with long-duration hydrogen storage, even though solar is stressed in the "volcano" scenario. When preparing these docs, I thought this a fantastic example where an unintuitive economic solution prevails, but I heard a few times that people questioned if it could be an error.

Rather than open another PR just for this .md file, my suggestion is: let me reparameterize the example into a simpler instance and add it directly to this PR; and you can review the new example, if this is ok? I will need a quiet hour, will push it tonight.

Then I'll merge this PR with an eventually better example.

@energyLS
Copy link
Copy Markdown
Contributor Author

@energyLS thanks for catching this. It seems the text wasn't updated after changes between the working and released docs versions.

Since we are at it, I had a thought that we could parametrise this example to be simpler and more intuitive. In the current stochastic risk-neutral setup, the model yields slightly less solar, more wind, and about three times more electrolysis, which is close to optimization noise. The risk_aversion extension then shows that the cheapest hedge is to overbuild solar and pair it with long-duration hydrogen storage, even though solar is stressed in the "volcano" scenario. When preparing these docs, I thought this a fantastic example where an unintuitive economic solution prevails, but I heard a few times that people questioned if it could be an error.

Rather than open another PR just for this .md file, my suggestion is: let me reparameterize the example into a simpler instance and add it directly to this PR; and you can review the new example, if this is ok? I will need a quiet hour, will push it tonight.

Then I'll merge this PR with an eventually better example.

Dear @Irieo thank you so much for the detailled reply and the insights. I fully support your idea to reparameterize, and I would be happy to review. Just ping me when it is ready for a review!

@Irieo
Copy link
Copy Markdown
Contributor

Irieo commented Nov 28, 2025

Dear @Irieo thank you so much for the detailled reply and the insights. I fully support your idea to reparameterize, and I would be happy to review. Just ping me when it is ready for a review!

Thanks Leon. After playing a bit with numbers, two suggestions in 918e6a1: (i) backup generator does not have existing capacity now (so hedge comes at CAPEX + OPEX costs), and (ii) volcano scenario is a bit more likely. Please take a look if this is now intuitive and clear.
Doctest should pass 🟢

Copy link
Copy Markdown
Contributor Author

@energyLS energyLS left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @Irieo for the updated example. It is now more intuitive and consistent, increasing the likelihood of the "volcano" scenario shows high impact on the backup generation. The comments are only minor.

@Irieo Irieo merged commit 4c7037d into PyPSA:master Dec 3, 2025
22 checks passed
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.

3 participants