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

add MOSEK solver #189

Merged
merged 11 commits into from
Oct 31, 2023
Merged

add MOSEK solver #189

merged 11 commits into from
Oct 31, 2023

Conversation

fneum
Copy link
Member

@fneum fneum commented Oct 28, 2023

Solve a linear problem using the MOSEK solver.

category: commercial

https://www.mosek.com/

For more information on solver options, see
https://docs.mosek.com/latest/pythonapi/parameters.html#doc-all-parameter-list

https://docs.mosek.com/latest/pythonapi/index.html#

Install with pip install mosek

Needs license setup (free academic): https://www.mosek.com/products/academic-licenses/

Tested locally and passed all tests. However, quadratic problems are not supported yet.

MOSEK does not understand "integer" as a label in the LP-file. It understands "general" however, and all other solvers also seem to. Not sure if you want to change the label completely, or have this as function argument.

MOSEK can also compute IIS (for later).

import pypsa

n = pypsa.examples.ac_dc_meshed()
n.optimize(solver_name='highs')
n.buses_t.marginal_price["London"]
n.generators_t.p
n.optimize(solver_name='mosek')
n.generators_t.p
n.buses_t.marginal_price["London"]

@codecov
Copy link

codecov bot commented Oct 28, 2023

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (ae5d511) 87.62% compared to head (0b53dad) 89.15%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   87.62%   89.15%   +1.53%     
==========================================
  Files          14       15       +1     
  Lines        2989     3291     +302     
  Branches      669      753      +84     
==========================================
+ Hits         2619     2934     +315     
+ Misses        277      248      -29     
- Partials       93      109      +16     
Files Coverage Δ
linopy/io.py 87.90% <100.00%> (ø)
linopy/solvers.py 89.23% <88.70%> (+9.66%) ⬆️

... and 1 file with indirect coverage changes

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

@fneum
Copy link
Member Author

fneum commented Oct 28, 2023

closes #35

@fneum
Copy link
Member Author

fneum commented Oct 28, 2023

Thankful for an idea how I can stop CI for MOSEK, since license is commercial.

@FabianHofmann
Copy link
Collaborator

image

According to the docs, we should be able to set up a license in the GH secrets.

@FabianHofmann FabianHofmann merged commit d43b533 into master Oct 31, 2023
11 of 13 checks passed
@FabianHofmann FabianHofmann deleted the mosek branch October 31, 2023 15:22
@fneum fneum mentioned this pull request Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants