Skip to content

Commit

Permalink
Update storage_all.jl
Browse files Browse the repository at this point in the history
Update storage_all.jl with "VirtualChargeDischargeCost setting parameter to account for cost of virtual charging and discharging
  • Loading branch information
sambuddhac authored Jan 13, 2024
1 parent 7c98a73 commit ebcb585
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/model/resources/storage/storage_all.jl
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,20 @@ function storage_all!(EP::Model, inputs::Dict, setup::Dict)
@expression(EP, eTotalCVarIn, sum(eTotalCVarInT[t] for t in 1:T))
add_to_expression!(EP[:eObj], eTotalCVarIn)

if CapacityReserveMargin > 0
#Variable costs of "virtual charging" for technologies "y" during hour "t" in zone "z"
@expression(EP, eCVar_in_virtual[y in STOR_ALL,t=1:T], inputs["omega"][t]*setup["VirtualChargeDischargeCost"]*vCAPRES_charge[y,t])
@expression(EP, eTotalCVarInT_virtual[t=1:T], sum(eCVar_in_virtual[y,t] for y in STOR_ALL))
@expression(EP, eTotalCVarIn_virtual, sum(eTotalCVarInT_virtual[t] for t in 1:T))
EP[:eObj] += eTotalCVarIn_virtual

#Variable costs of "virtual discharging" for technologies "y" during hour "t" in zone "z"
@expression(EP, eCVar_out_virtual[y in STOR_ALL,t=1:T], inputs["omega"][t]*setup["VirtualChargeDischargeCost"]*vCAPRES_discharge[y,t])
@expression(EP, eTotalCVarOutT_virtual[t=1:T], sum(eCVar_out_virtual[y,t] for y in STOR_ALL))
@expression(EP, eTotalCVarOut_virtual, sum(eTotalCVarOutT_virtual[t] for t in 1:T))
EP[:eObj] += eTotalCVarOut_virtual
end

## Power Balance Expressions ##

# Term to represent net dispatch from storage in any period
Expand Down

0 comments on commit ebcb585

Please sign in to comment.