Skip to content

Reduction problem size by adding conditions on constraint construction #84

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

willu47
Copy link
Member

@willu47 willu47 commented Apr 21, 2023

I've added a few small conditions to constraints following these rough guidelines:

  • trade constraints should not be created when r and rr are equal
  • all constraints with Produce only need to be generated when there are corresponding non-zero values in the OutputActivityRatio
  • all constraints with Use only need to be generated when there are corresponding non-zero values in the InputActivityRatio
  • Also fixed an issue with incorrect index in constraint OC1 causing the variable cost to be calculated for every timeslice.

@willu47 willu47 self-assigned this Jun 9, 2023
@willu47 willu47 requested a review from Copilot June 10, 2025 13:04
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reduces model size by adding conditional filters to constraint definitions, restricts trade flows to distinct regions, and corrects an indexing issue in the operating cost constraint.

  • Added filter expressions to avoid generating constraints when activity ratios are zero
  • Restricted Trade variable and related constraints to r <> rr
  • Corrected the OC1 constraint by updating its index list
Comments suppressed due to low confidence (1)

src/osemosys.txt:604

  • The OC1 constraint removed the l in TIMESLICE index but its body still references the timeslice dimension; reintroduce l in TIMESLICE in the index list or adjust the body to remove l references.
s.t. OC1_OperatingCostsVariable{r in REGION, t in TECHNOLOGY, y in YEAR: sum{m in MODE_OF_OPERATION} VariableCost[r,t,m,y] <> 0}:

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Progress
Development

Successfully merging this pull request may close these issues.

1 participant