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

Fix investment results in repeated solving #1005

Open
jokochems opened this issue Oct 31, 2023 · 2 comments · May be fixed by #1007
Open

Fix investment results in repeated solving #1005

jokochems opened this issue Oct 31, 2023 · 2 comments · May be fixed by #1007
Assignees

Comments

@jokochems
Copy link
Member

jokochems commented Oct 31, 2023

Problem statement

I want to fix investment results and re-optimize a model in order to be able to interpret dual values (as prices which I can't as long as investments are endogenously optimized). This could be achieved by fixing investment variables using the .fix() method from pyomo on them on a solved model instance (i.e. effectively transforming them into parameters) and then re-optimizing the model.

Idea for implementation

  • My idea would be to introduce a new boolean attribute fix_investments into the Model class.
  • If this was set to True (False should be the default), a method to fix investment-related variables should be called by the dedicated child blocks of the model, i.e. InvestmentFlowBlock, GenericInvestmentStorageBlock resp. the SinkDSM investment blocks which iterates over the indices of the variables and fixes each value.
  • In case no model solution is there yet, an Error should be raised.

In my head, this doesn't seem to be to hard to add to the current status quo. I'll self-assign and try to provide the feature.

What do you think, @p-snft, @simnh, @nailend and @uvchik? Am I overlooking something or do you think it is reasonable like I described?

Outlook

In principle, I think a more general version of this feature could not be limited to the investment variables, but unfortunately, I do not have a use case nor capacities to tackle such a broad approach.

@jokochems jokochems self-assigned this Oct 31, 2023
@jokochems jokochems linked a pull request Oct 31, 2023 that will close this issue
@jokochems jokochems linked a pull request Oct 31, 2023 that will close this issue
@nailend
Copy link
Contributor

nailend commented Nov 8, 2023

I just had the time to have a look at this. Do I understand right, that after fixing you still get the same dispatch optimization results as before, but you are now able to interpret the duals as they are not influenced by the investment variables any more? I remember sth like this from OR-lecture...

@jokochems
Copy link
Member Author

I just had the time to have a look at this. Do I understand right, that after fixing you still get the same dispatch optimization results as before, but you are now able to interpret the duals as they are not influenced by the investment variables any more? I remember sth like this from OR-lecture...

Yes, you are right about that. It is hard / impossible to sensibly interpret dual variables in the presence of investments. It might be (and is even not so super unlikely in the case of a system optimized for costs) that your system is so scarce that for supplying one more marginal unit, you'd have to invest and then you'd end up with the investment-related costs cluttering up your dual variable. Classically, you might want to interpret something like the duals of an electricity bus or gas bus as electricity price or gas price or the duals of an emissions constraint as a(n implicit) carbon price.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants