Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Storage equations (and objective function) contain mistakes! #96

Open
Timon-R opened this issue Dec 11, 2023 · 0 comments
Open

Bug: Storage equations (and objective function) contain mistakes! #96

Timon-R opened this issue Dec 11, 2023 · 0 comments

Comments

@Timon-R
Copy link

Timon-R commented Dec 11, 2023

Some of the storage equations are wrong:

The following equation (that appear 4 times in the code) contains mistakes that are explained below:

####s.t. TDC2_TotalDiscountedCost{r in REGION, y in YEAR}: sum{t in TECHNOLOGY}((((sum{yy in YEAR: y-yy < OperationalLife[r,t] && y-yy>=0} NewCapacity[r,t,yy])+ ResidualCapacity[r,t,y])*FixedCost[r,t,y] + sum{m in MODEperTECHNOLOGY[t], l in TIMESLICE} RateOfActivity[r,l,t,m,y]*YearSplit[l,y]*VariableCost[r,t,m,y])/DiscountFactorMid[r,y]+CapitalCost[r,t,y] * NewCapacity[r,t,y]/DiscountFactor[r,y]+DiscountedTechnologyEmissionsPenalty[r,t,y]-DiscountedSalvageValue[r,t,y]) + sum{s in STORAGE} (CapitalCostStorage[r,s,y] * NewStorageCapacity[r,s,y]/DiscountFactor[r,y]-CapitalCostStorage[r,s,y] * NewStorageCapacity[r,s,y]/DiscountFactor[r,y]) = TotalDiscountedCost[r,y];

The storage part of this equation has two mistakes.

  1. It substacts to zero and should instead substract the DiscountedSalvageValueStorage instead of this term: CapitalCostStorage[r,s,y] * NewStorageCapacity[r,s,y]/DiscountFactor[r,y]
  2. Intead of the DiscountFactor[r,y], the DiscountFactorStorage[r,y,s] should be used. Otherwise it doesn't compute.

(In newer version of the code, the DiscountFactor might be replaced by the CapitalRecoveryFactor)
The error is also in the objective function, in the section "Summary Results" and at the bottom of the code in the table TotalDiscountedCostResults.

The error with the use of the DiscountFactor instead of the DiscountFactorStorage also appears in this equation:
#s.t. SI9_SalvageValueStorageDiscountedToStartYear[...]

@Timon-R Timon-R changed the title Bug: Storage equations contain mistakes! Bug: Storage equations (and objective function) contain mistakes! Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant