From ebcb5850a4865e20968cf2206a058ebdc2bfb137 Mon Sep 17 00:00:00 2001 From: "Chakrabarti, Sambuddha (Sam)" Date: Fri, 12 Jan 2024 19:17:50 -0500 Subject: [PATCH] Update storage_all.jl Update storage_all.jl with "VirtualChargeDischargeCost setting parameter to account for cost of virtual charging and discharging --- src/model/resources/storage/storage_all.jl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/model/resources/storage/storage_all.jl b/src/model/resources/storage/storage_all.jl index 99e22622a5..281a297f38 100644 --- a/src/model/resources/storage/storage_all.jl +++ b/src/model/resources/storage/storage_all.jl @@ -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