Skip to content

Add low bound to the sum of flows for transport flows #1178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

gnawin
Copy link
Member

@gnawin gnawin commented Apr 28, 2025

Model

  • Enforce free signs only for transport flows, the rest flows will have a low bound of 0.
  • Add a lower bound of 0 for the sum of outgoing flows, if one of them is a transport flow, for producers, conversions, and storages. Exclude assets with UC because the bound is already applied by constraint min_output_flow_with_unit_commitment.
  • Add a lower bound of 0 for the sum of incoming flows, if one of them is a transport flow, for conversions, and storages. Since UC does not have bounds for incoming flows, so assets with UC are not excluded.

Documentation

  • Update concepts.
  • Update mathematical formulation.

Testing

This change affects the multi-year case: one transport flow is defined from a producer to a demand. Previously the flow has a lower bound directly, but now lower bounds are set by the new constraints.

  • To be updated: MPS file.

Related issues

Closes #1159, #1168

Checklist

  • I am following the contributing guidelines

  • Tests are passing

  • Lint workflow is passing

  • Docs were updated and workflow is passing

Copy link
Contributor

github-actions bot commented Apr 28, 2025

✅ MPS files match

🤖 This was CompareMPS, we hope you have enjoyed this program.

Copy link

codecov bot commented Apr 28, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Project coverage is 97.63%. Comparing base (385195c) to head (dcd1ad8).

Files with missing lines Patch % Lines
src/variables/flows.jl 0.00% 1 Missing ⚠️

❌ Your patch check has failed because the patch coverage (83.33%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1178      +/-   ##
==========================================
+ Coverage   97.62%   97.63%   +0.01%     
==========================================
  Files          31       31              
  Lines        1138     1143       +5     
==========================================
+ Hits         1111     1116       +5     
  Misses         27       27              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@gnawin
Copy link
Member Author

gnawin commented Apr 28, 2025

@datejada The MPS file has changed, but somehow the change was not detected. I'll update the MPS file once you have a look at the Github actions. Thanks.

@gnawin gnawin marked this pull request as draft April 28, 2025 14:26
@gnawin gnawin force-pushed the 1159-add-lower-bound branch from 6bb1d9a to 74d2804 Compare May 1, 2025 13:26
@gnawin gnawin force-pushed the 1159-add-lower-bound branch from 74d2804 to dcd1ad8 Compare May 6, 2025 13:03
Copy link
Contributor

github-actions bot commented May 6, 2025

🤖 CompareMPS report

⌛ Running MPS comparison

Please wait.

Copy link
Contributor

github-actions bot commented May 6, 2025

🤖 CompareMPS report

⚠️ MPS files differ

What to do?

👍 If this is expected

Then you just have to update the MPS files running from the root of TulipaEnergyModel.jl:

julia --project=. utils/scripts/model-mps-update.jl

👎 If this is bad

Then, review the log below to figure out why the files differ:

┌ Info: New comparison
│ Comparing files
│ - /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../benchmark/model-mps-folder/Multi-year Investments.mps
│ - /tmp/jl_pLZhwX/Multi-year Investments.mps
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:29
┌ Info: Create mps for /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../test/inputs/Multi-year Investments in /tmp/jl_pLZhwX
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:34
┌ Error: Files don't have the same size
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:43
┌ Info: New comparison
│ Comparing files
│ - /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../benchmark/model-mps-folder/Norse.mps
│ - /tmp/jl_90njvh/Norse.mps
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:29
┌ Info: Create mps for /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../test/inputs/Norse in /tmp/jl_90njvh
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:34
┌ Error: Files don't have the same size
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:43
┌ Info: New comparison
│ Comparing files
│ - /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../benchmark/model-mps-folder/Storage.mps
│ - /tmp/jl_vDjycz/Storage.mps
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:29
┌ Info: Create mps for /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../test/inputs/Storage in /tmp/jl_vDjycz
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:34
┌ Info: No difference found
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:84
┌ Info: New comparison
│ Comparing files
│ - /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../benchmark/model-mps-folder/Tiny.mps
│ - /tmp/jl_nRki11/Tiny.mps
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:29
┌ Info: Create mps for /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../test/inputs/Tiny in /tmp/jl_nRki11
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:34
┌ Info: No difference found
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:84
┌ Info: New comparison
│ Comparing files
│ - /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../benchmark/model-mps-folder/UC-ramping.mps
│ - /tmp/jl_UARQih/UC-ramping.mps
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:29
┌ Info: Create mps for /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../test/inputs/UC-ramping in /tmp/jl_UARQih
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:34
┌ Info: No difference found
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:84
┌ Info: New comparison
│ Comparing files
│ - /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../benchmark/model-mps-folder/Variable Resolution.mps
│ - /tmp/jl_4i69GI/Variable Resolution.mps
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:29
┌ Info: Create mps for /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/../../test/inputs/Variable Resolution in /tmp/jl_4i69GI
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:34
┌ Info: No difference found
└ @ Main /home/runner/work/TulipaEnergyModel.jl/TulipaEnergyModel.jl/utils/scripts/model-mps-compare.jl:84

For more details about this workflow, check https://tulipaenergy.github.io/TulipaEnergyModel.jl/dev/91-developer/#Testing-the-generate-MPS-files.

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.

Lower bound for the capacity constraints
1 participant