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
269 stars 114 forks source link

Question regarding flexible demand capacity in multi stage modelling #286

Open CarbonNeutral35 opened 1 year ago

CarbonNeutral35 commented 1 year ago

Hi,

I was wondering, whether it would be possible to alter the amount of flexible demand during multi stage modelling. Say, I would like to model three stages, each 10 years apart, and during this time there would be ongoing electrification for example in heating, and I would like to include this in the model by increasing the capacity of a flexible resource, for example having 100 MW in stage 1, 200 in stage 2 and 300 in stage 3.

It would seem, that now the "Existing_Cap_MW" value in "Generators_data.csv" is only read for the first time period, and changes in this value do not seem to cause any changes in later stages, even if one were to change these values in the input files for the second period for example.

So my question would be, is it possible somehow to alter the capacity of flexible resources between the modelling stages, or whether this would not be possible?

sambuddhac commented 1 year ago

To the best of my knowledge, the results of any stage are used as the starting values for the next stage in terms of capacity decisions. But, I would refer this question to @dharik13 and @JesseJenkins to see if they have a take on whether it's possible or recommended to have manual control on the decision for flexible demand.

JesseJenkins commented 1 year ago

@CarbonNeutral35 this is a good question and a use case for the dynamic model that we've not had to face before. Thanks for flagging. @dharik13 see below for suggested fix but Ill need someone from your team familiar with the multi-stage expansion to address this...

The issue is that flexible demand capacity is set exogenously in the generators_data.csv file, but when running the dynamic multi-stage expansion, GenX overwrites the existing capacity specified in the input file with the results from the prior stage expansion. For other resources eligible for expansion, you can use the Min_Cap_MW column to force the model to increase capacity to the specified level. But this does not work for flexible demand, because it does not have a vCAP decision variable. Flexible demand falls into the last else block in this snippet from investment_discharge.jl.

# Cap_Size is set to 1 for all variables when unit UCommit == 0
    # When UCommit > 0, Cap_Size is set to 1 for all variables except those where THERM == 1
    @expression(EP, eTotalCap[y in 1:G],
        if y in intersect(NEW_CAP, RET_CAP) # Resources eligible for new capacity and retirements
            if y in COMMIT
                eExistingCap[y] + dfGen[y,:Cap_Size]*(EP[:vCAP][y] - EP[:vRETCAP][y])
            else
                eExistingCap[y] + EP[:vCAP][y] - EP[:vRETCAP][y]
            end
        elseif y in setdiff(NEW_CAP, RET_CAP) # Resources eligible for only new capacity
            if y in COMMIT
                eExistingCap[y] + dfGen[y,:Cap_Size]*EP[:vCAP][y]
            else
                eExistingCap[y] + EP[:vCAP][y]
            end
        elseif y in setdiff(RET_CAP, NEW_CAP) # Resources eligible for only capacity retirements
            if y in COMMIT
                eExistingCap[y] - dfGen[y,:Cap_Size]*EP[:vRETCAP][y]
            else
                eExistingCap[y] - EP[:vRETCAP][y]
            end
        else # Resources not eligible for new capacity or retirements
            eExistingCap[y] + EP[:vZERO]
        end
    )

Proposed solution: for resources that are not part of the NEW_CAP or RET_CAP sets (e.g. flexible demand), modify the multi-stage expansion so that it does not take the capacity from the prior expansion period, but rather treats installed capacity as a constant parameter read from the generators_data.csv file for each planning year. A user can then specify exogenously in the generators_data.csv file a trajectory for the changes in capacity for that resource. This will fix the issue for flexible demand, but could also be used to e.g. force a specified build trajectory for offshore wind or DG solar or some other resource that is being driven by policy decisions (or a user just wants to exogenously specify the trajectory of capacity for sensitivity purposes). @dharik13 can you address this (or assign it to someone who can)?

dharik13 commented 1 year ago

Thanks for flagging this. Seems like valuable addition. Will try to get this done soon.

ASamarkRoth commented 1 year ago

Hi everyone.

I was wondering of the progress of solving this issue, highly relevant for us.

Best, Anton

ASamarkRoth commented 1 year ago

Hi again.

A hack that I found to work on v0.3.3 was to allow the flex resource to also expand (New_Build=1) and specify Min_Cap_MW as well as Max_Cap_MW to define the capacity for the different stages.

Best, Anton