FZJ-IEK3-VSA / FINE

The FINE python package provides a framework for modeling, optimizing and assessing energy systems
https://vsa-fine.readthedocs.io
Other
68 stars 39 forks source link

Separate model init and model solve #4

Closed l-kotzur closed 5 years ago

l-kotzur commented 5 years ago

It would be great if the two steps of the pyomo.Concrete model initialization and parameterization could be separated from the model solving. Such, it would be possible to add custom constraints after the initialization process, or to output the resulting model without the requirement to solve it

l-welder commented 5 years ago

Hi Leander, thank you for bringing this to my attention. I split the old optimize function into (a) a declareOptimizationProblem and (b) a new optimize function. Additionally, I added a boolean to the new optimize function which, when True, calls the declareOptimizationFunction. In this way, the declareOptimizationProblem function does not have to be called and the setup is consistent with previous versions. The changes were implemented with the last push to the restruct branch.