GenXProject / GenX.jl

GenX: a configurable power system capacity expansion model for studying low-carbon energy futures. More details at : https://genx.mit.edu
https://genxproject.github.io/GenX.jl/
GNU General Public License v2.0
262 stars 105 forks source link

Multi-stage optimization with investment periods of varying lengths may result in incorrect discount factors #671

Closed ran1988 closed 3 months ago

ran1988 commented 3 months ago

https://github.com/GenXProject/GenX.jl/blob/5100d174b17357cd054a4234dcfeeaeadea58e1a/src/multi_stage/dual_dynamic_programming.jl#L580 I have reviewed the calculation method for the discount factor and noticed that it assumes equal lengths for each investment period. If I want to perform an optimization with [5,5,5,10] investment periods, what should I do?

sambuddhac commented 3 months ago

PR #672 fixes this

lbonaldo commented 3 months ago

Thank you, @ran1988, for opening this issue. To perform an optimization with periods of different length, you need to edit the StageLengths parameter of the multi_stage_settings.yml:

StageLengths: [10,10,10] # Length of each model stage (years)

The implementation of the discount factor calculation included in the initialize_cost_to_go function works with periods of different length, and we updated the docstring to reflect the code. Please let us know if this addresses your question.

ran1988 commented 3 months ago

Thank you for your attention and efforts! I have performed a optimization with the updated initialize_cost_togo function, but it still didn't solve the problem. The revised code is : "DF = \frac{1}{(1+WACC)^{L{p}*(p-1)}}" If a [5,5,5,10] investment period setting is applied, then the DF for the fourth stage is 1/(1+wacc)^30. It should be 1/(1+wacc)^15, isn't it?

ran1988 commented 3 months ago

The latest update works! Thanks!