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

Double Negative for Storage Costs in Objective Equation #106

Open
trevorb1 opened this issue Nov 7, 2024 · 1 comment · May be fixed by #107
Open

Double Negative for Storage Costs in Objective Equation #106

trevorb1 opened this issue Nov 7, 2024 · 1 comment · May be fixed by #107
Labels
bug Something isn't working

Comments

@trevorb1
Copy link
Member

trevorb1 commented Nov 7, 2024

Hi! I have a question relating to how Storage Salvage Value is treated in the objective equation in OSeMOSYS_fast:

I think the actual calculation of discounting the salvage value is correct, but we are adding it to the cost (via the double negative) rather than subtracting it? Or I may just be interpreting something wrong?

minimize cost: sum{r in REGION, t in TECHNOLOGY, y in YEAR}
((((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] * CapitalRecoveryFactor[r,t] * PvAnnuity[r,t] / DiscountFactor[r,y] +
DiscountedTechnologyEmissionsPenalty[r,t,y] - DiscountedSalvageValue[r,t,y]) +
sum{r in REGION, s in STORAGE, y in YEAR} (CapitalCostStorage[r,s,y] * NewStorageCapacity[r,s,y] / DiscountFactorStorage[r,s,y] -
- SalvageValueStorage[r,s,y] / ((1+DiscountRateStorage[r,s])^(max{yy in YEAR} max(yy)-min{yy in YEAR} min(yy)+1)));

image

@trevorb1 trevorb1 added the bug Something isn't working label Nov 7, 2024
@willu47
Copy link
Member

willu47 commented Nov 8, 2024

Classic. That's a good catch....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants