OSeMOSYS / OSeMOSYS_GNU_MathProg

The GNU MathProg implementation of OSeMOSYS
Apache License 2.0
9 stars 14 forks source link

Removal of TechWithCapacityNeededToMeetPeakTS causes issues with derived demands #28

Open willu47 opened 4 years ago

willu47 commented 4 years ago

There seems to be a mistake associated with an old improvement to the code.

The change is the first logged in the ChangeLog

And relates to: TechWithCapacityNeededToMeetPeakTS. The equation that was removed - that needs to be (re)inserted is:

s.t. CAa4_Constraint_Capacity{y in YEAR_X, l in TIMESLICE, t in TECHNOLOGY, 
                              r in REGION:
                              TechWithCapacityNeededToMeetPeakTS[t,r]<>0}: 
    RateOfTotalActivity[y,l,t,r] 
    <= 
    TotalCapacityAnnual[y,t,r] * CapacityFactor[y,t,l,r]*CapacityToActivityUnit[t,r];

This equation makes sure that you have enough capacity to meet demands in all time-slices. Ignoring it was necessary for almost all energy infrastructure with the exception of the power sector.

As storage of oil, gas and coal are relatively cheap you don't need to size them to meet the peak demand of the fuel they produce. So the overall capacity balance was OK.

Note that if you enter 'accumulated annual demand' and that is all they meet, it is fine. But if you have derived demands (say from use in a power plant) then it is NOT fine as those will have a time-slice definition.

The error has probably propagated to other versions of the code...

willu47 commented 4 years ago

This equation exists in current as of (81aff71) versions of the formulation but without the conditional operator relating to the TechWithCapacityNeededToMeetPeakTS parameter, which has been removed from the formulation.