Skip to content

Combination of roll forwards and investment optimization fails #1059

@hannesfelipe

Description

@hannesfelipe

Describe the bug
We try to model an investment model in combination with the roll forward parameter. However, the model is not running, unless the roll forward horizon is greater than the investment temporal block.

This is the unclear error message, that does not help to identify the issue. It took us a while to realize that the parameterization of the model was correct (just not the combination of the temporal blocks).

ERROR: LoadError: unable to evaluate expression:
-(0 milliseconds isless {connection_investment_tech_lifetime(analysis_time=Base.RefValue{Dates.DateTime}(Dates.DateTime("2019-01-02T20:00:00")), connection=pipeline_District_Heating, stochastic_scenario=realisation, t=2019-01-02T20:00~(5 hours)~>2019-01-03T01:00) = 10 years} ifelse 1 ifelse 0)
MethodError: no method matching isless(::Dates.Millisecond, ::Dates.Year)

(I skipped the rest of the error message)

To Reproduce
is this even intended as a use case?

In our case, we optimize over the period of one year (also the investment temporal block is one year) with an hourly resolution and a monthly roll forward.

e.g.,

the model start is 2019-01-01T00:00:00 and the model end is 2019-12-31T23:00:00.
roll forward is 730h (its monthly but we divide the hours of the year by 12 to generate the roll forward)
model__temporal_block and model__default_temporal_block have a temporal block with a resolution of 1h
model__default_investment_temporal_block has a temporal block with a resolution of 1Y.

Expected behavior
First, we would expect an error or warning message that clearly indicates the problem.

Second, we would expect that the intended combination is possible and that the model would run infeasible if the investments are not sufficient. This could be the case, if the investments that are based on the information from the first roll forward period are not sufficient to fulfill the constraints in later periods.

Desktop (please complete the following information):

  • Which SpineOpt version? 0.8.3
  • Which toolbox version? 0.8.2
  • OS: Windows

Additional context
We use the roll forward approach to reduce the runtime of the model. We need a hourly resolution but the complexity of our model results in long optimization times for the optimization of the dispatch of one year.

Now, we want to integrate the chance to invest at the beginning of the year into our model. Perhaps, you have another idea how to address this if the combination of the necessary parameters is not working (or let us know how to solve it).

Best regards,
Johannes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions