Skip to content
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

Learning sos2 #431

Draft
wants to merge 10 commits into
base: master
Choose a base branch
from
Draft

Learning sos2 #431

wants to merge 10 commits into from

Conversation

lisazeyen
Copy link
Contributor

@lisazeyen lisazeyen commented Aug 12, 2022

Closes # (if applicable).

Endogenous technology learning

This PR should include endogenous investment cost reductions based on installed capacities. Cumulative cost curves of one technology are piecewised linearised using SOS2 constraints. This results in an MIP problem. Currently endogenous learning is only implemented for pyomo=False and solver_name="gurobi".

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • Newly introduced dependencies are added to environment.yaml, environment_docs.yaml and setup.py (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

@lisazeyen
Copy link
Contributor Author

@fneum and @FabianHofmann I am not sure if it is worth it to pull this into the main pypsa code since it is only implemented for gurobi. Another option could be that we just include into pypsa the option to write SOS2 constraints with gurobi and I keep the learning script in my private repository. One could run the learning than just as an extra_functionality with skip_objective=True. Or we start to make a collection with helpful extra_functionalities and store the learning script there. What do you think?

@fneum
Copy link
Member

fneum commented Aug 29, 2022

I'm tending towards including learning functionality in PyPSA. It's quite a nice distinguishing feature. Would it be an option to include SOS2 for Gurobi and MILP formulation for other solvers?

@coroa
Copy link
Member

coroa commented Oct 23, 2022

@lisazeyen I just checked the CPLEX doc at https://www.ibm.com/docs/en/icos/12.8.0.0?topic=representation-mip-features-in-lp-file-format to find that their SOS2 constraint representation is compatible to Gurobi's, so that you at least capture both of them. What's missing here? Apart from porting it to linopy? :)

@lisazeyen
Copy link
Contributor Author

@lisazeyen I just checked the CPLEX doc at https://www.ibm.com/docs/en/icos/12.8.0.0?topic=representation-mip-features-in-lp-file-format to find that their SOS2 constraint representation is compatible to Gurobi's, so that you at least capture both of them. What's missing here? Apart from porting it to linopy? :)

Ah great, thanks for checking! Then we can just add a check for the solver and allow learning only for gurobi and cplex. I haven't done the MIP formulation for the other solvers but we could also pull it in now and do the implementation for the others at a later point.

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.

None yet

3 participants