Skip to content

Commit

Permalink
Update vre_stor.jl
Browse files Browse the repository at this point in the history
With expression virtual_discharge_cost=setup["VirtualChargeDischargeCost"]./scale_factor
  • Loading branch information
sambuddhac authored Feb 5, 2024
1 parent de129cf commit 197404b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/model/resources/vre_stor/vre_stor.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1925,6 +1925,8 @@ function vre_stor_capres!(EP::Model, inputs::Dict, setup::Dict)
CONSTRAINTSET = STOR
end

virtual_discharge_cost=setup["VirtualChargeDischargeCost"]./scale_factor

# Virtual State of Charge Expressions
@expression(EP, eVreStorVSoCBalStart[y in CONSTRAINTSET, t in START_SUBPERIODS],
EP[:vCAPRES_VS_VRE_STOR][y,t+hours_per_subperiod-1]
Expand Down Expand Up @@ -2035,28 +2037,28 @@ function vre_stor_capres!(EP::Model, inputs::Dict, setup::Dict)

#Variable costs of DC "virtual charging" for technologies "y" during hour "t" in zone "z"
@expression(EP, eCVar_Charge_DC_virtual[y in DC_CHARGE,t=1:T],
inputs["omega"][t]*(setup["VirtualChargeDischargeCost"]./scale_factor)*vCAPRES_DC_CHARGE[y,t]/by_rid(y,:EtaInverter))
inputs["omega"][t]*virtual_discharge_cost*vCAPRES_DC_CHARGE[y,t]/by_rid(y,:EtaInverter))
@expression(EP, eTotalCVar_Charge_DC_T_virtual[t=1:T], sum(eCVar_Charge_DC_virtual[y,t] for y in DC_CHARGE))
@expression(EP, eTotalCVar_Charge_DC_virtual, sum(eTotalCVar_Charge_DC_T_virtual[t] for t in 1:T))
EP[:eObj] += eTotalCVar_Charge_DC_virtual

#Variable costs of DC "virtual discharging" for technologies "y" during hour "t" in zone "z"
@expression(EP, eCVar_Discharge_DC_virtual[y in DC_DISCHARGE,t=1:T],
inputs["omega"][t]*(setup["VirtualChargeDischargeCost"]./scale_factor)*by_rid(y,:EtaInverter)*vCAPRES_DC_DISCHARGE[y,t])
inputs["omega"][t]*virtual_discharge_cost*by_rid(y,:EtaInverter)*vCAPRES_DC_DISCHARGE[y,t])
@expression(EP, eTotalCVar_Discharge_DC_T_virtual[t=1:T], sum(eCVar_Discharge_DC_virtual[y,t] for y in DC_DISCHARGE))
@expression(EP, eTotalCVar_Discharge_DC_virtual, sum(eTotalCVar_Discharge_DC_T_virtual[t] for t in 1:T))
EP[:eObj] += eTotalCVar_Discharge_DC_virtual

#Variable costs of AC "virtual charging" for technologies "y" during hour "t" in zone "z"
@expression(EP, eCVar_Charge_AC_virtual[y in AC_CHARGE,t=1:T],
inputs["omega"][t]*(setup["VirtualChargeDischargeCost"]./scale_factor)*vCAPRES_AC_CHARGE[y,t])
inputs["omega"][t]*virtual_discharge_cost*vCAPRES_AC_CHARGE[y,t])
@expression(EP, eTotalCVar_Charge_AC_T_virtual[t=1:T], sum(eCVar_Charge_AC_virtual[y,t] for y in AC_CHARGE))
@expression(EP, eTotalCVar_Charge_AC_virtual, sum(eTotalCVar_Charge_AC_T_virtual[t] for t in 1:T))
EP[:eObj] += eTotalCVar_Charge_AC_virtual

#Variable costs of AC "virtual discharging" for technologies "y" during hour "t" in zone "z"
@expression(EP, eCVar_Discharge_AC_virtual[y in AC_DISCHARGE,t=1:T],
inputs["omega"][t]*(setup["VirtualChargeDischargeCost"]./scale_factor)*vCAPRES_AC_DISCHARGE[y,t])
inputs["omega"][t]*virtual_discharge_cost*vCAPRES_AC_DISCHARGE[y,t])
@expression(EP, eTotalCVar_Discharge_AC_T_virtual[t=1:T], sum(eCVar_Discharge_AC_virtual[y,t] for y in AC_DISCHARGE))
@expression(EP, eTotalCVar_Discharge_AC_virtual, sum(eTotalCVar_Discharge_AC_T_virtual[t] for t in 1:T))
EP[:eObj] += eTotalCVar_Discharge_AC_virtual
Expand Down

0 comments on commit 197404b

Please sign in to comment.