diff --git a/base/addons/CCS/bb4/CCS_balbase4.inc b/base/addons/CCS/bb4/CCS_balbase4.inc new file mode 100644 index 00000000..6c6efd65 --- /dev/null +++ b/base/addons/CCS/bb4/CCS_balbase4.inc @@ -0,0 +1,7 @@ + +$ifi not %OPTIFLOW%==yes $goto NO_OPTIFLOW_CO2_CONNECTION +$ifi not %baloptCCU%==yes $goto NO_OPTIFLOW_CO2_CONNECTION + +QFLOWCO2LIM + +$label NO_OPTIFLOW_CO2_CONNECTION \ No newline at end of file diff --git a/base/addons/CCS/bb4/CCS_eqndecdef.inc b/base/addons/CCS/bb4/CCS_eqndecdef.inc new file mode 100644 index 00000000..cf12777d --- /dev/null +++ b/base/addons/CCS/bb4/CCS_eqndecdef.inc @@ -0,0 +1,20 @@ +* CCS add-on. Added by Juan Gea Bermudez + +* Thise file is a further development tying together captured carbon from the CCS addon to CO2 used in the OptiFlow addon. +* Made by Theis Madsen + +$ifi not %OPTIFLOW%==yes $goto NO_OPTIFLOW +*$ifi not %baloptCCU%==yes $goto NO_OPTIFLOW_CO2_CONNECTION + +EQUATION QFLOWCO2LIM(Y,AAA,PROCSOURCE,FLOW,S,T) "This equation limits the CO2 used in an OptiFlow production pathway by what is captured (ton/h)"; + +QFLOWCO2LIM(IY411,IA,PROCSOURCE,FLOW,S,T)$(ICO2(PROCSOURCE,FLOW)) .. + VFLOWSOURCE(IY411,IA,PROCSOURCE,FLOW,S,T) + =L= +$ifi %baloptCCU%==yes + SUM(G$(IAGK_HASORPOT(IY411,IA,G) AND IGPROC(PROCSOURCE,G)),(IM_CO2(G) + IM_CO2RE(G)) * IOF0001 * IOF3P6 * VGF_T(IY411,IA,G,S,T) * CCS_CO2CAPTEFF_G(G)) +$ifi not %baloptCCU%==yes + EPS +; + + +$label NO_OPTIFLOW +*$label NO_OPTIFLOW_CO2_CONNECTION \ No newline at end of file diff --git a/base/addons/CCS/bb4/CCS_qlimco2c.inc b/base/addons/CCS/bb4/CCS_qlimco2c.inc index c5e4fc4d..3a2dc911 100644 --- a/base/addons/CCS/bb4/CCS_qlimco2c.inc +++ b/base/addons/CCS/bb4/CCS_qlimco2c.inc @@ -1,4 +1,5 @@ * CCS add-on. Added by Juan Gea Bermudez *Removing absorbed CO2 -+SUM((IA,G)$(IAGK_HASORPOT(IY411,IA,G) AND ICA(C,IA) AND GROUP_AAA(GROUP,IA)), SUM((IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * (IM_CO2(G) * IOF0001) * IOF3P6 * VGF_T(IY411,IA,G,IS3,T)*CCS_CO2CAPTEFF_G(G))) ++SUM((IA,G)$(IAGK_HASORPOT(IY411,IA,G) AND ICA(C,IA) AND GROUP_AAA(GROUP,IA)), SUM((IS3,T), IHOURSINST(IS3,T) * IHOURFRAC * (IM_CO2(G) + IM_CO2RE(G)) * IOF0001 * IOF3P6 * VGF_T(IY411,IA,G,IS3,T)*CCS_CO2CAPTEFF_G(G))) + diff --git a/base/addons/CCS/bb4/CCS_qlimco2na.inc b/base/addons/CCS/bb4/CCS_qlimco2na.inc index daebf363..6a2321d6 100644 --- a/base/addons/CCS/bb4/CCS_qlimco2na.inc +++ b/base/addons/CCS/bb4/CCS_qlimco2na.inc @@ -1,4 +1,5 @@ * CCS add-on. Added by Juan Gea Bermudez *Removing absorbed CO2 -+SUM(C,SUM((IA,G)$(IAGK_HASORPOT(IY411,IA,G) AND ICA(C,IA) AND GROUP_AAA(GROUP,IA)), SUM((IS3,T), IHOURSINST(IS3,T) * (IM_CO2(G) * IOF0001) * IOF3P6 * VGF_T(IY411,IA,G,IS3,T)*CCS_CO2CAPTEFF_G(G)))) ++SUM(C,SUM((IA,G)$(IAGK_HASORPOT(IY411,IA,G) AND ICA(C,IA) AND GROUP_AAA(GROUP,IA)), SUM((IS3,T), IHOURSINST(IS3,T) * IHOURFRAC * (IM_CO2(G) + IM_CO2RE(G)) * IOF0001 * IOF3P6 * VGF_T(IY411,IA,G,IS3,T)*CCS_CO2CAPTEFF_G(G)))) + diff --git a/base/addons/CCS/bb4/CCS_qobj.inc b/base/addons/CCS/bb4/CCS_qobj.inc index 4f4f38f0..ed212c4e 100644 --- a/base/addons/CCS/bb4/CCS_qobj.inc +++ b/base/addons/CCS/bb4/CCS_qobj.inc @@ -1,7 +1,10 @@ * Additions to the objective function: -- SUM((C,GROUP), SUM((IA,G)$(ICA(C,IA) AND IAGK_HASORPOT(Y,IA,G) AND CCS_G(G) AND GROUP_AAA(GROUP,IA)), SUM((IS3,T), IHOURSINST(IS3,T) * (IM_CO2(G)*IOF0001) * IOF3P6 * VGF_T(Y,IA,G,IS3,T)*CCS_CO2CAPTEFF_G(G)) * EMI_POL(Y,C,GROUP,"TAX_CO2")*IHOURFRAC)) +- SUM((C,GROUP), SUM((IA,G)$(ICA(C,IA) AND IAGK_HASORPOT(Y,IA,G) AND CCS_G(G) AND GROUP_AAA(GROUP,IA)), SUM((IS3,T), IHOURSINST(IS3,T) * IM_CO2(G) * IOF0001 * IOF3P6 * VGF_T(Y,IA,G,IS3,T)*CCS_CO2CAPTEFF_G(G)) * EMI_POL(Y,C,GROUP,"TAX_CO2")*IHOURFRAC)) *Transportation and storage costs -+ SUM(C, SUM((IA,G)$(ICA(C,IA) AND IAGK_HASORPOT(Y,IA,G) AND CCS_G(G)), SUM((IS3,T), IHOURSINST(IS3,T) * (IM_CO2(G)*IHOURFRAC*IOF0001) * IOF3P6 * VGF_T(Y,IA,G,IS3,T)*CCS_CO2CAPTEFF_G(G)) *CCS_TRANSPORTCOST )) +*(Right now only what is stored finally - think about how the CCU carbon is priced. Here, or in OptiFlow?) ++ SUM(C, SUM((IA,G)$(ICA(C,IA) AND IAGK_HASORPOT(Y,IA,G) AND CCS_G(G)), SUM((IS3,T), IHOURSINST(IS3,T) * (IM_CO2(G) + IM_CO2RE(G))*IHOURFRAC*IOF0001 * IOF3P6 * VGF_T(Y,IA,G,IS3,T)*CCS_CO2CAPTEFF_G(G)) *CCS_TRANSPORTCOST)) + + diff --git a/base/addons/DECOM/DECOM_balbase4.inc b/base/addons/DECOM/DECOM_balbase4.inc index 7fc01881..09b5e1dd 100644 --- a/base/addons/DECOM/DECOM_balbase4.inc +++ b/base/addons/DECOM/DECOM_balbase4.inc @@ -14,6 +14,7 @@ $ifi not %LIFETIME_DECOM_EXO_G%==yes $ifi not %ECONOMIC_DECOM_EXO_G%==yes $goto QDECOM_EXO_LIM QDECOM_EXO_ACCUM + $ifi not %LIFETIME_DECOM_EXO_G%==yes $ifi %ECONOMIC_DECOM_EXO_G%==yes $goto NO_DECOMMISSIONING_EXOGENOUS_GENERATION QDECOM_EXO_ACCUM_REST diff --git a/base/addons/DECOM/DECOM_eqndecdef.inc b/base/addons/DECOM/DECOM_eqndecdef.inc index ed84d54a..120d8d0f 100644 --- a/base/addons/DECOM/DECOM_eqndecdef.inc +++ b/base/addons/DECOM/DECOM_eqndecdef.inc @@ -35,8 +35,6 @@ $ifi not %LIFETIME_DECOM_EXO_G%==yes $ifi not %ECONOMIC_DECOM_EXO_G%==yes $goto EQUATION QDECOM_EXO_ACCUM(Y,AAA,G) 'Equation that calculates the accumulated endogenous decommissioning of exogenous technologies'; EQUATION QDECOM_EXO_LIM(Y,AAA,G) 'Equation limiting the yearly decommission of exogenous technologies'; - - QDECOM_EXO_ACCUM(IY411,IA,G)$IGDECOMEXOPOT(IY411,IA,G).. VDECOM_EXO_ACCUM(IY411,IA,G) =E= @@ -51,6 +49,7 @@ QDECOM_EXO_LIM(IY411,IA,G)$IGDECOMEXOPOT(IY411,IA,G).. GKFX(IY411,IA,G) ; + $ifi not %LIFETIME_DECOM_EXO_G%==yes $ifi %ECONOMIC_DECOM_EXO_G%==yes $goto NO_DECOMMISSIONING_EXOGENOUS_GENERATION EQUATION QDECOM_EXO_ACCUM_REST(Y,AAA,G) 'Equation establishing the restriction on the minimum decommissionining of exogenous technologies'; diff --git a/base/addons/DECOM/DECOM_ipardecdef.inc b/base/addons/DECOM/DECOM_ipardecdef.inc index 3faa6eec..20cd1038 100644 --- a/base/addons/DECOM/DECOM_ipardecdef.inc +++ b/base/addons/DECOM/DECOM_ipardecdef.inc @@ -1,4 +1,4 @@ -* Decommissioning introduced by Juan Gea Bermúdez 2018. +* Decommissioning introduced by Juan Gea Berm�dez 2018. $ifi not %LIFETIME_DECOM_EXO_G%==yes $ifi not %ECONOMIC_DECOM_EXO_G%==yes $ifi not %NO_DECOM_EXO_G%==yes $goto DEFAULT_DECOMMISSIONING_EXOGENOUS_GENERATION @@ -12,6 +12,9 @@ IDECOM_CHANGE(YYY,IA,G)=0; ILOOPBREAK=0; +PARAMETER IGKFX_OG(YYY,AAA,G) 'The initial GKFX that isnt edited'; +IGKFX_OG(YYY,IA,G) = GKFX(YYY,IA,G); + LOOP(YYY$(NOT(ORD(YYY) EQ 1) AND (YYY.VAL GT GDECOMEXOPOTSTART)), LOOP(IA, LOOP(G$IGDECOM(G), @@ -89,5 +92,4 @@ LOOP(IGKFIND, ); ); ); -); - +); \ No newline at end of file diff --git a/base/addons/_hooks/annuitycgadditions.inc b/base/addons/_hooks/annuitycgadditions.inc index 893aa80c..7058e5e1 100644 --- a/base/addons/_hooks/annuitycgadditions.inc +++ b/base/addons/_hooks/annuitycgadditions.inc @@ -1,3 +1,3 @@ * Location of ANNUITYCG additions used in add-ons -$ifi %HYDROGEN%==yes $include "../../base/addons/hydrogen/bb4/hydrogen_annuitycgadditions.inc"; \ No newline at end of file +$ifi %HYDROGEN%==yes $include "../../base/addons/hydrogen/bb4/hydrogen_annuitycgadditions.inc"; diff --git a/base/addons/_hooks/balbase4.inc b/base/addons/_hooks/balbase4.inc index a7af16c2..1978599f 100644 --- a/base/addons/_hooks/balbase4.inc +++ b/base/addons/_hooks/balbase4.inc @@ -25,5 +25,6 @@ $ifi %ANC_SERV%==yes $include "../../base/addons/ancilliary_services/ancillia $ifi %BalancingMarket%==yes $include "../../base/addons/balancing_market/balancing_market_balbase4.inc"; $ifi %INDIVUSERS%==yes $include "../../base/addons/indivusers/bb4/indivusers_balbase4.inc"; $ifi %OPTIFLOW%==yes $include "../../base/addons/optiflow/bb4/optiflow_balbase4.inc"; +$ifi %CCS%==yes $include "../../base/addons/CCS/bb4/CCS_balbase4.inc"; $label endoffile diff --git a/base/addons/_hooks/eqndecdef.inc b/base/addons/_hooks/eqndecdef.inc index eacacb60..c2e5db2e 100644 --- a/base/addons/_hooks/eqndecdef.inc +++ b/base/addons/_hooks/eqndecdef.inc @@ -36,5 +36,6 @@ $ifi %ANC_SERV%==yes $include "../../base/addons/ancilliary_services/ancillia $ifi %BalancingMarket%==yes $include "../../base/addons/balancing_market/balancing_market_eqndecdef.inc"; $ifi %INDIVUSERS%==yes $include "../../base/addons/indivusers/bb4/indivusers_eqndecdef.inc"; $ifi %OPTIFLOW%==yes $include "../../base/addons/optiflow/bb4/optiflow_eqndecdef.inc"; +$ifi %CCS%==yes $include "../../base/addons/CCS/bb4/CCS_eqndecdef.inc"; $label endoffile diff --git a/base/addons/_hooks/ipardecdef.inc b/base/addons/_hooks/ipardecdef.inc index 36d7a52f..fcc752db 100644 --- a/base/addons/_hooks/ipardecdef.inc +++ b/base/addons/_hooks/ipardecdef.inc @@ -9,6 +9,7 @@ $label beginbb4 $ifi %import_results%==yes $include "../../base/addons/import_results/import_results_ipardecdef.inc"; $ifi %HYDROGEN%==yes $include "../../base/addons/hydrogen/bb4/hydrogen_ipardecdef.inc"; +$ifi %OPTIFLOW%==yes $include "../../base/addons/optiflow/bb4/optiflow_ipardecdef.inc"; $ifi %UnitComm%==yes $include "../../base/addons/unitcommitment/bb4/uc_ipardecdef.inc"; $ifi %STEPWISE_RAMPING%==yes $include "../../base/addons/STEPWISE_RAMPING/stepwise_ramping_ipardecdef.inc"; $ifi %X3V%==yes $include "../../base/addons/x3v/bb4/x3v_ipardecdef.inc"; diff --git a/base/addons/_hooks/qgmaxaf.inc b/base/addons/_hooks/qgmaxaf.inc new file mode 100644 index 00000000..d5b6a757 --- /dev/null +++ b/base/addons/_hooks/qgmaxaf.inc @@ -0,0 +1,7 @@ +* Latest revision 20240423 (tmad) + + +$ifi %OPTIFLOW%==yes $ifi %baloptfuelbridge%==yes $include "../../base/addons/optiflow/bb4/optiflow_qgmaxaf.inc" + + +$label endoffile diff --git a/base/addons/_hooks/qgmaxcf.inc b/base/addons/_hooks/qgmaxcf.inc new file mode 100644 index 00000000..e3f8830a --- /dev/null +++ b/base/addons/_hooks/qgmaxcf.inc @@ -0,0 +1,7 @@ +* Latest revision 20240423 (tmad) + + +$ifi %OPTIFLOW%==yes $ifi %baloptfuelbridge%==yes $include "../../base/addons/optiflow/bb4/optiflow_qgmaxcf.inc" + + +$label endoffile diff --git a/base/addons/_hooks/qgmaxrf.inc b/base/addons/_hooks/qgmaxrf.inc new file mode 100644 index 00000000..b490deac --- /dev/null +++ b/base/addons/_hooks/qgmaxrf.inc @@ -0,0 +1,7 @@ +* Latest revision 20240423 (tmad) + + +$ifi %OPTIFLOW%==yes $ifi %baloptfuelbridge%==yes $include "../../base/addons/optiflow/bb4/optiflow_qgmaxrf.inc" + + +$label endoffile diff --git a/base/addons/_hooks/qhydrogen_eq.inc b/base/addons/_hooks/qhydrogen_eq.inc index 31082bfc..f3c06906 100644 --- a/base/addons/_hooks/qhydrogen_eq.inc +++ b/base/addons/_hooks/qhydrogen_eq.inc @@ -2,7 +2,7 @@ $ifi %TRANSPORT%==yes $include "../../base/addons/transport/bb4/transport_qhydrogen_eq.inc"; - +$ifi %OPTIFLOW%==yes $include "../../base/addons/optiflow/bb4/optiflow_qh2eq_region.inc" $ifi %vqdebug%==yes $setglobal equation qhydrogen_eq $ifi %vqdebug%==yes $include "../../base/addons/vqdebug/bb4/vqdebug_equations.inc"; diff --git a/base/addons/_hooks/qhydrogen_eq_area.inc b/base/addons/_hooks/qhydrogen_eq_area.inc index 4a802c30..b12d2285 100644 --- a/base/addons/_hooks/qhydrogen_eq_area.inc +++ b/base/addons/_hooks/qhydrogen_eq_area.inc @@ -1,5 +1,6 @@ * Latest revision 20180418 (hr) +$ifi %OPTIFLOW%==yes $include "../../base/addons/optiflow/bb4/optiflow_qh2eq_area.inc" $ifi %vqdebug%==yes $setglobal equation qhydrogen_eq_area $ifi %vqdebug%==yes $include "../../base/addons/vqdebug/bb4/vqdebug_equations.inc"; diff --git a/base/addons/_hooks/qlimco2c.inc b/base/addons/_hooks/qlimco2c.inc index abda9fc1..7c9c8c91 100644 --- a/base/addons/_hooks/qlimco2c.inc +++ b/base/addons/_hooks/qlimco2c.inc @@ -3,7 +3,7 @@ $ifi %CCS%==yes $include "../../base/addons/CCS/bb4/CCS_qlimco2c.inc"; - +$ifi %OPTIFLOW%==yes $include "../../base/addons/optiflow/bb4/optiflow_qlimco2c.inc"; diff --git a/base/addons/_hooks/qlimco2na.inc b/base/addons/_hooks/qlimco2na.inc index f83f5837..d757ed76 100644 --- a/base/addons/_hooks/qlimco2na.inc +++ b/base/addons/_hooks/qlimco2na.inc @@ -3,6 +3,7 @@ $ifi %CCS%==yes $include "../../base/addons/CCS/bb4/CCS_qlimco2na.inc"; +$ifi %OPTIFLOW%==yes $include "../../base/addons/optiflow/bb4/optiflow_qlimco2na.inc"; diff --git a/base/addons/_hooks/varassign.inc b/base/addons/_hooks/varassign.inc index 6e27eaec..d0db0807 100644 --- a/base/addons/_hooks/varassign.inc +++ b/base/addons/_hooks/varassign.inc @@ -4,4 +4,5 @@ $ifi %testbb1234%==yes $include "../../base/addons/bb1234compare/bb1234_varas $ifi %DECOM%==yes $include "../../base/addons/DECOM/DECOM_varassign.inc"; $ifi %HEATTRANS%==yes $include "../../base/addons/heattrans/bb4/heattrans_varassign.inc"; $ifi %HYDROGEN%==yes $include "../../base/addons/hydrogen/bb4/hydrogen_varassign.inc"; +$ifi %OPTIFLOW%==yes $include "../../base/addons/optiflow/bb4/optiflow_varassign.inc"; $ifi %OFFSHOREGRID%==yes $include "../../base/addons/offshoregrid/bb4/offshoregrid_varassign.inc"; diff --git a/base/addons/optiflow/agkndisc/agkndisc20090331.pdf b/base/addons/optiflow/agkndisc/agkndisc20090331.pdf index 5b21b838..f6dc3eeb 100644 Binary files a/base/addons/optiflow/agkndisc/agkndisc20090331.pdf and b/base/addons/optiflow/agkndisc/agkndisc20090331.pdf differ diff --git a/base/addons/optiflow/bb4/optiflow_annuities.inc b/base/addons/optiflow/bb4/optiflow_annuities.inc new file mode 100644 index 00000000..6e913718 --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_annuities.inc @@ -0,0 +1,72 @@ +* OPTIFLOW ANNUITY CALCULATIONS + +$ifi not %inv%==yes $goto NO_PROC_INVESTMENTS + +SCALAR ILOOPBREAK "Scalar used as binary number to break any loop function"; +PARAMETER IWEIGHTY(Y) "Relative weight of the individual years in Y"; +* Set the relative weight of the individual years in Y. +* Two ideas implemented here. Used according to option bb4weighty. +* Simple idea is to give equal weights: +$ifi "%bb4weighty%"=="same" IWEIGHTY(Y) = 1; +* More complex weighting of the individual years (years in YYY but not in Y are shared between two nearest (first and last years double the shared weight contribution)): +$ifi "%bb4weighty%"=="shareYYY" IWEIGHTY(Y)$(ORD(Y) EQ 1) = 1$(CARD(Y) EQ 1) + ((YVALUE(Y+1)-YVALUE(Y)-1)+1)$(CARD(Y) GT 1); +$ifi "%bb4weighty%"=="shareYYY" IWEIGHTY(Y)$((ORD(Y) GT 1) AND (ORD(Y) LT CARD(Y))) = (YVALUE(Y) - YVALUE(Y-1) -1)/2 + (YVALUE(Y+1) - YVALUE(Y) -1)/2 +1; +$ifi "%bb4weighty%"=="shareYYY" IWEIGHTY(Y)$((ORD(Y) EQ CARD(Y)) AND (CARD(Y) GT 1)) = ((YVALUE(Y)-YVALUE(Y-1)-1)+1); + +* HERE COMES SOME ANNUITY RELATED PARAMETERS, THE INTENTION IS TO MAKE ANNUITY PAYMENST WORK FOR OPTIFLOW +* SO THAT PREVIOUS YEAR INVESTMENTS WILL BE PAID LATER +PARAMETER IYHASANNUITYPROC(Y,Y,PROC) "Binary parameter to establish whether the annuity of an investment of a process made in Y (first index) should be paid in the time period Y (second index) (0,1)" ; +PARAMETER IINVYEARPROC_LEFT(Y,Y,PROC) "Remaining years of the lifetime of PROC of an investment made in Y (first index) at the beggining of Y (second index) (years)"; +PARAMETER IN_INV_PROC(Y,PROC) "Number of investments made OF PROC within Y (fraction)"; + +**PROCESS +LOOP(IPROCFIND, + LOOP(IYALIAS, + LOOP(Y$(ORD(Y) EQ ORD(IYALIAS)), + IINVYEARPROC_LEFT(IYALIAS,Y,IPROCFIND)=PROCDATA(IPROCFIND,'PROCLIFETIME'); + ); + ); +); + +LOOP(IPROCFIND, + LOOP(IYALIAS, + ILOOPBREAK=0; + IN_INV_PROC(IYALIAS,IPROCFIND)=ROUND(IWEIGHTY(IYALIAS)/PROCDATA(IPROCFIND,'PROCLIFETIME')); +*Correction of IN_INV_PROC + IF (IN_INV_PROC(IYALIAS,IPROCFIND) EQ 0, + IN_INV_PROC(IYALIAS,IPROCFIND)=1; + ); + LOOP(Y$(ORD(Y) GE ORD(IYALIAS) AND (ILOOPBREAK EQ 0)), +*First year's annuity + IF (ORD(Y) EQ ORD(IYALIAS), + IYHASANNUITYPROC(IYALIAS,Y,IPROCFIND)= 1; + IF(IINVYEARPROC_LEFT(IYALIAS,Y,IPROCFIND)*IN_INV_PROC(IYALIAS,IPROCFIND) LE IWEIGHTY(Y), + ILOOPBREAK=1; + ); + IINVYEARPROC_LEFT(IYALIAS,Y+1,IPROCFIND)$(ORD(Y) NE CARD(IYALIAS2))=PROCDATA(IPROCFIND,'PROCLIFETIME')*IN_INV_PROC(IYALIAS,IPROCFIND)-IWEIGHTY(Y); + ); +*Remaining year's annuity + IF (ORD(Y) GT ORD(IYALIAS), + IF ( IINVYEARPROC_LEFT(IYALIAS,Y,IPROCFIND) GT IWEIGHTY(Y) , + IYHASANNUITYPROC(IYALIAS,Y,IPROCFIND)= 1; + IINVYEARPROC_LEFT(IYALIAS,Y+1,IPROCFIND)$(ORD(Y) NE CARD(IYALIAS2))=IINVYEARPROC_LEFT(IYALIAS,Y,IPROCFIND)-IWEIGHTY(Y); + ); + IF ((IINVYEARPROC_LEFT(IYALIAS,Y,IPROCFIND) GE IWEIGHTY(IYALIAS)/2) AND (IINVYEARPROC_LEFT(IYALIAS,Y,IPROCFIND) LE IWEIGHTY(Y)) , !!Assumption: if the reamining years are more ore equal than half of IWEIGHTY, then the technology is in in this snapshot + IYHASANNUITYPROC(IYALIAS,Y,IPROCFIND)= 1; + ILOOPBREAK=1; + ); + IF ((IINVYEARPROC_LEFT(IYALIAS,Y,IPROCFIND) LT IWEIGHTY(IYALIAS)/2) AND (IINVYEARPROC_LEFT(IYALIAS,Y,IPROCFIND) LE IWEIGHTY(Y)) , !!Assumption: if the reamining years are less than half of IWEIGHTY, then the technology is out in this snapshot + IYHASANNUITYPROC(IYALIAS,Y,IPROCFIND)= 0; + ILOOPBREAK=1; + ); + ); + ); + ); +); + + +PARAMETER ANNUITYCPROC(CCC,PROC) "Parameter for annuity values of processes"; + +ANNUITYCPROC(CCC,PROC)$(PROCDATA(PROC,'PROCKAPVARIABLE') EQ 1) = RateOfReturn / (1 - (1 + RateOfReturn) ** (-PROCDATA(PROC,'PROCLIFETIME'))); + +$label NO_PROC_INVESTMENTS \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_balbase4.inc b/base/addons/optiflow/bb4/optiflow_balbase4.inc index 4caba15e..43965ea8 100644 --- a/base/addons/optiflow/bb4/optiflow_balbase4.inc +++ b/base/addons/optiflow/bb4/optiflow_balbase4.inc @@ -29,7 +29,7 @@ QMINFLOW_A QMINFLOW_R QMINFLOW_C -*$ifi %inv%==yes QPROCKAPACCUMNET !! Has weakness - but used anyway +$ifi %inv%==yes QPROCKAPACCUMNET !! Has weakness - but used anyway $ifi %inv%==yes QPROCKAP_UP $ifi %inv%==yes QSTOVOLTLIM_T $ifi %inv%==yes QSTOVOLTLIM diff --git a/base/addons/optiflow/bb4/optiflow_eqndecdef.inc b/base/addons/optiflow/bb4/optiflow_eqndecdef.inc index 8a1d8c86..c7114e1e 100644 --- a/base/addons/optiflow/bb4/optiflow_eqndecdef.inc +++ b/base/addons/optiflow/bb4/optiflow_eqndecdef.inc @@ -1,6 +1,6 @@ EQUATION QOBJQ "Objective function value assuming parameterised quantities technique (U)"; EQUATION QOBJWQ "Objective function value assuming weighted objectives values and parameterised quantities technique (U)"; -EQUATION QNODEBALANCE(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T) "Balance of input and output FLOW in interior PROC (U/h)" +EQUATION QNODEBALANCE(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T) "Balance of input and output FLOW in interior PROC (U/h)"; EQUATION QSOURCENODEBALANCE(Y,AAA,PROCSOURCE,FLOW,S,T) "Balance at Source node (U/h)"; EQUATION QSINKNODEBALANCE(Y,AAA,PROCSINK,FLOW,S,T) "Balance at Sink node (U/h)"; EQUATION QBUFFERNODEBALANCE(Y,AAA,PROCBUFFER,FLOW,S,T) "Heat balance in district heating networks - NEJ generel, but includes Heat balance.. (U/h)"; @@ -48,8 +48,8 @@ EQUATION QMINFLOW_C(Y,C,PROC,FLOW) "Constraint of FLOW consumption equals to a *----- Any declarations and definitions of equations for addon: *------------------------------------------------------------------------------- -*$ifi %inv%==yes EQUATION QPROCKAPACCUMNET(Y,AAA,PROC) 'NOT FINISHED Accumulated new investments minus decommissioning of previous investments due to lifetime expiration available at beginning of next year (U/h)'; -$ifi %inv%==yes EQUATION QPROCKAP_UP(Y,AAA,IPROCFROM,IPROCTO,FLOW,S,T) 'Capacity constraint on ..... (U/h)'; +$ifi %inv%==yes EQUATION QPROCKAPACCUMNET(Y,AAA,PROC) 'NOT FINISHED Accumulated new investments minus decommissioning of previous investments due to lifetime expiration available at beginning of next year (U/h)'; +$ifi %inv%==yes EQUATION QPROCKAP_UP(Y,AAA,IPROCFROM,IPROCTO,FLOW,S,T) 'Capacity constraint on ..... (U/h)'; $ifi %inv%==yes EQUATION QPROCKAUP_SCALE1(Y,AAA,PROC) "Equation for modelling economy of scale of new investments" ; $ifi %inv%==yes EQUATION QPROCKAUP_SCALE2(Y,AAA,PROC) "Equation for modelling economy of scale of new investments" ; $ifi %inv%==yes EQUATION QPROCKAP_DEC(Y,AAA,IPROCFROM,IPROCTO,FLOW,S,T) "Equation for modelling of decomissioning plants"; @@ -176,7 +176,7 @@ QNODEBALANCE(IY411,IA,PROC,IFLOWIN,IFLOWOUT,S,T)$(IPROCINOUTFLOW(IY411,IA,PROC,I + SUM(IPROCTO$(FLOWFROMTOPROC(IY411,IA,PROC,IPROCTO,IFLOWOUT) AND (PROCINOUTFLOW(IY411,IA,PROC,IFLOWIN,IFLOWOUT,"IMANYONE"))), VFLOW(IY411,IA,PROC,IPROCTO,IFLOWOUT,S,T)*PROCINOUTFLOW(IY411,IA,PROC,IFLOWIN,IFLOWOUT,"IMANYONE")) * The multiple outFLOW that are coming from a single inFLOW (SUM acts as summation): - + SUM((IPROCTO,FLOW)$(FLOWFROMTOPROC(IY411,IA,PROC,IPROCTO,FLOW) AND (PROCINOUTFLOW(IY411,IA,PROC,IFLOWIN,FLOW,"IONEMANY"))), !!TODO: compare §§ above: why different + + SUM((IPROCTO,FLOW)$(FLOWFROMTOPROC(IY411,IA,PROC,IPROCTO,FLOW) AND (PROCINOUTFLOW(IY411,IA,PROC,IFLOWIN,FLOW,"IONEMANY"))), !!TODO: compare §§ above: why different VFLOW(IY411,IA,PROC,IPROCTO,FLOW,S,T)*PROCINOUTFLOW(IY411,IA,PROC,IFLOWIN,FLOW,"IONEMANY")) * Export to other areas: + SUM(IAI$(ITRANSFROMTO(IA,IAI)),VFLOWTRANS(IY411,IA,IAI,PROC,IFLOWOUT,S,T)$(NOT TRANSFLOWMAX(IA,IAI,PROC,IFLOWOUT)))$PROCEXIM(PROC) @@ -433,27 +433,40 @@ QINDICINDICMIN(IY411,FLOWINDIC)$(INDICLIMGOAL(FLOWINDIC,"INDICMIN") AND (INDICLI QINDICINDICMAX(IY411,FLOWINDIC)$(INDICLIMGOAL(FLOWINDIC,"INDICMAX") AND (INDICLIMGOAL(FLOWINDIC,"INDICMAX") LT +INF)).. VFLOWINDICVALUES(IY411,FLOWINDIC) =L= INDICLIMGOAL(FLOWINDIC,"INDICMAX"); +*------------------------------------- +* Process capacity investments +*------------------------------------- + +* This equation accumulates investments into process capacity +QPROCKAPACCUMNET(IY411,IA,IPROC)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAPROCKAPNEW(Y,IA,IPROC)) + .. + VPROCKAPACCUMNET(IY411,IA,IPROC) + =E= + SUM(IY402$IY411PREVY(IY411,IY402), VPROCKAPACCUMNET(IY402,IA,IPROC)$SUM(Y$(YVALUE(Y) LT YVALUE(IY411)),IAPROCKAPNEW(Y,IA,IPROC)))$(NOT IYFIRST(IY411)) + + VPROCKAPNEW(IY411,IA,IPROC)$IAPROCKAPNEW(IY411,IA,IPROC) +; + + *This equation is for any process that is not a storage process, so IPROCFROM (when is in IFLOWINOUT_OUT or IPROCTO (when is IFLOWIN_IN) cannot be a PROCSTORAGE *If we want to highlight the importance of storage, we should take them into account and write them QPROCKAP_UP(IY411,IA,IPROCFROM,IPROCTO,FLOW,S,T)$( ( *(NOT PROCSTORAGE(IPROCFROM)) AND (NOT PROCSTORAGE_Y(IPROCFROM)) AND - (FLOWFROMTOPROC(IY411,IA,IPROCFROM,IPROCTO,FLOW) AND (PROCKAPDATA(IY411,IPROCFROM,FLOW,'IFLOWINOUT_OUT')))) + (FLOWFROMTOPROC(IY411,IA,IPROCFROM,IPROCTO,FLOW) AND (IPROCKAPDATA(IY411,IPROCFROM,FLOW,'IFLOWINOUT_OUT')))) OR ( *(NOT PROCSTORAGE(IPROCTO)) AND (NOT PROCSTORAGE_Y(IPROCTO)) AND - (FLOWFROMTOPROC(IY411,IA,IPROCFROM,IPROCTO,FLOW) AND (PROCKAPDATA(IY411,IPROCTO,FLOW,'IFLOWINOUT_IN')))) + (FLOWFROMTOPROC(IY411,IA,IPROCFROM,IPROCTO,FLOW) AND (IPROCKAPDATA(IY411,IPROCTO,FLOW,'IFLOWINOUT_IN')))) ).. - VFLOW(IY411,IA,IPROCFROM,IPROCTO,FLOW,S,T) =L= - + VFLOW(IY411,IA,IPROCFROM,IPROCTO,FLOW,S,T) + =L= PROCKAPFX(IY411,IA,IPROCFROM,FLOW,'IFLOWINOUT_OUT')$(PROCKAPDATA(IY411,IPROCFROM,FLOW,'IFLOWINOUT_OUT')) + PROCKAPFX(IY411,IA,IPROCTO,FLOW,'IFLOWINOUT_IN')$(PROCKAPDATA(IY411,IPROCTO,FLOW,'IFLOWINOUT_IN')) + + VPROCKAPACCUMNET(IY411,IA,IPROCFROM)$(SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAPROCKAPNEW(Y,IA,IPROCFROM)) AND (IPROCKAPDATA(IY411,IPROCFROM,FLOW,'IFLOWINOUT_OUT'))) + + VPROCKAPACCUMNET(IY411,IA,IPROCTO)$(SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAPROCKAPNEW(Y,IA,IPROCTO)) AND (IPROCKAPDATA(IY411,IPROCTO,FLOW,'IFLOWINOUT_IN'))) +; -* + (SUM(IY402$IY411PREVY(IY411,IY402),VPROCKAPACCUMNET(IY402,IA,IPROCFROM)) !! CHECK - + VPROCKAPNEW(IY411,IA,IPROCFROM)$(FLOWFROMTOPROC(IY411,IA,IPROCFROM,IPROCTO,FLOW) AND (PROCKAPDATA(IY411,IPROCFROM,FLOW,'IFLOWINOUT_OUT'))) -* + (SUM(IY402$IY411PREVY(IY411,IY402),VPROCKAPACCUMNET(IY402,IA,IPROCTO)) !! CHECK - + VPROCKAPNEW(IY411,IA,IPROCTO)$(FLOWFROMTOPROC(IY411,IA,IPROCFROM,IPROCTO,FLOW) AND (PROCKAPDATA(IY411,IPROCTO,FLOW,'IFLOWINOUT_IN'))); - +*FLOWFROMTOPROC(IY411,IA,IPROCFROM2,IPROCTO,FLOW) AND QPROCKAUP_SCALE1(IY411,IA,PROC)$(IAPROCKAPNEW(IY411,IA,PROC) AND PROCKAPNEWSCALE(PROC)).. VPROCKAPNEW(IY411,IA,PROC)=G=PROCKAPNEWSCALE(PROC)*VPROCKAPNEWSCALE_U(IY411,IA,PROC); @@ -648,7 +661,4 @@ SUM(IA$ICA(C,IA), (SUM((PROCSINK,S,T)$(PROCSINK(PROC) AND IENTERPROC(IY411,IA,PROCSINK,FLOW)),VFLOWSINK(IY411,IA,PROCSINK,FLOW,S,T)*IHOURSINST(S,T)))$(PROC_T(PROC))+ (SUM((PROCSINK,S,ITWWT)$(PROCSINK(PROC) AND IENTERPROC(IY411,IA,PROCSINK,FLOW)),VFLOWSINK(IY411,IA,PROCSINK,FLOW,S,ITWWT)*IHOURSINSTWWT(S,ITWWT)))$((NOT PROC_T(PROC))) ) - =G=MINFLOW(IY411,C,PROC,FLOW); - - - + =G=MINFLOW(IY411,C,PROC,FLOW); \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_ipardecdef.inc b/base/addons/optiflow/bb4/optiflow_ipardecdef.inc new file mode 100644 index 00000000..053ce0d3 --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_ipardecdef.inc @@ -0,0 +1,14 @@ + + +*Initializing CO2 sources +$ifi not %baloptCCU%==yes $goto noCCUopti + +*Initializing set if a flow is for biogenic or fossil CO2 +SET IGPROC(PROCSOURCE,G) "Connection of CO2 flow and technology with CCS"; +IGPROC(PROCSOURCE,G)=0; +IGPROC('CO2_Source_Biogen',G)$(CCS_G(G) AND IM_CO2RE(G)) = YES; +IGPROC('CO2_Source_Fossil',G)$(CCS_G(G) AND IM_CO2(G)) = YES; + +$label noCCUopti + +$label endoffile \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_isetdecdef.inc b/base/addons/optiflow/bb4/optiflow_isetdecdef.inc index 4acdba84..a45e38a5 100644 --- a/base/addons/optiflow/bb4/optiflow_isetdecdef.inc +++ b/base/addons/optiflow/bb4/optiflow_isetdecdef.inc @@ -1,3 +1,40 @@ *IEQFLOW_Y(CCCRRRAAA,PROC,FLOW)=EQFLOW(Y,CCCRRRAAA,PROC,FLOW); *IMAXFLOW_Y(CCCRRRAAA,PROC,FLOW)=MAXFLOW(Y,CCCRRRAAA,PROC,FLOW); *IMINFLOW_Y(CCCRRRAAA,PROC,FLOW)=MINFLOW(Y,CCCRRRAAA,PROC,FLOW); + +*Initializing the set IFPROC and IFFLOW if OPTIFLOW is enabled and the bridge of biomass usage between models, TMAD +$ifi not %baloptfuelbridge%==yes $goto nofuelbridge + +SET IFFLOW(FFF,FLOW) "Fuel in Balmorel that corresponds to a flow in OptiFlow"; +IFFLOW(FFF,FLOW)=0; + +IFFLOW('STRAW','STRAW_GEN_FLOW')=YES; +IFFLOW('WOOD','WOOD_GEN_FLOW')=YES; +IFFLOW('WOODPELLETS','WOOD_PELLETS_GEN_FLOW')=YES; + +SET IFPROC(FFF,PROC) "Fuel in Balmorel that corresponds to a flow in OptiFlow"; +IFPROC(FFF,PROC)=0; + +IFPROC('STRAW','Straw_Gen')=YES; +IFPROC('WOOD','Wood_Gen')=YES; +IFPROC('WOODPELLETS','Wood_Pellets_Gen')=YES; + +$label nofuelbridge + +*Initializing the set IFPROC and IFFLOW if OPTIFLOW is enabled and the bridge of biogas between models, TMAD +$ifi not %baloptgasbridge%==yes $goto nogasbridge +IFFLOW('BIOGAS','GASFLOW')=YES; +IFPROC('BIOGAS','GasBuffer')=YES; + +$label nogasbridge + +*Initializing CO2 sources +$ifi not %baloptCCU%==yes $goto noCCUopti +SET ICO2(PROCSOURCE,FLOW) "Set of CO2 source and flows"; +ICO2(PROCSOURCE,FLOW)=0; +ICO2('CO2_Source_Biogen','CO2_SOURCE_FLOW_BIOGEN') = YES; +ICO2('CO2_Source_Fossil','CO2_SOURCE_FLOW_FOSSIL') = YES; + +$label noCCUopti + +$label endoffile \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_pardefine.inc b/base/addons/optiflow/bb4/optiflow_pardefine.inc index b31c9d29..f1d20a70 100644 --- a/base/addons/optiflow/bb4/optiflow_pardefine.inc +++ b/base/addons/optiflow/bb4/optiflow_pardefine.inc @@ -101,15 +101,15 @@ $if not EXIST '../data/OPTIFLOW_PROC.inc' $INCLUDE '../../base/data/OPTIFLOW_PRO ALIAS (PROC,IPROC,IPROCFROM,IPROCTO,IPROCFROM2,IPROCTO2,IPROCABROAD); !!IPROCABROAD ? -* Indholdet i denne kan garanteres afledes af PROCPAR nedenfor, lige nu håndlaver vi den. -* Men i øvrigt er det formentlig sikrere (ift. bruger) at definere eksplicit her. Bør i øvrigt checkes i errorcode. TODO/done? +* Indholdet i denne kan garanteres afledes af PROCPAR nedenfor, lige nu h�ndlaver vi den. +* Men i �vrigt er det formentlig sikrere (ift. bruger) at definere eksplicit her. B�r i �vrigt checkes i errorcode. TODO/done? SET PROCSOURCE(PROC) "Source PROC (no flow entering it)" %semislash% $if EXIST '../data/OPTIFLOW_PROCSOURCE.inc' $INCLUDE '../data/OPTIFLOW_PROCSOURCE.inc'; $if not EXIST '../data/OPTIFLOW_PROCSOURCE.inc' $INCLUDE '../../base/data/OPTIFLOW_PROCSOURCE.inc'; %semislash%; -* Indholdet i denne kan garanteres afledes af PROCPAR nedenfor, lige nu håndlaver vi den. -* Men i øvrigt er det formentlig sikrere (ift. bruger) at definere eksplicit her. Bør i øvrigt checkes i errorcode. TODO/done? +* Indholdet i denne kan garanteres afledes af PROCPAR nedenfor, lige nu h�ndlaver vi den. +* Men i �vrigt er det formentlig sikrere (ift. bruger) at definere eksplicit her. B�r i �vrigt checkes i errorcode. TODO/done? SET PROCSINK(PROC) "Sink PROC (no flow leaving it)" %semislash% $if EXIST '../data/OPTIFLOW_PROCSINK.inc' $INCLUDE '../data/OPTIFLOW_PROCSINK.inc'; $if not EXIST '../data/OPTIFLOW_PROCSINK.inc' $INCLUDE '../../base/data/OPTIFLOW_PROCSINK.inc'; @@ -175,9 +175,10 @@ $ifi %inv%==yes $if EXIST '../data/OPTIFLOW_APROCKAPNEW.inc' $INCLUDE $ifi %inv%==yes $if not EXIST '../data/OPTIFLOW_APROCKAPNEW.inc' $INCLUDE '../../base/data/OPTIFLOW_APROCKAPNEW.inc'; $ifi %inv%==yes %semislash%; -$ifi %inv%==yes SET IAPROCKAPNEW(YYY,AAA,PROC) 'Area, Proc where technology may be invested based on APKN and some implicit constraints'; -IAPROCKAPNEW(YYY,IA,PROC) = APROCKAPNEW(YYY,IA,PROC); !! MORE LATER - +$ifi %inv%==yes SET IAPROCKAPNEW(YYY,AAA,PROC) 'Area, Proc where technology may be invested based on APKN and some implicit constraints'; +$ifi %inv%==yes SET IAPROCKAPNEW_notY(AAA,PROC) 'Same as IAPROCKAPNEW, but not for a year'; +IAPROCKAPNEW(Y,IA,PROC) = APROCKAPNEW(Y,IA,PROC); !! MORE LATER +IAPROCKAPNEW_notY(IA,PROC) = SUM(Y,IAPROCKAPNEW(Y,IA,PROC)); * NB: for debugging, print and ailing memory nice to have FLOW elements in UPPERCASE og Proc elements in CamelCase. * NONONO: I now prefer the other way: FLOW elements in CamelCase og Proc elements in UPPERCASE! @@ -233,8 +234,18 @@ $if EXIST '../data/OPTIFLOW_PROCKAPDATA.inc' $INCLUDE '../data/OPTIF $if not EXIST '../data/OPTIFLOW_PROCKAPDATA.inc' $INCLUDE '../../base/data/OPTIFLOW_PROCKAPDATA.inc'; %semislash%; +* To ensure that flow restricted by capacity functions properly with accumulating investments, we update the PROCKAPDATA set to not include all combinations. +* The set should, firstly, only include the years in the simulation, and secondly, not include processes that are not available yet in that year. + +SET IPROCKAPDATA(YYY,PROC,FLOW,IFLOWINOUT) "Same as PROCKAPDATA, but includes only simulated years, as well as the year an investment is available from"; +*SET IPROCKAPDATA_V2(YYY,PROC,FLOW,IFLOWINOUT) "Same as before, for test"; +IPROCKAPDATA(Y,PROC,FLOW,IFLOWINOUT) = PROCKAPDATA(Y,PROC,FLOW,IFLOWINOUT); + +* Create subset of processes that is for the model to invest in, based on if it is in PROCDATA and has investment cost +$ifi %inv%==yes SET IPROCFIND(PROC) 'Set of processes to be found as investments'; +$ifi %inv%==yes IPROCFIND(PROC)=PROC(PROC)$(PROCDATA(PROC,'PROCKAPVARIABLE') EQ 1); PARAMETER PROCKAPFX(YYY,AAA,PROC,FLOW,IFLOWINOUT) "Capacity of Process (U/h)" %semislash% $if EXIST '../data/OPTIFLOW_PROCKAPFX.inc' $INCLUDE '../data/OPTIFLOW_PROCKAPFX.inc'; @@ -264,7 +275,7 @@ $if not EXIST '../data/OPTIFLOW_PROCKAPDECOM.inc' $INCLUDE '../../base/data/OPTI -IAPROCKAPNEW(YYY,IA,PROC)$(PROCDATA(PROC,'PROCKAPVARIABLE') EQ 0) = NO; !! Not needed, is implicit in APROCKAPNEW +*IAPROCKAPNEW(YYY,IA,PROC)$(PROCDATA(PROC,'PROCKAPVARIABLE') EQ 0) = NO; !! Not needed, is implicit in APROCKAPNEW * TODO: add condition for COMBINATION OF Y AND PROCFROMYEAR (which may reduce IAPROCKAPNEW). @@ -612,6 +623,8 @@ $if EXIST '../data/OPTIFLOW_RateOfReturn.inc' $INCLUDE '../data/OPTI $if not EXIST '../data/OPTIFLOW_RateOfReturn.inc' $INCLUDE '../../base/data/OPTIFLOW_RateOfReturn.inc'; %semislash%; +* Annuity calculation +$ifi %OPTIFLOW%==yes $include "../../base/addons/optiflow/bb4/optiflow_annuities.inc"; * ------------------------------------------------------------------------------ * OBJECTIVES: diff --git a/base/addons/optiflow/bb4/optiflow_qeeq.inc b/base/addons/optiflow/bb4/optiflow_qeeq.inc index 867375b0..5f7296c4 100644 --- a/base/addons/optiflow/bb4/optiflow_qeeq.inc +++ b/base/addons/optiflow/bb4/optiflow_qeeq.inc @@ -1,4 +1,5 @@ --SUM(IA$(RRRAAA(IR,IA) AND (SUM(IPROCFROM$FLOWFROMTOPROC(IY411,IA,IPROCFROM,'ElecBuffer','ELECFLOW'),1) OR SUM((IPROCTO)$FLOWFROMTOPROC(IY411,IA,'ElecBuffer',IPROCTO,'ELECFLOW'),1)) ), VFLOWBUFFER(IY411,IA,'ElecBuffer','ELECFLOW',IS3,T)) +-SUM(IA$(RRRAAA(IR,IA) AND (SUM(IPROCFROM$FLOWFROMTOPROC(IY411,IA,IPROCFROM,'ElecBuffer','ELECFLOW'),1) OR SUM((IPROCTO)$FLOWFROMTOPROC(IY411,IA,'ElecBuffer',IPROCTO,'ELECFLOW'),1)) ), + VFLOWBUFFER(IY411,IA,'ElecBuffer','ELECFLOW',IS3,T)) diff --git a/base/addons/optiflow/bb4/optiflow_qgmaxaf.inc b/base/addons/optiflow/bb4/optiflow_qgmaxaf.inc new file mode 100644 index 00000000..fde5627f --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_qgmaxaf.inc @@ -0,0 +1,7 @@ +* hook of biomass between Balmorel and OptiFlow (tmad) +* assumes bb4 + + + SUM((IS3,T,PROCSOURCE,FLOW)$(IFPROC(FFF,PROCSOURCE) AND IFFLOW(FFF,FLOW)), IHOURSINST(IS3,T)*IHOURFRAC * VFLOWSOURCE(IY411,IA,PROCSOURCE,FLOW,IS3,T)) + + + - SUM((IS3,T,PROCBUFFER,FLOW)$(IFPROC(FFF,PROCBUFFER) AND IFFLOW(FFF,FLOW)), IHOURSINST(IS3,T)*IHOURFRAC * VFLOWBUFFER(IY411,IA,PROCBUFFER,FLOW,IS3,T)) \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_qgmaxcf.inc b/base/addons/optiflow/bb4/optiflow_qgmaxcf.inc new file mode 100644 index 00000000..af3ab6f0 --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_qgmaxcf.inc @@ -0,0 +1,7 @@ +* hook of biomass between Balmorel and OptiFlow (tmad) +* assumes bb4 + + + SUM((IS3,T,IA,PROCSOURCE,FLOW)$(IFPROC(FFF,PROCSOURCE) AND IFFLOW(FFF,FLOW) AND ICA(C,IA)), IHOURSINST(IS3,T)*IHOURFRAC * VFLOWSOURCE(IY411,IA,PROCSOURCE,FLOW,IS3,T)) + + + - SUM((IS3,T,IA,PROCBUFFER,FLOW)$(IFPROC(FFF,PROCBUFFER) AND IFFLOW(FFF,FLOW) AND ICA(C,IA)), IHOURSINST(IS3,T)*IHOURFRAC * VFLOWBUFFER(IY411,IA,PROCBUFFER,FLOW,IS3,T)) \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_qgmaxrf.inc b/base/addons/optiflow/bb4/optiflow_qgmaxrf.inc new file mode 100644 index 00000000..1b7daa91 --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_qgmaxrf.inc @@ -0,0 +1,7 @@ +* hook of biomass between Balmorel and OptiFlow (tmad) +* assumes bb4 + + + SUM((IS3,T,IA,PROCSOURCE,FLOW)$(IFPROC(FFF,PROCSOURCE) AND IFFLOW(FFF,FLOW) AND RRRAAA(IR,IA)), IHOURSINST(IS3,T)*IHOURFRAC * VFLOWSOURCE(IY411,IA,PROCSOURCE,FLOW,IS3,T)) + + + - SUM((IS3,T,IA,PROCBUFFER,FLOW)$(IFPROC(FFF,PROCBUFFER) AND IFFLOW(FFF,FLOW) AND RRRAAA(IR,IA)), IHOURSINST(IS3,T)*IHOURFRAC * VFLOWBUFFER(IY411,IA,PROCBUFFER,FLOW,IS3,T)) \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_qh2eq_area.inc b/base/addons/optiflow/bb4/optiflow_qh2eq_area.inc new file mode 100644 index 00000000..da0f3831 --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_qh2eq_area.inc @@ -0,0 +1,11 @@ +* hook of hydrogen between Balmorel and OptiFlow, added by Theis Madsen +* First line is for the hydrogen balancing constraint at an area level +* Second line is for the region level balancing constraint. +* This file is for AREA, another file is for REGION. + + +*-VFLOWBUFFER(IY411,IA,'HydrogenBuffer_MWh','HYDROGENFLOW_MWh',IS3,T)$(SUM(IPROCFROM$FLOWFROMTOPROC(IY411,IA,IPROCFROM,'HydrogenBuffer_MWh','HYDROGENFLOW_MWh'),1) OR SUM((IPROCTO)$FLOWFROMTOPROC(IY411,IA,'HydrogenBuffer_MWh',IPROCTO,'HYDROGENFLOW_MWh'),1)) ++VFLOWSOURCE(IY411,IA,'HydrogenSource_MWh','HYDROGENFLOW_MWh',IS3,T)$(SUM(IPROCFROM$FLOWFROMTOPROC(IY411,IA,IPROCFROM,'HydrogenSource_MWh','HYDROGENFLOW_MWh'),1) OR SUM((IPROCTO)$FLOWFROMTOPROC(IY411,IA,'HydrogenSource_MWh',IPROCTO,'HYDROGENFLOW_MWh'),1)) + +*-SUM(IA$(RRRAAA(IR,IA) AND (SUM(IPROCFROM$FLOWFROMTOPROC(IY411,IA,IPROCFROM,'HydrogenBuffer_MWh','HYDROGEN_FLOW_MWh'),1) OR SUM((IPROCTO)$FLOWFROMTOPROC(IY411,IA,'HydrogenBuffer_MWh',IPROCTO,'HYDROGEN_FLOW_MWh'),1)) ), +* VFLOWBUFFER(IY411,IA,'HydrogenBuffer_MWh','HYDROGEN_FLOW_MWh',IS3,T)) diff --git a/base/addons/optiflow/bb4/optiflow_qh2eq_region.inc b/base/addons/optiflow/bb4/optiflow_qh2eq_region.inc new file mode 100644 index 00000000..36168e69 --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_qh2eq_region.inc @@ -0,0 +1,12 @@ +* hook of hydrogen between Balmorel and OptiFlow, added by Theis Madsen +* First line is for the hydrogen balancing constraint at an area level +* Second line is for the region level balancing constraint. +* This file is for REGION, another file is for AREA. + +*-VFLOWBUFFER(IY411,IA,'HydrogenBuffer_MWh','HYDROGEN_FLOW_MWh',IS3,T)$(SUM(IPROCFROM$FLOWFROMTOPROC(IY411,IA,IPROCFROM,'HydrogenBuffer_MWh','HYDROGEN_FLOW_MWh'),1) OR SUM((IPROCTO)$FLOWFROMTOPROC(IY411,IA,'HydrogenBuffer_MWh',IPROCTO,'HYDROGEN_FLOW_MWh'),1)) + + +*-SUM(IA$(RRRAAA(IR,IA) AND (SUM(IPROCFROM$FLOWFROMTOPROC(IY411,IA,IPROCFROM,'HydrogenBuffer_MWh','HYDROGENFLOW_MWh'),1) OR SUM((IPROCTO)$FLOWFROMTOPROC(IY411,IA,'HydrogenBuffer_MWh',IPROCTO,'HYDROGENFLOW_MWh'),1)) ), +* VFLOWBUFFER(IY411,IA,'HydrogenBuffer_MWh','HYDROGENFLOW_MWh',IS3,T)) ++SUM(IA$(RRRAAA(IR,IA) AND (SUM(IPROCFROM$FLOWFROMTOPROC(IY411,IA,IPROCFROM,'HydrogenSource_MWh','HYDROGENFLOW_MWh'),1) OR SUM((IPROCTO)$FLOWFROMTOPROC(IY411,IA,'HydrogenSource_MWh',IPROCTO,'HYDROGENFLOW_MWh'),1)) ), + VFLOWSOURCE(IY411,IA,'HydrogenSource_MWh','HYDROGENFLOW_MWh',IS3,T)) \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_qlimco2c.inc b/base/addons/optiflow/bb4/optiflow_qlimco2c.inc new file mode 100644 index 00000000..006600a7 --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_qlimco2c.inc @@ -0,0 +1,8 @@ +* CCU in optiflow, requires CCS add-on. Added by Theis Madsen + +*Re-adding utilizes CO2 for fuels +$ifi not %CCS%==yes $goto NOCCUS + +$ifi %baloptCCU%==yes -SUM((IA,PROCSOURCE,FLOW)$(ICA(C,IA) AND ICO2(PROCSOURCE,FLOW)), SUM((IS3,T), IHOURSINST(IS3,T) * IHOURFRAC * VFLOWSOURCE(IY411,IA,PROCSOURCE,FLOW,IS3,T))) + +$label NOCCUS \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_qlimco2na.inc b/base/addons/optiflow/bb4/optiflow_qlimco2na.inc new file mode 100644 index 00000000..0e1c7e07 --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_qlimco2na.inc @@ -0,0 +1,8 @@ +* CCU in optiflow, requires CCS add-on. Added by Theis Madsen + +*Re-adding utilizes CO2 for fuels +$ifi not %CCS%==yes $goto NOCCUS + +$ifi %baloptCCU%==yes -SUM(C,SUM((IA,PROCSOURCE,FLOW)$(ICA(C,IA) AND ICO2(PROCSOURCE,FLOW)), SUM((IS3,T), IHOURSINST(IS3,T) * IHOURFRAC * VFLOWSOURCE(IY411,IA,PROCSOURCE,FLOW,IS3,T)))) + +$label NOCCUS \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_qobj.inc b/base/addons/optiflow/bb4/optiflow_qobj.inc index eae6b83c..373827ab 100644 --- a/base/addons/optiflow/bb4/optiflow_qobj.inc +++ b/base/addons/optiflow/bb4/optiflow_qobj.inc @@ -6,14 +6,20 @@ * Investment costs !! TODO: shall it be here, or e.g. in VFLOWINDICVALUES , or in .. - + SUM((IA,PROC)$IAPROCKAPNEW(Y,IA,PROC), - IOF1000000*PROCDATA(PROC,'PROCINVCOST')*INDICLIMGOAL(FLOWINDIC,'INDICWEIGHT')*VPROCKAPNEW(Y,IA,PROC)*(RateOfReturn/(1-((1+RateOfReturn)**(-PROCDATA(PROC,'PROCLIFETIME')))))) - + SUM((IA,PROC,FLOW,IFLOWINOUT)$(PROCKAPDATA(Y,PROC,FLOW,IFLOWINOUT) AND (IAPROCKAPNEW(Y,IA,PROC) OR PROCKAPFX(Y,IA,PROC,FLOW,IFLOWINOUT))), +* First here, year one cost of investment + + IOF1000000*(SUM((IA,PROC)$IAPROCKAPNEW(Y,IA,PROC), + PROCDATA(PROC,'PROCINVCOST')*INDICLIMGOAL(FLOWINDIC,'INDICWEIGHT')*VPROCKAPNEW(Y,IA,PROC)*(SUM(C$ICA(C,IA),ANNUITYCPROC(C,PROC)))*SUM(IYALIAS2$(ORD(IYALIAS2) EQ ORD(Y)),IYHASANNUITYPROC(Y,IYALIAS2,PROC)))) +* Second, cost of previous year investments + + IOF1000000*(SUM((IYALIAS2,IA,PROC)$(IAPROCKAPNEW(IYALIAS2,IA,PROC) AND (ORD(IYALIAS2) LT ORD(Y))), + PROCDATA(PROC,'PROCINVCOST')*INDICLIMGOAL(FLOWINDIC,'INDICWEIGHT')*VPROCKAPNEW(IYALIAS2,IA,PROC)*(SUM(C$ICA(C,IA),ANNUITYCPROC(C,PROC)))*IYHASANNUITYPROC(IYALIAS2,Y,PROC))) +* all investments fixed cost, TMAD + + SUM((IA,PROC,FLOW,IFLOWINOUT)$(IPROCKAPDATA(Y,PROC,FLOW,IFLOWINOUT) AND (IAPROCKAPNEW_notY(IA,PROC) OR PROCKAPFX(Y,IA,PROC,FLOW,IFLOWINOUT))), PROCDATA(PROC,'PROCFIXCOST')*INDICLIMGOAL(FLOWINDIC,'INDICWEIGHT')* - (VPROCKAPNEW(Y,IA,PROC)$(IAPROCKAPNEW(Y,IA,PROC))+PROCKAPFX(Y,IA,PROC,FLOW,IFLOWINOUT)$(NOT PROCKAPDECOM(PROC))+PROCKAPFX(Y,IA,PROC,FLOW,IFLOWINOUT)*VPROCKAPDEC_U(Y,IA,PROC)$(PROCKAPDECOM(PROC))))) - + (VPROCKAPACCUMNET(Y,IA,PROC)$(IAPROCKAPNEW_notY(IA,PROC))+PROCKAPFX(Y,IA,PROC,FLOW,IFLOWINOUT)$(NOT PROCKAPDECOM(PROC))+PROCKAPFX(Y,IA,PROC,FLOW,IFLOWINOUT)*VPROCKAPDEC_U(Y,IA,PROC)$(PROCKAPDECOM(PROC))))) +* If Balmorel Carbon Capture is used in a fuel, then remove the transport cost again paid for in the CCS addon. +$ifi %baloptCCU%==yes $ifi %CCS%==yes - SUM(IA, SUM((IS3,T), SUM((PROCSOURCE,FLOW)$(ICO2(PROCSOURCE,FLOW)),IHOURSINST(IS3,T) * VFLOWSOURCE(Y,IA,PROCSOURCE,FLOW,IS3,T))) *CCS_TRANSPORTCOST ) diff --git a/base/addons/optiflow/bb4/optiflow_varassign.inc b/base/addons/optiflow/bb4/optiflow_varassign.inc new file mode 100644 index 00000000..08d0b00c --- /dev/null +++ b/base/addons/optiflow/bb4/optiflow_varassign.inc @@ -0,0 +1,4 @@ +* File hydrogen_varassign.inc for addon hydrogen. + +$ifi %inv%==yes LOOP(Y$(YVALUE(Y) LE YVALUE(IYALIAS)),VPROCKAPNEW.FX(Y,IA,PROC)$IAPROCKAPNEW(Y,IA,PROC)= VPROCKAPNEW.L(Y,IA,PROC);); +$ifi %inv%==yes VPROCKAPACCUMNET.FX(IY411FIRST,IA,PROC)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411FIRST)),IAPROCKAPNEW(Y,IA,PROC)) = VPROCKAPACCUMNET.L(IY411FIRST,IA,PROC); \ No newline at end of file diff --git a/base/addons/optiflow/bb4/optiflow_vardeclare.inc b/base/addons/optiflow/bb4/optiflow_vardeclare.inc index 9e2d8ada..0548ee1a 100644 --- a/base/addons/optiflow/bb4/optiflow_vardeclare.inc +++ b/base/addons/optiflow/bb4/optiflow_vardeclare.inc @@ -6,7 +6,7 @@ POSITIVE VARIABLE VFLOW(Y,AAA,IPROCFROM,IPROCTO,FLOW,S,T) "FLO POSITIVE VARIABLE VFLOWSOURCE(Y,AAA,PROCSOURCE,FLOW,S,T) "FLOW quantities from Source (U/h)"; POSITIVE VARIABLE VFLOWSINK(Y,AAA,PROCSINK,FLOW,S,T) "FLOW quantities to Sink (U/h)"; FREE VARIABLE VFLOWBUFFER(Y,AAA,PROCBUFFER,FLOW,S,T) "Net FLOW quantities to Buffer (U/h)"; -POSITIVE VARIABLE VFLOWTRANS(Y,IAAAE,IAAAI,PROC,FLOW,S,T) "Transport quantities (ton/h)"; +POSITIVE VARIABLE VFLOWTRANS(Y,IAAAE,IAAAI,PROC,FLOW,S,T) "Transport quantities (ton/h)"; POSITIVE VARIABLE VSTORAGEVOL(Y,AAA,PROC,FLOW,S,T) "Content in PROCSTORAGE (U)"; POSITIVE VARIABLE VSTORAGEVOL_Y(Y,AAA,PROC,FLOW,S) "Content in PROCSTORAGE_Y (U)"; POSITIVE VARIABLE VSTORAGEVOL_ST(Y,AAA,PROC,FLOW,S,T); @@ -20,9 +20,9 @@ POSITIVE VARIABLE VQFLOWBOUNDSHAREOUT2OUTUP(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T,ILOU POSITIVE VARIABLE VQFLOWBOUNDSHAREOUT2OUTLO(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T,ILOUPFXSET,IPLUSMINUS) "Feasibility-ensuring variable with high penalty cost - values are all zero in an OK model instance (U/h)"; POSITIVE VARIABLE VQFLOWBOUNDSHAREOUT2OUTFX(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T,ILOUPFXSET,IPLUSMINUS) "Feasibility-ensuring variable with high penalty cost - values are all zero in an OK model instance (U/h)"; -POSITIVE VARIABLE VQFLOWSHAREOUT2INLO(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T,ILOUPFXSET,IPLUSMINUS) -POSITIVE VARIABLE VQFLOWSHAREOUT2INUP(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T,ILOUPFXSET,IPLUSMINUS) -POSITIVE VARIABLE VQFLOWSHAREOUT2INFX(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T,ILOUPFXSET,IPLUSMINUS) +POSITIVE VARIABLE VQFLOWSHAREOUT2INLO(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T,ILOUPFXSET,IPLUSMINUS); +POSITIVE VARIABLE VQFLOWSHAREOUT2INUP(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T,ILOUPFXSET,IPLUSMINUS); +POSITIVE VARIABLE VQFLOWSHAREOUT2INFX(Y,AAA,PROC,IFLOWIN,IFLOWOUT,S,T,ILOUPFXSET,IPLUSMINUS); diff --git a/base/model/Balmorelbb4.inc b/base/model/Balmorelbb4.inc index f415504d..4f8e4dcb 100644 --- a/base/model/Balmorelbb4.inc +++ b/base/model/Balmorelbb4.inc @@ -177,6 +177,7 @@ SET IGCND(G) "Condensing technologies"; SET IGBPR(G) "Back pressure technologies"; !! Corresponding to acronym GBPR SET IGEXT(G) "Extraction technologies"; !! Corresponding to acronym GEXT SET IGHOB(G) "Heat-only boilers"; !! Corresponding to acronym GHOB +SET IGHS(G) "Heat savings"; !! Corresponding to acronym GHS SET IGETOH(G) "Electric heaters, heatpumps, electrolysis plants"; !! Corresponding to acronym GETOH SET IGHSTO(G) "Intra-seasonal heat storage technologies"; !! Corresponding to acronym GHSTO SET IGHSTOS(G) "Inter-seasonal heat storage technologies"; !! Corresponding to acronym GHSTOS @@ -353,6 +354,7 @@ IS33(S,ISALIAS)$((ORD(S) EQ CARD(S)) AND (ORD(ISALIAS) EQ 1)) = YES; !! CIRCULAR IGSOLE(G) = YES$(GDATA(G,'GDTYPE') EQ GSOLE); IGSOLH(G) = YES$(GDATA(G,'GDTYPE') EQ GSOLH); IGWAVE(G) = YES$(GDATA(G,'GDTYPE') EQ GWAVE); + IGHS(G) = YES$(GDATA(G,'GDTECHGROUP') EQ HEAT_SAVING); * Assignments of IGESTO, IGESTOS, IGHSTO and IGHSTOS may be changed if option stointers has a non-default value. @@ -766,7 +768,7 @@ PARAMETER IM_SO2(G) "SO2 emission coefficient for fuel (kg/GJ)"; PARAMETER IM_N2O(G) "NO2 emission coefficient for fuel (kg/GJ)"; LOOP(FFF, !! TODO: Check forbedringen af kode som givet p\E5 SONYstick - IM_CO2(G)$IGF(G,FFF) = FDATA(FFF,'FDCO2'); + IM_CO2(G)$IGF(G,FFF) = FDATA(FFF,'FDCO2')*(1 - FDATA(FFF,'FDRE')); IM_CO2RE(G)$IGF(G,FFF) = FDATA(FFF,'FDCO2')*FDATA(FFF,'FDRE'); IM_SO2(G)$IGF(G,FFF) = FDATA(FFF,'FDSO2')$(GDATA(G,'GDDESO2') EQ 0) + (FDATA(FFF,'FDSO2')*(1-GDATA(G,'GDDESO2')))$(GDATA(G,'GDDESO2') GT 0); @@ -1270,6 +1272,7 @@ EQUATIONS QMAXINVESTCF(Y,C,FFF) "Maximal investment by country and fuel during one simulated year (MW)" QMAXINVESTGROWTHCG(Y,C,G) "Maximum model generated capacity increase from one year to the next (MW)" QMAXINVESTNAF(Y,FFF) "Maximal investment by aggerated countries and fuel during one simulated year (MW)" + QMAXINVESTGKN(Y,AAA,G) "Maximum total capacity of new generating technology (MW)" QGKNACCUMNET(Y,AAA,G) "Accumulated new investments minus decommissioning of previous investments due to lifetime expiration available at beginning of next year (MW)" QGKE_UP(Y,AAA,G,S,T) "Capacity constraint on electricity generation (MW)" @@ -1888,6 +1891,7 @@ QGMINCF(IY411,C,FFF)$IGMINF(IY411,C,FFF).. * "Maximum fuel use by year, country and fuel (GJ)" QGMAXCF(IY411,C,FFF)$IGMAXF(IY411,C,FFF).. SUM(IAGK_HASORPOT(IY411,IA,G)$(IGF(G,FFF) AND ICA(C,IA)), IOF3P6 * SUM((IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * VGF_T(IY411,IA,G,IS3,T))) +$include "../../base/addons/_hooks/qgmaxcf.inc" =L= IGMAXF(IY411,C,FFF); * "Exact fuel use by year, country and fuel (GJ)" @@ -1905,6 +1909,7 @@ QGMINRF(IY411,IR,FFF)$IGMINF(IY411,IR,FFF).. * "Maximum fuel use by year, region and fuel constraint (GJ)" QGMAXRF(IY411,IR,FFF)$IGMAXF(IY411,IR,FFF).. SUM(IAGK_HASORPOT(IY411,IA,G)$(IGF(G,FFF) AND RRRAAA(IR,IA)), IOF3P6 * SUM((IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * VGF_T(IY411,IA,G,IS3,T))) +$include "../../base/addons/_hooks/qgmaxrf.inc" =L= IGMAXF(IY411,IR,FFF); * "Exact fuel use by year, region and fuel (GJ)" @@ -1917,6 +1922,7 @@ $include "../../base/addons/_hooks/qgeqrf.inc" * "Minimum fuel use by year, area and fuel (GJ)" QGMINAF(IY411,IA,FFF)$IGMINF(IY411,IA,FFF).. SUM(IAGK_HASORPOT(IY411,IA,G)$(IGF(G,FFF)), IOF3P6 * SUM((IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * VGF_T(IY411,IA,G,IS3,T))) +$include "../../base/addons/_hooks/qgmaxaf.inc" =G= IGMINF(IY411,IA,FFF); * "Maximum fuel use by year, area and fuel (GJ)" @@ -2182,6 +2188,9 @@ QLIMCO2NA(IY411,GROUP)$(EMI_POLNA(IY411,GROUP,'LIM_CO2') AND (EMI_POLNA(IY411,GR $include "../../base/addons/_hooks/qlimco2na.inc" ; +*------------------------------------------------------------------------------- +* Limits to investments into production capacity +*------------------------------------------------------------------------------- * "Maximal investment by country and fuel during one simulated year (MW)" QMAXINVESTCF(IY411,C,FFF)$(FMAXINVEST(C,FFF) AND (FMAXINVEST(C,FFF) LT INF)) .. @@ -2199,6 +2208,20 @@ QMAXINVESTNAF(IY411,FFF)$(FMAXINVESTNA(IY411,FFF) AND (FMAXINVESTNA(IY411,FFF) L ) ; +* "Maximum model generated capacity increase from one year to the next (MW)" +QMAXINVESTGROWTHCG(IY411,C,G)$(GROWTHCAP(C,G) AND (GROWTHCAP(C,G) LT INF)) .. + GROWTHCAP(C,G) +=G= + SUM((IAGKNY(IY411,IA,G))$(ICA(C,IA)), VGKN(IY411,IA,G)) +; + +*"Maximum total capacity of new generating technology (MW)" +QMAXINVESTGKN(IY411,IA,G)$(GKNMAX(IY411,IA,G) AND (GKNMAX(IY411,IA,G) LT INF)) .. + GKNMAX(IY411,IA,G) +=G= + VGKNACCUMNET(IY411,IA,G) +; + *------------------------------------------------------------------------------- * Accumulated new endogenous net generation capacity investments during present BB4 model @@ -2215,6 +2238,38 @@ QGKNACCUMNET(IY411,IA,IGKFIND)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411)),IAGKNY(Y,IA,IG $include "../../base/addons/_hooks/qgknaccumnet.inc"; +*--- +* Restrictions on accumulated new generation capacity +*--- + +EQUATION QGKNMAXSOLE(Y) 'Restriction on new solar PV generation capacity from one year to the next'; +EQUATION QGKNMAXWND(Y) 'Restriction on new wind generation capacity from one year to the next'; +EQUATION QGKNMAXHP(Y) 'Restriction on new heat pump capacity from one year to the next'; +EQUATION QGKNMAXHS(Y) 'Restriction on new heat saving capacity from one year to the next'; + +QGKNMAXSOLE(IY411)$(YVALUE(IY411) LE RAMP_YEAR).. + SUM((IA,IGSOLE),VGKN(IY411,IA,IGSOLE)) + =L= + IWEIGHTY(IY411) * RAMP_RATE_SOLE * IOF1000 +; + +QGKNMAXWND(IY411)$(YVALUE(IY411) LE RAMP_YEAR).. + SUM((IA,IGWND),VGKN(IY411,IA,IGWND)) + =L= + IWEIGHTY(IY411) * RAMP_RATE_WND * IOF1000 +; + +QGKNMAXHP(IY411)$(YVALUE(IY411) LE RAMP_YEAR).. + SUM((IA,IHEATPUMP),VGKN(IY411,IA,IHEATPUMP)) + =L= + IWEIGHTY(IY411) * RAMP_RATE_HP * IOF1000 +; +QGKNMAXHS(IY411)$(YVALUE(IY411) LE RAMP_YEAR).. + SUM((IA,IGHS),VGKN(IY411,IA,IGHS)) + =L= + IWEIGHTY(IY411) * RAMP_RATE_HS * IOF1000 +; + *------------------------------------------------------------------------------- *---------- Capacity constraint on technologies wiht endogenous investment ----- *------------------------------------------------------------------------------- @@ -2502,6 +2557,12 @@ $ifi not %TechInvest%==yes $ifi not %DECOM%==yes $goto NO_TECH_INVESTMENTS_NO_D *--- Investment restrictions---------------------------------------------------- QMAXINVESTNAF QMAXINVESTCF + QMAXINVESTGROWTHCG + QMAXINVESTGKN +$ifi %RampingVRE%==yes QGKNMAXSOLE +$ifi %RampingVRE%==yes QGKNMAXWND +$ifi %RampingVRE%==yes QGKNMAXHP +$ifi %RampingVRE%==yes $ifi %GHEATSAVING%==yes QGKNMAXHS $label NO_TECH_INVESTMENTS_NO_DECOMMISSIONING *--------------------------------------------------------------- @@ -2573,9 +2634,6 @@ $ifi not exist 'Balmorelbb4.sim' $include '../../base/model/Balmorelbb4.sim'; $ifi %OUTPUT_SUMMARY%==yes $if EXIST '../../base/output/OUTPUT_SUMMARY.inc' $INCLUDE '../../base/output/OUTPUT_SUMMARY.inc'; *--- End of Main results calculation --------------------------------------- -*----optiflow output file (TO BE MERGED IN OUTPUT_SUMMARY.inc) -$ifi %Optiflow%==yes $if EXIST '../../base/output/Optiflow_OutputFile.inc' $include '../../base/output/Optiflow_OutputFile.inc'; - $ifi not %export_results%==yes $goto result_export *------------------------------------------------------------------------------ * GENERATE INPUT FILES FOR FUTURE RUNS FROM RESULTS OF THIS RUN diff --git a/base/model/Balmorelbb4.sim b/base/model/Balmorelbb4.sim index 5192cc16..f617868e 100644 --- a/base/model/Balmorelbb4.sim +++ b/base/model/Balmorelbb4.sim @@ -341,6 +341,7 @@ $ifi %TechInvest%==yes VGKNACCUMNET.FX(IY411FIRST,IA,G)$SUM(Y$(YVALUE(Y) $ifi %TransInvest%==yes VXKN.FX(IY411FIRST,IRE,IRI)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411FIRST)),IXKN(Y,IRE,IRI))= VXKN.L(IY411FIRST,IRE,IRI); $ifi %TransInvest%==yes VXKNACCUMNET.FX(IY411FIRST,IRE,IRI)$SUM(Y$(YVALUE(Y) LE YVALUE(IY411FIRST)),IXKN(Y,IRE,IRI))= VXKNACCUMNET.L(IY411FIRST,IRE,IRI); + $include "../../base/addons/_hooks/varassign.inc" * ------------------------------------------------------------------------------ diff --git a/base/model/balopt.opt b/base/model/balopt.opt index cf730b6d..7b38af96 100644 --- a/base/model/balopt.opt +++ b/base/model/balopt.opt @@ -1,1044 +1,1080 @@ -* This file holds options that are used to control model functionality, -* including extentions in the form of addons, and interplay between models. - -* Note: in final version all relevant control settings will be indicated -* by an *!option statement, e.g. "*!option yes" and other instructions. - -* Note: If you work with BUI, the above is mandatory. -* Moreover, the only way to enter a comment in this file -* is to use a '*' as the first character on the line; -* thus, you can not use e.g., $ontext..$offtext or /*..*/ or // or !!. -* Further, if you work with BUI, this file will not be $included into Balmorel.gms, -* instead the file Balopt.bui will be $included. See the description elsewhere. - -*---- START: VQDEBUG ------------------------------------------------ -*----------------------------------------------------------------- -* overall control variable vqdebug must be 'yes' if any of the other vqdebug controls are: -* Debugging hints are available if you include feasiblity-ensuring variables. -* However, adding more variables will increase calculation time. -* Hence, if calculation time is an issue, it is recommended as default to not use them, -* and then, if the solver declares the problem infeasible, use them and resolve. -* Information of ... in the .log file? -$setglobal vqdebug -*!option yes - -*Reduce number of infeasibility variables. By default, infeasibility variables are added to many equations, which is not always required. -$setglobal reduced_vqdebug -*!option yes -*----------------------------------------------------------------- -*---- END: VQDEBUG ------------------------------------------------ - - -*=============================================================================== -*=============================================================================== -* Project and Case ID: -*=============================================================================== -*=============================================================================== - -* PROJECTID is the identification of the Project. -* Convenient, and additioanally needed if results shall be compared among projects. -* -$setglobal PROJECTID -*!option !fixedvalue -* -* -* CASEID is the Case identification string. It can be assigned freely, however, if -* the case is a base case to which other cases should be compared the name should be -* BASE. Normally the model in the base directory will be called BASE while -* any variants will have names as appropriate. Model results in the form of GDX files -* (or Access MDBs) will have the CASEID as filename with the appropriate extension. -* Note that CASEID MUST be identical to folder name of the diretory holding the case. -* -$setglobal CASEID BASE -*!option !fixedvalue - - -*=============================================================================== -*=============================================================================== -* Model choices: -*=============================================================================== -*=============================================================================== - -*------------------------------------------------------------------------------- -* The following global variables concern the choice of model. -* If $Setglobal bb4 yes, BB4 is chosen. -$setglobal bb4 yes -*!option yes - -*=============================================================================== -*=============================================================================== -* Basic models details and Addon modules: -*=============================================================================== -*=============================================================================== - -*------------------------------------------------------------------------------- -* The following global variables concern the choice of details in some of the models. -* Note that some of the choices are mutually dependent. - -*-------- Seasonal rolling horizon --------- -* Optimize seasons with a rolling horizon approach instead of all together. -*NOTE: This option is supposed to be combined with the option "import_results", which must contain information for all S and at least the first element in T -$setglobal RollingSeasons -*!option yes - -SCALAR ROLLINGSEASONSNUMBER 'Number of seasons to be optimized at a time in each rolling season optimization'; -ROLLINGSEASONSNUMBER= 1; - -*-------- END: Seasonal rolling horizon --------- - -*-------- QDENET --------- -* Introduces the calculation of the net demand of different users (e.g. households, industry, etc). Relevant for taxes, grid tariffs, demand response, etc. -$setglobal NETDEMAND -*!option yes -*-------- END: QDENET --------- - -*----------------------------------------------------------------- -*---- Investments ------------------------------------------------ - -*---- Generation investments options---- - -* Permit investments in generation and storage capacity: -$setglobal TechInvest yes -*!option yes - -SCALAR GINVESTSTART 'Year from which endogenous decisions in generation capacities are allowed' ; -GINVESTSTART= 2025; - -*---- End: Generation investments options---- - -*---- Transmission investments options---- - -* Permit investments in transmission capacity: -$setglobal TransInvest YES -*!option yes - -SCALAR XINVESTSTART 'Year from which endogenous decisions in transmission capacities are allowed' ; -XINVESTSTART= 2035; - -*---- End: Transmission investments options---- - -*----END: Investments--------------------------------------------------- -*----------------------------------------------------------------------- - -*-----------------------HEAT TRANSFER-------------------------------------------------------- -*overall control variable HEATTRANS must be 'yes' if any of the other heat trans controls are. - -* Permit heat transmission between areas. -$setglobal HEATTRANS YES -*!option yes - -* Permit heat transmission investments between areas. -$setglobal HeatTransInvest -*!option yes - -SCALAR XHINVESTSTART 'Year from which endogenous decisions in heat transmission capacities are allowed' ; -XHINVESTSTART= 2025; - -* Permit temperature lift from heat pumps to move energy from low temperature areas to high temperature ones (NOT WORKING, TO BE CHECKED). -$setglobal HeatTempLift -*!option yes -*-----------------------END OF: HEAT TRANSFER-------------------------------------------------------- - -* Include industry data in the optimization. Requires HEATTRANSFER add-on to be activated. -$setglobal INDUSTRY YES -*!option yes - -*--------------------INDIVIDUAL USERS-------------------------------------------------------------- -* overall control variable INDIVUSERS must be 'yes' if any of the other INDIVUSERS controls are: - -* Include individual users data in the optimization. Requires HEATTRANSFER add-on to be activated. -$setglobal INDIVUSERS YES -*!option yes - -* Include the possibility to shift exogenous heat demand between technology groups. -$setglobal GROUP_DEMAND_SHIFT -*!option yes -*-----------------END: INDIVIDUAL USERS-------------------------------------------------------------- - -* Include seasonal variation of heat pump's COP. If not activated, heat pumps will have a constant COP during the year. -$setglobal SEASONALCOP -*!option yes - -*------------START OF: OFFSHORE GRIDS-------------------------- -* overall control variable OFFSHOREGRID must be 'yes' if any of the other OFFSHOREGRID controls are: -* Allow to build a complicated offshore grid with hubs in the sea. Requires MIP to work as intended since technologies are modelled with economies of scale via SOS variables. If RMIP is used, it will become a linear problem. -$setglobal OFFSHOREGRID NO -*!option yes - -*Adds Economies of Scale in generation elements that are part of offshore grids. It requires to use the MIP solver, so remember to activate it. -$setglobal OFFSHOREGRID_ES_GEN -*!option yes - -*Adds Economies of Scale in electricity transmission elements that are part of offshore grids. It requires to use the MIP solver, so remember to activate it. -$setglobal OFFSHOREGRID_ES_ELTRANS -*!option yes -*------------END OF: OFFSHORE GRIDS-------------------------- - - -* Allow Carbon Capture Storage (CCS) technologies. -$setglobal CCS YES -*!option yes - -* Allow curtailment of variable renewable energy generators (BB4) -$setglobal VRESHUTDOWN yes -*!option yes - -*------------------------------EV ADDON------------------------------------------------- -* overall control variable EV must be 'yes' if any of the other EV controls are: - -$setglobal EV -*!option YES - -* Adds DUMB charging: -$setglobal DUMB -*!option yes - -* Adds smart charging. Only smart charging, without V2G!: -$setglobal SMART -*!option yes - -* Adds V2G charging: -$setglobal V2G YES -*!option yes - -* Restricts PHEV vehicles from doing V2G (only relevant if V2G is activated): -$setglobal NO_PHEV_V2G yes -*!option yes - -* Adds step charging scheme (NOT SURE IT IS WORKING ANY MORE): -$setglobal STEPCHARGSCHEME -*!option yes - -* Adds cycle degradation (NOT SURE IT IS WORKING ANY MORE, COSTS SHOULD BE ANNUALIZED): -$setglobal DEGCYCLE -*!option yes - -* Adds calendar degradation (NOT SURE IT IS WORKING ANY MORE, COSTS SHOULD BE ANNUALIZED): -$setglobal DEGCAL -*!option yes - -* EV timeseries will be averaged (relevant if less than all time steps in TTT are used). -* NOTE: It currently only works if T are equally distanced from each other and if the first T chosen is equal to the first element int TTT). If this is not desired, one can replace the timeseries with new averaged-with-another-procedude timeseries -* NOTE: It might lead to infeasibilities though -$setglobal EV_PROFILE_AVG yes -*!option yes - -*Adds EV infeasibility variables (added here on purpose, since if not all TTT are used it is very likely to run into small infeasibilities) -*Note: The value of the parameter PENALTQ should be in line with the cost assumptions in the model to obtain meaninful results -$setglobal EV_infeas yes -*!option - -* Models EV as inter-seasonal storage (if it is not activated, then EVs are model as intra-seasonal storage): -$setglobal EV_INTERSEASONAL -*!option yes -*------------------------------END: EV ADDON------------------------------------------------- - -*------------------------------TRANSPORT ADDON------------------------------------------------- -* overall control variable TRANSPORT must be 'yes' if any of the other TRANSPORT controls are: -* Include transport data in the optimization (it is supposed to complement the EV addon, so check consistency of data before using it). -$setglobal TRANSPORT YES -*!option yes - -* Defines the commodity used to model synthetic fuel generation. -$setglobal TRANSPORT_SYNTHFUEL_COMMODITY HYDROGEN -*!option ELECTRICITY !Text "The demand for synthetic fuel generation is modelled as electricity demand" -*!option HYDROGEN !Text "The demand for synthetic fuel generation is modelled as hydrogen demand (requires hydrogen addon to be activated)" - -* Defines the possibility for the transport demand of synthetic fuels to be aggregated internationally instead of having to satisfy it regionally. -$setglobal TRANSPORT_DEMAND_AGGREGATED - - -*------------------------------END:TRANSPORT ADDON------------------------------------------------- - -*----------------------------------------------------------- -*---------------HYDRO RESERVOIRS OPTIONS-------------------- -*Interpretation of the seasonal level of hydro reservoirs (QHYRSSEQ) -$setglobal HYRS_AGG hydro_year_agg -*!option hydro_year_agg !Text "The storage level of hydro reservoirs (QHYRSSEQ) will be scaled so the Seasons included in the optimization represent an annual behaviour" -*!option hydro_season_agg !Text "The storage level of hydro reservoirs (QHYRSSEQ) will be scaled so the Seasons included in the optimization represent a seasonal behaviour" - -* Relax seasonal limits for hydropower storages when running the model with less than 26 seasons (in HYRSDATA.inc) -$setglobal RELAX_HYDROSTORAGE yes -*!option yes -*---------------END: HYDRO RESERVOIRS OPTIONS-------------- -*---------------------------------------------------------- - -*------------------------------------------------- -*---- Timeseries scaling ------ -*Allows to modify the time series scaling approach -$setglobal timeseries_scaling usedtimesteps_timseries_scaling -*!option usedtimesteps_timseries_scaling !Text "Timeseries values are scaled linearly by the following factor: scaling factor = annual energy content / sum of the energy in the used part of the timeseries" -*!option full_timeseries_scaling !Text "Timeseries values are scaled linearly by the following factor: scaling factor = annual energy content / sum of the energy in the full timeseries" - -*----END: Timeseries scaling -*------------------------------------------------- - -*------------------------------------------------- -*---- IGKRATE data ------ -*Includes stochastic outages. If activated, IGKRATE will take the values in file IGKRATE.gdx, else it will be built based on GKRATE -$setglobal IGKRATE_STOCHASTIC -*!option yes -*---- end: IGKRATE calculation ------ -*------------------------------------------------- - -*-------- Balancing market --------- -* overall control variable BalancingMarket must be 'yes' if any of the other BalancingMarket controls are: -* Peforms the balancing market optimization -*Note: it is meant to be combined with Unit Commitment and import_results add-ons. It can also be combined with ancilliary services -$setglobal BalancingMarket -*!option yes - -*Define the purpose of the balancing run. -$setglobal BALANCINGRUNPURPOSE TSOREDISPATCH -*!option INTRADAYMARKET !Text "The run will simulate INTRADAY markets" -*!option TSOREDISPATCH !Text "The run will simulate the re-dispatch optimization from the TSO perspective (congetion management), adding penalties to compensate for forced re-dispatch of the units based on the TSO needs" - -*If activated the TSO will also compensate generators for the forced down re-dispatch due to forecast errors, ramping limits, etc. (only relevant if BALANCINGRUNPURPOSE=TSOREDISPATCH) (to be finished) -$setglobal FORCEDDOWNREDISPATCH -*!option yes - -*Define which units will be allowed to change their commitment status (on/off) (requires Unit Commitment addon to be on) -$setglobal CommitmentStatus NoChange -*!option NoChange !Text "The units will not be allowed to change their commitment, which will be taken from previous runs " -*!option FastUnitsChange !Text "The slow units will not be allowed to change their commitment, which will be taken from previous runs " -*!option None !Text "All the units will be allowed to change their commitment with respect to previous runs" - -*Restricts heat market from participating in the balancing market by restricting relevant heat generation variables from previous runs and not including the heat balance equation -$setglobal NOHEATMARKET -*!option yes -*-------- END: Balancing market --------- - -*------------------------------------------------------------------------------- -* The following global variables concern the choice of add-on modules to include. -* Include a module by assigning yes . -* Note that some of the choices are mutually dependent. - -* Presently some of the addons are commented out - -* they may or may not be working (at least with an appropriate data set), -* however, it has not been checked. Please take contact if problems. - -* Combine two technologies to one to achieve e.g. multifuel characteristics. -$setglobal COMBTECH -*!option yes - -*-----------------HYDROGEN ADDON--------------------------------------- -* overall control variable HYDROGEN must be 'yes' if any of the other HYDROGEN controls are: -* Set demands for hydrogen consumption and enable hydrogen technologies (some options require COMBTECH to be activated too). -$Setglobal HYDROGEN YES -*!option yes - -* Allows investments in hydrogen transport -$Setglobal H2TransInvest YES -*!option yes - -SCALAR XH2INVESTSTART 'Year from which endogenous decisions in H2 transmission capacities are allowed' ; -XH2INVESTSTART= 2030; - -*Adds Economies of Scale in H2 transmission. It requires to use the MIP solver, so remember to activate it (Dataset not updated for new countries in pan-European system) -$setglobal ES_H2TRANS - -* Allows import of Hydrogen from 3rd countries outside Balmorel -$Setglobal IMPORT_H2 YES -*!option yes - -* Allows flexible demand of H2 in regions (set ratio of flexible demand in HYDROGEN_FLEXDH2 with the scalar THETA_FLEX_DH2) -$setglobal flexible_h2_space -*!option yes - -*-----------------END: HYDROGEN ADDON--------------------------------------- - -* Use stepwise linear fuel prices -$Setglobal STEPWISEPRICE - -* Set a common maximum for fuels. (it should be checked before using it) -$Setglobal LIMITSFORFUELS -*!option yes - -* Allow demand elasticity (it should be checked before using it) -$setglobal DFLEXQUANT -*!option yes - -* Allow demand response (requires NETDEMAND) (it should be checked before using it) -$setglobal DEMANDRESPONSE -*!option yes - -* Permit exchange of electricity with third regions using a price interface (in contrast to X3FX) (it should be checked before using it) -$setglobal X3V -*!option yes - -* Grid tariffs on electricity use (requires NETDEMAND) -$setglobal GRIDTARIFFS -*!option yes - -* Taxes addon (requires NETDEMAND) -$setglobal TAXES -*!option yes - -* Transmission ramping addon (it asssumes seasonal linking) -$setglobal TRANS_RAMP -*!option yes - -*-----------------------ANCILLARY SERVICES---------------------------------------------------------------------------------------------------- -* Ancillary services addon (it requires UnitComm to be active). The other options require this one to be activated. -$setglobal ANC_SERV -*!option yes - -* FCR reserve requirement activated -$setglobal FCR -*!option yes - -* AFRR reserve requirement activated -$setglobal AFRR yes -*!option yes - -* MFRR reserve requirement activated (NOT FINISHED) -$setglobal MFRR -*!option yes - -* MRR reserve requirement activated (NOT FINISHED) -$setglobal MRR -*!option yes - -* Allow VRE to provide for reserves -$setglobal ANC_SERV_VRE YES -*!option yes - -*Include down regulation reserves. For simplification, down regulation of spinning reserves can be disactivated, since they are generally less expensive than up regulation. -$setglobal DOWN_REGULATION_INCLUDED -*!option yes -*-----------------------END: ANCILLIARY SERVICES---------------------------------------------------------------------------------------------------- - -* Make investments in technologies only at specified capacities. (it should be checked before using it) -$setglobal AGKNDISC -*!option yes -*!onlyif %BB2%==yes -*!onlyif %solvetype%==MIP - - -* Use the flow-based capacity allocation methodology -$Setglobal FlowBased -*!option yes - -* Set short storages to be inter- or intra-seasonal -* according to GDSTOINTERS in GDATA (default) or all or none -$setglobal stointers -*! option default Use as specified by GDSTOINTERS in GDATA -*! option all Let all storage technologies be inter-seasonal -*! option none Let no storage technologies be inter-seasonal (i.e., let all be intra-seasonal) - - -* Bypass of 'turbine' (electricity production) on CHP units. -$setglobal bypass yes -*!option yes - - -*-----------------------TECHNOLOGY DECOMMISSIONING-------------------------------------------------------- -* overall control variable DECOM must be 'yes' if any of the other decommissioning controls are. -$setglobal DECOM yes -*!option yes - -*-------ENDOGENOUS CAPACITIES---------- -* Note: If no option for endogenous capacities is activated, endogenous investments will not be decommissioned - -* Adds Endogenous capacities will maximum stay in the system as much as their lifetimes: -$setglobal LIFETIME_DECOM_ENDO_G YES -*!option yes - -* Adds Endogenous capacities can be decommissioned based on their profitability: -$setglobal ECONOMIC_DECOM_ENDO_G yes -*!option yes - -* Adds Endogenous decommissioned endogenous capacities can be brought back to the energy system. To be combined with the other decommissioning options: -$setglobal REVERT_DECOM_ENDO_G yes -*!option yes - -*--------END OF ENDOGENOUS CAPACITIES----- - -*--------EXOGENOUS CAPACITIES------------ -* Note: If either NO_DECOM_EXO_G, or LIFETIME_DECOM_EXO_G, or ECONOMIC_DECOM_EXO_Gor is activated, then the parameter GKFX will be recalculated so capacities only increase in the system. - -SCALAR GDECOMEXOSTART 'Year from which endogenous decisions in decommissioning of exogenous generation capacities are allowed'; -GDECOMEXOSTART= 2025; - -SCALAR GDECOMEXOPOTSTART 'Starting year to calculate the yearly decommissioning capacity potential, i.e. exogenous decommissioning occuring before this year will not be considered' ; -GDECOMEXOPOTSTART= 2016; - -* Adds No decommissioning of exogenous capacities will take place at all. The capacities in the recalculated GKFX will take place in the optimization -* Note: This option is not compatible with the other exogenous capacities decommissioning options. -$setglobal NO_DECOM_EXO_G -*!option yes - -* Adds Exogenous capacities will maximum stay in the system as much as their lifetimes (or as much as political decissions suggest it, for instance), which should be represented in the yearly development of capacities of the input parameter GKFX: -$setglobal LIFETIME_DECOM_EXO_G YES -*!option yes - -* Adds Exogenous capacities can be decommissioned based on their profitability: -$setglobal ECONOMIC_DECOM_EXO_G yes -*!option yes - -* Adds Endogenous decommissioned exogenous capacities can be brought back to the energy system. To be combined with the other decommissioning options: -$setglobal REVERT_DECOM_EXO_G yes -*!option yes -*--------END OF ENDOGENOUS CAPACITIES----- -*-----------------------End of TECHNOLOGY DECOMMISSIONING-------------------------------------------------------- - - -*-------------------- UNIT COMMITMENT ----------------------------------------------------------- -* overall control variable UnitComm must be 'yes' if any of the other unit commitment controls are: - -$setglobal UnitComm -*!option yes - -* Adds minimal production-when-on: -$setglobal MINFUELCONS YES -*!option yes -* Adds respecting minimum off time of the capacities: -$setglobal MINSTARTUPTIME yes -*!option yes -* Adds respecting minimum on time of the capacities: -$setglobal MINSHUTDOWNTIME yes -*!option yes -* Adds ramping technical limitations and stepwise costs to the Power plants when-on: -$setglobal STEPWISE_RAMPING_UC ramp_const -*!option ramp_const_cost !Text "With ramping constraints and ramping costs" -*!option ramp_const !Text "With ramping constraints but without ramping costs" -*!option no_ramping !Text "Neither ramping constraints nor ramping costs" -* Adds optimisation of planned maintenance of the generation and storage technologies -$setglobal PLANNED_MAINTENANCE -*!option yes - -* Seasonal link is on for all UC options activated. This means that past seasons will influence future seasons. -* This option increases computanional time but assures continuity in the fuel consumption profile. -$setglobal SEASONALLINKUC -*!option yes - -* The production interval is segmented into a number of disjunct pieces, each with its own costs: NOT IMPLEMENTED -$setglobal UnitCseg -*!option yes -*-------------------- End of UNIT COMMITMENT ----------------------------------------------------------- - -*--------------------STEPWISE RAMPING (LINEAR VERSION)----------------------------------------------------------- -* overall control variable Stepwise_ramping must be 'yes' if any of the other stepwise ramping controls are: -* This add-on is an alternative to Unit Commitment to model ramping constraints without using MIP. This add-on uses currently the relevant data and sets from the Unit Commitment add-on -* This add-on is not compatible with the Unit Commitment stepwiseramping option -* The use of this add-on togeter with the rest of options of Unit Commitment add-on has not been tested, so, unless tested, this add-on should not be activated if UnitComm is on. - -$setglobal STEPWISE_RAMPING -*!option yes - -* Seasonal ramping link is on. This means that the fuel consumption of the last element ot the set T of the set S will be linked to the first element of the set T of the set S+1. -* This option increases computanional time but assures continuity in the fuel consumption profile. -$setglobal SEASONALLINKRAMPING -*!option yes - -*----------------END OF STEPWISE RAMPING (LINEAR VERSION)---------------------------------------------------------- - -* Options timeaggr control automatic aggregation of time (it should be checked before using it). -$setglobal timeaggr -*!option yes - - -*------------------------------------------------------------------------------- -* OptiFlow model. -*------------------------------------------------------------------------------- -$setglobal OPTIFLOW -*!option yes -* Addon APKNdisc: discrete size investments in PROC. -$setglobal APKNdisc -*!option yes -*Investments in Optiflow technologies -$setglobal inv yes -*! option yes -*Model solved as MIP -$setglobal solveOptiFlowmip -*! option yes - -* Debug possibilities: -$Setglobal addEPStoL -*! option yes -* Not needed if there are no capacity bounds on internal proc -* It will be needed if there are capacity bounds on some internal proc, therefore add them only in that case (requires some coding, TODO). -* With such minimal use the infeasibilities will be moved to SOSIBU proc whenever possible. -$Setglobal useQNODEslack -*! option -$Setglobal useSSBslack -*! option yes -$Setglobal useShareSlack -*! option yes -* Option uniquesol permit to use quadratic terms in QOBJ in order to attain unique solution. -* Should be used for debug on small systems only. -$Setglobal uniquesol -*! option yes -* Testing ONLY: -$setglobal singlearea -*! option yes -* Testing ONLY: -$setglobal addUP -*! option yes -*------------------------------------------------------------------------------- -*Optiflow end -*------------------------------------------------------------------------------- - -* In model Balbase4 (BB4) indicate the strategy for relative weighting of years -$setglobal bb4weighty shareYYY -*!option same !Text "Use same weights for all Y" -*!option shareYYY !Text "Years in YYY but not in Y are shared between two nearest (first and last years double the shared weight contribution)" - -*=============================================================================== -*=============================================================================== -* Relative paths -*=============================================================================== -*=============================================================================== -* No choices, they must be set as shown. Note the format. -* They are to be used as illustrated below and elsewhere in the code. -* -$ifi not %system.filesys%==UNIX $goto endofUNIXrelpaths -$setglobal relpathModel "" -*!fixedvalue -$setglobal relpathoutput "../output/" -*!fixedvalue -$setglobal relpathInputdata2GDX "../output/inputout/" -*!fixedvalue -$setglobal relpathtemp "../output/temp/" -*!fixedvalue -$label endofUNIXrelpaths - -$ifi not %system.filesys%==MSNT $goto endofMSNTrelpaths -$setglobal relpathModel "" -*!fixedvalue -$setglobal relpathoutput "..\output\" -*!fixedvalue -$setglobal relpathInputdata2GDX "..\output\inputout\" -*!fixedvalue -$setglobal relpathtemp "..\output\temp\" -*!fixedvalue -$label endofMSNTrelpaths - -*=============================================================================== -*=============================================================================== -* Some interaction between models: -*=============================================================================== -*=============================================================================== - -* The following options are related to interplay between models, -* e.g. one model output serving as input to another model. - -* Overall control to export results so they can be used in future runs : -$Setglobal export_results yes -*!option yes - -*-------------------------------------------- -*--------------IMPORT OF RESULTS---------------- -*-------------------------------------------- -* Overall control to import results so they can be used in future runs: -*NOTE: In order for results to work fine, the set S used in the runs should be contained in the import results. -*NOTE: In order for results to work fine, the first element in set T of the import results should match the one used in the current run. -$Setglobal import_results -*!option yes - -*------------ IMPORT OPTIONS ---------------- - -* -----------------ENERGY DISPATCH-------------------------- - -*Adds energy dispatch (demand, generation, transmission) from previous runs -$setglobal ADDENERGYDISPATCH -*!option yes -* -----------------END OF ENERGY DISPATCH-------------------------- - -* ------------------HYDRO--------------------------------- -* For this model run it is possible to use values found from previuos solutions to specify use of hydro power -$setglobal HYRSBB123 none -*!option quant !Text "Use seasonal quantities of hydro generation (from HYRSG.gdx??) in this run ('primal decomposition')(not implemented in BB4)" -*!option price !Text "Use seasonal prices for hydro generation (from WATERVAL.gdx) in this run ('dual decomposition')" -*!option quantprice !Text "Use seasonal quantities and prices for hydro generation (from HYRSG.gdx?? and WATERVAL.gdx) in in this run (not implemented in BB4)" -*!option cont !Text "Use seasonal content for hydro generation (from VHYRS_SL.gdx) in in this run" -*!option none !Text "Do not not use this hydro addon" -* ------------------ END OF HYDRO--------------------------------- - -*--------------------INTERSEASONAL STORAGE----------------------------------------------------------- -*Import inter-seasonal electricity storage data from previous runs -$Setglobal ADDESTOVOLTS none -*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" -*!option price !Text "Import electricity storage contents at beginning of time segment (ESTOVOLTS.gdx) for the first element in set T and S, and puts a price to use with ESTOVOLTSVAL.gdx from previous runs. " -*!option none !Text "Do not not use this addon" - -*Import inter-seasonal heat storage data from previous runs -$Setglobal ADDHSTOVOLTS none -*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" -*!option price !Text "Import Heat storage contents at beginning of time segment (HSTOVOLTS.gdx) for the first element in set T and S, and puts a price to use with HSTOVOLTSVAL.gdx from previous runs." -*!option none !Text "Do not not use this addon" - -*Import intra-seasonal electricity storage data from previous runs -$Setglobal ADDESTOVOLT none -*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" -*!option price !Text "(to be finished) Import electricity storage contents at beginning of time segment (ESTOVOLT.gdx) for the first element in set T and S, and puts a price to generation (ESTOVOLTVAL) from previous runs." -*!option none !Text "Do not not use this addon" - -*Import intra-seasonal heat storage data from previous runs -$Setglobal ADDHSTOVOLT none -*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" -*!option price !Text "(to be finished) Import Heat storage contents at beginning of time segment (HSTOVOLT.gdx) for the first element in set T and S, and puts a price to generation (HSTOVOLTVAL) from previous runs" -*!option none !Text "Do not not use this addon" - -*Import inter-seasonal hydrogen storage data from previous runs (requires HYDROGEN addon) -$Setglobal ADDH2STOVOLTS none -*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" -*!option price !Text "Import hydrogen storage contents at beginning of time segment (H2STOVOLTS.gdx) for the first element in set T and S, and puts a price to use with H2STOVOLTSVAL.gdx from previous runs." -*!option none !Text "Do not not use this addon" - -*Import inter-seasonal biomethane storage data from previous runs (requires HYDROGEN addon) -$Setglobal ADDBIOMETHSTOVOLTS none -*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" -*!option price !Text "Import biomethane storage contents at beginning of time segment (BIOMETHSTOVOLTS.gdx) for the first element in set T and S, and puts a price to use with BIOMETHSTOVOLTSVAL.gdx from previous runs." -*!option none !Text "Do not not use this addon" - -*Import EV state of charge from previous runs (requires EV addon) -$Setglobal ADDEVSTOS none -*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition') (only works if EV_INTERSEASONAL is activated)" -*!option netcharging !Text "Use seasonal net charging of EV in this run ('primal decomposition') (only works if EV_INTERSEASONAL is NOT activated)" -*!option none !Text "Do not not use this addon" - - - -*--------------------END OF INTERSEASONAL STORAGE----------------------------------------------------------- - -*--------------------INVESTMENTS AND DECOMMISSIONING----------------------------------------------------------- -*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. - -*Import generation and storage technology capacity development from previous runs -$setglobal ADDTECHDEV -*!option yes - -*Add expensive to operate backup generation technologies (electricity, heat, ...). It often occurs that the investment optimization underestimates the need for power. -$setglobal ADDBACKUPGEN -*!option yes - -*Import transmission development from previous runs -$setglobal ADDTRANSDEV -*!option yes - -*Import heat transmission development from previous runs -$setglobal ADDHEATTRANSDEV -*!option yes - -*Import H2 transmission development from previous runs -$setglobal ADDH2TRANSDEV -*!option yes -*--------------------END OF INVESTMENTS AND DECOMMISSIONING----------------------------------------------------------- - -*--------------------FUEL PRICES----------------------------------------------------------- -*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. -*Import fuel prices development from previous runs -$setglobal ADDFUELPRICE -*!option yes -*--------------------END OF FUEL PRICES----------------------------------------------------------- - -*--------------------FUEL USE----------------------------------------------------------- -*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. -*Import seasonal fuel use upper limit from previous runs -$setglobal ADDMAXFUELUSES -*!option yes -*--------------------END OF FUEL USE----------------------------------------------------------- - -*--------------------PLANNED MAINTENANCE----------------------------------------------------------- -*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. -*Import optimized planned maintenance from previous runs (investments and/or decomissioning must not be allowed if this option is activated) -$setglobal ADDPLANNEDMAINTENANCE -*!option yes -*--------------------END OF PLANNED MAINTENANCE----------------------------------------------------------- - -*--------------------TRANSPORT DEMAND----------------------------------------------------------- -*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. -*Import demand per term (T) from the transport sector -$setglobal ADDTERMTRANSPORTDEMAND -*!option yes - -*Import seasonal demand from the transport sector -$setglobal ADDSEASONALTRANSPORTDEMAND -*!option yes - -*Import peak demand from the transport sector -$setglobal ADDPEAKTRANSPORTDEMAND -*!option yes -*--------------------END OF TRANSPORT DEMAND----------------------------------------------------------- - -*--------------------INDIVIDUAL USERS----------------------------------------------------------- -*Import Share of heat demand in an individual user group. Requires GROUP_DEMAND_SHIFT to be activated -$setglobal ADDGROUP_DEMAND_SHIFT -*!option yes -*--------------------END OF INDIVIDUAL USERS----------------------------------------------------------- - - -*------------- END OF IMPORT OPTIONS ---------------- -*-------------------------------------------- -*--------------END OF IMPORT OF RESULTS---------------- -*-------------------------------------------- - - - - -*=============================================================================== -*=============================================================================== -* Output: -*=============================================================================== -*=============================================================================== - -* ------------------------------------------------------------------------------ -* Alternative presentations of input data -* ------------------------------------------------------------------------------ - -* It may be convenient under some circumstances to have the applied input data in other forms, -* this may be achieved by the following mechanism. - -* Make a summary of the input data in text format to file inputout.out: -$setglobal inputdatatxt "" -*!option "" !text do not make it -*!option yes !text make it when solving -*!option yesnosolve !text make it but do not solve - - -* Save the input data in gdx format for further processing by Gdx utilities, -* e.g. viewing (Gdxviewer), comparing (Gdxdiff), or transferring to other data formats like Excel or Access. -* Note that this will be done as a compile time operation, -* such that only the 'direct' data definitions (and no assignments) are reflected. -$setglobal INPUTDATA2GDX YES -*!option yes - - -* Transfer the input data in gdx format to a Microsoft Access database ../output/inputout/inputdataout.mdb: -$setglobal INPUTDATAGDX2MDB -*!option yes !onlyif %INPUTDATA2GDX%==yes -* Note: if you have established a link from another Access database to inputdataout.mdb -* close all tables in it before executing Balmorel in order to ensure updating of the links. - -* Merge input data with the output into the gdx file %CASEID%.gdx -$setglobal MERGEINPUTDATA -*!option yes - - -* Transfer the input data in gdx format to Microsoft Excel format: -* NOTWORKING: presently. -$setglobal INPUTDATAGDX2XLS -*!option yes - - -*------------------------------------------------------------------------------- -* Output from model solutions: -*------------------------------------------------------------------------------- - -* A quick way to get (some of) the relevant information is to make a gdx file with all information. -* This option will provide unloading of all that is available at the end of Balmorel.gms. -* -$setglobal all_endofmodelgdx yes -*!option yes !Save the file all_endofmodel.gdx to the model folder - - - - -* Make some output in text format to show some results of an execution. -* The detailed code for the writing of the files is given in /output/printout/printinc. -* Setting "yes" for PRINTFILES will make some standard printout files to folder /output/printout/. -$setglobal PRINTFILES -*!option yes - -$setglobal OUTPUT_SUMMARY yes -*!option yes - -* PRINTSEPARATOR is a single character used for separating columns in printfiles, -* convenient e.g. to use ';' for copy-paste to Excel. -$setglobal PRINTSEPARATOR ';' -*!option ' ' -*!option ';' -*!option ',' - -*------------------------------------------------------------------------------- -* Results collection for the present case -*------------------------------------------------------------------------------- - -* The following will establish a mechanism that will save annual optimization results -* from bb1 and bb2 (seasonal for bb3) as gdx files; at the end they may be merged to one gdx file. -* This merged file may then be transferred to an Access database or to Excel. -* It is to be seen in conjunction with saving annual results in file bb123.sim, -* which is accomplished using savepoint with value 1, cf '$Setglobal SAVEPOINTVALUE'. -* -* The following closely linked controls are used: -* SAVEPOINTVALUE, cf. above -* MERGESAVEPOINTRESULTS yes -* MERGEDSAVEPOINTRESULTS2MDB -* MERGEDSAVEPOINTRESULTS2SQLITE -* MERGEDSAVEPOINTRESULTS2XLS: presently not working, we are waiting for GAMS version 22.7, which has better support for this. -* MERGECASE/MERGEWITH -* DIFFCASE/DIFFWITH -* -* Savepoint: the GAMS command "Modelname.Savepoint=number;" -* The savepoint attribute tells GAMS to save a GDX file that contains the information on the current solution point. -* One can save the information from just the last solve or from every solve. -* The points that are saved can be used to provide an advanced basis, an integer program starting point or a NLP starting point. -* Numeric input is expected with the allowable numeric values being: -* 0 no point gdx file is to be saved -* 1 a point gdx file is to be saved from the last solve in the GAMS model -* 2 a point gdx file is to be saved from every solve in the GAMS model -* The value specified by $Setglobal SAVEPOINTVALUE will be used for savepoint. -* To be used with subsequent handling of output. -* -$setglobal SAVEPOINTVALUE 0 -*!option 0 -*!option 1 !mustif %MERGESAVEPOINTRESULTS%==yes !mustif %MERGEDSAVEPOINTRESULTS2GDX%==yes !mustif %MERGEDSAVEPOINTRESULTS2XLS%==yes !mustif not %MERGECASE%==none !mustif not %DIFFCASE%==none -*!option 2 !text Note: nothing implemented nor tested, so do not use it. - -* Use the $setglobal MERGESAVEPOINTRESULTS to choose whether to merge annual/seasonal results or not: -$setglobal MERGESAVEPOINTRESULTS -*!option yes !onlyif %SAVEPOINTVALUE%==1 -* Note: make sure that it is possible to make the new merged gdx file, -* e.g. make sure that the file *.gdx is not open in another application (like GAMD IDE). -* -* Then prepare for the necessary details: -$ifi %system.filesys%==MSNT -$setglobal batfileMERGESAVEPOINTRESULTS %relpathModel%MERGESAVEPOINTRESULTS.bat -*!option !fixedvalue -$ifi %system.filesys%==MSNT -file fileMERGESAVEPOINTRESULTSbat / %batfileMERGESAVEPOINTRESULTS% /; -$ifi %system.filesys%==MSNT -putclose fileMERGESAVEPOINTRESULTSbat; - -$ifi %system.filesys%==UNIX -$setglobal bashfileMERGESAVEPOINTRESULTS %relpathModel%MERGESAVEPOINTRESULTS.sh -*!option !fixedvalue -$ifi %system.filesys%==UNIX -file fileMERGESAVEPOINTRESULTSbash / %bashfileMERGESAVEPOINTRESULTS% /; -$ifi %system.filesys%==UNIX -putclose fileMERGESAVEPOINTRESULTSbash; - -$setglobal MERGEDSAVEPOINTRESULTS2MDB -*!option yes !onlyif %SAVEPOINTVALUE%==1 !onlyif %MERGESAVEPOINTRESULTS%==yes - -$setglobal MERGEDSAVEPOINTRESULTS2SQLITE -*!option yes !onlyif %SAVEPOINTVALUE%==1 !onlyif %MERGESAVEPOINTRESULTS%==yes - - -*------------------------------------------------------------------------------- -* Comparison between Cases: -*------------------------------------------------------------------------------- - -* The following will merge and/or compare two results. -* With option MERGECASE is set to NONE this will be not be done, otherwise it will. -* If done, the result will be in the output folder of the present case in the form of a GDX file. -* With option MERGEDSAVEPOINTRESULTS2MDB" this may then be transferred to a MDB file. -* All output go to the output folder of the present case. -* Similar considerations for DIFFCASE. - -$setglobal MERGECASE none -*!option none !text Comparison will not be made -*!option -* MERGEWITH defines the case with which to merge results. -$setglobal MERGEWITH CaseNonversioned -*!option !mustif not %MERGECASE%==none - -* The diff uses gdxdiff. The diffile only shows items that meaningfull can be compared, -* non-compared items are reported in the Balmorel.log file. -$setglobal DIFFCASE none -*!option none !text Comparison will not be made -*!option - -$setglobal DIFFWITH CaseNonversioned -*!option none !text Comparison will not be made -*!option !mustif not %DIFFCASE%==none - -* Then prepare for the necessary details: TODO -file fileMERGEWITHBASEbat / %batfileMERGEWITHBASE% /; -putclose fileMERGEWITHBASEbat; - - - - -*=============================================================================== -*=============================================================================== -* The model type's implication for solver type -*=============================================================================== -*=============================================================================== - -* The model type has implications for the solver type. -* Classical model types are LP (Linear Programming), QP (Quadratic Programming), MIP (Mixed Integer Programming). -$setglobal SOLVETYPE LP -*!option LP "Linear Programming" -*!option RMIP "Relaxed Mixed Integer Programming" -*!option MIP "Mixed Integer Programming" - -*!option yes -*!mustif %AGKNDISC%==yes -*!mustif %UnitComm%==yes - - - -*=============================================================================== -*=============================================================================== -* Input data: -*=============================================================================== -*=============================================================================== - -*------------------------------------------------------------------------------- -*------------------------------------------------------------------------------- -* Option semislash is used to control input data format for text files. -* With "$Setglobal semislash ;" the input files must include -* the declaration statement initially and must terminate with a "/;". -* With "$Setglobal semislash /" the input files do not contain this, but only data. -* Note that parameters and tables are identical declarations, however, -* when using "$Setglobal semislash /" make sure -* that the use of either "parameter" or "table" in Balmorel.gms for any data file -* corresponds to the data format used in the file. -* NOTE: Rev.3.03: Not fully implemented yet, you MUST use "$Setglobal semislash ;". -$setglobal semislash ";" -*!fixedvalue ; -**!option ; - - - - -* Domain overloading: The options specify the domain (indexes) that the identifiyer is declared on. -$setglobal GMINF_DOL YYY_CCCRRRAAA_FFF -*!option CCCRRRAAA_FFF -*!option YYY_CCCRRRAAA_FFF -* -$setglobal GMAXF_DOL YYY_CCCRRRAAA_FFF -*!option CCCRRRAAA_FFF -*!option YYY_CCCRRRAAA_FFF -* -$setglobal GEQF_DOL YYY_CCCRRRAAA_FFF -*!option CCCRRRAAA_FFF -*!option YYY_CCCRRRAAA_FFF -* -$setglobal XKRATE_DOL IRRRE_IRRRI_SSS -*!option IRRRE_IRRRI -*!option IRRRE_IRRRI_SSS -*!option IRRRE_IRRRI_SSS_TTT -* -$setglobal GKRATE_DOL AAA_GGG_SSS -*!option AAA_GGG_SSS -*!option AAA_GGG_SSS_TTT - -$setglobal WNDFLH_DOL AAA -*!option AAA_GGG -*!option AAA - -$setglobal SOLEFLH_DOL AAA -*!option AAA_GGG -*!option AAA - -$setglobal SOLHFLH_DOL AAA -*!option AAA_GGG -*!option AAA - -$setglobal GWAVE_DOL AAA -*!option AAA_GGG -*!option AAA - - - -*------------------------------------------------------------------------------- -* Active options will be reported to log file via file hellolog.inc -*------------------------------------------------------------------------------- - - -*------------------------------------------------------------------------------- -* End of Balopt.opt -*------------------------------------------------------------------------------- +* This file holds options that are used to control model functionality, +* including extentions in the form of addons, and interplay between models. + +* Note: in final version all relevant control settings will be indicated +* by an *!option statement, e.g. "*!option yes" and other instructions. + +* Note: If you work with BUI, the above is mandatory. +* Moreover, the only way to enter a comment in this file +* is to use a '*' as the first character on the line; +* thus, you can not use e.g., $ontext..$offtext or /*..*/ or // or !!. +* Further, if you work with BUI, this file will not be $included into Balmorel.gms, +* instead the file Balopt.bui will be $included. See the description elsewhere. + + +* Debugging hints are available if you include feasiblity-ensuring variables. +* However, adding more variables will increase calculation time. +* Hence, if calculation time is an issue, it is recommended as default to not use them, +* and then, if the solver declares the problem infeasible, use them and resolve. +* Information of ... in the .log file? +$setglobal vqdebug +*!option yes + +*Reduce number of infeasibility variables. By default, infeasibility variables are added to many equations, which is not always required. +$setglobal reduced_vqdebug +*!option yes +*----------------------------------------------------------------- +*---- END: VQDEBUG ------------------------------------------------ + + +*=============================================================================== +*=============================================================================== +* Project and Case ID: +*=============================================================================== +*=============================================================================== + +* PROJECTID is the identification of the Project. +* Convenient, and additioanally needed if results shall be compared among projects. +* +$setglobal PROJECTID +*!option !fixedvalue +* +* +* CASEID is the Case identification string. It can be assigned freely, however, if +* the case is a base case to which other cases should be compared the name should be +* BASE. Normally the model in the base directory will be called BASE while +* any variants will have names as appropriate. Model results in the form of GDX files +* (or Access MDBs) will have the CASEID as filename with the appropriate extension. +* Note that CASEID MUST be identical to folder name of the diretory holding the case. +* +$setglobal CASEID BASE +*!option !fixedvalue + + +*=============================================================================== +*=============================================================================== +* Model choices: +*=============================================================================== +*=============================================================================== + +*------------------------------------------------------------------------------- +* The following global variables concern the choice of model. +* If $Setglobal bb4 yes, BB4 is chosen. +$setglobal bb4 yes +*!option yes + + +*=============================================================================== +*=============================================================================== +* Basic models details and Addon modules: +*=============================================================================== +*=============================================================================== + +*------------------------------------------------------------------------------- +* The following global variables concern the choice of details in some of the models. +* Note that some of the choices are mutually dependent. + +*-------- Seasonal rolling horizon --------- +* Optimize seasons with a rolling horizon approach instead of all together. +*NOTE: This option is supposed to be combined with the option "import_results", which must contain information for all S and at least the first element in T +$setglobal RollingSeasons +*!option yes + +SCALAR ROLLINGSEASONSNUMBER 'Number of seasons to be optimized at a time in each rolling season optimization'; +ROLLINGSEASONSNUMBER= 1; + +*-------- END: Seasonal rolling horizon --------- + +*-------- QDENET --------- +* Introduces the calculation of the net demand of different users (e.g. households, industry, etc). Relevant for taxes, grid tariffs, demand response, etc. +$setglobal NETDEMAND +*!option yes +*-------- END: QDENET --------- + +*----------------------------------------------------------------- +*---- Investments ------------------------------------------------ + +*---- Generation investments options---- + +* Permit investments in generation and storage capacity: +$setglobal TechInvest yes +*!option yes + +SCALAR GINVESTSTART 'Year from which endogenous decisions in generation capacities are allowed' ; +GINVESTSTART= 2025; + + +* Set a ramping constraint on the build-out of solar and wind +$setglobal RampingVRE +*!option yes + +SCALAR RAMP_RATE_SOLE 'ramping rate build-out of solar in GW/yr'; +SCALAR RAMP_RATE_WND 'ramping rate build-out of wind in GW/yr'; +SCALAR RAMP_RATE_HP 'ramping rate build-out of heat pumps in GW/yr'; +SCALAR RAMP_RATE_HS 'ramping rate build-out of heat savings in GW/yr'; +SCALAR RAMP_YEAR 'year that the ramping rate is effective until'; +* The ramp-rate of heat savings is a bit ambiguous, it is defined as the total capacity of all heat saving technologies divided by 10 + +RAMP_RATE_SOLE = 50; +RAMP_RATE_WND = 30; +RAMP_RATE_HP = 30; +RAMP_RATE_HS = 15; +RAMP_YEAR = 2030; + +*---- End: Generation investments options---- + +*---- Transmission investments options---- + +* Permit investments in transmission capacity: +$setglobal TransInvest YES +*!option yes + +SCALAR XINVESTSTART 'Year from which endogenous decisions in transmission capacities are allowed' ; +XINVESTSTART= 2035; + +*---- End: Transmission investments options---- + +*----END: Investments--------------------------------------------------- +*----------------------------------------------------------------------- + +*-----------------------HEAT TRANSFER-------------------------------------------------------- +*overall control variable HEATTRANS must be 'yes' if any of the other heat trans controls are. + +* Permit heat transmission between areas. +$setglobal HEATTRANS YES +*!option yes + +* Permit heat transmission investments between areas. +$setglobal HeatTransInvest +*!option yes + +SCALAR XHINVESTSTART 'Year from which endogenous decisions in heat transmission capacities are allowed' ; +XHINVESTSTART= 2025; + +* Permit temperature lift from heat pumps to move energy from low temperature areas to high temperature ones (NOT WORKING, TO BE CHECKED). +$setglobal HeatTempLift +*!option yes +*-----------------------END OF: HEAT TRANSFER-------------------------------------------------------- + +* Include industry data in the optimization. Requires HEATTRANSFER add-on to be activated. +$setglobal INDUSTRY YES +*!option yes + +*--------------------INDIVIDUAL USERS-------------------------------------------------------------- +* overall control variable INDIVUSERS must be 'yes' if any of the other INDIVUSERS controls are: + +* Include individual users data in the optimization. Requires HEATTRANSFER add-on to be activated. +$setglobal INDIVUSERS YES +*!option yes + +* Include the possibility to shift exogenous heat demand between technology groups. +$setglobal GROUP_DEMAND_SHIFT +*!option yes + +* Include the investment in heat saving generation technologies +* Technologies are added in the normal GDATA, and applied to _IDVU_SPACEHEATING and DH areas +$setglobal GHEATSAVING +*!option yes + +*-----------------END: INDIVIDUAL USERS-------------------------------------------------------------- + +* Include seasonal variation of heat pump's COP. If not activated, heat pumps will have a constant COP during the year. +$setglobal SEASONALCOP +*!option yes + +*------------START OF: OFFSHORE GRIDS-------------------------- +* overall control variable OFFSHOREGRID must be 'yes' if any of the other OFFSHOREGRID controls are: +* Allow to build a complicated offshore grid with hubs in the sea. +$setglobal OFFSHOREGRID +*!option yes + +*Adds Economies of Scale in generation elements that are part of offshore grids. It requires to use the MIP solver, so remember to activate it. +$setglobal OFFSHOREGRID_ES_GEN +*!option yes + +* Allow to build a complicated offshore grid with hubs in the sea. Requires MIP to work as intended since technologies are modelled with economies of scale via SOS variables. If RMIP is used, it will become a linear problem. +$setglobal OFFSHOREGRID NO +*!option yes +*------------END OF: OFFSHORE GRIDS-------------------------- + + +* Allow Carbon Capture Storage (CCS) technologies. +$setglobal CCS YES +*!option yes + +* Allow curtailment of variable renewable energy generators (BB4) +$setglobal VRESHUTDOWN yes +*!option yes + +*------------------------------EV ADDON------------------------------------------------- +* overall control variable EV must be 'yes' if any of the other EV controls are: + +$setglobal EV +*!option YES + +* Adds DUMB charging: +$setglobal DUMB +*!option yes + +* Adds smart charging. Only smart charging, without V2G!: +$setglobal SMART +*!option yes + +* Adds V2G charging: +$setglobal V2G YES +*!option yes + +* Restricts PHEV vehicles from doing V2G (only relevant if V2G is activated): +$setglobal NO_PHEV_V2G yes +*!option yes + +* Adds step charging scheme: +$setglobal STEPCHARGSCHEME +*!option yes + +* Adds cycle degradation charging: +$setglobal DEGCYCLE +*!option yes + +* Adds calendar degradation charging: +$setglobal DEGCAL +*!option yes + +* EV timeseries will be averaged (relevant if less than all time steps in TTT are used). +* NOTE: It currently only works if T are equally distanced from each other and if the first T chosen is equal to the first element int TTT). If this is not desired, one can replace the timeseries with new averaged-with-another-procedude timeseries +* NOTE: It might lead to infeasibilities though +$setglobal EV_PROFILE_AVG yes +*!option yes + +*Adds EV infeasibility variables (added here on purpose, since if not all TTT are used it is very likely to run into small infeasibilities) +*Note: The value of the parameter PENALTQ should be in line with the cost assumptions in the model to obtain meaninful results +$setglobal EV_infeas yes +*!option + +* Models EV as inter-seasonal storage (if it is not activated, then EVs are model as intra-seasonal storage): +$setglobal EV_INTERSEASONAL +*!option yes +*------------------------------END: EV ADDON------------------------------------------------- + +*------------------------------TRANSPORT ADDON------------------------------------------------- +* overall control variable TRANSPORT must be 'yes' if any of the other TRANSPORT controls are: +* Include transport data in the optimization (it is supposed to complement the EV addon, so check consistency of data before using it). +$setglobal TRANSPORT YES +*!option yes + +* Defines the commodity used to model synthetic fuel generation. +$setglobal TRANSPORT_SYNTHFUEL_COMMODITY HYDROGEN +*!option ELECTRICITY !Text "The demand for synthetic fuel generation is modelled as electricity demand" +*!option HYDROGEN !Text "The demand for synthetic fuel generation is modelled as hydrogen demand (requires hydrogen addon to be activated)" + +* Defines the possibility for the transport demand of synthetic fuels to be aggregated internationally instead of having to satisfy it regionally. +$setglobal TRANSPORT_DEMAND_AGGREGATED + +* Enable electricity demand from EVs with a simple charging profile +$setglobal SIMPLE_EV yes +*!option yes + +*------------------------------END:TRANSPORT ADDON------------------------------------------------- + +*----------------------------------------------------------- +*---------------HYDRO RESERVOIRS OPTIONS-------------------- +*Interpretation of the seasonal level of hydro reservoirs (QHYRSSEQ) +$setglobal HYRS_AGG hydro_year_agg +*!option hydro_year_agg !Text "The storage level of hydro reservoirs (QHYRSSEQ) will be scaled so the Seasons included in the optimization represent an annual behaviour" +*!option hydro_season_agg !Text "The storage level of hydro reservoirs (QHYRSSEQ) will be scaled so the Seasons included in the optimization represent a seasonal behaviour" + +* Relax seasonal limits for hydropower storages when running the model with less than 26 seasons (in HYRSDATA.inc) +$setglobal RELAX_HYDROSTORAGE yes +*!option yes +*---------------END: HYDRO RESERVOIRS OPTIONS-------------- +*---------------------------------------------------------- + +*------------------------------------------------- +*---- Timeseries scaling ------ + +$setglobal timeseries_scaling usedtimesteps_timseries_scaling +*!option usedtimesteps_timseries_scaling !Text "Timeseries values are scaled linearly by the following factor: scaling factor = annual energy content / sum of the energy in the used part of the timeseries" +*!option full_timeseries_scaling !Text "Timeseries values are scaled linearly by the following factor: scaling factor = annual energy content / sum of the energy in the full timeseries" + +*----END: Timeseries scaling +*------------------------------------------------- + +*------------------------------------------------- +*---- IGKRATE data ------ +$setglobal IGKRATE_STOCHASTIC +*!option IGKRATE_STOCHASTIC !Text "If activated, IGKRATE will take the values in file IGKRATE.gdx, else it will be built based on GKRATE" +*---- end: IGKRATE calculation ------ +*------------------------------------------------- + +*-------- Balancing market --------- +* overall control variable BalancingMarket must be 'yes' if any of the other BalancingMarket controls are: +* Peforms the balancing market optimization +*Note: it is meant to be combined with Unit Commitment and import_results add-ons. It can also be combined with ancilliary services +$setglobal BalancingMarket +*!option yes + +*Define the purpose of the balancing run. +$setglobal BALANCINGRUNPURPOSE TSOREDISPATCH +*!option INTRADAYMARKET !Text "The run will simulate INTRADAY markets" +*!option TSOREDISPATCH !Text "The run will simulate the re-dispatch optimization from the TSO perspective (congetion management), adding penalties to compensate for forced re-dispatch of the units based on the TSO needs" + +*If activated the TSO will also compensate generators for the forced down re-dispatch due to forecast errors, ramping limits, etc. (only relevant if BALANCINGRUNPURPOSE=TSOREDISPATCH) (to be finished) +$setglobal FORCEDDOWNREDISPATCH +*!option yes + +*Define which units will be allowed to change their commitment status (on/off) +$setglobal CommitmentStatus FastUnitsChange +*!option NoChange !Text "The units will not be allowed to change their commitment, which will be taken from previous runs " +*!option FastUnitsChange !Text "The slow units will not be allowed to change their commitment, which will be taken from previous runs " + +*Restricts heat market from participating in the balancing market by restricting relevant heat generation variables from previous runs and not including the heat balance equation +$setglobal NOHEATMARKET +*!option yes +*-------- END: Balancing market --------- + +*------------------------------------------------------------------------------- +* The following global variables concern the choice of add-on modules to include. +* Include a module by assigning yes . +* Note that some of the choices are mutually dependent. + +* Presently some of the addons are commented out - +* they may or may not be working (at least with an appropriate data set), +* however, it has not been checked. Please take contact if problems. + +* Combine two technologies to one to achieve e.g. multifuel characteristics. +$setglobal COMBTECH +*!option yes + +*-----------------HYDROGEN ADDON--------------------------------------- +* overall control variable HYDROGEN must be 'yes' if any of the other HYDROGEN controls are: +* Set demands for hydrogen consumption and enable hydrogen technologies (some options require COMBTECH to be activated too). +$Setglobal HYDROGEN YES +*!option yes + +* Allows investments in hydrogen transport +$Setglobal H2TransInvest yes +*!option yes + +SCALAR XH2INVESTSTART 'Year from which endogenous decisions in H2 transmission capacities are allowed' ; +XH2INVESTSTART= 2030; +XH2INVESTSTART= 2030; + +*Adds Economies of Scale in H2 transmission. It requires to use the MIP solver, so remember to activate it (Dataset not updated for new countries in pan-European system) +$setglobal ES_H2TRANS + +* Allows import of Hydrogen from 3rd countries outside Balmorel +$Setglobal IMPORT_H2 YES +*!option yes + +* Allows flexible demand of H2 in regions (set ratio of flexible demand in HYDROGEN_FLEXDH2 with the scalar THETA_FLEX_DH2) +$setglobal flexible_h2_space +*!option yes + +*-----------------END: HYDROGEN ADDON--------------------------------------- + +* Use stepwise linear fuel prices +$Setglobal STEPWISEPRICE + +* Set a common maximum for fuels. +$Setglobal LIMITSFORFUELS +*!option yes + +* Allow demand elasticity +$setglobal DFLEXQUANT +*!option yes + +* Allow demand response (requires NETDEMAND) +$setglobal DEMANDRESPONSE +*!option yes + +* Permit exchange of electricity with third regions using a price interface (in contrast to X3FX) (TO-DO, TEST IT) +$setglobal X3V +*!option yes + +* Grid tariffs on electricity use (requires NETDEMAND) +$setglobal GRIDTARIFFS +*!option yes + +* Taxes addon (requires NETDEMAND) +$setglobal TAXES +*!option yes + +* Transmission ramping addon (it asssumes seasonal linking) +$setglobal TRANS_RAMP +*!option yes + +*-----------------------ANCILLARY SERVICES---------------------------------------------------------------------------------------------------- +* Ancillary services addon (it requires UnitComm to be active). The other options require this one to be activated. +$setglobal ANC_SERV +*!option yes + +* FCR reserve requirement activated +$setglobal FCR +*!option yes + +* AFRR reserve requirement activated +$setglobal AFRR yes +*!option yes + +* MFRR reserve requirement activated (NOT FINISHED) +$setglobal MFRR +*!option yes + +* MRR reserve requirement activated (NOT FINISHED) +$setglobal MRR +*!option yes + +* Allow VRE to provide for reserves +$setglobal ANC_SERV_VRE YES +*!option yes + +*Include down regulation reserves. For simplification, down regulation of spinning reserves can be disactivated, since they are generally less expensive than up regulation. +$setglobal DOWN_REGULATION_INCLUDED +*!option yes +*-----------------------END: ANCILLIARY SERVICES---------------------------------------------------------------------------------------------------- + +* Make investments in technologies only at specified capacities. (it should be checked before using it) +$setglobal AGKNDISC +*!option yes +*!onlyif %BB2%==yes +*!onlyif %solvetype%==MIP + + +* Use the flow-based capacity allocation methodology +$Setglobal FlowBased +*!option yes + +* Set short storages to be inter- or intra-seasonal +* according to GDSTOINTERS in GDATA (default) or all or none +$setglobal stointers +*! option default Use as specified by GDSTOINTERS in GDATA +*! option all Let all storage technologies be inter-seasonal +*! option none Let no storage technologies be inter-seasonal (i.e., let all be intra-seasonal) + + +* Bypass of 'turbine' (electricity production) on CHP units. +$setglobal bypass yes +*!option yes + + +*-----------------------TECHNOLOGY DECOMMISSIONING-------------------------------------------------------- +* overall control variable DECOM must be 'yes' if any of the other decommissioning controls are. +$setglobal DECOM yes +*!option yes + +*-------ENDOGENOUS CAPACITIES---------- +* Note: If no option for endogenous capacities is activated, endogenous investments will not be decommissioned + +* Adds Endogenous capacities will maximum stay in the system as much as their lifetimes: +$setglobal LIFETIME_DECOM_ENDO_G YES +*!option yes + +* Adds Endogenous capacities can be decommissioned based on their profitability: +$setglobal ECONOMIC_DECOM_ENDO_G yes +*!option yes + +* Adds Endogenous decommissioned endogenous capacities can be brought back to the energy system. To be combined with the other decommissioning options: +$setglobal REVERT_DECOM_ENDO_G yes +*!option yes + +*--------END OF ENDOGENOUS CAPACITIES----- + +*--------EXOGENOUS CAPACITIES------------ +* Note: If either NO_DECOM_EXO_G, or LIFETIME_DECOM_EXO_G, or ECONOMIC_DECOM_EXO_Gor is activated, then the parameter GKFX will be recalculated so capacities only increase in the system. + +SCALAR GDECOMEXOSTART 'Year from which endogenous decisions in decommissioning of exogenous generation capacities are allowed'; +GDECOMEXOSTART= 2025; + +SCALAR GDECOMEXOPOTSTART 'Starting year to calculate the yearly decommissioning capacity potential, i.e. exogenous decommissioning occuring before this year will not be considered' ; +GDECOMEXOPOTSTART= 2016; + +* Adds No decommissioning of exogenous capacities will take place at all. The capacities in the recalculated GKFX will take place in the optimization +* Note: This option is not compatible with the other exogenous capacities decommissioning options. +$setglobal NO_DECOM_EXO_G +*!option yes + +* Adds Exogenous capacities will maximum stay in the system as much as their lifetimes (or as much as political decissions suggest it, for instance), which should be represented in the yearly development of capacities of the input parameter GKFX: +$setglobal LIFETIME_DECOM_EXO_G YES +*!option yes + +* Adds Exogenous capacities can be decommissioned based on their profitability: +$setglobal ECONOMIC_DECOM_EXO_G +*!option + +* Adds Endogenous decommissioned exogenous capacities can be brought back to the energy system. To be combined with the other decommissioning options: +$setglobal REVERT_DECOM_EXO_G +*!option yes +*--------END OF ENDOGENOUS CAPACITIES----- +*-----------------------End of TECHNOLOGY DECOMMISSIONING-------------------------------------------------------- + +*------------------------------------------------------------------------------- +* OptiFlow model. +*------------------------------------------------------------------------------- +$setglobal OPTIFLOW yes +*!option yes +* Addon APKNdisc: discrete size investments in PROC. +$setglobal APKNdisc +*!option yes +*Investments in Optiflow technologies +$setglobal inv yes +*! option yes +*Model solved as MIP +$setglobal solveOptiFlowmip +*! option yes +* Connects biomass use between Balmorel and OptiFlow. +* Also sets MAXFLOW to 0 +$setglobal baloptfuelbridge yes +*! option yes +* Connects biogas produced by OptiFlow to Balmorel. +* Also sets balmorel biogas potential to 0 +$setglobal baloptgasbridge yes +*! option yes +* Connects captured CO2 in Balmorel with CO2 use in OptiFlow +* !! Requires the CCS addon!!! +$setglobal baloptCCU yes +*! option yes + +* Debug possibilities: +$Setglobal addEPStoL +*! option yes +* Not needed if there are no capacity bounds on internal proc +* It will be needed if there are capacity bounds on some internal proc, therefore add them only in that case (requires some coding, TODO). +* With such minimal use the infeasibilities will be moved to SOSIBU proc whenever possible. +$Setglobal useQNODEslack +*! option +$Setglobal useSSBslack +*! option yes +$Setglobal useShareSlack +*! option yes +* Option uniquesol permit to use quadratic terms in QOBJ in order to attain unique solution. +* Should be used for debug on small systems only. +$Setglobal uniquesol +*! option yes +* Testing ONLY: +$setglobal singlearea +*! option yes +* Testing ONLY: +$setglobal addUP +*! option yes +*------------------------------------------------------------------------------- +*Optiflow end +*------------------------------------------------------------------------------- + + +*-------------------- UNIT COMMITMENT ----------------------------------------------------------- +* overall control variable UnitComm must be 'yes' if any of the other unit commitment controls are: + +$setglobal UnitComm +*!option yes + +* Adds minimal production-when-on: +$setglobal MINFUELCONS YES +*!option yes +* Adds respecting minimum off time of the capacities: +$setglobal MINSTARTUPTIME yes +*!option yes +* Adds respecting minimum on time of the capacities: +$setglobal MINSHUTDOWNTIME yes +*!option yes +* Adds ramping technical limitations and stepwise costs to the Power plants when-on: +$setglobal STEPWISE_RAMPING_UC ramp_const +*!option ramp_const_cost !Text "With ramping constraints and ramping costs" +*!option ramp_const !Text "With ramping constraints but without ramping costs" +*!option no_ramping !Text "Neither ramping constraints nor ramping costs" +* Adds optimisation of planned maintenance of the generation and storage technologies +$setglobal PLANNED_MAINTENANCE +*!option yes + +* Seasonal link is on for all UC options activated. This means that past seasons will influence future seasons. +* This option increases computanional time but assures continuity in the fuel consumption profile. +$setglobal SEASONALLINKUC +*!option yes + +* The production interval is segmented into a number of disjunct pieces, each with its own costs: NOT IMPLEMENTED +$setglobal UnitCseg +*!option yes +*-------------------- End of UNIT COMMITMENT ----------------------------------------------------------- + +*--------------------STEPWISE RAMPING (LINEAR VERSION)----------------------------------------------------------- +* overall control variable Stepwise_ramping must be 'yes' if any of the other stepwise ramping controls are: +* This add-on is an alternative to Unit Commitment to model ramping constraints without using MIP. This add-on uses currently the relevant data and sets from the Unit Commitment add-on +* This add-on is not compatible with the Unit Commitment stepwiseramping option +* The use of this add-on togeter with the rest of options of Unit Commitment add-on has not been tested, so, unless tested, this add-on should not be activated if UnitComm is on. + +$setglobal STEPWISE_RAMPING +*!option yes + +* Seasonal ramping link is on. This means that the fuel consumption of the last element ot the set T of the set S will be linked to the first element of the set T of the set S+1. +* This option increases computanional time but assures continuity in the fuel consumption profile. +$setglobal SEASONALLINKRAMPING +*!option yes + +*----------------END OF STEPWISE RAMPING (LINEAR VERSION)---------------------------------------------------------- + +* Calibrate the price side of electricity demand +$setglobal DEFPCALIB +*!option yes +* +* Calibrate the price side of heat demand +$setglobal DHFPCALIB +*!option yes + +* In model Balbase4 (BB4) indicate the strategy for relative weighting of years +$setglobal bb4weighty shareYYY +*!option same !Text "Use same weights for all Y" +*!option shareYYY !Text "Years in YYY but not in Y are shared between two nearest (first and last years double the shared weight contribution)" + +*=============================================================================== +*=============================================================================== +* Relative paths +*=============================================================================== +*=============================================================================== +* No choices, they must be set as shown. Note the format. +* They are to be used as illustrated below and elsewhere in the code. +* +$ifi not %system.filesys%==UNIX $goto endofUNIXrelpaths +$setglobal relpathModel "" +*!fixedvalue +$setglobal relpathoutput "../output/" +*!fixedvalue +$setglobal relpathInputdata2GDX "../output/inputout/" +*!fixedvalue +$setglobal relpathtemp "../output/temp/" +*!fixedvalue +$label endofUNIXrelpaths + +$ifi not %system.filesys%==MSNT $goto endofMSNTrelpaths +$setglobal relpathModel "" +*!fixedvalue +$setglobal relpathoutput "..\output\" +*!fixedvalue +$setglobal relpathInputdata2GDX "..\output\inputout\" +*!fixedvalue +$setglobal relpathtemp "..\output\temp\" +*!fixedvalue +$label endofMSNTrelpaths + +*=============================================================================== +*=============================================================================== +* Some interaction between models: +*=============================================================================== +*=============================================================================== + +* The following options are related to interplay between models, +* e.g. one model output serving as input to another model. + +* Overall control to export results so they can be used in future runs : +$Setglobal export_results yes +*!option yes + +*-------------------------------------------- +*--------------IMPORT OF RESULTS---------------- +*-------------------------------------------- +* Overall control to import results so they can be used in future runs: +*NOTE: In order for results to work fine, the set S used in the runs should be contained in the import results. +*NOTE: In order for results to work fine, the first element in set T of the import results should match the one used in the current run. +$Setglobal import_results +*!option yes + +*------------ IMPORT OPTIONS ---------------- + +* -----------------ENERGY DISPATCH-------------------------- + +*Adds energy dispatch (demand, generation, transmission) from previous runs +$setglobal ADDENERGYDISPATCH +*!option yes +* -----------------END OF ENERGY DISPATCH-------------------------- + +* ------------------HYDRO--------------------------------- +* For this model run it is possible to use values found from previuos solutions to specify use of hydro power +$setglobal HYRSBB123 none +*!option quant !Text "Use seasonal quantities of hydro generation (from HYRSG.gdx??) in this run ('primal decomposition')(not implemented in BB4)" +*!option price !Text "Use seasonal prices for hydro generation (from WATERVAL.gdx) in this run ('dual decomposition')" +*!option quantprice !Text "Use seasonal quantities and prices for hydro generation (from HYRSG.gdx?? and WATERVAL.gdx) in in this run (not implemented in BB4)" +*!option cont !Text "Use seasonal content for hydro generation (from VHYRS_SL.gdx) in in this run" +*!option none !Text "Do not not use this hydro addon" +* ------------------ END OF HYDRO--------------------------------- + +*--------------------INTERSEASONAL STORAGE----------------------------------------------------------- +*Import inter-seasonal electricity storage data from previous runs +$Setglobal ADDESTOVOLTS none +*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" +*!option price !Text "Import electricity storage contents at beginning of time segment (ESTOVOLTS.gdx) for the first element in set T and S, and puts a price to use with ESTOVOLTSVAL.gdx from previous runs. " +*!option none !Text "Do not not use this addon" + +*Import inter-seasonal heat storage data from previous runs +$Setglobal ADDHSTOVOLTS none +*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" +*!option price !Text "Import Heat storage contents at beginning of time segment (HSTOVOLTS.gdx) for the first element in set T and S, and puts a price to use with HSTOVOLTSVAL.gdx from previous runs." +*!option none !Text "Do not not use this addon" + +*Import intra-seasonal electricity storage data from previous runs +$Setglobal ADDESTOVOLT none +*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" +*!option price !Text "(to be finished) Import electricity storage contents at beginning of time segment (ESTOVOLT.gdx) for the first element in set T and S, and puts a price to generation (ESTOVOLTVAL) from previous runs." +*!option none !Text "Do not not use this addon" + +*Import intra-seasonal heat storage data from previous runs +$Setglobal ADDHSTOVOLT none +*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" +*!option price !Text "(to be finished) Import Heat storage contents at beginning of time segment (HSTOVOLT.gdx) for the first element in set T and S, and puts a price to generation (HSTOVOLTVAL) from previous runs" +*!option none !Text "Do not not use this addon" + +*Import inter-seasonal hydrogen storage data from previous runs (requires HYDROGEN addon) +$Setglobal ADDH2STOVOLTS none +*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" +*!option price !Text "Import hydrogen storage contents at beginning of time segment (H2STOVOLTS.gdx) for the first element in set T and S, and puts a price to use with H2STOVOLTSVAL.gdx from previous runs." +*!option none !Text "Do not not use this addon" + +*Import inter-seasonal biomethane storage data from previous runs (requires HYDROGEN addon) +$Setglobal ADDBIOMETHSTOVOLTS none +*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition')" +*!option price !Text "Import biomethane storage contents at beginning of time segment (BIOMETHSTOVOLTS.gdx) for the first element in set T and S, and puts a price to use with BIOMETHSTOVOLTSVAL.gdx from previous runs." +*!option none !Text "Do not not use this addon" + +*Import EV state of charge from previous runs (requires EV addon) +$Setglobal ADDEVSTOS none +*!option cont !Text "Use seasonal content from previous runs in this run ('primal decomposition') (only works if EV_INTERSEASONAL is activated)" +*!option netcharging !Text "Use seasonal net charging of EV in this run ('primal decomposition') (only works if EV_INTERSEASONAL is NOT activated)" +*!option none !Text "Do not not use this addon" + + + +*--------------------END OF INTERSEASONAL STORAGE----------------------------------------------------------- + +*--------------------INVESTMENTS AND DECOMMISSIONING----------------------------------------------------------- +*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. + +*Import generation and storage technology capacity development from previous runs +$setglobal ADDTECHDEV +*!option yes + +*Add expensive to operate backup power and heat generation technology. It often occurs that the investment optimization underestimates the need for power. +$setglobal ADDBACKUPGEN +*!option yes + +*Import transmission development from previous runs +$setglobal ADDTRANSDEV +*!option yes + +*Import heat transmission development from previous runs +$setglobal ADDHEATTRANSDEV +*!option yes + +*Import H2 transmission development from previous runs +$setglobal ADDH2TRANSDEV +*!option yes +*--------------------END OF INVESTMENTS AND DECOMMISSIONING----------------------------------------------------------- + +*--------------------FUEL PRICES----------------------------------------------------------- +*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. +*Import fuel prices development from previous runs +$setglobal ADDFUELPRICE +*!option yes +*--------------------END OF FUEL PRICES----------------------------------------------------------- + +*--------------------FUEL USE----------------------------------------------------------- +*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. +*Import seasonal fuel use upper limit from previous runs +$setglobal ADDMAXFUELUSES +*!option yes +*--------------------END OF FUEL USE----------------------------------------------------------- + +*--------------------PLANNED MAINTENANCE----------------------------------------------------------- +*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. +*Import optimized planned maintenance from previous runs (investments and/or decomissioning must not be allowed if this option is activated) +$setglobal ADDPLANNEDMAINTENANCE +*!option yes +*--------------------END OF PLANNED MAINTENANCE----------------------------------------------------------- + +*--------------------TRANSPORT DEMAND----------------------------------------------------------- +*NOTE: The set Y should be the same in the optimization should be the same as the one in the import results. +*Import demand per term (T) from the transport sector +$setglobal ADDTERMTRANSPORTDEMAND +*!option yes + +*Import seasonal demand from the transport sector +$setglobal ADDSEASONALTRANSPORTDEMAND +*!option yes + +*Import peak demand from the transport sector +$setglobal ADDPEAKTRANSPORTDEMAND +*!option yes +*--------------------END OF TRANSPORT DEMAND----------------------------------------------------------- + +*--------------------INDIVIDUAL USERS----------------------------------------------------------- +*Import Share of heat demand in an individual user group. Requires GROUP_DEMAND_SHIFT to be activated +$setglobal ADDGROUP_DEMAND_SHIFT +*!option yes +*--------------------END OF INDIVIDUAL USERS----------------------------------------------------------- + + +*------------- END OF IMPORT OPTIONS ---------------- +*-------------------------------------------- +*--------------END OF IMPORT OF RESULTS---------------- +*-------------------------------------------- + +*=============================================================================== +*=============================================================================== +* Output: +*=============================================================================== +*=============================================================================== + +* ------------------------------------------------------------------------------ +* Alternative presentations of input data +* ------------------------------------------------------------------------------ + +* It may be convenient under some circumstances to have the applied input data in other forms, +* this may be achieved by the following mechanism. + +* Make a summary of the input data in text format to file inputout.out: +$setglobal inputdatatxt "" +*!option "" !text do not make it +*!option yes !text make it when solving +*!option yesnosolve !text make it but do not solve + + +* Save the input data in gdx format for further processing by Gdx utilities, +* e.g. viewing (Gdxviewer), comparing (Gdxdiff), or transferring to other data formats like Excel or Access. +* Note that this will be done as a compile time operation, +* such that only the 'direct' data definitions (and no assignments) are reflected. +$setglobal INPUTDATA2GDX YES +*!option yes + + +* Transfer the input data in gdx format to a Microsoft Access database ../output/inputout/inputdataout.mdb: +$setglobal INPUTDATAGDX2MDB +*!option yes !onlyif %INPUTDATA2GDX%==yes +* Note: if you have established a link from another Access database to inputdataout.mdb +* close all tables in it before executing Balmorel in order to ensure updating of the links. + +* Merge input data with the output into the gdx file %CASEID%.gdx +$setglobal MERGEINPUTDATA +*!option yes + + +* Transfer the input data in gdx format to Microsoft Excel format: +* NOTWORKING: presently. +$setglobal INPUTDATAGDX2XLS +*!option yes + + +*------------------------------------------------------------------------------- +* Output from model solutions: +*------------------------------------------------------------------------------- + +* A quick way to get (some of) the relevant information is to make a gdx file with all information. +* This option will provide unloading of all that is available at the end of Balmorel.gms. +* +$setglobal all_endofmodelgdx yes +*!option yes !Save the file all_endofmodel.gdx to the model folder + + +* Make some output in text format to show some results of an execution. +* The detailed code for the writing of the files is given in /output/printout/printinc. +* Setting "yes" for PRINTFILES will make some standard printout files to folder /output/printout/. +$setglobal PRINTFILES +*!option yes + +$setglobal OUTPUT_SUMMARY yes +*!option yes + + +* PRINTSEPARATOR is a single character used for separating columns in printfiles, +* convenient e.g. to use ';' for copy-paste to Excel. +$setglobal PRINTSEPARATOR ';' +*!option ' ' +*!option ';' +*!option ',' + +*------------------------------------------------------------------------------- +* Results collection for the present case +*------------------------------------------------------------------------------- + +* The following will establish a mechanism that will save annual optimization results +* from bb1 and bb2 (seasonal for bb3) as gdx files; at the end they may be merged to one gdx file. +* This merged file may then be transferred to an Access database or to Excel. +* It is to be seen in conjunction with saving annual results in file bb123.sim, +* which is accomplished using savepoint with value 1, cf '$Setglobal SAVEPOINTVALUE'. +* +* The following closely linked controls are used: +* SAVEPOINTVALUE, cf. above +* MERGESAVEPOINTRESULTS yes +* MERGEDSAVEPOINTRESULTS2MDB +* MERGEDSAVEPOINTRESULTS2SQLITE +* MERGEDSAVEPOINTRESULTS2XLS: presently not working, we are waiting for GAMS version 22.7, which has better support for this. +* MERGECASE/MERGEWITH +* DIFFCASE/DIFFWITH +* +* Savepoint: the GAMS command "Modelname.Savepoint=number;" +* The savepoint attribute tells GAMS to save a GDX file that contains the information on the current solution point. +* One can save the information from just the last solve or from every solve. +* The points that are saved can be used to provide an advanced basis, an integer program starting point or a NLP starting point. +* Numeric input is expected with the allowable numeric values being: +* 0 no point gdx file is to be saved +* 1 a point gdx file is to be saved from the last solve in the GAMS model +* 2 a point gdx file is to be saved from every solve in the GAMS model +* The value specified by $Setglobal SAVEPOINTVALUE will be used for savepoint. +* To be used with subsequent handling of output. +* +$setglobal SAVEPOINTVALUE 0 +*!option 0 +*!option 1 !mustif %MERGESAVEPOINTRESULTS%==yes !mustif %MERGEDSAVEPOINTRESULTS2GDX%==yes !mustif %MERGEDSAVEPOINTRESULTS2XLS%==yes !mustif not %MERGECASE%==none !mustif not %DIFFCASE%==none +*!option 2 !text Note: nothing implemented nor tested, so do not use it. + +* Use the $setglobal MERGESAVEPOINTRESULTS to choose whether to merge annual/seasonal results or not: +$setglobal MERGESAVEPOINTRESULTS +*!option yes !onlyif %SAVEPOINTVALUE%==1 +* Note: make sure that it is possible to make the new merged gdx file, +* e.g. make sure that the file *.gdx is not open in another application (like GAMD IDE). +* +* Then prepare for the necessary details: +$ifi %system.filesys%==MSNT +$setglobal batfileMERGESAVEPOINTRESULTS %relpathModel%MERGESAVEPOINTRESULTS.bat +*!option !fixedvalue +$ifi %system.filesys%==MSNT +file fileMERGESAVEPOINTRESULTSbat / %batfileMERGESAVEPOINTRESULTS% /; +$ifi %system.filesys%==MSNT +putclose fileMERGESAVEPOINTRESULTSbat; + +$ifi %system.filesys%==UNIX +$setglobal bashfileMERGESAVEPOINTRESULTS %relpathModel%MERGESAVEPOINTRESULTS.sh +*!option !fixedvalue +$ifi %system.filesys%==UNIX +file fileMERGESAVEPOINTRESULTSbash / %bashfileMERGESAVEPOINTRESULTS% /; +$ifi %system.filesys%==UNIX +putclose fileMERGESAVEPOINTRESULTSbash; + +$setglobal MERGEDSAVEPOINTRESULTS2MDB +*!option yes !onlyif %SAVEPOINTVALUE%==1 !onlyif %MERGESAVEPOINTRESULTS%==yes + +$setglobal MERGEDSAVEPOINTRESULTS2SQLITE +*!option yes !onlyif %SAVEPOINTVALUE%==1 !onlyif %MERGESAVEPOINTRESULTS%==yes + + +*------------------------------------------------------------------------------- +* Comparison between Cases: +*------------------------------------------------------------------------------- + +* The following will merge and/or compare two results. +* With option MERGECASE is set to NONE this will be not be done, otherwise it will. +* If done, the result will be in the output folder of the present case in the form of a GDX file. +* With option MERGEDSAVEPOINTRESULTS2MDB" this may then be transferred to a MDB file. +* All output go to the output folder of the present case. +* Similar considerations for DIFFCASE. + +$setglobal MERGECASE none +*!option none !text Comparison will not be made +*!option +* MERGEWITH defines the case with which to merge results. +$setglobal MERGEWITH CaseNonversioned +*!option !mustif not %MERGECASE%==none + +* The diff uses gdxdiff. The diffile only shows items that meaningfull can be compared, +* non-compared items are reported in the Balmorel.log file. +$setglobal DIFFCASE none +*!option none !text Comparison will not be made +*!option + +$setglobal DIFFWITH CaseNonversioned +*!option none !text Comparison will not be made +*!option !mustif not %DIFFCASE%==none + +* Then prepare for the necessary details: TODO +file fileMERGEWITHBASEbat / %batfileMERGEWITHBASE% /; +putclose fileMERGEWITHBASEbat; + + + + +*=============================================================================== +*=============================================================================== +* The model type's implication for solver type +*=============================================================================== +*=============================================================================== + +* The model type has implications for the solver type. +* Classical model types are LP (Linear Programming), QP (Quadratic Programming), MIP (Mixed Integer Programming). +$setglobal SOLVETYPE LP +*!option LP "Linear Programming" +*!option RMIP "Relaxed Mixed Integer Programming" +*!option MIP "Mixed Integer Programming" + +*!option yes +*!mustif %AGKNDISC%==yes +*!mustif %UnitComm%==yes + + + +*=============================================================================== +*=============================================================================== +* Input data: +*=============================================================================== +*=============================================================================== + +*------------------------------------------------------------------------------- +*------------------------------------------------------------------------------- +* Option semislash is used to control input data format for text files. +* With "$Setglobal semislash ;" the input files must include +* the declaration statement initially and must terminate with a "/;". +* With "$Setglobal semislash /" the input files do not contain this, but only data. +* Note that parameters and tables are identical declarations, however, +* when using "$Setglobal semislash /" make sure +* that the use of either "parameter" or "table" in Balmorel.gms for any data file +* corresponds to the data format used in the file. +* NOTE: Rev.3.03: Not fully implemented yet, you MUST use "$Setglobal semislash ;". +$setglobal semislash ";" +*!fixedvalue ; +**!option ; + + + + +* Domain overloading: The options specify the domain (indexes) that the identifiyer is declared on. +$setglobal GMINF_DOL YYY_CCCRRRAAA_FFF +*!option CCCRRRAAA_FFF +*!option YYY_CCCRRRAAA_FFF +* +$setglobal GMAXF_DOL YYY_CCCRRRAAA_FFF +*!option CCCRRRAAA_FFF +*!option YYY_CCCRRRAAA_FFF +* +$setglobal GEQF_DOL YYY_CCCRRRAAA_FFF +*!option CCCRRRAAA_FFF +*!option YYY_CCCRRRAAA_FFF +* +$setglobal XKRATE_DOL IRRRE_IRRRI_SSS +*!option IRRRE_IRRRI +*!option IRRRE_IRRRI_SSS +*!option IRRRE_IRRRI_SSS_TTT +* +$setglobal GKRATE_DOL AAA_GGG_SSS +*!option AAA_GGG_SSS +*!option AAA_GGG_SSS_TTT + +$setglobal WNDFLH_DOL AAA +*!option AAA_GGG +*!option AAA + +$setglobal SOLEFLH_DOL AAA +*!option AAA_GGG +*!option AAA + +$setglobal SOLHFLH_DOL AAA +*!option AAA_GGG +*!option AAA + +$setglobal GWAVE_DOL AAA +*!option AAA_GGG +*!option AAA + + + +*------------------------------------------------------------------------------- +* Active options will be reported to log file via file hellolog.inc +*------------------------------------------------------------------------------- + + +*------------------------------------------------------------------------------- +* End of Balopt.opt +*------------------------------------------------------------------------------- diff --git a/base/model/bb4datainc.inc b/base/model/bb4datainc.inc index 69c9cf35..76ddceea 100644 --- a/base/model/bb4datainc.inc +++ b/base/model/bb4datainc.inc @@ -416,6 +416,16 @@ $if EXIST '../data/FMAXINVESTNA.inc' $INCLUDE '../data/FMAXINVESTNA.inc $if not EXIST '../data/FMAXINVESTNA.inc' $INCLUDE '../../base/data/FMAXINVESTNA.inc'; %semislash%; +PARAMETER GROWTHCAP(CCC,GGG) 'Maximum model generated capacity increase (MW) from one year to the next' %semislash% +$if EXIST '../data/GROWTHCAP.inc' $INCLUDE '../data/GROWTHCAP.inc'; +$if not EXIST '../data/GROWTHCAP.inc' $INCLUDE '../../base/data/GROWTHCAP.inc'; +%semislash%; + +PARAMETER GKNMAX(YYY,AAA,GGG) 'Maximum capacity of production technologies' %semislash% +$if EXIST '../data/GKNMAX.inc' $INCLUDE '../data/GKNMAX.inc'; +$if not EXIST '../data/GKNMAX.inc' $INCLUDE '../../base/data/GKNMAX.inc'; +%semislash%; + PARAMETER DISLOSS_E(RRR) "Loss in electricity distribution (fraction)" %semislash% $if EXIST '../data/DISLOSS_E.inc' $INCLUDE '../data/DISLOSS_E.inc'; $if not EXIST '../data/DISLOSS_E.inc' $INCLUDE '../../base/data/DISLOSS_E.inc'; diff --git a/base/output/OUTPUT_SUMMARY(old).inc b/base/output/OUTPUT_SUMMARY(old).inc new file mode 100644 index 00000000..c717c87f --- /dev/null +++ b/base/output/OUTPUT_SUMMARY(old).inc @@ -0,0 +1,1645 @@ +*Create output file + +SET CATEGORY /COSTS,INCOME,PROFIT/; +SET SUBCATEGORY /ELECTRICITY_SALE,HEAT_SALE,H2_SALE,BIOMETHANE_SALE,GENERATION_CAPITAL_COSTS,GENERATION_FIXED_COSTS,GENERATION_OPERATIONAL_COSTS,GENERATION_FUEL_COSTS,GENERATION_TAXES,GENERATION_GRID_TARIFFS,TRANSMISSION_CAPITAL_COSTS,TRANSMISSION_OPERATIONAL_COSTS,TRANSMISSION_TRADE_INCOME,TRANSMISSION_TRADE_COSTS,HEAT_TRANSMISSION_CAPITAL_COSTS,HEAT_TRANSMISSION_OPERATIONAL_COSTS,H2_TRANSMISSION_CAPITAL_COSTS,H2_TRANSMISSION_OPERATIONAL_COSTS,GENERATION_CO2_TAX,GENERATION_CO2_TRANSPORT,GENERATION_UC_COSTS,GENERATION_OTHER_EMI_TAX,GENERATION_OPPORTUNITY_COSTS_STORAGE,GENERATION_REDISPATCH_COMPENSATION_COST,HYDRO_PROFILE,TAXES,GRID_TARIFFS,TOTAL_PROFIT,ENERGY_SPECIFIC_PROFIT/; +SET COMMODITY /ELECTRICITY,HEAT,HYDROGEN,BIOMETHANE/; +SET TECH_TYPE /CONDENSING,CHP-BACK-PRESSURE,CHP-EXTRACTION,BOILERS,ELECT-TO-HEAT,INTERSEASONAL-HEAT-STORAGE,INTERSEASONAL-ELECT-STORAGE,INTRASEASONAL-HEAT-STORAGE,INTRASEASONAL-ELECT-STORAGE,HYDRO-RESERVOIRS,HYDRO-RUN-OF-RIVER,WIND-ON,WIND-OFF,SOLAR-PV,SOLAR-HEATING,HYDRO-WAVE,HEAT-PUMP,EL-BOILER,FUELCELL,ELECTROLYZER,H2-STORAGE,BIOMETH-DAC,BIOGASUPGRADING,BIOGASMETHANATION,HUB-OFF,STEAMREFORMING/; +SET GTECH_TYPE(GGG,TECH_TYPE); +SET PRICE_CATEGORY /AVERAGE,AVERAGE_WEIGHTED_BY_CONSUMPTION,AVERAGE_WEIGHTED_BY_PRODUCTION/; +SET VARIABLE_CATEGORY /EXOGENOUS,ENDOGENOUS,DECOMMISSIONING,ENDOGENOUS_ELECT2HEAT,ENDO_INTRASTO,ENDO_INTERSTO,ENDO_EV,ENDO_HEATPUMP,ENDO_ELBOILER,ENDO_OTHERTRANS,DIST_LOSSES,TRANS_LOSSES,ENDO_CCS,ENDO_H2,ENDO_BIOMETHANE,ENDO_FUELCELL/; +SET EL_BAL_TYPE /CURTAILMENT,NETEXPORT,EXPORT3RD,PRICE,DEMAND_EXO,DEMAND_LOSS,DEMAND_INTERSTO,DEMAND_INTRASTO,DEMAND_P2H,DEMAND_EV,CONDENSING,CHP-BACK-PRESSURE,CHP-EXTRACTION,ELECT-TO-HEAT,INTER-STO,INTRA-STO,HYDRO-RESERVOIRS,HYDRO-RUN-OF-RIVER,WIND-ON,WIND-OFF,SOLAR-PV,HYDRO-WAVE,FUELCELL,DEMAND_OTHERTRANS,DEMAND_DISTLOSSES,DEMAND_CCS,DEMAND_P2G/; +SET H_BAL_TYPE /CURTAILMENT,NETEXPORT,PRICE,DEMAND_EXO,DEMAND_LOSS,DEMAND_INTERSTO,DEMAND_INTRASTO,BOILERS,CHP-BACK-PRESSURE,CHP-EXTRACTION,INTER-STO,INTRA-STO,SOLAR-HEATING,P2H,FUELCELL,DEMAND_P2G,DEMAND_DISTLOSSES/; +SET UNITS /GW,TWh,MWh,Money_per_MWh,Mmoney,kton,GWh/; + + + GTECH_TYPE(G,'CONDENSING')$IGCND(G) = YES; + GTECH_TYPE(G,'CHP-BACK-PRESSURE')$IGBPR(G) = YES; + GTECH_TYPE(G,'CHP-EXTRACTION')$IGEXT(G) = YES; + GTECH_TYPE(G,'BOILERS')$IGHOB(G) = YES; + GTECH_TYPE(G,'ELECT-TO-HEAT')$IGETOH(G) = YES; + GTECH_TYPE(G,'INTRASEASONAL-HEAT-STORAGE')$(GDATA(G,'GDTYPE') EQ GHSTO) = YES; + GTECH_TYPE(G,'INTERSEASONAL-HEAT-STORAGE')$(GDATA(G,'GDTYPE') EQ GHSTOS) = YES; + GTECH_TYPE(G,'INTRASEASONAL-ELECT-STORAGE')$(GDATA(G,'GDTYPE') EQ GESTO) = YES; + GTECH_TYPE(G,'INTERSEASONAL-ELECT-STORAGE')$(GDATA(G,'GDTYPE') EQ GESTOS) = YES; + GTECH_TYPE(G,'HYDRO-RESERVOIRS')$IGHYRS(G) = YES; + GTECH_TYPE(G,'HYDRO-RUN-OF-RIVER')$IGHYRR(G) = YES; + GTECH_TYPE(G,'WIND-ON')$(IGWND(G) AND GDATA(G,'GDTECHGROUP') EQ WINDTURBINE_ONSHORE) = YES; + GTECH_TYPE(G,'WIND-OFF')$(IGWND(G) AND GDATA(G,'GDTECHGROUP') EQ WINDTURBINE_OFFSHORE) = YES; + GTECH_TYPE(G,'SOLAR-PV')$IGSOLE(G) = YES; + GTECH_TYPE(G,'SOLAR-HEATING')$IGSOLH(G) = YES; + GTECH_TYPE(G,'HYDRO-WAVE')$IGWAVE(G) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'FUELCELL')$(GDATA(G,'GDTECHGROUP') EQ FUELCELL) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'ELECTROLYZER')$(GDATA(G,'GDTECHGROUP') EQ ELECTROLYZER) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'ELECTROLYZER')$(GDATA(G,'GDTECHGROUP') EQ BACKUP_HYDROGEN) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'H2-STORAGE')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GH2STO) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'BIOMETH-DAC')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GH2TOBIOMETH) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'BIOGASUPGRADING')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GBIOGASUPGRADING) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'BIOGASMETHANATION')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GBIOGASMETHANATION) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'STEAMREFORMING')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GCH4TOH2) = YES; +$ifi %OFFSHOREGRID%==yes GTECH_TYPE(G,'HUB-OFF')$(GDATA(G,'GDTYPE') EQ HUB_OFF) = YES; + +PARAMETER G_CAP_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS) "Generation capacity for each year, country, region, area, technology, fuel, commodity, technology type and variable type (GW)"; +PARAMETER G_STO_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS) "Generation storage for each year, country, region, area, technology, fuel, commodity, technology type and variable type (GWh)"; +PARAMETER PRO_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS) "Energy Production for each year, country, region, area, technology, fuel, season, hour, commodity and technology type (MWh)" ; +PARAMETER PRO_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS) "Annual Energy Production for each year, country, region, area, technology, fuel, commodity and technology type (TWh)"; +PARAMETER F_CONS_YCRAST(Y,C,RRR,AAA,G,FFF,SSS,TTT,TECH_TYPE,UNITS) "Fuel consumption for each year, country, region, area, technology, fuel, season, hour and technology type (MWh)"; +PARAMETER F_CONS_YCRA(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS) "Fuel consumption for each year, country, region, area, technology, fuel and technology type (TWh)"; +PARAMETER X_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS) "Transmission capacity for each year, country, from region to region (GW)"; +PARAMETER X_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS) "Transmission flow for each year, country, from region to region, for each season and hour (MWh)"; +PARAMETER X_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS) "Transmission flow for each year, country, from region to region (TWh)"; +PARAMETER ECO_G_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,CATEGORY,SUBCATEGORY,UNITS) "Generation Economic Output for each year, country, region, fuel, technology type, area and technology (Mmoney)"; +PARAMETER ECO_X_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS) "Electric Transmission Economic Output for each year, country and region (Mmoney)"; +PARAMETER OBJ_YCR(Y,C,RRR,SUBCATEGORY,UNITS) "Objective function (Mmoney)"; +PARAMETER EL_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS) "Average Electricity Prices for each region (money/MWh)"; +PARAMETER EL_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS) "Hourly Electricity Prices for each region (money/MWh)"; +PARAMETER H_PRICE_YCRA(Y,C,RRR,AAA,PRICE_CATEGORY,UNITS) "Average heating Prices for each area(money/MWh)"; +PARAMETER H_PRICE_YCRAST(Y,C,RRR,AAA,SSS,TTT,UNITS) "Hourly heating Prices for each area (money(MWh)"; +PARAMETER EL_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS) "Aggregated Hourly Electricity Demand (MWh)"; +PARAMETER EL_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS) "Aggregated annual Electricity Demand (TWh)"; +PARAMETER H_DEMAND_YCRAST(Y,C,RRR,AAA,SSS,TTT,VARIABLE_CATEGORY,UNITS) "Aggregated Hourly heat Demand (MWh)"; +PARAMETER H_DEMAND_YCRA(Y,C,RRR,AAA,VARIABLE_CATEGORY,UNITS) "Aggregated Annual heat Demand (MWh)"; +PARAMETER EMI_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS) "Annual CO2 emissions(ktons)"; +PARAMETER CURT_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS) "Hourly energy curtailment per country, region, area, technology, fuel, hour and technology type (MWh)"; +PARAMETER CURT_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS) "Hourly energy curtailment per country, region, area, technology, fuel, hour and technology type (MWh)"; +PARAMETER EL_BALANCE_YCRST(Y,C,RRR,EL_BAL_TYPE,SSS,TTT,UNITS) "Hourly electricity balance per country, region, and type (MWh)"; +PARAMETER H_BALANCE_YCRAST(Y,C,RRR,AAA,H_BAL_TYPE,SSS,TTT,UNITS) "Hourly heat balance per country, region, area and type (MWh)"; +$ifi %HYDROGEN%==yes PARAMETER H2_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS) "Hourly hydrogen Prices for each region (money/MWh)"; +$ifi %HYDROGEN%==yes PARAMETER BIOMETH_PRICE_YST(Y,SSS,TTT,UNITS) "Hourly biomethane Prices for each region (money/MWh)"; +$ifi %HYDROGEN%==yes PARAMETER XH2_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS) "H2 Transmission capacity for each year, country, from region to region (GW)"; +$ifi %HYDROGEN%==yes PARAMETER XH2_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS) "H2 Transmission flow for each year, country, from region to region, for each season and hour (MWh)"; +$ifi %HYDROGEN%==yes PARAMETER XH2_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS) "H2 Transmission flow for each year, country, from region to region (TWh)"; +$ifi %HYDROGEN%==yes PARAMETER ECO_XH2_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS) "H2 Transmission Economic Output for each year, country and region (Mmoney)"; +$ifi %HYDROGEN%==yes PARAMETER H2_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS) "Aggregated Hourly H2 Demand (MWh)"; +$ifi %HYDROGEN%==yes PARAMETER H2_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS) "Aggregated annual H2 Demand (TWh)"; + +**Additional Addon output +*HEATRANS +$ifi %HEATTRANS%==yes PARAMETER XH_CAP_YCA(Y,C,IAAAE,IAAAI,VARIABLE_CATEGORY,UNITS) "Heat Transmission capacity for each year, country, from area to area (GW)"; +$ifi %HEATTRANS%==yes PARAMETER XH_FLOW_YCAST(Y,C,IAAAE,IAAAI,SSS,TTT,UNITS) "Heat Transmission flow for each year, country, from areas to area, for each season and hour (MWh)"; +$ifi %HEATTRANS%==yes PARAMETER XH_FLOW_YCA(Y,C,IAAAE,IAAAI,UNITS) "Heat Transmission flow for each year, country, from area to area (TWh)"; +$ifi %HEATTRANS%==yes PARAMETER ECO_XH_YCRA(Y,C,RRR,AAA,IAAAI,CATEGORY,SUBCATEGORY,UNITS) "Heat Transmission Economic Output for each year, country and region and area (Mmoney)"; + + +$ifi not %stointers%==all $goto NO_STOINTERS +*Modification of STORAGE sets so calculation are done correcting its type: +IGHSTO(G) = 0; +IGHSTOS(G) = 0; +IGESTO(G) = 0; +IGESTOS(G) = 0; +IGHSTO(G) = YES$(GDATA(G,'GDTYPE') EQ GHSTO); +IGHSTOS(G) = YES$(GDATA(G,'GDTYPE') EQ GHSTOS); +IGESTO(G) = YES$(GDATA(G,'GDTYPE') EQ GESTO); +IGESTOS(G) = YES$(GDATA(G,'GDTYPE') EQ GESTOS); +$label NO_STOINTERS + +*Modification of IHOURSINST +$ifi %RollingSeasons%==yes PARAMETER IHOURSINTROLLINGSEASON(S,T) "Length of time segment (hours) used in rolling season mode"; +$ifi %RollingSeasons%==yes IWEIGHSUMS=SUM(SSS$(ORD(SSS) LE ROLLINGSEASONSNUMBER), WEIGHT_S(SSS)); +$ifi %RollingSeasons%==yes IHOURSINTROLLINGSEASON(S,T)=IOF8760*WEIGHT_S(S)*WEIGHT_T(T)/(IWEIGHSUMS*SUM(ITALIAS, WEIGHT_T(ITALIAS)))/IHOURFRAC; + +IWEIGHSUMS = SUM(S, WEIGHT_S(S)); +IWEIGHSUMT = SUM(T, WEIGHT_T(T)); +IHOURSINST(SSS,TTT)=0; +IHOURSINST(S,T)=IOF8760*WEIGHT_S(S)*WEIGHT_T(T)/(IWEIGHSUMS*IWEIGHSUMT)/IHOURFRAC; + + + +* -------------------- ENERGY CAPACITY --------------------- + +* ------------- ELECTRICITY CAPACITY -------------- + +** EXOGENOUS ELECTRICITY CAPACITY + +G_CAP_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'EXOGENOUS','GW')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND NOT(IHYDROGEN(IGE)))= +IOF0001*GKFX(Y,IA,IGE)/(1$((NOT IGESTO(IGE)) AND (NOT IGESTOS(IGE)))+GDATA(IGE,'GDSTOHUNLD')$((IGESTO(IGE)) OR IGESTOS(IGE))) +; + + +** ENDOGENOUS ELECTRIC CAPACITY ACCUMULATED INVESTMENTS +G_CAP_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'ENDOGENOUS','GW')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND NOT(IHYDROGEN(IGE)))= +IOF0001*VGKNACCUMNET.L(Y,IA,IGE)/(1$((NOT IGESTO(IGE)) AND (NOT IGESTOS(IGE)))+GDATA(IGE,'GDSTOHUNLD')$((IGESTO(IGE)) OR IGESTOS(IGE))) +; + +** ENDOGENOUS ELECTRICITY CAPACITY ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'DECOMMISSIONING','GW')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGE) AND NOT(IHYDROGEN(IGE)))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGE)/(1$((NOT IGESTO(IGE)) AND (NOT IGESTOS(IGE)))+GDATA(IGE,'GDSTOHUNLD')$((IGESTO(IGE)) OR IGESTOS(IGE))) +; + + +* ------------- END OF ELECTRICITY CAPACITY -------------- + +* ------------- HEAT CAPACITY -------------- + +** EXOGENOUS HEAT CAPACITY + +G_CAP_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'EXOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= +(IOF0001*GKFX(Y,IA,IGH)/((1$((NOT IGHSTO(IGH)) AND (NOT IGHSTOS(IGH)))+GDATA(IGH,'GDSTOHUNLD')$((IGHSTO(IGH)) OR IGHSTOS(IGH)))*(GDATA(IGH,'GDCB')$IGBPR(IGH)+ (GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV'))$IGEXT(IGH)+1$(NOT (IGBPR(IGH) OR IGEXT(IGH))))))$(NOT IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) ++(IOF0001*GKFX(Y,IA,IGH)*(((GDATA(IGH,'GDCB')/GDATA(IGH,'GDBYPASSC')+1)/(GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV')))$IGEXT(IGH) + (1/GDATA(IGH,'GDBYPASSC')+1/GDATA(IGH,'GDCB'))$IGBPR(IGH)))$(IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) +$ifi %HYDROGEN%==yes +(IOF0001*GKFX(Y,IA,IGH)/GDATA(IGH,'GDCB'))$(IHYDROGEN_GETOHH2(IGH) OR IHYDROGEN_GH2TOEH(IGH)) +; + +** ENDOGENOUS HEAT CAPACITY ACCUMULATED INVESTMENTS +G_CAP_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'ENDOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= +(IOF0001*VGKNACCUMNET.L(Y,IA,IGH)/((1$((NOT IGHSTO(IGH)) AND (NOT IGHSTOS(IGH)))+GDATA(IGH,'GDSTOHUNLD')$((IGHSTO(IGH)) OR IGHSTOS(IGH)))*(GDATA(IGH,'GDCB')$IGBPR(IGH)+ (GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV'))$IGEXT(IGH)+1$(NOT (IGBPR(IGH) OR IGEXT(IGH))))))$(NOT IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) ++(IOF0001*VGKNACCUMNET.L(Y,IA,IGH)*(((GDATA(IGH,'GDCB')/GDATA(IGH,'GDBYPASSC')+1)/(GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV')))$IGEXT(IGH) + (1/GDATA(IGH,'GDBYPASSC')+1/GDATA(IGH,'GDCB'))$IGBPR(IGH)))$(IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) +$ifi %HYDROGEN%==yes +(IOF0001*VGKNACCUMNET.L(Y,IA,IGH)/GDATA(IGH,'GDCB'))$(IHYDROGEN_GETOHH2(IGH) OR IHYDROGEN_GH2TOEH(IGH)) +; + +** ENDOGENOUS HEAT CAPACITY ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'DECOMMISSIONING','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGH))= +$ifi %DECOM%==yes -(IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH)/((1$((NOT IGHSTO(IGH)) AND (NOT IGHSTOS(IGH)))+GDATA(IGH,'GDSTOHUNLD')$((IGHSTO(IGH)) OR IGHSTOS(IGH)))*(GDATA(IGH,'GDCB')$IGBPR(IGH)+ (GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV'))$IGEXT(IGH)+1$(NOT (IGBPR(IGH) OR IGEXT(IGH))))))$(NOT IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) +$ifi %DECOM%==yes -(IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH)*(((GDATA(IGH,'GDCB')/GDATA(IGH,'GDBYPASSC')+1)/(GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV')))$IGEXT(IGH) + (1/GDATA(IGH,'GDBYPASSC')+1/GDATA(IGH,'GDCB'))$IGBPR(IGH)))$(IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) +$ifi %DECOM%==yes $ifi %HYDROGEN%==yes -(IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH)/GDATA(IGH,'GDCB'))$(IHYDROGEN_GETOHH2(IGH) OR IHYDROGEN_GH2TOEH(IGH)) +; + +* ------------- END OF HEAT CAPACITY -------------- + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_CAPACITY +* ------------- HYDROGEN CAPACITY -------------- + +** EXOGENOUS HYDROGEN CAPACITY + +G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'EXOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G))= +IOF0001*GKFX(Y,IA,G)*(1$IHYDROGEN_GH2STO(G)+GDATA(G,'GDFE')$(NOT(IHYDROGEN_GH2STO(G))))/(1$(NOT IHYDROGEN_GH2STO(G))+GDATA(G,'GDSTOHUNLD')$IHYDROGEN_GH2STO(G)) +; + + +** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED INVESTMENTS +G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'ENDOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G))= +IOF0001*VGKNACCUMNET.L(Y,IA,G)*(1$IHYDROGEN_GH2STO(G)+GDATA(G,'GDFE')$(NOT(IHYDROGEN_GH2STO(G))))/(1$(NOT IHYDROGEN_GH2STO(G))+GDATA(G,'GDSTOHUNLD')$IHYDROGEN_GH2STO(G)) +; + +** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'DECOMMISSIONING','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,G) AND IHYDROGEN(G))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,G)*(1$IHYDROGEN_GH2STO(G)+GDATA(G,'GDFE')$(NOT(IHYDROGEN_GH2STO(G))))/(1$(NOT IHYDROGEN_GH2STO(G))+GDATA(G,'GDSTOHUNLD')$IHYDROGEN_GH2STO(G)) +; + +* ------------- END OF HYDROGEN CAPACITY -------------- + +* ------------- BIOMETHANE CAPACITY -------------- + +** EXOGENOUS BIOMETHANE CAPACITY + +G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'EXOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= +IOF0001*GKFX(Y,IA,G) +; + +** ENDOGENOUS BIOMETHANE CAPACITY ACCUMULATED INVESTMENTS +G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'ENDOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= +IOF0001*VGKNACCUMNET.L(Y,IA,G) +; + +** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'DECOMMISSIONING','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,G) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,G) +; + +* ------------- END OF BIOMETHANE CAPACITY -------------- + +$label NO_HYDROGEN_CAPACITY + +* ---------------- END OF ENERGY CAPACITY ----------------- + +* -------------------- ENERGY STORAGE --------------------- + +* ------------- ELECTRICITY STORAGE -------------- + +** EXOGENOUS ELECTRICITY STORAGE + +G_STO_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'EXOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND (IGESTO(IGE) OR IGESTOS(IGE) OR IGHYRS(IGE)) )= +IOF0001*GKFX(Y,IA,IGE)*(1$(NOT IGHYRS(IGE)) + HYRSMAXVOL_G(IA,IGE)$IGHYRS(IGE)) +; + +** ENDOGENOUS ELECTRIC STORAGE ACCUMULATED INVESTMENTS +G_STO_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'ENDOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND (IGESTO(IGE) OR IGESTOS(IGE) OR IGHYRS(IGE)) )= +IOF0001*VGKNACCUMNET.L(Y,IA,IGE)*(1$(NOT IGHYRS(IGE)) + HYRSMAXVOL_G(IA,IGE)$IGHYRS(IGE)) +; + +** ENDOGENOUS ELECTRICITY STORAGE ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_STO_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'DECOMMISSIONING','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGE) AND (IGESTO(IGE) OR IGESTOS(IGE) OR IGHYRS(IGE)) )= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGE)*(1$(NOT IGHYRS(IGE)) + HYRSMAXVOL_G(IA,IGE)$IGHYRS(IGE)) +; + +* ------------- END OF ELECTRICITY CAPACITY -------------- + +* ------------- HEAT STORAGE -------------- + +** EXOGENOUS HEAT STORAGE + +G_STO_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'EXOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND (IGHSTO(IGH) OR IGHSTOS(IGH)))= +IOF0001*GKFX(Y,IA,IGH) +; + +** ENDOGENOUS HEAT STORAGE ACCUMULATED INVESTMENTS +G_STO_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'ENDOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND (IGHSTO(IGH) OR IGHSTOS(IGH)))= +IOF0001*VGKNACCUMNET.L(Y,IA,IGH) +; + +** ENDOGENOUS HEAT STORAGE ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_STO_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'DECOMMISSIONING','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGH) AND (IGHSTO(IGH) OR IGHSTOS(IGH)))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH) +; + +* ------------- END OF HEAT STORAGE -------------- + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_STORAGE +* ------------- HYDROGEN STORAGE -------------- + +** EXOGENOUS HYDROGEN STORAGE + +G_STO_YCRAF(Y,C,IR,IA,IHYDROGEN_GH2STO,FFF,'HYDROGEN',TECH_TYPE,'EXOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO) AND IGF(IHYDROGEN_GH2STO,FFF) AND GTECH_TYPE(IHYDROGEN_GH2STO,TECH_TYPE) )= +IOF0001*GKFX(Y,IA,IHYDROGEN_GH2STO) +; + +** ENDOGENOUS HYDROGEN STORAGE ACCUMULATED INVESTMENTS +G_STO_YCRAF(Y,C,IR,IA,IHYDROGEN_GH2STO,FFF,'HYDROGEN',TECH_TYPE,'ENDOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO) AND IGF(IHYDROGEN_GH2STO,FFF) AND GTECH_TYPE(IHYDROGEN_GH2STO,TECH_TYPE))= +IOF0001*VGKNACCUMNET.L(Y,IA,IHYDROGEN_GH2STO) +; + +** ENDOGENOUS HYDROGEN STORAGE ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_STO_YCRAF(Y,C,IR,IA,IHYDROGEN_GH2STO,FFF,'HYDROGEN',TECH_TYPE,'DECOMMISSIONING','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO) AND IGF(IHYDROGEN_GH2STO,FFF) AND GTECH_TYPE(IHYDROGEN_GH2STO,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IHYDROGEN_GH2STO))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IHYDROGEN_GH2STO) +; +* ------------- END OF HYDROGEN STORAGE -------------- +$label NO_HYDROGEN_STORAGE + +* ---------------- END OF ENERGY STORAGE ----------------- + + +* -------------------- ENERGY PRODUCTION --------------------- + +** ELECTRICITY PRODUCTION HOURLY +PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE))= + VGE_T.L(Y,IA,IGE,S,T); + +** ELECTRICITY PRODUCTION ANNUALLY +PRO_YCRAGF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'TWh')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE))= + SUM((S,T),IHOURSINST(S,T)*VGE_T.L(Y,IA,IGE,S,T)*IHOURFRAC)/IOF1000000; + +** HEAT PRODUCTION HOURLY +PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= + VGH_T.L(Y,IA,IGH,S,T); + +** HEAT PRODUCTION ANNUALY +PRO_YCRAGF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= + SUM((S,T),IHOURSINST(S,T)*VGH_T.L(Y,IA,IGH,S,T)*IHOURFRAC)/IOF1000000; + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_PRODUCTION +** HYDROGEN PRODUCTION HOURLY +PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'HYDROGEN',TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G) )= + +(VGE_T.L(Y,IA,G,S,T)*GDATA(G,'GDFE'))$IHYDROGEN_GETOH2(G) + +(VGE_T.L(Y,IA,G,S,T)*GDATA(G,'GDFE'))$IHYDROGEN_GETOHH2(G) + +(VGE_T.L(Y,IA,G,S,T)*GDATA(G,'GDFE'))$IHYDROGEN_GEHTOH2(G) + +(VHYDROGEN_GH2_T.L(Y,IA,G,S,T))$(IHYDROGEN_GCH4TOH2(G) OR IHYDROGEN_GH2STO(G)) +; + +** HYDROGEN PRODUCTION ANNUALY +PRO_YCRAGF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G))= + SUM((S,T),IHOURSINST(S,T)*PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'HYDROGEN',TECH_TYPE,'MWh')*IHOURFRAC)/IOF1000000 +; + +** BIOMETHANE PRODUCTION HOURLY +PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'BIOMETHANE',TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= + VGBIOMETH_T.L(Y,IA,G,S,T)$IHYDROGEN_GH2TOBIOMETH(G) + + VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)$IHYDROGEN_GBIOGASMETHANATION(G) + +VGBIOGASUPGRADING_T.L(Y,IA,G,S,T)$IHYDROGEN_GBIOGASUPGRADING(G) +; + +** BIOMETHANE PRODUCTION ANNUALY +PRO_YCRAGF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= + SUM((S,T),IHOURSINST(S,T)*PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'BIOMETHANE',TECH_TYPE,'MWh')*IHOURFRAC)/IOF1000000 +; +$label NO_HYDROGEN_PRODUCTION + +* ---------------- END OF ENERGY PRODUCTION ----------------- + + +* -------------------- FUEL CONSUMPTION --------------------- + +** HOURLY FUEL CONSUMPTION +F_CONS_YCRAST(Y,C,IR,IA,G,FFF,S,T,TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= + VGF_T.L(Y,IA,G,S,T); + +** ANNUAL FUEL CONSUMPTION +F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= + SUM((S,T),IHOURSINST(S,T)*VGF_T.L(Y,IA,G,S,T)*IHOURFRAC)/IOF1000000; + + +* ---------------- END OF FUEL CONSUMPTION ----------------- + +* ---------------- ENERGY CURTAILMENT ----------------------- +*HOURLY CURTAILMENT +CURT_YCRAGFST(Y,C,IR,IA,IGHYRR,FFF,S,T,'ELECTRICITY','HYDRO-RUN-OF-RIVER','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGHYRR) AND IGF(IGHYRR,FFF) AND GTECH_TYPE(IGHYRR,'HYDRO-RUN-OF-RIVER'))= +(WTRRRFLH(IA) * ( + GKFX(Y,IA,IGHYRR) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGHYRR) + + VGKNACCUMNET.L(Y,IA,IGHYRR) + ) * WTRRRVAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGHYRR,S,T)) + IGKRATE(IA,IGHYRR,S,T))) / IWTRRRSUM(IA) +-VGE_T.L(Y,IA,IGHYRR,S,T); + +CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-ON','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-ON'))= +$ifi %WNDFLH_DOL%==AAA (WNDFLH(IA) * ( +$ifi %WNDFLH_DOL%==AAA_GGG (WNDFLH(IA,IGWND) * ( + GKFX(Y,IA,IGWND) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGWND) + + VGKNACCUMNET.L(Y,IA,IGWND) + ) * WND_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGWND,S,T)) + IGKRATE(IA,IGWND,S,T))) / IWND_SUMST(IA) +-VGE_T.L(Y,IA,IGWND,S,T); + +CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-OFF','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-OFF'))= +$ifi %WNDFLH_DOL%==AAA (WNDFLH(IA) * ( +$ifi %WNDFLH_DOL%==AAA_GGG (WNDFLH(IA,IGWND) * ( + GKFX(Y,IA,IGWND) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGWND) + + VGKNACCUMNET.L(Y,IA,IGWND) + ) * WND_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGWND,S,T)) + IGKRATE(IA,IGWND,S,T))) / IWND_SUMST(IA) +-VGE_T.L(Y,IA,IGWND,S,T); + +CURT_YCRAGFST(Y,C,IR,IA,IGSOLE,FFF,S,T,'ELECTRICITY','SOLAR-PV','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLE) AND IGF(IGSOLE,FFF) AND GTECH_TYPE(IGSOLE,'SOLAR-PV'))= +$ifi %SOLEFLH_DOL%==AAA (SOLEFLH(IA) * ( +$ifi %SOLEFLH_DOL%==AAA_GGG (SOLEFLH(IA,IGSOLE) * ( + GKFX(Y,IA,IGSOLE) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGSOLE) + + VGKNACCUMNET.L(Y,IA,IGSOLE) + ) * SOLE_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGSOLE,S,T)) + IGKRATE(IA,IGSOLE,S,T))) / ISOLESUMST(IA) +-VGE_T.L(Y,IA,IGSOLE,S,T); + +CURT_YCRAGFST(Y,C,IR,IA,IGSOLH,FFF,S,T,'HEAT','SOLAR-HEATING','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLH) AND IGF(IGSOLH,FFF) AND GTECH_TYPE(IGSOLH,'SOLAR-HEATING'))= +$ifi %SOLHFLH_DOL%==AAA (SOLHFLH(IA) * ( +$ifi %SOLHFLH_DOL%==AAA_GGG (SOLHFLH(IA,IGSOLH) * ( + GKFX(Y,IA,IGSOLH) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGSOLH) + + VGKNACCUMNET.L(Y,IA,IGSOLH) + ) * SOLH_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGSOLH,S,T)) + IGKRATE(IA,IGSOLH,S,T))) / ISOLHSUMST(IA) +-VGH_T.L(Y,IA,IGSOLH,S,T); + + +*ANNUAL CURTAILMENT +CURT_YCRAGF(Y,C,IR,IA,IGHYRR,FFF,'ELECTRICITY','HYDRO-RUN-OF-RIVER','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGHYRR) AND IGF(IGHYRR,FFF) AND GTECH_TYPE(IGHYRR,'HYDRO-RUN-OF-RIVER'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGHYRR,FFF,S,T,'ELECTRICITY','HYDRO-RUN-OF-RIVER','MWh')*IHOURFRAC)/IOF1000000 +; +CURT_YCRAGF(Y,C,IR,IA,IGWND,FFF,'ELECTRICITY','WIND-ON','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-ON'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-ON','MWh')*IHOURFRAC)/IOF1000000 +; +CURT_YCRAGF(Y,C,IR,IA,IGWND,FFF,'ELECTRICITY','WIND-OFF','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-OFF'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-OFF','MWh')*IHOURFRAC)/IOF1000000 +; +CURT_YCRAGF(Y,C,IR,IA,IGSOLE,FFF,'ELECTRICITY','SOLAR-PV','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLE) AND IGF(IGSOLE,FFF) AND GTECH_TYPE(IGSOLE,'SOLAR-PV'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGSOLE,FFF,S,T,'ELECTRICITY','SOLAR-PV','MWh')*IHOURFRAC)/IOF1000000 +; +CURT_YCRAGF(Y,C,IR,IA,IGSOLH,FFF,'HEAT','SOLAR-HEATING','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLH) AND IGF(IGSOLH,FFF) AND GTECH_TYPE(IGSOLH,'SOLAR-HEATING'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGSOLH,FFF,S,T,'HEAT','SOLAR-HEATING','MWh')*IHOURFRAC)/IOF1000000 +; + +*Curtailment of hydro reservoirs should be analyzed by aggregating the technology set +CURT_YCRAGF(Y,C,IR,IA,IGHYRS,FFF,'ELECTRICITY','HYDRO-RESERVOIRS','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGHYRS) AND IGF(IGHYRS,FFF) AND GTECH_TYPE(IGHYRS,'HYDRO-RESERVOIRS'))= +SUM(S, + IHYINF_S(IA,S) * + ( + GKFX(Y,IA,IGHYRS) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGHYRS) + +VGKNACCUMNET.L(Y,IA,IGHYRS) + ) + -SUM(T,IHYRST(S,T)*VGE_T.L(Y,IA,IGHYRS,S,T)) + )/IOF1000000*IHOURFRAC +; + + +* ---------------- END OF ENERGY CURTAILMENT ----------------------- + +* ------------------------- ENERGY DEMAND ---------------------- + +* ------------- ELECTRICITY DEMAND -------------- + +*HOURLY +** EXOGENOUS DEMAND + +EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR) AND SUM(DEUSER,IDE_SUMST(IR,DEUSER)))= +SUM((DEUSER)$IDE_SUMST(IR,DEUSER), DE(Y,IR,DEUSER) * DE_VAR_T(IR,DEUSER,S,T) / IDE_SUMST(IR,DEUSER)) + +$ifi not %DEMANDRESPONSE%==yes $goto NO_DEMANDRESPONSE +* Downward regulation for DR shed technologies: +- SUM(IADR(Y,IA,DR_TECH_SHED)$(RRRAAA(IR,IA) AND CCCRRR(C,IR)), VDR_DOWN.L(Y,IA,DR_TECH_SHED,S,T)) +* Balance between upward and downward regulation for DR shift technologies: +*TODO - efficiency +- SUM(IADR(Y,IA,DR_TECH_SHIFT)$(RRRAAA(IR,IA) AND CCCRRR(C,IR)), VDR_DOWN.L(Y,IA,DR_TECH_SHIFT,S,T)) + SUM(IADR(Y,IA,DR_TECH_SHIFT)$(RRRAAA(IR,IA) AND CCCRRR(C,IR)), VDR_UP.L(Y,IA,DR_TECH_SHIFT,S,T)) +$label NO_DEMANDRESPONSE +; + +** ENDOGENOUS DEMAND + +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDOGENOUS_ELECT2HEAT','MWh')$CCCRRR(C,IR)= +* P2H CONSUMPTION + SUM(IA$RRRAAA(IR,IA), SUM(IGETOH$IAGK_HASORPOT(Y,IA,IGETOH), VGE_T.L(Y,IA,IGETOH,S,T))) +; + +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTRASTO','MWh')$CCCRRR(C,IR)= +* INTRASEASONAL ELECTRICITY STORAGE +$ifi not %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADT.L(Y,IA,IGESTO,S,T))) +$ifi %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADTS.L(Y,IA,IGESTO,S,T))) +; + +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTERSTO','MWh')$CCCRRR(C,IR)= +* INTERSEASONAL ELECTRICITY STORAGE + +SUM(IA$RRRAAA(IR,IA),SUM(IGESTOS$IAGK_HASORPOT(Y,IA,IGESTOS),VESTOLOADTS.L(Y,IA,IGESTOS,S,T))) +; + +$ifi not %EV%==yes $goto NO_EV +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_EV','MWh')$CCCRRR(C,IR)= + + VEV_VG2V_BEV.L(Y,IR,S,T) + + VEV_VG2V_PHEV.L(Y,IR,S,T) +$ifi %V2G%==yes - VEV_VV2G_BEV.L(Y,IR,S,T) +$ifi %V2G%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T) +$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_BEV.L(Y,IR,S,T)$(cs('v2g',IY411)) +$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T)$(cs('v2g',IY411)) +; +$label NO_EV + +$ifi %TRANSPORT%==yes EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')$CCCRRR(C,IR)= +$ifi %TRANSPORT%==yes $ifi %TRANSPORT_SYNTHFUEL_COMMODITY%==ELECTRICITY +VTRANSDEMAND_T.L(Y,IR,S,T) +$ifi %TRANSPORT%==yes +0; + +$ifi %CCS%==yes EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_CCS','MWh')$CCCRRR(C,IR)= +$ifi %CCS%==yes SUM((IA,G)$(IAGK_HASORPOT(Y,IA,G) AND RRRAAA(IR,IA) AND CCS_G(G)),VGF_T.L(Y,IA,G,S,T) * IM_CO2(G)*IOF0001 * IOF3P6 * CCS_CO2CAPTEFF_G(G)* CCS_DECO2COMP_G(G)); + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_H2','MWh')$CCCRRR(C,IR)= ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOH2,S,T)) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOHH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOHH2,S,T)) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GEHTOH2,S,T)) +; + +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')$CCCRRR(C,IR)= +*Adding electricity consumption from BIOMETHANE-DAC generation ++ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)*DAC_DE(IHYDROGEN_GH2TOBIOMETH)) +*Adding electricity consumption from biogas upgrading generation ++ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASUPGRADING)$(RRRAAA(IR,IA)),VGBIOGASUPGRADING_T.L(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)*BIOGASUPGRADING_DE(IHYDROGEN_GBIOGASUPGRADING)) +*Adding electricity consumption from biogas methanation generation ++ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASMETHANATION)$(RRRAAA(IR,IA)),VGBIOGASMETHANATION_T.L(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)*METHANATION_DE(IHYDROGEN_GBIOGASMETHANATION)) +; +$label NO_HYDROGEN_DEMAND + + +**LOSSES +EL_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')$CCCRRR(C,IR)= +* EXOGENOUS DEMAND +EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')*DISLOSS_E(IR)/(1-DISLOSS_E(IR)) +* P2H CONSUMPTION ++SUM(IA$RRRAAA(IR,IA), SUM(IGETOH$IAGK_HASORPOT(Y,IA,IGETOH), VGE_T.L(Y,IA,IGETOH,S,T)*DISLOSS_E_AG(IA,IGETOH)/(1-DISLOSS_E_AG(IA,IGETOH)))) +* INTRASEASONAL ELECTRICITY STORAGE +$ifi not %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADT.L(Y,IA,IGESTO,S,T)*DISLOSS_E_AG(IA,IGESTO)/(1-DISLOSS_E_AG(IA,IGESTO)))) +$ifi %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADTS.L(Y,IA,IGESTO,S,T)*DISLOSS_E_AG(IA,IGESTO)/(1-DISLOSS_E_AG(IA,IGESTO)))) +* INTERSEASONAL ELECTRICITY STORAGE ++SUM(IA$RRRAAA(IR,IA),SUM(IGESTOS$IAGK_HASORPOT(Y,IA,IGESTOS),VESTOLOADT.L(Y,IA,IGESTOS,S,T)*DISLOSS_E_AG(IA,IGESTOS)/(1-DISLOSS_E_AG(IA,IGESTOS)))) +* EVs +$ifi not %EV%==yes $goto NO_EV2 + +( + + VEV_VG2V_BEV.L(Y,IR,S,T) + + VEV_VG2V_PHEV.L(Y,IR,S,T) + )*EV_DISTLOSSLOAD(IR)/(1-EV_DISTLOSSLOAD(IR)) + +( +$ifi %V2G%==yes - VEV_VV2G_BEV.L(Y,IR,S,T) +$ifi %V2G%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T) +$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_BEV.L(Y,IR,S,T)$(cs('v2g',IY411)) +$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T)$(cs('v2g',IY411)) + +0)*EV_DISTLOSSUNLOAD(IR)/(1-EV_DISTLOSSUNLOAD(IR)) +$label NO_EV2 +*CCS +$ifi %CCS%==yes +SUM((IA,G)$(IAGK_HASORPOT(Y,IA,G) AND RRRAAA(IR,IA) AND CCS_G(G)),VGF_T.L(Y,IA,G,S,T) * IM_CO2(G)*IOF0001 * IOF3P6 * CCS_CO2CAPTEFF_G(G)* CCS_DECO2COMP_G(G)*DISLOSS_E_AG(IA,G)/(1-DISLOSS_E_AG(IA,G))) + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND2 ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOH2,S,T)*DISLOSS_E_AG(IA,IHYDROGEN_GETOH2)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GETOH2))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOHH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOHH2,S,T)*DISLOSS_E_AG(IA,IHYDROGEN_GETOHH2)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GETOHH2))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GEHTOH2,S,T)*DISLOSS_E_AG(IA,IHYDROGEN_GEHTOH2)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GEHTOH2))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)*DAC_DE(IHYDROGEN_GH2TOBIOMETH)*DISLOSS_E_AG(IA,IHYDROGEN_GH2TOBIOMETH)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GH2TOBIOMETH))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASUPGRADING)$(RRRAAA(IR,IA)),VGBIOGASUPGRADING_T.L(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)*BIOGASUPGRADING_DE(IHYDROGEN_GBIOGASUPGRADING)*DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASUPGRADING)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASUPGRADING))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASMETHANATION)$(RRRAAA(IR,IA)),VGBIOGASMETHANATION_T.L(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)*METHANATION_DE(IHYDROGEN_GBIOGASMETHANATION)*DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASMETHANATION)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASMETHANATION))) +$label NO_HYDROGEN_DEMAND2 + +*PRODUCTION SIDE ++SUM((IGE,IA,FFF,TECH_TYPE)$((NOT IGETOH(IGE)) AND RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh')*DISLOSS_E_AG(IA,IGE)) +; + +EL_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')$CCCRRR(C,IR)= +*TRANSMISSION LOSSES ++SUM(IRE$IXK_HASORPOT(Y,IRE,IR),VX_T.L(Y,IRE,IR,S,T)*XLOSS(IRE,IR)); + + +*ANNUAL DEMAND +** EXOGENOUS DEMAND + +EL_DEMAND_YCR(Y,C,IR,'EXOGENOUS','TWh')$(CCCRRR(C,IR) AND SUM(DEUSER,IDE_SUMST(IR,DEUSER)))= +SUM((DEUSER,S,T)$IDE_SUMST(IR,DEUSER), IHOURSINST(S,T)*IHOURFRAC*DE(Y,IR,DEUSER) * DE_VAR_T(IR,DEUSER,S,T) / IDE_SUMST(IR,DEUSER))/IOF1000000; + +** ENDOGENOUS DEMAND + +EL_DEMAND_YCR(Y,C,IR,'ENDOGENOUS_ELECT2HEAT','TWh')$CCCRRR(C,IR)= +* HEAT PUMPS CONSUMPTION + SUM((S,T,IA)$RRRAAA(IR,IA), SUM(IGETOH$IAGK_HASORPOT(Y,IA,IGETOH), IHOURSINST(S,T)*IHOURFRAC*VGE_T.L(Y,IA,IGETOH,S,T)))/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_INTRASTO','TWh')$CCCRRR(C,IR)= +* INTRASEASONAL ELECTRICITY STORAGE LOSS +$ifi not %stointers%==all +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),IHOURSINST(S,T)*IHOURFRAC*(VESTOLOADT.L(Y,IA,IGESTO,S,T)-VGE_T.L(Y,IA,IGESTO,S,T))))/IOF1000000 +$ifi %stointers%==all +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),IHOURSINST(S,T)*IHOURFRAC*(VESTOLOADTS.L(Y,IA,IGESTO,S,T)-VGE_T.L(Y,IA,IGESTO,S,T))))/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_INTERSTO','TWh')$CCCRRR(C,IR)= +* INTERSEASONAL ELECTRICITY STORAGE LOSS + +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IGESTOS$IAGK_HASORPOT(Y,IA,IGESTOS),IHOURSINST(S,T)*IHOURFRAC*(VESTOLOADTS.L(Y,IA,IGESTOS,S,T)-VGE_T.L(Y,IA,IGESTOS,S,T))))/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_EV','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_EV','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_OTHERTRANS','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'DIST_LOSSES','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'TRANS_LOSSES','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_CCS','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_CCS','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_H2','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_H2','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_BIOMETHANE','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')*IHOURFRAC)/IOF1000000 +; + +* ----------- END OF ELECTRICITY DEMAND -------------- + +* ------------- HEAT DEMAND -------------- +*HOURLY DEMAND +** EXOGENOUS DEMAND + +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER,IDH_SUMST(IA,DHUSER)))= +SUM((DHUSER)$IDH_SUMST(IA,DHUSER), DH(Y,IA,DHUSER) * DH_VAR_T(IA,DHUSER,S,T) / IDH_SUMST(IA,DHUSER)) + +$ifi not %INDIVUSERS%==yes $goto NO_INDIVUSERSGROUP +$ifi not %GROUP_DEMAND_SHIFT%==yes $goto NO_INDIVUSERSGROUP ++ ( +*Removing default demand + -SUM((DHUSER)$IDH_SUMST(IA,DHUSER), DH(Y,IA,DHUSER) * DH_VAR_T(IA,DHUSER,S,T) / IDH_SUMST(IA,DHUSER)) +*Introducing new allocated demand + +SUM((INDIVUSERS_GROUP,DHUSER)$INDIVUSERS_GROUP_A(IA,DHUSER,INDIVUSERS_GROUP), + VINDIVUSERS_GROUPSHARE.L(Y,IR,DHUSER,INDIVUSERS_GROUP)* DH_VAR_T(IA,DHUSER,S,T)/ IDH_SUMST(IA,DHUSER) + )*SUM((INDIVUSERS_DEMANDTYPE,DHUSER)$INDIVUSERS_DEMANDTYPE_A(IA,DHUSER,INDIVUSERS_DEMANDTYPE), + SUM(IAI$(RRRAAA(IR,IAI) AND INDIVUSERS_DEMANDTYPE_A(IAI,DHUSER,INDIVUSERS_DEMANDTYPE)), DH(Y,IAI,DHUSER)) + ) + )$(INDIVUSERS_AAA(IA) + AND SUM((INDIVUSERS_GROUP,DHUSER),INDIVUSERS_GROUP_A(IA,DHUSER,INDIVUSERS_GROUP)) + AND SUM((INDIVUSERS_DEMANDTYPE,DHUSER),INDIVUSERS_DEMANDTYPE_A(IA,DHUSER,INDIVUSERS_DEMANDTYPE))) +$label NO_INDIVUSERSGROUP +; + +** ENDOGENOUS DEMAND + +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTRASTO','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +* INTRASEASONAL HEAT STORAGE +$ifi not %stointers%==all SUM(IGHSTO$IAGK_HASORPOT(Y,IA,IGHSTO),VHSTOLOADT.L(Y,IA,IGHSTO,S,T)) +$ifi %stointers%==all SUM(IGHSTO$IAGK_HASORPOT(Y,IA,IGHSTO),VHSTOLOADTS.L(Y,IA,IGHSTO,S,T)) + +; + +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTERSTO','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +* INTERSEASONAL HEAT STORAGE + + SUM(IGHSTOS$IAGK_HASORPOT(Y,IA,IGHSTOS),VHSTOLOADTS.L(Y,IA,IGHSTOS,S,T)) +; + +**LOSSES +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'DIST_LOSSES','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +* EXOGENOUS DEMAND +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh')*DISLOSS_H(IA)/(1-DISLOSS_H(IA)) +; + +$ifi %HEATTRANS%==yes H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'TRANS_LOSSES','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +$ifi %HEATTRANS%==yes *TRANSMISSION LOSSES +$ifi %HEATTRANS%==yes +SUM(IAE$IXHK_HASORPOT(Y,IAE,IA),VXH_T.L(Y,IAE,IA,S,T)*XHLOSS(IAE,IA)); +$ifi %HEATTRANS%==yes ; + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND3 +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_H2','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGH_T.L(Y,IA,IHYDROGEN_GEHTOH2,S,T)) +; + +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_BIOMETHANE','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= ++ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)*DAC_DH(IHYDROGEN_GH2TOBIOMETH)) +; +$label NO_HYDROGEN_DEMAND3 + + +*ANNUAL DEMAND +** EXOGENOUS DEMAND + +H_DEMAND_YCRA(Y,C,IR,IA,'EXOGENOUS','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER,IDH_SUMST(IA,DHUSER)))= +SUM((S,T),IHOURSINST(S,T)*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh')*IHOURFRAC)/IOF1000000; +; + +** ENDOGENOUS DEMAND +H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_INTRASTO','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +* INTRASEASONAL HEAT STORAGE LOSS +$ifi not %stointers%==all SUM((S,T,IGHSTO)$IAGK_HASORPOT(Y,IA,IGHSTO),IHOURSINST(S,T)*IHOURFRAC*(VHSTOLOADT.L(Y,IA,IGHSTO,S,T)-VGH_T.L(Y,IA,IGHSTO,S,T)))/IOF1000000 +$ifi %stointers%==all SUM((S,T,IGHSTO)$IAGK_HASORPOT(Y,IA,IGHSTO),IHOURSINST(S,T)*IHOURFRAC*(VHSTOLOADTS.L(Y,IA,IGHSTO,S,T)-VGH_T.L(Y,IA,IGHSTO,S,T)))/IOF1000000 + +; + +H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_INTERSTO','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + +* INTERSEASONAL HEAT STORAGE LOSS + + SUM((S,T,IGHSTOS)$IAGK_HASORPOT(Y,IA,IGHSTOS),IHOURSINST(S,T)*IHOURFRAC*(VHSTOLOADTS.L(Y,IA,IGHSTOS,S,T)-VGH_T.L(Y,IA,IGHSTOS,S,T)))/IOF1000000 +; + +H_DEMAND_YCRA(Y,C,IR,IA,'DIST_LOSSES','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'DIST_LOSSES','MWh'))/IOF1000000 +; + +H_DEMAND_YCRA(Y,C,IR,IA,'TRANS_LOSSES','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'TRANS_LOSSES','MWh'))/IOF1000000 +; + +H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_H2','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_H2','MWh'))/IOF1000000 +; + +H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_BIOMETHANE','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_BIOMETHANE','MWh'))/IOF1000000 +; +* ----------- END OF HEAT DEMAND -------------- + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND30 +* ------------- H2 DEMAND -------------- + +*HOURLY +** EXOGENOUS DEMAND + +H2_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR))= + IHYDROGEN_DH2_REGION_T_Y(Y,IR,S,T)+ + SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(Y,IA,S,T)) +; + +H2_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')$CCCRRR(C,IR)= + IHYDROGEN_DH2_REGION_T_Y(Y,IR,S,T)*DISLOSS_H2(IR)/(1-DISLOSS_H2(IR))+ + SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(Y,IA,S,T)*DISLOSS_H2(IA)/(1-DISLOSS_H2(IA))) +; + +** ENDOGENOUS DEMAND + +H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTERSTO','MWh')$CCCRRR(C,IR)= +* INTERSEASONAL H2 STORAGE + +SUM(IA$RRRAAA(IR,IA),SUM(IHYDROGEN_GH2STO$IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO),VHYDROGEN_STOLOADT.L(Y,IA,IHYDROGEN_GH2STO,S,T))) +; + +$ifi %TRANSPORT%==yes H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')$CCCRRR(C,IR)= +$ifi %TRANSPORT%==yes $ifi %TRANSPORT_SYNTHFUEL_COMMODITY%==HYDROGEN +VTRANSDEMAND_T.L(Y,IR,S,T) +$ifi %TRANSPORT%==yes +0; + + +H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_FUELCELL','MWh')$CCCRRR(C,IR)= +*Adding H2 consumption from FUELCELLS generation ++ SUM(IAGK_HASORPOT(Y,IA,G)$(RRRAAA(IR,IA) AND GTECH_TYPE(G,'FUELCELL')),VGF_T.L(Y,IA,G,S,T)) +; + +H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')$CCCRRR(C,IR)= +*Adding H2 consumption from BIOMETHANE-DAC generation ++ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)/GDATA(IHYDROGEN_GH2TOBIOMETH,'GDFE')) +*Adding H2 consumption from biogas methanation generation ++ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASMETHANATION)$(RRRAAA(IR,IA)),VGBIOGASMETHANATION_T.L(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)*METHANATION_DH2(IHYDROGEN_GBIOGASMETHANATION)) + +; + + +**LOSSES + +H2_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')$CCCRRR(C,IR)= +*TRANSMISSION LOSSES ++SUM(IRE$IXH2K_HASORPOT(Y,IRE,IR),VXH2_T.L(Y,IRE,IR,S,T)*XH2LOSS(IRE,IR)); + + +*ANNUAL DEMAND +** EXOGENOUS DEMAND + +H2_DEMAND_YCR(Y,C,IR,'EXOGENOUS','TWh')$(CCCRRR(C,IR))= +SUM((S,T), IHOURSINST(S,T)*IHOURFRAC*H2_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh'))/IOF1000000; + +** ENDOGENOUS DEMAND + +H2_DEMAND_YCR(Y,C,IR,'ENDO_INTERSTO','TWh')$CCCRRR(C,IR)= +* INTERSEASONAL H2 STORAGE LOSS + +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IHYDROGEN_GH2STO$IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO),IHOURSINST(S,T)*IHOURFRAC*(VHYDROGEN_STOLOADT.L(Y,IA,IHYDROGEN_GH2STO,S,T)-VHYDROGEN_GH2_T.L(Y,IA,IHYDROGEN_GH2STO,S,T))))/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'ENDO_FUELCELL','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_FUELCELL','MWh')*IHOURFRAC)/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'ENDO_OTHERTRANS','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')*IHOURFRAC)/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'TRANS_LOSSES','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')*IHOURFRAC)/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'DIST_LOSSES','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')*IHOURFRAC)/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'ENDO_BIOMETHANE','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')*IHOURFRAC)/IOF1000000 +; + +* ----------- END OF H2 DEMAND -------------- +$label NO_HYDROGEN_DEMAND30 + +* -------------------- END OF ENERGY DEMAND ----------------------- + + +* -------------------- TRANSMISSION CAPACITY ----------------------- + +** EXOGENOUS ELECTRICITY CAPACITY + +X_CAP_YCR(Y,C,IR,IRI,'EXOGENOUS','GW')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +IOF0001*XKFX(Y,IR,IRI) +; + + +** ENDOGENOUS ELECTRIC CAPACITY + +$ifi not %TransInvest%==yes $goto Transmission_investments_end +X_CAP_YCR(Y,C,IR,IRI,'ENDOGENOUS','GW')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +IOF0001*VXKNACCUMNET.L(Y,IR,IRI) +; +$label Transmission_investments_end + + +* -------------------- END OF TRANSMISSION CAPACITY ----------------------- + +* -------------------- TRANSMISSION FLOW ----------------------- + +** HOURLY TRANSMISSION FLOW + +X_FLOW_YCRST(Y,C,IR,IRI,S,T,'MWh')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +VX_T.L(Y,IR,IRI,S,T); +; + + +** ANNUAL TRANSMISSION FLOW +X_FLOW_YCR(Y,C,IR,IRI,'TWh')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*VX_T.L(Y,IR,IRI,S,T))/IOF1000000; +; + + + +* -------------------- END OF TRANSMISSION FLOW ----------------------- + +$ifi NOT %HEATTRANS%==yes $goto no_heattrans +* -------------------- HEAT TRANSMISSION CAPACITY ----------------------- + +** EXOGENOUS HEAT TRANSMISSION CAPACITY + +XH_CAP_YCA(Y,C,IA,IAI,'EXOGENOUS','GW')$(ICA(C,IA) AND (XHKFX(Y,IA,IAI) OR XHKFX_DH(Y,IA,IAI)))= +IOF0001*(XHKFX(Y,IA,IAI) + XHKFX_DH(Y,IA,IAI)) +; + +** ENDOGENOUS HEAT TRANSMISSION CAPACITY + +$ifi not %HeatTransInvest%==yes $goto Heat_Transmission_investments_end +XH_CAP_YCA(Y,C,IA,IAI,'ENDOGENOUS','GW')$(ICA(C,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +IOF0001*VXHKNACCUMNET.L(Y,IA,IAI) +; +$label Heat_Transmission_investments_end + + +* -------------------- END OF HEAT TRANSMISSION CAPACITY ----------------------- + +* -------------------- HEAT TRANSMISSION FLOW ----------------------- + +** HOURLY HEAT TRANSMISSION FLOW + +XH_FLOW_YCAST(Y,C,IA,IAI,S,T,'MWh')$(ICA(C,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +VXH_T.L(Y,IA,IAI,S,T); +; + +** ANNUAL HEAT TRANSMISSION FLOW +XH_FLOW_YCA(Y,C,IA,IAI,'TWh')$(ICA(C,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*VXH_T.L(Y,IA,IAI,S,T))/IOF1000000; +; + +* -------------------- END OF HEAT TRANSMISSION FLOW ----------------------- +$label no_heattrans + + +$ifi NOT %hydrogen%==yes $goto no_hydrogentrans +* -------------------- H2 TRANSMISSION CAPACITY ----------------------- + +** EXOGENOUS H2 TRANSMISSION CAPACITY + +XH2_CAP_YCR(Y,C,IR,IRI,'EXOGENOUS','GW')$(CCCRRR(C,IR) AND XH2KFX(Y,IR,IRI))= +IOF0001*XH2KFX(Y,IR,IRI) +; + +** ENDOGENOUS H2 TRANSMISSION CAPACITY + +$ifi not %H2TransInvest%==yes $goto H2_Transmission_investments_end +XH2_CAP_YCR(Y,C,IR,IRI,'ENDOGENOUS','GW')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +IOF0001*(VXH2KNACCUMNET.L(Y,IR,IRI)$SUM(IYALIAS2$(YVALUE(IYALIAS2) LE YVALUE(Y)),IXH2KN(IYALIAS2,IR,IRI)) + +VXH2KNACCUMNET_NGTOH2.L(Y,IR,IRI)$SUM(IYALIAS2$(YVALUE(IYALIAS2) LE YVALUE(Y)),IXH2KN_NGTOH2(IYALIAS2,IR,IRI))) +; +$label H2_Transmission_investments_end + + +* -------------------- END OF HEAT TRANSMISSION CAPACITY ----------------------- + +* -------------------- H2 TRANSMISSION FLOW ----------------------- + +** HOURLY H2 TRANSMISSION FLOW + +XH2_FLOW_YCRST(Y,C,IR,IRI,S,T,'MWh')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +VXH2_T.L(Y,IR,IRI,S,T); +; + +** ANNUAL H2 TRANSMISSION FLOW +XH2_FLOW_YCR(Y,C,IR,IRI,'TWh')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*VXH2_T.L(Y,IR,IRI,S,T))/IOF1000000; +; + +* -------------------- END OF H2 TRANSMISSION FLOW ----------------------- +$label no_hydrogentrans + +* ---------------------- ECONOMIC OUTPUT ---------------------- + +* ------------- COMMODITY PRICES -------------- + +** ELECTRICITY PRICES + +*HOURLY ELECTRICITY PRICE + +EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')$CCCRRR(C,IR)=OMONEY*QEEQ.M(Y,IR,S,T) +$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) +$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) +/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); + +*AVERAGE ELECTRICITY PRICE + +EL_PRICE_YCR(Y,C,IR,'AVERAGE','Money_per_MWh')$CCCRRR(C,IR)= +SUM((S,T),EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')/(IWEIGHSUMS*IWEIGHSUMT/(WEIGHT_S(S)*WEIGHT_T(T)))); + +$ontext +*EXCLUDED SO FAR +*AVERAGE ELECTRICITY PRICE WEIGTHED BY CONSUMPTION + +EL_PRICE_YCR(Y,C,IR,'AVERAGE_WEIGHTED_BY_CONSUMPTION','Money_per_MWh')$CCCRRR(C,IR)= + SUM((VARIABLE_CATEGORY,S,T), + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*EL_DEMAND_YCRST(Y,C,IR,S,T,VARIABLE_CATEGORY,'MWh') + ) + /SUM((VARIABLE_CATEGORY,S,T),EL_DEMAND_YCRST(Y,C,IR,S,T,VARIABLE_CATEGORY,'MWh')) +; + +*AVERAGE ELECTRICITY PRICE WEIGTHED BY PRODUCTION + +EL_PRICE_YCR(Y,C,IR,'AVERAGE_WEIGHTED_BY_PRODUCTION','Money_per_MWh')$CCCRRR(C,IR)= + SUM((IGE,IA,FFF,S,T,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGE)), + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh') + ) + /SUM((IGE,IA,FFF,S,T,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh')) +; +$offtext + +** END OF ELECTRICITY PRICES + +** heatING PRICES + +*HOURLY heatING PRICE + +$ifi %BalancingMarket%==yes $ifi %NOHEATMARKET%==yes $goto NO_HEATMARKET +H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND (SUM(DHUSER, IDH_SUMST(IA,DHUSER)) +$ifi %HEATTRANS%==yes OR SUM(IAE,IXHK_HASORPOT(Y,IAE,IA)) OR SUM(IAI,IXHK_HASORPOT(Y,IA,IAI)) +))=OMONEY*QHEQ.M(Y,IA,S,T) +$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) +$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) +/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); +$label NO_HEATMARKET +$ifi %BalancingMarket%==yes $ifi %NOHEATMARKET%==yes H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=0; + + + +*AVERAGE heatING PRICE + +H_PRICE_YCRA(Y,C,IR,IA,'AVERAGE','Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND (SUM(DHUSER, IDH_SUMST(IA,DHUSER)) +$ifi %HEATTRANS%==yes OR SUM(IAE,IXHK_HASORPOT(Y,IAE,IA)) OR SUM(IAI,IXHK_HASORPOT(Y,IA,IAI)) +))= +SUM((S,T),H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')/(IWEIGHSUMS*IWEIGHSUMT/(WEIGHT_S(S)*WEIGHT_T(T)))); + +$ontext +*EXCLUDED SO FAR +*AVERAGE heatING PRICE WEIGTHED BY CONSUMPTION + +H_PRICE_YCRA(Y,C,IR,IA,'AVERAGE_WEIGHTED_BY_CONSUMPTION','Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER, IDH_SUMST(IA,DHUSER)))= + SUM((VARIABLE_CATEGORY,S,T), + H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,VARIABLE_CATEGORY,'MWh') + ) + /SUM((VARIABLE_CATEGORY,S,T),H_DEMAND_YCRAST(Y,C,IR,IA,S,T,VARIABLE_CATEGORY,'MWh')) +; + +*AVERAGE heatING PRICE WEIGTHED BY PRODUCTION + +H_PRICE_YCRA(Y,C,IR,IA,'AVERAGE_WEIGHTED_BY_PRODUCTION','Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER, IDH_SUMST(IA,DHUSER)))= + SUM((IGH,FFF,S,T,TECH_TYPE)$IAGK_HASORPOT(Y,IA,IGH), + H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh') + ) + /SUM((IGH,FFF,S,T,TECH_TYPE)$IAGK_HASORPOT(Y,IA,IGH),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh')) +; +$offtext + +** END OF heatING PRICES + +$ifi NOT %HYDROGEN%==yes $goto NO_HYDROGEN_PRICE + +*HOURLY HYDROGEN PRICE +H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')$CCCRRR(C,IR)=OMONEY*QHYDROGEN_EQ.M(Y,IR,S,T) +$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) +$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) +/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); + +*HOURLY BIOMETHANE PRICE +BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh')=OMONEY*QBIOMETHANE_EQ.M(Y,S,T) +$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) +$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) +/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); + +$label NO_HYDROGEN_PRICE + +* ------------- END OF COMMODITY PRICES -------------- + + +* ------------- COSTS -------------- + +* -- GENERATION COSTS ----- + +** GENERATION INVESTMENTS + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and RRRAAA(IR,IA))= + OMONEY*( + SUM(IYALIAS2$((ORD(IYALIAS2) LE ORD(Y)) AND IAGKNY(IYALIAS2,IA,G) AND (NOT IGKN_ES(G))),IYHASANNUITYG(IYALIAS2,Y,G)*VGKN.L(IYALIAS2,IA,G)*GINVCOST(IA,G)*ANNUITYCG(C,G)) +$ifi %OFFSHOREGRID%==yes + SUM(IYALIAS2$((ORD(IYALIAS2) LE ORD(Y)) AND IAGKNY(IYALIAS2,IA,G) AND IGKN_ES(G)),IYHASANNUITYG(IYALIAS2,Y,G)*SUM(XES,VGLAMBDA.L(IYALIAS2,IA,G,XES)*GINVCOST_ES(G,XES))*ANNUITYCG(C,G)) +) +; + +** GENEARTION FIXED COSTS + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FIXED_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + OMONEY/IOF1000*GOMFCOST(IA,G)*( + GKFX(Y,IA,G) + +VGKNACCUMNET.L(Y,IA,G) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,G)$IGDECOMEXOPOT(Y,IA,G) + ) +; + +** GENERATION O&M COSTS + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + OMONEY/IOF1000000* + ( + (IHOURFRAC *GOMVCOSTO(IA,G)*( + SUM((S,T), IHOURSINST(S,T) * VGE_T.L(Y,IA,G,S,T))$IGKE(G) +$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VHYDROGEN_GH2_T.L(Y,IA,G,S,T))$(IHYDROGEN_GH2STO(G) OR IHYDROGEN_GCH4TOH2(G)) +$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VGBIOMETH_T.L(Y,IA,G,S,T))$IHYDROGEN_GH2TOBIOMETH(G) +$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T))$IHYDROGEN_GBIOGASMETHANATION(G) +$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VGBIOGASUPGRADING_T.L(Y,IA,G,S,T))$IHYDROGEN_GBIOGASUPGRADING(G) + )) + + (IHOURFRAC *GOMVCOSTO(IA,G) * GDATA(G,'GDCV') * + ( + + SUM((S,T), IHOURSINST(S,T) * VGH_T.L(Y,IA,G,S,T))))$IGKH(G) + + + (IHOURFRAC *GOMVCOSTIN(IA,G)* + ( + + SUM((S,T), IHOURSINST(S,T) * VGF_T.L(Y,IA,G,S,T)))) + ) ; + +** GENERATION FUEL COSTS + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FUEL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + OMONEY/IOF1000000*( + IHOURFRAC *FUELPRICE(Y,IA,FFF)*IOF3P6 +$ifi not %STEPWISEPRICE%==yes $goto No_STEPWISEPRICE + +(QSTEPWISEPRICE_GFTOSTEP.M(Y,C,FFF)/(IDISCOUNTFACTOR(Y)*IWEIGHTY(Y)))$ISTEPWISEPRICE_F(Y,C,FFF) +$label No_STEPWISEPRICE + )* + ( + SUM((S,T), IHOURSINST(S,T) * VGF_T.L(Y,IA,G,S,T) )$IAGK_HASORPOT(Y,IA,G) + )$(IGNOTETOH(G) and (not IGESTO(G)) and (not IGHSTO(G)) and (not IGESTOS(G)) and (not IGHSTOS(G))) + + +* Electricity storages: +$ifi not %stointers%==all +1/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VESTOLOADT.L(Y,IA,G,S,T))$IGESTO(G) +$ifi %stointers%==all +1/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VESTOLOADTS.L(Y,IA,G,S,T))$IGESTO(G) + +1/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VESTOLOADTS.L(Y,IA,G,S,T))$IGESTOS(G) +* Heat storages: +$ifi not %stointers%==all +1/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VHSTOLOADT.L(Y,IA,G,S,T))$IGHSTO(G) +$ifi %stointers%==all +1/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VHSTOLOADTS.L(Y,IA,G,S,T))$IGHSTO(G) + +1/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VHSTOLOADTS.L(Y,IA,G,S,T))$IGHSTOS(G) +* Electricity to heat: + +1/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGE_T.L(Y,IA,G,S,T))$(IAGK_HASORPOT(Y,IA,G) and IGETOH(G)) + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_PRICE2 + +1/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGE_T.L(Y,IA,G,S,T))$(IHYDROGEN_GETOH2(G) OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G)) + +1/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VGH_T.L(Y,IA,G,S,T))$IHYDROGEN_GEHTOH2(G) + +1/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VHYDROGEN_STOLOADT.L(Y,IA,G,S,T))$IHYDROGEN_GH2STO(G) + +1/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGF_T.L(Y,IA,G,S,T))$IHYDROGEN_GH2FUEL(G) + +1/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGF_T.L(Y,IA,G,S,T) + + H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VGBIOMETH_T.L(Y,IA,G,S,T)*DAC_DH(G) + + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOMETH_T.L(Y,IA,G,S,T)*DAC_DE(G) + )$IHYDROGEN_GH2TOBIOMETH(G) + +1/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOGASUPGRADING_T.L(Y,IA,G,S,T)*BIOGASUPGRADING_DE(G) + )$IHYDROGEN_GBIOGASUPGRADING(G) + +1/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)*METHANATION_DH2(G) + + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)*METHANATION_DE(G) + )$IHYDROGEN_GBIOGASMETHANATION(G) + +1/IOF1000000*SUM((S,T), BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh')*VGF_T.L(Y,IA,G,S,T))$IGBIOMETHANE(G) +$label NO_HYDROGEN_PRICE2 +; + +** CO2 EMISSIONS COST +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TAX','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + SUM(GROUP$(GROUP_AAA(GROUP,IA)),OMONEY/IOF1000000*IHOURFRAC *IM_CO2(G)*IOF0001 * IOF3P6 *EMI_POL(Y,C,GROUP,"TAX_CO2") * SUM((S,T), IHOURSINST(S,T)*(VGF_T.L(Y,IA,G,S,T) +$ifi %CCS%==yes -(VGF_T.L(Y,IA,G,S,T)*CCS_CO2CAPTEFF_G(G))$CCS_G(G) +))) +; + +** CO2 TRANSPORT COST +$ifi %CCS%==yes ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TRANSPORT','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G) AND CCS_G(G))= +$ifi %CCS%==yes OMONEY/IOF1000000*IHOURFRAC *IM_CO2(G)*IOF0001 * IOF3P6 * CCS_TRANSPORTCOST * SUM((S,T), IHOURSINST(S,T)*(VGF_T.L(Y,IA,G,S,T))); + + +** OTHER EMISSIONS COST +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OTHER_EMI_TAX','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + SUM(GROUP$(GROUP_AAA(GROUP,IA)),OMONEY/IOF1000000* + ( SUM((S,T), IHOURSINST(S,T) * (IHOURFRAC *IM_SO2(G)*IOF0001) * IOF3P6 * VGF_T.L(Y,IA,G,S,T))*EMI_POL(Y,C,GROUP,"TAX_SO2") + + SUM((S,T), IHOURSINST(S,T) * (IHOURFRAC *GDATA(G,'GDNOX')*IOF0000001) * IOF3P6 * VGF_T.L(Y,IA,G,S,T))* EMI_POL(Y,C,GROUP,"TAX_NOX") + )) +; + + +** UNIT COMMITMENT COST +$ifi not %UnitComm%==yes $goto No_UC +ECO_G_YCRAG(Y,C,IR,IA,IGUC,FFF,TECH_TYPE,'COSTS','GENERATION_UC_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(IGUC,FFF) AND GTECH_TYPE(IGUC,TECH_TYPE) and IAGK_HASORPOT(Y,IA,IGUC))= +OMONEY/IOF1000000*SUM((S,T), IHOURSINST(S,T)*( + VUCU.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCUCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHUNLD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! startup cost + +VUCD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCDCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHUNLD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! shutdown cost + +VUCON.L(Y,IA,IGUC,S,T)*IHOURFRAC*GDATA(IGUC,'GDUCCOST0')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHUNLD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC))) !! fixed hourly cost + +VUCU_STOLOAD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCUCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHLOAD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! startup cost + +VUCD_STOLOAD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCDCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHLOAD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! shutdown cost + +VUCON_STOLOAD.L(Y,IA,IGUC,S,T)*IHOURFRAC*GDATA(IGUC,'GDUCCOST0')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHLOAD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC))) !! fixed hourly cost + +$ifi %STEPWISE_RAMPING_UC%==ramp_const_cost +SUM(RAMPING_RATE,(VRAMPING_DOWN.L(Y,IA,IGUC,RAMPING_RATE,S,T)*IRAMPING_G_COSTS_DOWN(IGUC,RAMPING_RATE)+VRAMPING_UP.L(Y,IA,IGUC,RAMPING_RATE,S,T)*IRAMPING_G_COSTS_UP(IGUC,RAMPING_RATE))/CHRONOHOUR(S,T)*WEIGHT_T(T)) !! ramping cost +)) +; +$label NO_UC + + +*TAXES +$ifi NOT %TAXES%==yes $goto No_TAXES +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_TAXES','Mmoney')$(CCCRRR(C,IR) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G))= +OMONEY/IOF1000000*( +* Tax(+)/subsidy(-) on fuel use for electricity generation + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_F_EL(Y,C,G) * VGE_T.L(Y,IA,G,IS3,T)/ (GDATA(G,'GDFE') * (1$(NOT GEFFRATE(IA,G))+GEFFRATE(IA,G)))) + +* Tax(+)/subsidy(-) on fuel use for heat generation + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_F_HEAT(Y,C,G) * GDATA(G,'GDCV') * VGH_T.L(Y,IA,G,IS3,T)/ (GDATA(G,'GDFE') * (1$(NOT GEFFRATE(IA,G))+GEFFRATE(IA,G)))) + +* Tax(+)/subsidy(-) on fuel use + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_F(Y,C,G) * VGF_T.L(Y,IA,G,IS3,T)) + +* Tax(+)/subsidy(-) on heat generation + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_G_HEAT(Y,C,G) * VGH_T.L(Y,IA,G,IS3,T)) + +* Tax(+)/subsidy(-) on heat generation + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_G_EL(Y,C,G) * VGE_T.L(Y,IA,G,IS3,T)) +) +; +$label NO_TAXES + + +*GRID TARIFFS +$ifi NOT %GRIDTARIFFS%==yes $goto No_GRIDTARIFFS +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_GRID_TARIFFS','Mmoney')$(CCCRRR(C,IR) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND (IGETOH(G) +$ifi %HYDROGEN%==yes OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G) OR IHYDROGEN_GETOH2(G) +))= +OMONEY/IOF1000000*( + +* Fixed component and subscribed power (per MW installed) + + IOF1000 * + IGR_PRICE_TECH(Y,IR,'GRDSUBS') * (VGKNACCUMNET.L(Y,IA,G) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,G)$IGDECOMEXOPOT(Y,IA,G) + + GKFX(Y,IA,G)) /((GDATA(G,'GDFE') *(1$(NOT GEFFRATE(IA,G))+GEFFRATE(IA,G)))$IGETOH(G) + 1$(NOT IGETOH(G))) + +* Energy charge winter + + SUM((IS3,T)$IGR_TIME('GRDECW',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDECW') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge summer + + SUM((IS3,T)$IGR_TIME('GRDECS',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDECS') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge TOU step 1 + + SUM((IS3,T)$IGR_TIME('GRDTOU1',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU1') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge TOU step 2 + + SUM((IS3,T)$IGR_TIME('GRDTOU2',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU2') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge TOU step 3 + + SUM((IS3,T)$IGR_TIME('GRDTOU3',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU3') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge TOU step 4 + + SUM((IS3,T)$IGR_TIME('GRDTOU4',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU4') * VGE_T.L(Y,IA,G,IS3,T)) +) +; +$label NO_GRIDTARIFFS + +* -- TRANSMISSION ----- +*ELECTRICITY +** TRANSMISSION INVESTMENTS +ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= + OMONEY*IOF0000001*( + SUM((IYALIAS2)$((IXKN(IYALIAS2,IRI,IR) OR IXKN(IYALIAS2,IR,IRI)) AND (ORD(IYALIAS2) LE ORD(Y)) AND (NOT (IXKN_ES(IR,IRI) OR IXKN_ES(IRI,IR)))), + IOF05*ANNUITYCX(C)*IYHASANNUITYX(IYALIAS2,Y)*VXKN.L(IYALIAS2,IR,IRI)*XINVCOST(IYALIAS2,IR,IRI)) +$ifi %OFFSHOREGRID%==yes +SUM((IYALIAS2)$((IXKN(IYALIAS2,IRI,IR) OR IXKN(IYALIAS2,IR,IRI)) AND (ORD(IYALIAS2) LE ORD(Y)) AND (IXKN_ES(IR,IRI) OR IXKN_ES(IRI,IR))), +$ifi %OFFSHOREGRID%==yes IOF05*ANNUITYCX(C)*IYHASANNUITYX(IYALIAS2,Y)*SUM(XES,VXLAMBDA.L(IYALIAS2,IR,IRI,XES)*XINVCOST_ES(IYALIAS2,IR,IRI,XES))) +) +; +** TRANSMISSION FLOW COSTS +ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +OMONEY*IOF0000001* SUM((S,T), IHOURSINST(S,T) * (VX_T.L(Y,IR,IRI,S,T) * IHOURFRAC *XCOST(IR,IRI))); + +** TRANSMISSION TRADE COST +ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_TRADE_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VX_T.L(Y,IRI,IR,S,T) * EL_PRICE_YCRST(Y,C,IRI,S,T,'Money_per_MWh'))); + +** TRANSMISSION TRADE INCOME +ECO_X_YCR(Y,C,IR,IRI,'INCOME','TRANSMISSION_TRADE_INCOME','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VX_T.L(Y,IR,IRI,S,T) * EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))); + +*HEAT +$ifi not %HEATTRANS%==yes $goto No_HEATTRANS_costs +** TRANSMISSION INVESTMENTS +ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= + OMONEY*IOF0000001*SUM((IYALIAS2)$((IXHKN(IYALIAS2,IAI,IA) OR IXHKN(IYALIAS2,IA,IAI)) AND ORD(IYALIAS2) LE ORD(Y)) , + IOF05*ANNUITYCXH(C)*IYHASANNUITYXH(IYALIAS2,Y)*VXHKN.L(IYALIAS2,IA,IAI)*XHINVCOST(IYALIAS2,IA,IAI) + ); +** TRANSMISSION FLOW +ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH_T.L(Y,IA,IAI,S,T) * IHOURFRAC *XHCOST(IA,IAI))); + +** TRANSMISSION TRADE COST +ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','TRANSMISSION_TRADE_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH_T.L(Y,IAI,IA,S,T) * H_PRICE_YCRAST(Y,C,IR,IAI,S,T,'Money_per_MWh'))); + +** TRANSMISSION TRADE INCOME +ECO_XH_YCRA(Y,C,IR,IA,IAI,'INCOME','TRANSMISSION_TRADE_INCOME','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH_T.L(Y,IA,IAI,S,T) * H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh'))); + + +$label No_HEATTRANS_costs + +*Hydrogen +$ifi not %HYDROGEN%==yes $goto No_H2TRANS_costs + +** TRANSMISSION INVESTMENTS +ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= + OMONEY*IOF0000001*(SUM((IYALIAS2)$((IXH2KN(IYALIAS2,IRI,IR) OR IXH2KN(IYALIAS2,IR,IRI)) AND (NOT (IXKN_ES(IR,IRI) OR IXKN_ES(IRI,IR))) AND ORD(IYALIAS2) LE ORD(Y)) , + IOF05*ANNUITYCXH2(C)*IYHASANNUITYXH2(IYALIAS2,Y)*VXH2KN.L(IYALIAS2,IR,IRI)*XH2INVCOST(IYALIAS2,IR,IRI)) + + SUM((IYALIAS2)$((IXH2KN_NGTOH2(IYALIAS2,IRI,IR) OR IXH2KN_NGTOH2(IYALIAS2,IR,IRI)) AND ORD(IYALIAS2) LE ORD(Y)) , + IOF05*ANNUITYCXH2(C)*IYHASANNUITYXH2(IYALIAS2,Y)*VXH2KN_NGTOH2.L(IYALIAS2,IR,IRI)*XH2INVCOST_NGTOH2(IYALIAS2,IR,IRI)) + +SUM((IYALIAS2)$((IXH2KN(IYALIAS2,IRI,IR) OR IXH2KN(IYALIAS2,IR,IRI)) AND (ORD(IYALIAS2) LE ORD(Y)) AND (IXH2KN_ES(IR,IRI) OR IXH2KN_ES(IRI,IR))), + IOF05*ANNUITYCXH2(C)*IYHASANNUITYXH2(IYALIAS2,Y)*SUM(XES,VXH2LAMBDA.L(IYALIAS2,IR,IRI,XES)*XH2INVCOST_ES(IYALIAS2,IR,IRI,XES))) + ) +; + +** TRANSMISSION FLOW +ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH2_T.L(Y,IR,IRI,S,T) * IHOURFRAC *XH2COST(IR,IRI))); + +** TRANSMISSION TRADE COST +ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_TRADE_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH2_T.L(Y,IR,IRI,S,T) * H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))); + +** TRANSMISSION TRADE INCOME +ECO_XH2_YCR(Y,C,IR,IRI,'INCOME','TRANSMISSION_TRADE_INCOME','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH2_T.L(Y,IR,IRI,S,T) * H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))); + + +$label No_H2TRANS_costs + +* ------------- END OF COSTS -------------- + +* ------------- OBJECTIVE FUNCTION -------------- + +OBJ_YCR(Y,C,IR,'GENERATION_FUEL_COSTS','Mmoney')$CCCRRR(C,IR)= + +*GENERATION COSTS +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND NOT((IGESTOALL(G) OR IGHSTOALL(G) OR IGETOH(G) +$ifi %STEPWISEPRICE%==yes OR ISTEPWISEPRICE_F(Y,C,FFF) +$ifi %HYDROGEN%==yes OR IHYDROGEN_GETOH2(G) OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G) OR IHYDROGEN_GH2STO(G) OR IHYDROGEN_GH2TOE(G) OR IHYDROGEN_GH2TOEH(G) OR IHYDROGEN_GH2TOBIOMETH(G) OR IGBIOMETHANE(G) +))), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FUEL_COSTS','Mmoney') +) + +$ifi not %STEPWISEPRICE%==yes $goto No_STEPWISEPRICE2 + +SUM(STEPWISEPRICE_FFF$(ISTEPWISEPRICE_F(Y,C,STEPWISEPRICE_FFF) AND SUM(STEPWISEPRICE_L,VSTEPWISEPRICE_VGF_T_STEP.L(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF))), + OMONEY/IOF1000000*( + (0+ SUM((S,T,IA,G)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND IGF(G,STEPWISEPRICE_FFF)), IHOURSINST(S,T) * VGF_T.L(Y,IA,G,S,T)*IOF3P6)*IHOURFRAC)* + SUM(STEPWISEPRICE_L,STEPWISEPRICE_FUELPRICE_STEP(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF)*VSTEPWISEPRICE_VGF_T_STEP.L(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF)) + /SUM(STEPWISEPRICE_L,VSTEPWISEPRICE_VGF_T_STEP.L(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF)) + ) + ) +$label No_STEPWISEPRICE2 + +; + +OBJ_YCR(Y,C,IR,'GENERATION_OPPORTUNITY_COSTS_STORAGE','Mmoney')$CCCRRR(C,IR)= +$ifi %import_results%==yes $ifi %ADDESTOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGESTOS)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGESTOS)),IHOURSINST(S,T)*ESTOVOLTSVAL(Y,IA,IGESTOS,S,T)*IHOURFRAC*(VGE_T.L(Y,IA,IGESTOS,S,T)/GDATA(IGESTOS,'GDFE')-VESTOLOADTS.L(Y,IA,IGESTOS,S,T))) +$ifi %import_results%==yes $ifi %ADDHSTOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGHSTOS)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGHSTOS)),IHOURSINST(S,T)*HSTOVOLTSVAL(Y,IA,IGHSTOS,S,T)*IHOURFRAC*(VGH_T.L(Y,IA,IGHSTOS,S,T)/GDATA(IGHSTOS,'GDFE')-VHSTOLOADTS.L(Y,IA,IGHSTOS,S,T))) +$ifi %import_results%==yes $ifi %ADDESTOVOLT%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGESTO)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGESTO)),IHOURSINST(S,T)*ESTOVOLTVAL(Y,IA,IGESTO,S,T)*IHOURFRAC*(VGE_T.L(Y,IA,IGESTO,S,T)/GDATA(IGESTO,'GDFE')-VESTOLOADT.L(Y,IA,IGESTO,S,T))) +$ifi %import_results%==yes $ifi %ADDHSTOVOLT%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGHSTO)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGHSTO)),IHOURSINST(S,T)*HSTOVOLTVAL(Y,IA,IGHSTO,S,T)*IHOURFRAC*(VGH_T.L(Y,IA,IGHSTO,S,T)/GDATA(IGHSTO,'GDFE')-VHSTOLOADT.L(Y,IA,IGHSTO,S,T))) +$ifi %import_results%==yes $ifi %HYDROGEN%==yes $ifi %ADDH2STOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T,IA,IHYDROGEN_GH2STO)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO)),IHOURSINST(S,T)*H2STOVOLTSVAL(Y,IA,IHYDROGEN_GH2STO,S,T)*IHOURFRAC*(VHYDROGEN_GH2_T.L(Y,IA,IHYDROGEN_GH2STO,S,T)/GDATA(IHYDROGEN_GH2STO,'GDFE')-VHYDROGEN_STOLOADT.L(Y,IA,IHYDROGEN_GH2STO,S,T))) +$ifi %import_results%==yes $ifi %HYDROGEN%==yes $ifi %ADDBIOMETHSTOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T)$(SUM((IA,IGBIOMETHANE),IAGK_HASORPOT(Y,IA,IGBIOMETHANE)) AND SUM((IA,IHYDROGEN_GH2TOBIOMETH),IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH))),IHOURSINST(S,T)*BIOMETHSTOVOLTSVAL(Y,S,T)*IHOURFRAC*(VBIOMETH_STOUNLOADT.L(Y,S,T)-VBIOMETH_STOLOADT.L(Y,S,T)) ) ++0; + +OBJ_YCR(Y,C,IR,'GENERATION_REDISPATCH_COMPENSATION_COST','Mmoney')$CCCRRR(C,IR)= +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IGE))$(NOT (IGETOH(IGE)) AND RRRAAA(IR,IA) AND GE_T(Y,IA,IGE,S,T)),IHOURFRAC*ELECTRICITY_PRICE(Y,IR,S,T)*IHOURSINST(S,T)*(1-DISLOSS_E_AG(IA,IGE))*VGE_T_DOWN.L(Y,IA,IGE,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IGH))$(RRRAAA(IR,IA) AND GH_T(Y,IA,IGH,S,T)),IHOURFRAC*HEAT_PRICE(Y,IA,S,T)*IHOURSINST(S,T)*VGH_T_DOWN.L(Y,IA,IGH,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN))$(RRRAAA(IR,IA) AND GH2_T(Y,IA,IHYDROGEN,S,T)),IHOURFRAC*HYDROGEN_PRICE(Y,IR,S,T)*IHOURSINST(S,T)*VGH2_T_DOWN.L(Y,IA,IHYDROGEN,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH))$(RRRAAA(IR,IA) AND GBIOMETHANE_T(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)),IHOURFRAC*BIOMETHANE_PRICE(Y,S,T)*IHOURSINST(S,T)*VGBIOMETHANE_T_DOWN.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASUPGRADING))$(RRRAAA(IR,IA) AND GBIOGASUPGRADING_T(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)),IHOURFRAC*BIOMETHANE_PRICE(Y,S,T)*IHOURSINST(S,T)*VGBIOGASUPGRADING_T_DOWN.L(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASMETHANATION))$(RRRAAA(IR,IA) AND GBIOGASMETHANATION_T(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)),IHOURFRAC*BIOMETHANE_PRICE(Y,S,T)*IHOURSINST(S,T)*VGBIOGASMETHANATION_T_DOWN.L(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)) ++0; + + +OBJ_YCR(Y,C,IR,'HYDRO_PROFILE','Mmoney')$CCCRRR(C,IR)= +OMONEY*IOF0000001*SUM((IA,IGHYRS)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGHYRS)), SUM((S,T), HYPPROFILS(IA,S)*IHOURFRAC* IHOURSINST(S,T) + * VGE_T.L(Y,IA,IGHYRS,S,T))) +; + +OBJ_YCR(Y,C,IR,'GENERATION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CAPITAL_COSTS','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'GENERATION_FIXED_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FIXED_COSTS','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'GENERATION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OPERATIONAL_COSTS','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'GENERATION_CO2_TAX','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TAX','Mmoney') +) +; + +$ifi %CCS%==yes OBJ_YCR(Y,C,IR,'GENERATION_CO2_TRANSPORT','Mmoney')$CCCRRR(C,IR)= +$ifi %CCS%==yes SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND CCS_G(G)),ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TRANSPORT','Mmoney')); + +OBJ_YCR(Y,C,IR,'GENERATION_OTHER_EMI_TAX','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OTHER_EMI_TAX','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'GENERATION_UC_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_UC_COSTS','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'TRANSMISSION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM(IRI$IXK_HASORPOT(Y,IR,IRI),ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_CAPITAL_COSTS','Mmoney')) +; + +OBJ_YCR(Y,C,IR,'TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM(IRI$IXK_HASORPOT(Y,IR,IRI), ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_OPERATIONAL_COSTS','Mmoney')) +; + +$ifi not %HEATTRANS%==yes $goto No_HEATTRANS_costs_2 +OBJ_YCR(Y,C,IR,'HEAT_TRANSMISSION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,IAI)$(RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI)),ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_CAPITAL_COSTS','Mmoney')) +; + +OBJ_YCR(Y,C,IR,'HEAT_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,IAI)$(RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI)),ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')) +; +$label No_HEATTRANS_costs_2 + +$ifi not %HYDROGEN%==yes $goto No_H2_costs_2 +OBJ_YCR(Y,C,IR,'H2_TRANSMISSION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM(IRI$IXH2K_HASORPOT(Y,IR,IRI),ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_CAPITAL_COSTS','Mmoney')) +; + +OBJ_YCR(Y,C,IR,'H2_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM(IRI$IXH2K_HASORPOT(Y,IR,IRI), ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')) +; +$label No_H2_costs_2 + + +$ifi NOT %TAXES%==yes $goto No_TAXES2 +OBJ_YCR(Y,C,IR,'TAXES','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_TAXES','Mmoney')) ++OMONEY/IOF1000000*( + +* Tax on electricity consumption + + SUM(DEUSER, TAX_DE(C,DEUSER)*IHOURFRAC * SUM((IS3,T), IHOURSINST(IS3,T) * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0)) ) + +$ifi %DFLEXQUANT%==yes + SUM((DEUSER), *IHOURFRACTAX_DE(C,DEUSER) *( +$ifi %DFLEXQUANT%==yes SUM(DEF_U1,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_U1) ) - SUM(DEF_D1,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_D1) ) +$ifi %DFLEXQUANT%==yes + SUM(DEF_U2,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_U2) ) - SUM(DEF_D2,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_D2) ) +$ifi %DFLEXQUANT%==yes + SUM(DEF_U3,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_U3) ) - SUM(DEF_D3,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_D3) )) + + ++SUM(IA$RRRAAA(IR,IA), +* Tax on heat consumption + + SUM(DHUSER, TAX_DH(C,DHUSER)*IHOURFRAC * DH(Y,IA,DHUSER)) + +$ifi %DFLEXQUANT%==yes + SUM((DHUSER), TAX_DH(C,DHUSER)*IHOURFRAC * ( +$ifi %DFLEXQUANT%==yes SUM(DHF_U1,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_U1) ) - SUM(DHF_D1,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_D1) ) +$ifi %DFLEXQUANT%==yes + SUM(DHF_U2,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_U2) ) - SUM(DHF_D2,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_D2) ) +$ifi %DFLEXQUANT%==yes + SUM(DHF_U3,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_U3) ) - SUM(DHF_D3,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_D3) ) ) +) +) +; +$label NO_TAXES2 + + +*GRID TARIFFS2 +$ifi NOT %GRIDTARIFFS%==yes $goto No_GRIDTARIFFS2 +OBJ_YCR(Y,C,IR,'GRID_TARIFFS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND (IGETOH(G) +$ifi %HYDROGEN%==yes OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G) OR IHYDROGEN_GETOH2(G) +)), ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_GRID_TARIFFS','Mmoney')) + ++OMONEY/IOF1000000*( + +* Demand charge winter + + IOF1000 * SUM((MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCW',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP1.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDCW'))/(IGR_MONTHSINSIM/card(MMM)) !! Demand charge winter +* Demand charge summer + + IOF1000 * SUM((MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCS',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP1.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDCS'))/(IGR_MONTHSINSIM/card(MMM)) !! Demand charge summer +* Demand charge 2 (e.g for spring and fall months) + + IOF1000 * SUM((MMM)$(SUM((IS3,T)$IGR_TIME('GRDDC2',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP1.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDC2'))/(IGR_MONTHSINSIM/card(MMM)) !! Demand charge 2 + +* Demand charge TOU + + IOF1000 * SUM((MMM), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP2.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDCTOU'))/(IGR_MONTHSINSIM/card(MMM)) +* Demand charge yearly + + IOF1000 * SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAPY.L(Y,IA)) * IGR_PRICE_TECH(Y,IR,'GRDDCY') + +* Tariffs on user groups + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDECW',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDECW') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDECS',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDECS') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU1',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU1') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU2',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU2') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU3',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU3') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU4',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU4') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + + IOF1000 * SUM((DEUSER,MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCW',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), VDEUSER_CAP1.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCW'))/(IGR_MONTHSINSIM/CARD(MMM)) + + IOF1000 * SUM((DEUSER,MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCS',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), VDEUSER_CAP1.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCS'))/(IGR_MONTHSINSIM/CARD(MMM)) + + IOF1000 * SUM((DEUSER,MMM)$(SUM((IS3,T)$IGR_TIME('GRDDC2',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), VDEUSER_CAP1.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDC2'))/(IGR_MONTHSINSIM/CARD(MMM)) + + IOF1000 * SUM((DEUSER,MMM), VDEUSER_CAP2.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCTOU'))/(IGR_MONTHSINSIM/card(MMM)) + + IOF1000 * SUM((DEUSER), VDEUSER_CAPY.L(Y,IR,DEUSER) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCY')) + +) + +; +$label NO_GRIDTARIFFS2 + +*ADD OTHER COSTS(?) + + +* ------------- END OF OBJECTIVE FUNCTION -------------- + + +* ------------- INCOME -------------- + +** ELECTRICITY SALES +ECO_G_YCRAG(Y,C,IR,IA,IGE,FFF,TECH_TYPE,'INCOME','ELECTRICITY_SALE','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) and IGNOTETOH(IGE))= + IOF0000001*( + SUM((S,T), IHOURSINST(S,T)* VGE_T.L(Y,IA,IGE,S,T)*EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))) +; + +** HEAT SALES +ECO_G_YCRAG(Y,C,IR,IA,IGH,FFF,TECH_TYPE,'INCOME','HEAT_SALE','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= + IOF0000001* + SUM((S,T), IHOURSINST(S,T)*VGH_T.L(Y,IA,IGH,S,T)*H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')) +; + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_INCOME +** HYDROGEN SALES +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','H2_SALE','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G))= + IOF0000001* + SUM((S,T), IHOURSINST(S,T)*PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'HYDROGEN',TECH_TYPE,'MWh')*H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')) +; + +** BIOMETHANE SALES +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','BIOMETHANE_SALE','Mmoney')$((IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASUPGRADING(G) OR IHYDROGEN_GBIOGASMETHANATION(G)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= + IOF0000001*( + +SUM((S,T), IHOURSINST(S,T)*VGBIOMETH_T.L(Y,IA,G,S,T)*BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh'))$IHYDROGEN_GH2TOBIOMETH(G) + +SUM((S,T), IHOURSINST(S,T)*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)*BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh'))$IHYDROGEN_GBIOGASMETHANATION(G) + +SUM((S,T), IHOURSINST(S,T)*VGBIOGASUPGRADING_T.L(Y,IA,G,S,T)*BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh'))$IHYDROGEN_GBIOGASUPGRADING(G) +) +; + + +$label NO_HYDROGEN_INCOME + +* ------------- END OF INCOME -------------- + +* ------------- PROFIT -------------- +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'PROFIT','TOTAL_PROFIT','Mmoney')$IAGK_HASORPOT(Y,IA,G)= +SUM(SUBCATEGORY, ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME',SUBCATEGORY,'Mmoney')-ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS',SUBCATEGORY,'Mmoney') +) +; + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'PROFIT','ENERGY_SPECIFIC_PROFIT','Money_per_MWh')$(IAGK_HASORPOT(Y,IA,G) AND SUM(COMMODITY,PRO_YCRAGF(Y,C,IR,IA,G,FFF,COMMODITY,TECH_TYPE,'TWh') > 0)) = +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'PROFIT','TOTAL_PROFIT','Mmoney')/SUM(COMMODITY,PRO_YCRAGF(Y,C,IR,IA,G,FFF,COMMODITY,TECH_TYPE,'TWh')) +; +* ------------- END OF PROFIT -------------- + +* --------- END OF ECONOMIC OUTPUT ----------- + +* ---------------------- ENVIRONMENT ---------------------- + +* ------------- CO2 EMISSIONS ------------- + +EMI_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'kton')$(F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh'))= +(F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh') +$ifi %CCS%==yes -(F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh')*CCS_CO2CAPTEFF_G(G))$CCS_G(G) +)*IM_CO2(G)*IOF3P6 +; + +* ------------- END OF CO2 EMISSIONS ------------- + +* ---------------------- END OF ENVIRONMENT ---------------------- + +*---------------ELECTRICITY BALANCE------------ +*GENERATION +EL_BALANCE_YCRST(Y,C,IR,'CONDENSING',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','CONDENSING','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'CHP-BACK-PRESSURE',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','CHP-BACK-PRESSURE','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'CHP-EXTRACTION',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','CHP-EXTRACTION','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'INTER-STO',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','INTERSEASONAL-ELECT-STORAGE','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'INTRA-STO',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','INTRASEASONAL-ELECT-STORAGE','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'HYDRO-RESERVOIRS',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','HYDRO-RESERVOIRS','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'HYDRO-RUN-OF-RIVER',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','HYDRO-RUN-OF-RIVER','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'WIND-ON',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','WIND-ON','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'WIND-OFF',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','WIND-OFF','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'SOLAR-PV',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','SOLAR-PV','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'HYDRO-WAVE ',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','HYDRO-WAVE','MWh')); +$ifi %HYDROGEN%==yes EL_BALANCE_YCRST(Y,C,IR,'FUELCELL',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','FUELCELL','MWh')); + +*DEMAND +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_EXO',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_P2H',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDOGENOUS_ELECT2HEAT','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_INTRASTO',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTRASTO','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_INTERSTO',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTERSTO','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_EV',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_EV','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_OTHERTRANS',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_DISTLOSSES',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_CCS',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_CCS','MWh'); +$ifi %HYDROGEN%==yes EL_BALANCE_YCRST(Y,C,IR,'DEMAND_P2G',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_H2','MWh')+EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh'); + + +*TRANSMISSION +EL_BALANCE_YCRST(Y,C,IR,'NETEXPORT',S,T,'MWh')$CCCRRR(C,IR)=SUM(IRE$IXK_HASORPOT(Y,IR,IRE),VX_T.L(Y,IR,IRE,S,T))-SUM(IRI$IXK_HASORPOT(Y,IRI,IR),VX_T.L(Y,IRI,IR,S,T)*(1-XLOSS(IRI,IR))); +*TRANSMISSION TO 3RD COUNTRIES +EL_BALANCE_YCRST(Y,C,IR,'EXPORT3RD',S,T,'MWh')$CCCRRR(C,IR)=IX3FX_T(Y,IR,S,T); + + +*CURTAILMENT +EL_BALANCE_YCRST(Y,C,IR,'CURTAILMENT',S,T,'MWh')$CCCRRR(C,IR)= +SUM((IGE,TECH_TYPE,IA,FFF)$(RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE)), +CURT_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh') +); + +*PRICE +EL_BALANCE_YCRST(Y,C,IR,'PRICE',S,T,'Money_per_MWh')$CCCRRR(C,IR)=EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'); +*---------------END ELECTRICITY BALANCE------------ + + +*---------------HEAT BALANCE------------ +*GENERATION +H_BALANCE_YCRAST(Y,C,IR,IA,'P2H',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','ELECT-TO-HEAT','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'CHP-BACK-PRESSURE',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','CHP-BACK-PRESSURE','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'CHP-EXTRACTION',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','CHP-EXTRACTION','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'INTER-STO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','INTERSEASONAL-HEAT-STORAGE','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'INTRA-STO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','INTRASEASONAL-HEAT-STORAGE','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'BOILERS',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','BOILERS','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'SOLAR-HEATING',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','SOLAR-HEATING','MWh')); +$ifi %HYDROGEN%==yes H_BALANCE_YCRAST(Y,C,IR,IA,'FUELCELL',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','FUELCELL','MWh')); + + +*DEMAND +H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_EXO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh'); +H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_INTRASTO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTRASTO','MWh'); +H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_INTERSTO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTERSTO','MWh'); +H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_DISTLOSSES',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'DIST_LOSSES','MWh'); +$ifi %HYDROGEN%==yes H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_P2G',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_H2','MWh')+ H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_BIOMETHANE','MWh'); + +*TRANSMISSION +$ifi %HEATTRANS%==yes H_BALANCE_YCRAST(Y,C,IR,IA,'NETEXPORT',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM(IAE$IXHK_HASORPOT(Y,IA,IAE),VXH_T.L(Y,IA,IAE,S,T))-SUM(IAI$IXHK_HASORPOT(Y,IAI,IA),VXH_T.L(Y,IAI,IA,S,T)*(1-XHLOSS(IAI,IA))); + +*CURTAILMENT +H_BALANCE_YCRAST(Y,C,IR,IA,'CURTAILMENT',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +SUM((IGH,TECH_TYPE,FFF)$(IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE)), +CURT_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh') +); + +*PRICE +H_BALANCE_YCRAST(Y,C,IR,IA,'PRICE',S,T,'Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh'); +*---------------END HEAT BALANCE------------ + + + +execute_unload "MainResults.gdx" ECO_G_YCRAG,ECO_X_YCR,OBJ_YCR,EL_PRICE_YCR,EL_PRICE_YCRST,PRO_YCRAGFST,EL_DEMAND_YCRST,EL_DEMAND_YCR, +H_DEMAND_YCRAST,H_DEMAND_YCRA,PRO_YCRAGF,H_PRICE_YCRAST,H_PRICE_YCRA,G_CAP_YCRAF,G_STO_YCRAF,X_CAP_YCR,X_FLOW_YCRST,X_FLOW_YCR,F_CONS_YCRAST,F_CONS_YCRA,EMI_YCRAG, +EL_BALANCE_YCRST,CURT_YCRAGFST,CURT_YCRAGF,H_BALANCE_YCRAST + +$ifi %HEATTRANS%==yes ,XH_CAP_YCA,XH_FLOW_YCAST,XH_FLOW_YCA,ECO_XH_YCRA +$ifi %HYDROGEN%==yes ,H2_PRICE_YCRST,BIOMETH_PRICE_YST,XH2_CAP_YCR, XH2_FLOW_YCRST,XH2_FLOW_YCR,ECO_XH2_YCR,H2_DEMAND_YCRST,H2_DEMAND_YCR +; + + +*Establishing modified sets and parameters to original for further calculations + +$ifi not %stointers%==all $goto NO_STOINTERS2 +*Modification of STORAGE +IGESTOS(IGESTO) = YES; IGHSTOS(IGHSTO) = YES; +IGESTO(IGESTO) = NO; IGHSTO(IGHSTO) = NO; +$label NO_STOINTERS2 + +$ifi not %RollingSeasons%==yes $goto NO_ROLLINGSEASONS +*Modification of IHOURSINST +IHOURSINST(SSS,TTT)=0; +LOOP(IS3LOOPSET$(ORD(IS3LOOPSET) LE (CARD(S)-ROLLINGSEASONSNUMBER+1)), + IS3(S)=NO; + IS3(S)$((ORD(S) LE (ORD(IS3LOOPSET)+ROLLINGSEASONSNUMBER-1)) AND (ORD(S) GE ORD(IS3LOOPSET)) )=YES; + IWEIGHSUMS=SUM(IS3, WEIGHT_S(IS3)); + IHOURSINST(IS3,T)=IOF8760*WEIGHT_S(IS3)*WEIGHT_T(T)/(IWEIGHSUMS*SUM(ITALIAS, WEIGHT_T(ITALIAS)))/IHOURFRAC; +); + +$label NO_ROLLINGSEASONS + +*Deleting files to release memory: +G_CAP_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS)=0; +G_STO_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS)=0; +PRO_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS)=0; +PRO_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS)=0; +F_CONS_YCRAST(Y,C,RRR,AAA,G,FFF,SSS,TTT,TECH_TYPE,UNITS)=0; +F_CONS_YCRA(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS)=0; +X_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS)=0; +X_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS)=0; +X_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS)=0; +ECO_G_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,CATEGORY,SUBCATEGORY,UNITS)=0; +ECO_X_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS)=0; +OBJ_YCR(Y,C,RRR,SUBCATEGORY,UNITS)=0; +EL_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS)=0; +EL_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS)=0; +H_PRICE_YCRA(Y,C,RRR,AAA,PRICE_CATEGORY,UNITS)=0; +H_PRICE_YCRAST(Y,C,RRR,AAA,SSS,TTT,UNITS)=0; +EL_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS)=0; +EL_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS)=0; +H_DEMAND_YCRAST(Y,C,RRR,AAA,SSS,TTT,VARIABLE_CATEGORY,UNITS)=0; +H_DEMAND_YCRA(Y,C,RRR,AAA,VARIABLE_CATEGORY,UNITS)=0; +EMI_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS)=0; +CURT_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS)=0; +CURT_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS)=0; +EL_BALANCE_YCRST(Y,C,RRR,EL_BAL_TYPE,SSS,TTT,UNITS)=0; +H_BALANCE_YCRAST(Y,C,RRR,AAA,H_BAL_TYPE,SSS,TTT,UNITS)=0; +$ifi %HYDROGEN%==yes H2_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS)=0; +$ifi %HYDROGEN%==yes BIOMETH_PRICE_YST(Y,SSS,TTT,UNITS)=0; +$ifi %HEATTRANS%==yes XH_CAP_YCA(Y,C,IAAAE,IAAAI,VARIABLE_CATEGORY,UNITS)=0; +$ifi %HEATTRANS%==yes XH_FLOW_YCAST(Y,C,IAAAE,IAAAI,SSS,TTT,UNITS)=0; +$ifi %HEATTRANS%==yes XH_FLOW_YCA(Y,C,IAAAE,IAAAI,UNITS)=0; +$ifi %HEATTRANS%==yes ECO_XH_YCRA(Y,C,RRR,AAA,IAAAI,CATEGORY,SUBCATEGORY,UNITS)=0; +$ifi %HYDROGEN%==yes XH2_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS)=0; +$ifi %HYDROGEN%==yes XH2_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS)=0; +$ifi %HYDROGEN%==yes XH2_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS)=0; +$ifi %HYDROGEN%==yes ECO_XH2_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS)=0; +$ifi %HYDROGEN%==yes H2_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS)=0; +$ifi %HYDROGEN%==yes H2_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS)=0; + + + + + diff --git a/base/output/OUTPUT_SUMMARY.inc b/base/output/OUTPUT_SUMMARY.inc index bfdaba32..c2595798 100644 --- a/base/output/OUTPUT_SUMMARY.inc +++ b/base/output/OUTPUT_SUMMARY.inc @@ -1,1698 +1,1757 @@ -*Create output file - -SET CATEGORY /COSTS,INCOME,PROFIT, Market_Value/; -SET SUBCATEGORY /ELECTRICITY_SALE,HEAT_SALE,H2_SALE,BIOMETHANE_SALE,GENERATION_CAPITAL_COSTS,GENERATION_FIXED_COSTS, - GENERATION_OPERATIONAL_COSTS,GENERATION_FUEL_COSTS,GENERATION_TAXES,GENERATION_GRID_TARIFFS,TRANSMISSION_CAPITAL_COSTS,TRANSMISSION_OPERATIONAL_COSTS, - TRANSMISSION_TRADE_INCOME,TRANSMISSION_TRADE_COSTS,HEAT_TRANSMISSION_CAPITAL_COSTS,HEAT_TRANSMISSION_OPERATIONAL_COSTS, - H2_TRANSMISSION_CAPITAL_COSTS,H2_TRANSMISSION_OPERATIONAL_COSTS,GENERATION_CO2_TAX,GENERATION_CO2_TRANSPORT,GENERATION_UC_COSTS, - GENERATION_OTHER_EMI_TAX,GENERATION_OPPORTUNITY_COSTS,HYDRO_PROFILE,TAXES,GRID_TARIFFS,TOTAL_PROFIT,ENERGY_SPECIFIC_PROFIT, - GENERATION_OPPORTUNITY_COSTS_STORAGE,GENERATION_REDISPATCH_COMPENSATION_COST,ELECTRICITY_REDISPATCH_COMPENSATION, - HEAT_REDISPATCH_COMPENSATION,HYDROGEN_REDISPATCH_COMPENSATION,BIOMETHANE_REDISPATCH_COMPENSATION - /; -SET COMMODITY /ELECTRICITY,HEAT,HYDROGEN,BIOMETHANE/; -SET TECH_TYPE /CONDENSING,CHP-BACK-PRESSURE,CHP-EXTRACTION,BOILERS,ELECT-TO-HEAT,INTERSEASONAL-HEAT-STORAGE,INTERSEASONAL-ELECT-STORAGE,INTRASEASONAL-HEAT-STORAGE,INTRASEASONAL-ELECT-STORAGE,HYDRO-RESERVOIRS,HYDRO-RUN-OF-RIVER,WIND-ON,WIND-OFF,SOLAR-PV,SOLAR-HEATING,HYDRO-WAVE,HEAT-PUMP,EL-BOILER,FUELCELL,ELECTROLYZER,H2-STORAGE,BIOMETH-DAC,BIOGASUPGRADING,BIOGASMETHANATION,HUB-OFF,STEAMREFORMING/; -SET GTECH_TYPE(GGG,TECH_TYPE); -SET PRICE_CATEGORY /AVERAGE,AVERAGE_WEIGHTED_BY_CONSUMPTION,AVERAGE_WEIGHTED_BY_PRODUCTION/; -SET VARIABLE_CATEGORY /EXOGENOUS,ENDOGENOUS,DECOMMISSIONING,ENDOGENOUS_ELECT2HEAT,ENDO_INTRASTO,ENDO_INTERSTO,ENDO_EV,ENDO_HEATPUMP,ENDO_ELBOILER,ENDO_OTHERTRANS,DIST_LOSSES,TRANS_LOSSES,ENDO_CCS,ENDO_H2,ENDO_BIOMETHANE,ENDO_FUELCELL,ENDO_REGIONAL/; -SET EL_BAL_TYPE /CURTAILMENT,NETEXPORT,PRICE,DEMAND_EXO,DEMAND_LOSS,DEMAND_INTERSTO,DEMAND_INTRASTO,DEMAND_P2H,DEMAND_EV,CONDENSING,CHP-BACK-PRESSURE,CHP-EXTRACTION,ELECT-TO-HEAT,INTER-STO,INTRA-STO,HYDRO-RESERVOIRS,HYDRO-RUN-OF-RIVER,WIND-ON,WIND-OFF,SOLAR-PV,HYDRO-WAVE,FUELCELL,DEMAND_OTHERTRANS,DEMAND_DISTLOSSES,DEMAND_CCS,DEMAND_P2G/; -SET H_BAL_TYPE /CURTAILMENT,NETEXPORT,PRICE,DEMAND_EXO,DEMAND_LOSS,DEMAND_INTERSTO,DEMAND_INTRASTO,BOILERS,CHP-BACK-PRESSURE,CHP-EXTRACTION,INTER-STO,INTRA-STO,SOLAR-HEATING,P2H,FUELCELL,DEMAND_P2G,DEMAND_DISTLOSSES/; -SET UNITS /GW,TWh,MWh,Money_per_MWh,Mmoney,kton,GWh/; - - - GTECH_TYPE(G,'CONDENSING')$IGCND(G) = YES; - GTECH_TYPE(G,'CHP-BACK-PRESSURE')$IGBPR(G) = YES; - GTECH_TYPE(G,'CHP-EXTRACTION')$IGEXT(G) = YES; - GTECH_TYPE(G,'BOILERS')$IGHOB(G) = YES; - GTECH_TYPE(G,'ELECT-TO-HEAT')$IGETOH(G) = YES; - GTECH_TYPE(G,'INTRASEASONAL-HEAT-STORAGE')$(GDATA(G,'GDTYPE') EQ GHSTO) = YES; - GTECH_TYPE(G,'INTERSEASONAL-HEAT-STORAGE')$(GDATA(G,'GDTYPE') EQ GHSTOS) = YES; - GTECH_TYPE(G,'INTRASEASONAL-ELECT-STORAGE')$(GDATA(G,'GDTYPE') EQ GESTO) = YES; - GTECH_TYPE(G,'INTERSEASONAL-ELECT-STORAGE')$(GDATA(G,'GDTYPE') EQ GESTOS) = YES; - GTECH_TYPE(G,'HYDRO-RESERVOIRS')$IGHYRS(G) = YES; - GTECH_TYPE(G,'HYDRO-RUN-OF-RIVER')$IGHYRR(G) = YES; - GTECH_TYPE(G,'WIND-ON')$(IGWND(G) AND GDATA(G,'GDTECHGROUP') EQ WINDTURBINE_ONSHORE) = YES; - GTECH_TYPE(G,'WIND-OFF')$(IGWND(G) AND GDATA(G,'GDTECHGROUP') EQ WINDTURBINE_OFFSHORE) = YES; - GTECH_TYPE(G,'SOLAR-PV')$IGSOLE(G) = YES; - GTECH_TYPE(G,'SOLAR-HEATING')$IGSOLH(G) = YES; - GTECH_TYPE(G,'HYDRO-WAVE')$IGWAVE(G) = YES; -$ifi %HYDROGEN%==yes GTECH_TYPE(G,'FUELCELL')$(GDATA(G,'GDTECHGROUP') EQ FUELCELL) = YES; -$ifi %HYDROGEN%==yes GTECH_TYPE(G,'ELECTROLYZER')$(GDATA(G,'GDTECHGROUP') EQ ELECTROLYZER) = YES; -$ifi %HYDROGEN%==yes GTECH_TYPE(G,'ELECTROLYZER')$(GDATA(G,'GDTECHGROUP') EQ BACKUP_HYDROGEN) = YES; -$ifi %HYDROGEN%==yes GTECH_TYPE(G,'H2-STORAGE')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GH2STO) = YES; -$ifi %HYDROGEN%==yes GTECH_TYPE(G,'BIOMETH-DAC')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GH2TOBIOMETH) = YES; -$ifi %HYDROGEN%==yes GTECH_TYPE(G,'BIOGASUPGRADING')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GBIOGASUPGRADING) = YES; -$ifi %HYDROGEN%==yes GTECH_TYPE(G,'BIOGASMETHANATION')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GBIOGASMETHANATION) = YES; -$ifi %HYDROGEN%==yes GTECH_TYPE(G,'STEAMREFORMING')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GCH4TOH2) = YES; -$ifi %OFFSHOREGRID%==yes GTECH_TYPE(G,'HUB-OFF')$(GDATA(G,'GDTYPE') EQ HUB_OFF) = YES; - -PARAMETER G_CAP_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS) "Generation capacity for each year, country, region, area, technology, fuel, commodity, technology type and variable type (GW)"; -PARAMETER G_STO_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS) "Generation storage for each year, country, region, area, technology, fuel, commodity, technology type and variable type (GWh)"; -PARAMETER PRO_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS) "Energy Production for each year, country, region, area, technology, fuel, season, hour, commodity and technology type (MWh)" ; -PARAMETER PRO_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS) "Annual Energy Production for each year, country, region, area, technology, fuel, commodity and technology type (TWh)"; -PARAMETER F_CONS_YCRAST(Y,C,RRR,AAA,G,FFF,SSS,TTT,TECH_TYPE,UNITS) "Fuel consumption for each year, country, region, area, technology, fuel, season, hour and technology type (MWh)"; -PARAMETER F_CONS_YCRA(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS) "Fuel consumption for each year, country, region, area, technology, fuel and technology type (TWh)"; -PARAMETER X_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS) "Transmission capacity for each year, country, from region to region (GW)"; -PARAMETER X_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS) "Transmission flow for each year, country, from region to region, for each season and hour (MWh)"; -PARAMETER X_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS) "Transmission flow for each year, country, from region to region (TWh)"; -PARAMETER ECO_G_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,CATEGORY,SUBCATEGORY,UNITS) "Generation Economic Output for each year, country, region, fuel, technology type, area and technology (Mmoney)"; -PARAMETER ECO_X_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS) "Electric Transmission Economic Output for each year, country and region (Mmoney)"; -PARAMETER OBJ_YCR(Y,C,RRR,SUBCATEGORY,UNITS) "Objective function (Mmoney)"; -PARAMETER EL_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS) "Average Electricity Prices for each region (money/MWh)"; -PARAMETER EL_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS) "Hourly Electricity Prices for each region (money/MWh)"; -PARAMETER H_PRICE_YCRA(Y,C,RRR,AAA,PRICE_CATEGORY,UNITS) "Average heating Prices for each area(money/MWh)"; -PARAMETER H_PRICE_YCRAST(Y,C,RRR,AAA,SSS,TTT,UNITS) "Hourly heating Prices for each area (money(MWh)"; -PARAMETER EL_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS) "Aggregated Hourly Electricity Demand (MWh)"; -PARAMETER EL_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS) "Aggregated annual Electricity Demand (TWh)"; -PARAMETER H_DEMAND_YCRAST(Y,C,RRR,AAA,SSS,TTT,VARIABLE_CATEGORY,UNITS) "Aggregated Hourly heat Demand (MWh)"; -PARAMETER H_DEMAND_YCRA(Y,C,RRR,AAA,VARIABLE_CATEGORY,UNITS) "Aggregated Annual heat Demand (MWh)"; -PARAMETER EMI_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS) "Annual CO2 emissions(ktons)"; -PARAMETER CURT_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS) "Hourly energy curtailment per country, region, area, technology, fuel, hour and technology type (MWh)"; -PARAMETER CURT_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS) "Hourly energy curtailment per country, region, area, technology, fuel, hour and technology type (MWh)"; -PARAMETER EL_BALANCE_YCRST(Y,C,RRR,EL_BAL_TYPE,SSS,TTT,UNITS) "Hourly electricity balance per country, region, and type (MWh)"; -PARAMETER H_BALANCE_YCRAST(Y,C,RRR,AAA,H_BAL_TYPE,SSS,TTT,UNITS) "Hourly heat balance per country, region, area and type (MWh)"; -$ifi %HYDROGEN%==yes PARAMETER H2_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS) "Average Hydrogen Prices for each region (money/MWh)"; -$ifi %HYDROGEN%==yes PARAMETER H2_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS) "Hourly hydrogen Prices for each region (money/MWh)"; -$ifi %HYDROGEN%==yes PARAMETER BIOMETH_PRICE_YST(Y,SSS,TTT,UNITS) "Hourly biomethane Prices for each region (money/MWh)"; -$ifi %HYDROGEN%==yes PARAMETER XH2_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS) "H2 Transmission capacity for each year, country, from region to region (GW)"; -$ifi %HYDROGEN%==yes PARAMETER XH2_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS) "H2 Transmission flow for each year, country, from region to region, for each season and hour (MWh)"; -$ifi %HYDROGEN%==yes PARAMETER XH2_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS) "H2 Transmission flow for each year, country, from region to region (TWh)"; -$ifi %HYDROGEN%==yes PARAMETER ECO_XH2_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS) "H2 Transmission Economic Output for each year, country and region (Mmoney)"; -$ifi %HYDROGEN%==yes PARAMETER H2_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS) "Aggregated Hourly H2 Demand (MWh)"; -$ifi %HYDROGEN%==yes PARAMETER H2_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS) "Aggregated annual H2 Demand (TWh)"; - - -**Additional Addon output -*HEATRANS -$ifi %HEATTRANS%==yes PARAMETER XH_CAP_YCA(Y,C,IAAAE,IAAAI,VARIABLE_CATEGORY,UNITS) "Heat Transmission capacity for each year, country, from area to area (GW)"; -$ifi %HEATTRANS%==yes PARAMETER XH_FLOW_YCAST(Y,C,IAAAE,IAAAI,SSS,TTT,UNITS) "Heat Transmission flow for each year, country, from areas to area, for each season and hour (MWh)"; -$ifi %HEATTRANS%==yes PARAMETER XH_FLOW_YCA(Y,C,IAAAE,IAAAI,UNITS) "Heat Transmission flow for each year, country, from area to area (TWh)"; -$ifi %HEATTRANS%==yes PARAMETER ECO_XH_YCRA(Y,C,RRR,AAA,IAAAI,CATEGORY,SUBCATEGORY,UNITS) "Heat Transmission Economic Output for each year, country and region and area (Mmoney)"; - - -$ifi not %stointers%==all $goto NO_STOINTERS -*Modification of STORAGE sets so calculation are done correcting its type: -IGHSTO(G) = 0; -IGHSTOS(G) = 0; -IGESTO(G) = 0; -IGESTOS(G) = 0; -IGHSTO(G) = YES$(GDATA(G,'GDTYPE') EQ GHSTO); -IGHSTOS(G) = YES$(GDATA(G,'GDTYPE') EQ GHSTOS); -IGESTO(G) = YES$(GDATA(G,'GDTYPE') EQ GESTO); -IGESTOS(G) = YES$(GDATA(G,'GDTYPE') EQ GESTOS); -$label NO_STOINTERS - -*Modification of IHOURSINST -$ifi %RollingSeasons%==yes PARAMETER IHOURSINTROLLINGSEASON(S,T) "Length of time segment (hours) used in rolling season mode"; -$ifi %RollingSeasons%==yes IWEIGHSUMS=SUM(SSS$(ORD(SSS) LE ROLLINGSEASONSNUMBER), WEIGHT_S(SSS)); -$ifi %RollingSeasons%==yes IHOURSINTROLLINGSEASON(S,T)=IOF8760*WEIGHT_S(S)*WEIGHT_T(T)/(IWEIGHSUMS*SUM(ITALIAS, WEIGHT_T(ITALIAS)))/IHOURFRAC; - -IWEIGHSUMS = SUM(S, WEIGHT_S(S)); -IWEIGHSUMT = SUM(T, WEIGHT_T(T)); -IHOURSINST(SSS,TTT)=0; -IHOURSINST(S,T)=IOF8760*WEIGHT_S(S)*WEIGHT_T(T)/(IWEIGHSUMS*IWEIGHSUMT)/IHOURFRAC; - - - -* -------------------- ENERGY CAPACITY --------------------- - -* ------------- ELECTRICITY CAPACITY -------------- - -** EXOGENOUS ELECTRICITY CAPACITY - -G_CAP_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'EXOGENOUS','GW')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND NOT(IHYDROGEN(IGE)))= -IOF0001*GKFX(Y,IA,IGE)/(1$((NOT IGESTO(IGE)) AND (NOT IGESTOS(IGE)))+GDATA(IGE,'GDSTOHUNLD')$((IGESTO(IGE)) OR IGESTOS(IGE))) -; - - -** ENDOGENOUS ELECTRIC CAPACITY ACCUMULATED INVESTMENTS -G_CAP_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'ENDOGENOUS','GW')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND NOT(IHYDROGEN(IGE)))= -IOF0001*VGKNACCUMNET.L(Y,IA,IGE)/(1$((NOT IGESTO(IGE)) AND (NOT IGESTOS(IGE)))+GDATA(IGE,'GDSTOHUNLD')$((IGESTO(IGE)) OR IGESTOS(IGE))) -; - -** ENDOGENOUS ELECTRICITY CAPACITY ACCUMULATED DECOMMISSIONING -$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'DECOMMISSIONING','GW')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGE) AND NOT(IHYDROGEN(IGE)))= -$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGE)/(1$((NOT IGESTO(IGE)) AND (NOT IGESTOS(IGE)))+GDATA(IGE,'GDSTOHUNLD')$((IGESTO(IGE)) OR IGESTOS(IGE))) -; - - -* ------------- END OF ELECTRICITY CAPACITY -------------- - -* ------------- HEAT CAPACITY -------------- - -** EXOGENOUS HEAT CAPACITY - -G_CAP_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'EXOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= -(IOF0001*GKFX(Y,IA,IGH)/((1$((NOT IGHSTO(IGH)) AND (NOT IGHSTOS(IGH)))+GDATA(IGH,'GDSTOHUNLD')$((IGHSTO(IGH)) OR IGHSTOS(IGH)))*(GDATA(IGH,'GDCB')$IGBPR(IGH)+ (GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV'))$IGEXT(IGH)+1$(NOT (IGBPR(IGH) OR IGEXT(IGH))))))$(NOT IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) -+(IOF0001*GKFX(Y,IA,IGH)*(((GDATA(IGH,'GDCB')/GDATA(IGH,'GDBYPASSC')+1)/(GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV')))$IGEXT(IGH) + (1/GDATA(IGH,'GDBYPASSC')+1/GDATA(IGH,'GDCB'))$IGBPR(IGH)))$(IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) -$ifi %HYDROGEN%==yes +(IOF0001*GKFX(Y,IA,IGH)/GDATA(IGH,'GDCB'))$(IHYDROGEN_GETOHH2(IGH) OR IHYDROGEN_GH2TOEH(IGH)) -; - -** ENDOGENOUS HEAT CAPACITY ACCUMULATED INVESTMENTS -G_CAP_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'ENDOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= -(IOF0001*VGKNACCUMNET.L(Y,IA,IGH)/((1$((NOT IGHSTO(IGH)) AND (NOT IGHSTOS(IGH)))+GDATA(IGH,'GDSTOHUNLD')$((IGHSTO(IGH)) OR IGHSTOS(IGH)))*(GDATA(IGH,'GDCB')$IGBPR(IGH)+ (GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV'))$IGEXT(IGH)+1$(NOT (IGBPR(IGH) OR IGEXT(IGH))))))$(NOT IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) -+(IOF0001*VGKNACCUMNET.L(Y,IA,IGH)*(((GDATA(IGH,'GDCB')/GDATA(IGH,'GDBYPASSC')+1)/(GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV')))$IGEXT(IGH) + (1/GDATA(IGH,'GDBYPASSC')+1/GDATA(IGH,'GDCB'))$IGBPR(IGH)))$(IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) -$ifi %HYDROGEN%==yes +(IOF0001*VGKNACCUMNET.L(Y,IA,IGH)/GDATA(IGH,'GDCB'))$(IHYDROGEN_GETOHH2(IGH) OR IHYDROGEN_GH2TOEH(IGH)) -; - -** ENDOGENOUS HEAT CAPACITY ACCUMULATED DECOMMISSIONING -$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'DECOMMISSIONING','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGH))= -$ifi %DECOM%==yes -(IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH)/((1$((NOT IGHSTO(IGH)) AND (NOT IGHSTOS(IGH)))+GDATA(IGH,'GDSTOHUNLD')$((IGHSTO(IGH)) OR IGHSTOS(IGH)))*(GDATA(IGH,'GDCB')$IGBPR(IGH)+ (GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV'))$IGEXT(IGH)+1$(NOT (IGBPR(IGH) OR IGEXT(IGH))))))$(NOT IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) -$ifi %DECOM%==yes -(IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH)*(((GDATA(IGH,'GDCB')/GDATA(IGH,'GDBYPASSC')+1)/(GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV')))$IGEXT(IGH) + (1/GDATA(IGH,'GDBYPASSC')+1/GDATA(IGH,'GDCB'))$IGBPR(IGH)))$(IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) -$ifi %DECOM%==yes $ifi %HYDROGEN%==yes -(IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH)/GDATA(IGH,'GDCB'))$(IHYDROGEN_GETOHH2(IGH) OR IHYDROGEN_GH2TOEH(IGH)) -; - -* ------------- END OF HEAT CAPACITY -------------- - -$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_CAPACITY -* ------------- HYDROGEN CAPACITY -------------- - -** EXOGENOUS HYDROGEN CAPACITY - -G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'EXOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G))= -IOF0001*GKFX(Y,IA,G)*(1$IHYDROGEN_GH2STO(G)+GDATA(G,'GDFE')$(NOT(IHYDROGEN_GH2STO(G))))/(1$(NOT IHYDROGEN_GH2STO(G))+GDATA(G,'GDSTOHUNLD')$IHYDROGEN_GH2STO(G)) -; - - -** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED INVESTMENTS -G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'ENDOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G))= -IOF0001*VGKNACCUMNET.L(Y,IA,G)*(1$IHYDROGEN_GH2STO(G)+GDATA(G,'GDFE')$(NOT(IHYDROGEN_GH2STO(G))))/(1$(NOT IHYDROGEN_GH2STO(G))+GDATA(G,'GDSTOHUNLD')$IHYDROGEN_GH2STO(G)) -; - -** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED DECOMMISSIONING -$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'DECOMMISSIONING','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,G) AND IHYDROGEN(G) AND NOT(IHYDROGEN_GH2TOBIOMETH(G)))= -$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,G)*(1$IHYDROGEN_GH2STO(G)+GDATA(G,'GDFE')$(NOT(IHYDROGEN_GH2STO(G))))/(1$(NOT IHYDROGEN_GH2STO(G))+GDATA(G,'GDSTOHUNLD')$IHYDROGEN_GH2STO(G)) -; - -* ------------- END OF HYDROGEN CAPACITY -------------- - -* ------------- BIOMETHANE CAPACITY -------------- - -** EXOGENOUS BIOMETHANE CAPACITY - -G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'EXOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= -IOF0001*GKFX(Y,IA,G) -; - -** ENDOGENOUS BIOMETHANE CAPACITY ACCUMULATED INVESTMENTS -G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'ENDOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= -IOF0001*VGKNACCUMNET.L(Y,IA,G) -; - -** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED DECOMMISSIONING -$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'DECOMMISSIONING','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,G) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= -$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,G) -; - -* ------------- END OF BIOMETHANE CAPACITY -------------- - -$label NO_HYDROGEN_CAPACITY - -* ---------------- END OF ENERGY CAPACITY ----------------- - -* -------------------- ENERGY STORAGE --------------------- - -* ------------- ELECTRICITY STORAGE -------------- - -** EXOGENOUS ELECTRICITY STORAGE - -G_STO_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'EXOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND (IGESTO(IGE) OR IGESTOS(IGE) OR IGHYRS(IGE)) )= -IOF0001*GKFX(Y,IA,IGE)*(1$(NOT IGHYRS(IGE)) + HYRSMAXVOL_G(IA,IGE)$IGHYRS(IGE)) -; - -** ENDOGENOUS ELECTRIC STORAGE ACCUMULATED INVESTMENTS -G_STO_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'ENDOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND (IGESTO(IGE) OR IGESTOS(IGE) OR IGHYRS(IGE)) )= -IOF0001*VGKNACCUMNET.L(Y,IA,IGE)*(1$(NOT IGHYRS(IGE)) + HYRSMAXVOL_G(IA,IGE)$IGHYRS(IGE)) -; - -** ENDOGENOUS ELECTRICITY STORAGE ACCUMULATED DECOMMISSIONING -$ifi %DECOM%==yes G_STO_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'DECOMMISSIONING','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGE) AND (IGESTO(IGE) OR IGESTOS(IGE) OR IGHYRS(IGE)) )= -$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGE)*(1$(NOT IGHYRS(IGE)) + HYRSMAXVOL_G(IA,IGE)$IGHYRS(IGE)) -; - -* ------------- END OF ELECTRICITY CAPACITY -------------- - -* ------------- HEAT STORAGE -------------- - -** EXOGENOUS HEAT STORAGE - -G_STO_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'EXOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND (IGHSTO(IGH) OR IGHSTOS(IGH)))= -IOF0001*GKFX(Y,IA,IGH) -; - -** ENDOGENOUS HEAT STORAGE ACCUMULATED INVESTMENTS -G_STO_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'ENDOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND (IGHSTO(IGH) OR IGHSTOS(IGH)))= -IOF0001*VGKNACCUMNET.L(Y,IA,IGH) -; - -** ENDOGENOUS HEAT STORAGE ACCUMULATED DECOMMISSIONING -$ifi %DECOM%==yes G_STO_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'DECOMMISSIONING','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGH) AND (IGHSTO(IGH) OR IGHSTOS(IGH)))= -$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH) -; - -* ------------- END OF HEAT STORAGE -------------- - -$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_STORAGE -* ------------- HYDROGEN STORAGE -------------- - -** EXOGENOUS HYDROGEN STORAGE - -G_STO_YCRAF(Y,C,IR,IA,IHYDROGEN_GH2STO,FFF,'HYDROGEN',TECH_TYPE,'EXOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO) AND IGF(IHYDROGEN_GH2STO,FFF) AND GTECH_TYPE(IHYDROGEN_GH2STO,TECH_TYPE) )= -IOF0001*GKFX(Y,IA,IHYDROGEN_GH2STO) -; - -** ENDOGENOUS HYDROGEN STORAGE ACCUMULATED INVESTMENTS -G_STO_YCRAF(Y,C,IR,IA,IHYDROGEN_GH2STO,FFF,'HYDROGEN',TECH_TYPE,'ENDOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO) AND IGF(IHYDROGEN_GH2STO,FFF) AND GTECH_TYPE(IHYDROGEN_GH2STO,TECH_TYPE))= -IOF0001*VGKNACCUMNET.L(Y,IA,IHYDROGEN_GH2STO) -; - -** ENDOGENOUS HYDROGEN STORAGE ACCUMULATED DECOMMISSIONING -$ifi %DECOM%==yes G_STO_YCRAF(Y,C,IR,IA,IHYDROGEN_GH2STO,FFF,'HYDROGEN',TECH_TYPE,'DECOMMISSIONING','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO) AND IGF(IHYDROGEN_GH2STO,FFF) AND GTECH_TYPE(IHYDROGEN_GH2STO,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IHYDROGEN_GH2STO))= -$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IHYDROGEN_GH2STO) -; -* ------------- END OF HYDROGEN STORAGE -------------- -$label NO_HYDROGEN_STORAGE - -* ---------------- END OF ENERGY STORAGE ----------------- - - - - -* -------------------- ENERGY PRODUCTION --------------------- - -** ELECTRICITY PRODUCTION HOURLY -PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE))= - VGE_T.L(Y,IA,IGE,S,T); - -** ELECTRICITY PRODUCTION ANNUALLY -PRO_YCRAGF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'TWh')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE))= - SUM((S,T),IHOURSINST(S,T)*VGE_T.L(Y,IA,IGE,S,T)*IHOURFRAC)/IOF1000000; - -** HEAT PRODUCTION HOURLY -PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= - VGH_T.L(Y,IA,IGH,S,T); - -** HEAT PRODUCTION ANNUALY -PRO_YCRAGF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= - SUM((S,T),IHOURSINST(S,T)*VGH_T.L(Y,IA,IGH,S,T)*IHOURFRAC)/IOF1000000; - -$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_PRODUCTION -** HYDROGEN PRODUCTION HOURLY -PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'HYDROGEN',TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G) )= - +(VGE_T.L(Y,IA,G,S,T)*GDATA(G,'GDFE'))$IHYDROGEN_GETOH2(G) - +(VGE_T.L(Y,IA,G,S,T)*GDATA(G,'GDFE'))$IHYDROGEN_GETOHH2(G) - +(VGE_T.L(Y,IA,G,S,T)*GDATA(G,'GDFE'))$IHYDROGEN_GEHTOH2(G) - +(VHYDROGEN_GH2_T.L(Y,IA,G,S,T))$(IHYDROGEN_GCH4TOH2(G) OR IHYDROGEN_GH2STO(G)) -; - -** HYDROGEN PRODUCTION ANNUALY -PRO_YCRAGF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G))= - SUM((S,T),IHOURSINST(S,T)*PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'HYDROGEN',TECH_TYPE,'MWh')*IHOURFRAC)/IOF1000000 -; - -** BIOMETHANE PRODUCTION HOURLY -PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'BIOMETHANE',TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= - VGBIOMETH_T.L(Y,IA,G,S,T)$IHYDROGEN_GH2TOBIOMETH(G) - + VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)$IHYDROGEN_GBIOGASMETHANATION(G) - +VGBIOGASUPGRADING_T.L(Y,IA,G,S,T)$IHYDROGEN_GBIOGASUPGRADING(G) -; - -** BIOMETHANE PRODUCTION ANNUALY -PRO_YCRAGF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND (IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASMETHANATION(G) OR IHYDROGEN_GBIOGASUPGRADING(G)))= - SUM((S,T),IHOURSINST(S,T)*PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'BIOMETHANE',TECH_TYPE,'MWh')*IHOURFRAC)/IOF1000000 -; -$label NO_HYDROGEN_PRODUCTION - -* ---------------- END OF ENERGY PRODUCTION ----------------- - - -* -------------------- FUEL CONSUMPTION --------------------- - -** HOURLY FUEL CONSUMPTION -F_CONS_YCRAST(Y,C,IR,IA,G,FFF,S,T,TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= - VGF_T.L(Y,IA,G,S,T); - -** ANNUAL FUEL CONSUMPTION -F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= - SUM((S,T),IHOURSINST(S,T)*VGF_T.L(Y,IA,G,S,T)*IHOURFRAC)/IOF1000000; - - -* ---------------- END OF FUEL CONSUMPTION ----------------- - -* ---------------- ENERGY CURTAILMENT ----------------------- -*HOURLY CURTAILMENT -CURT_YCRAGFST(Y,C,IR,IA,IGHYRR,FFF,S,T,'ELECTRICITY','HYDRO-RUN-OF-RIVER','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGHYRR) AND IGF(IGHYRR,FFF) AND GTECH_TYPE(IGHYRR,'HYDRO-RUN-OF-RIVER') AND IWTRRRSUM(IA) > 0)= -(WTRRRFLH(IA) * ( - GKFX(Y,IA,IGHYRR) -$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGHYRR) - + VGKNACCUMNET.L(Y,IA,IGHYRR) - ) * WTRRRVAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGHYRR,S,T)) + IGKRATE(IA,IGHYRR,S,T))) / IWTRRRSUM(IA) --VGE_T.L(Y,IA,IGHYRR,S,T); - -CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-ON','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-ON') AND IWND_SUMST(IA) > 0)= -$ifi %WNDFLH_DOL%==AAA (WNDFLH(IA) * ( -$ifi %WNDFLH_DOL%==AAA_GGG (WNDFLH(IA,IGWND) * ( - GKFX(Y,IA,IGWND) -$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGWND) - + VGKNACCUMNET.L(Y,IA,IGWND) - ) * WND_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGWND,S,T)) + IGKRATE(IA,IGWND,S,T))) / IWND_SUMST(IA) --VGE_T.L(Y,IA,IGWND,S,T); - -CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-OFF','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-OFF') AND IWND_SUMST(IA) > 0)= -$ifi %WNDFLH_DOL%==AAA (WNDFLH(IA) * ( -$ifi %WNDFLH_DOL%==AAA_GGG (WNDFLH(IA,IGWND) * ( - GKFX(Y,IA,IGWND) -$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGWND) - + VGKNACCUMNET.L(Y,IA,IGWND) - ) * WND_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGWND,S,T)) + IGKRATE(IA,IGWND,S,T))) / IWND_SUMST(IA) --VGE_T.L(Y,IA,IGWND,S,T); - -CURT_YCRAGFST(Y,C,IR,IA,IGSOLE,FFF,S,T,'ELECTRICITY','SOLAR-PV','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLE) AND IGF(IGSOLE,FFF) AND GTECH_TYPE(IGSOLE,'SOLAR-PV') AND ISOLESUMST(IA) > 0)= -$ifi %SOLEFLH_DOL%==AAA (SOLEFLH(IA) * ( -$ifi %SOLEFLH_DOL%==AAA_GGG (SOLEFLH(IA,IGSOLE) * ( - GKFX(Y,IA,IGSOLE) -$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGSOLE) - + VGKNACCUMNET.L(Y,IA,IGSOLE) - ) * SOLE_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGSOLE,S,T)) + IGKRATE(IA,IGSOLE,S,T))) / ISOLESUMST(IA) --VGE_T.L(Y,IA,IGSOLE,S,T); - -CURT_YCRAGFST(Y,C,IR,IA,IGSOLH,FFF,S,T,'HEAT','SOLAR-HEATING','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLH) AND IGF(IGSOLH,FFF) AND GTECH_TYPE(IGSOLH,'SOLAR-HEATING') AND ISOLHSUMST(IA) > 0)= -$ifi %SOLHFLH_DOL%==AAA (SOLHFLH(IA) * ( -$ifi %SOLHFLH_DOL%==AAA_GGG (SOLHFLH(IA,IGSOLH) * ( - GKFX(Y,IA,IGSOLH) -$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGSOLH) - + VGKNACCUMNET.L(Y,IA,IGSOLH) - ) * SOLH_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGSOLH,S,T)) + IGKRATE(IA,IGSOLH,S,T))) / ISOLHSUMST(IA) --VGH_T.L(Y,IA,IGSOLH,S,T); - - -*ANNUAL CURTAILMENT -CURT_YCRAGF(Y,C,IR,IA,IGHYRR,FFF,'ELECTRICITY','HYDRO-RUN-OF-RIVER','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGHYRR) AND IGF(IGHYRR,FFF) AND GTECH_TYPE(IGHYRR,'HYDRO-RUN-OF-RIVER'))= -SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGHYRR,FFF,S,T,'ELECTRICITY','HYDRO-RUN-OF-RIVER','MWh')*IHOURFRAC)/IOF1000000 -; -CURT_YCRAGF(Y,C,IR,IA,IGWND,FFF,'ELECTRICITY','WIND-ON','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-ON'))= -SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-ON','MWh')*IHOURFRAC)/IOF1000000 -; -CURT_YCRAGF(Y,C,IR,IA,IGWND,FFF,'ELECTRICITY','WIND-OFF','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-OFF'))= -SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-OFF','MWh')*IHOURFRAC)/IOF1000000 -; -CURT_YCRAGF(Y,C,IR,IA,IGSOLE,FFF,'ELECTRICITY','SOLAR-PV','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLE) AND IGF(IGSOLE,FFF) AND GTECH_TYPE(IGSOLE,'SOLAR-PV'))= -SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGSOLE,FFF,S,T,'ELECTRICITY','SOLAR-PV','MWh')*IHOURFRAC)/IOF1000000 -; -CURT_YCRAGF(Y,C,IR,IA,IGSOLH,FFF,'HEAT','SOLAR-HEATING','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLH) AND IGF(IGSOLH,FFF) AND GTECH_TYPE(IGSOLH,'SOLAR-HEATING'))= -SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGSOLH,FFF,S,T,'HEAT','SOLAR-HEATING','MWh')*IHOURFRAC)/IOF1000000 -; - -*Curtailment of hydro reservoirs should be analyzed by aggregating the technology set -CURT_YCRAGF(Y,C,IR,IA,IGHYRS,FFF,'ELECTRICITY','HYDRO-RESERVOIRS','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGHYRS) AND IGF(IGHYRS,FFF) AND GTECH_TYPE(IGHYRS,'HYDRO-RESERVOIRS'))= -SUM(S, - IHYINF_S(IA,S) * - ( - GKFX(Y,IA,IGHYRS) -$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGHYRS) - +VGKNACCUMNET.L(Y,IA,IGHYRS) - ) - -SUM(T,IHYRST(S,T)*VGE_T.L(Y,IA,IGHYRS,S,T)) - )/IOF1000000*IHOURFRAC -; - - -* ---------------- END OF ENERGY CURTAILMENT ----------------------- - -* ------------------------- ENERGY DEMAND ---------------------- - -* ------------- ELECTRICITY DEMAND -------------- - -*HOURLY -** EXOGENOUS DEMAND - -EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR) AND SUM(DEUSER,IDE_SUMST(IR,DEUSER)))= -SUM((DEUSER)$IDE_SUMST(IR,DEUSER), DE(Y,IR,DEUSER) * DE_VAR_T(IR,DEUSER,S,T) / IDE_SUMST(IR,DEUSER)) - -$ifi not %DEMANDRESPONSE%==yes $goto NO_DEMANDRESPONSE -* Downward regulation for DR shed technologies: -- SUM(IADR(Y,IA,DR_TECH_SHED)$(RRRAAA(IR,IA) AND CCCRRR(C,IR)), VDR_DOWN.L(Y,IA,DR_TECH_SHED,S,T)) -* Balance between upward and downward regulation for DR shift technologies: -*TODO - efficiency -- SUM(IADR(Y,IA,DR_TECH_SHIFT)$(RRRAAA(IR,IA) AND CCCRRR(C,IR)), VDR_DOWN.L(Y,IA,DR_TECH_SHIFT,S,T)) + SUM(IADR(Y,IA,DR_TECH_SHIFT)$(RRRAAA(IR,IA) AND CCCRRR(C,IR)), VDR_UP.L(Y,IA,DR_TECH_SHIFT,S,T)) -$label NO_DEMANDRESPONSE -; - -** ENDOGENOUS DEMAND - -EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDOGENOUS_ELECT2HEAT','MWh')$CCCRRR(C,IR)= -* P2H CONSUMPTION - SUM(IA$RRRAAA(IR,IA), SUM(IGETOH$IAGK_HASORPOT(Y,IA,IGETOH), VGE_T.L(Y,IA,IGETOH,S,T))) -; - -EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTRASTO','MWh')$CCCRRR(C,IR)= -* INTRASEASONAL ELECTRICITY STORAGE -$ifi not %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADT.L(Y,IA,IGESTO,S,T))) -$ifi %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADTS.L(Y,IA,IGESTO,S,T))) -; - -EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTERSTO','MWh')$CCCRRR(C,IR)= -* INTERSEASONAL ELECTRICITY STORAGE - +SUM(IA$RRRAAA(IR,IA),SUM(IGESTOS$IAGK_HASORPOT(Y,IA,IGESTOS),VESTOLOADTS.L(Y,IA,IGESTOS,S,T))) -; - -$ifi not %EV%==yes $goto NO_EV -EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_EV','MWh')$CCCRRR(C,IR)= - + VEV_VG2V_BEV.L(Y,IR,S,T) - + VEV_VG2V_PHEV.L(Y,IR,S,T) -$ifi %V2G%==yes - VEV_VV2G_BEV.L(Y,IR,S,T) -$ifi %V2G%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T) -$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_BEV.L(Y,IR,S,T)$(cs('v2g',IY411)) -$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T)$(cs('v2g',IY411)) -; -$label NO_EV - -$ifi %TRANSPORT%==yes EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')$CCCRRR(C,IR)= -$ifi %TRANSPORT%==yes $ifi %TRANSPORT_SYNTHFUEL_COMMODITY%==ELECTRICITY +VTRANSDEMAND_T.L(Y,IR,S,T) -$ifi %TRANSPORT%==yes +0; - -$ifi %CCS%==yes EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_CCS','MWh')$CCCRRR(C,IR)= -$ifi %CCS%==yes SUM((IA,G)$(IAGK_HASORPOT(Y,IA,G) AND RRRAAA(IR,IA) AND CCS_G(G)),VGF_T.L(Y,IA,G,S,T) * IM_CO2(G)*IOF0001 * IOF3P6 * CCS_CO2CAPTEFF_G(G)* CCS_DECO2COMP_G(G)); - -$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND -EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_H2','MWh')$CCCRRR(C,IR)= -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOH2,S,T)) -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOHH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOHH2,S,T)) -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GEHTOH2,S,T)) -; - -EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')$CCCRRR(C,IR)= -*Adding electricity consumption from BIOMETHANE-DAC generation -+ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)*DAC_DE(IHYDROGEN_GH2TOBIOMETH)) -*Adding electricity consumption from biogas upgrading generation -+ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASUPGRADING)$(RRRAAA(IR,IA)),VGBIOGASUPGRADING_T.L(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)*BIOGASUPGRADING_DE(IHYDROGEN_GBIOGASUPGRADING)) -*Adding electricity consumption from biogas methanation generation -+ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASMETHANATION)$(RRRAAA(IR,IA)),VGBIOGASMETHANATION_T.L(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)*METHANATION_DE(IHYDROGEN_GBIOGASMETHANATION)) -; -$label NO_HYDROGEN_DEMAND - - -**LOSSES -EL_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')$CCCRRR(C,IR)= -* EXOGENOUS DEMAND -EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')*DISLOSS_E(IR)/(1-DISLOSS_E(IR)) -* P2H CONSUMPTION -+SUM(IA$RRRAAA(IR,IA), SUM(IGETOH$IAGK_HASORPOT(Y,IA,IGETOH), VGE_T.L(Y,IA,IGETOH,S,T)*DISLOSS_E_AG(IA,IGETOH)/(1-DISLOSS_E_AG(IA,IGETOH)))) -* INTRASEASONAL ELECTRICITY STORAGE -$ifi not %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADT.L(Y,IA,IGESTO,S,T)*DISLOSS_E_AG(IA,IGESTO)/(1-DISLOSS_E_AG(IA,IGESTO)))) -$ifi %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADTS.L(Y,IA,IGESTO,S,T)*DISLOSS_E_AG(IA,IGESTO)/(1-DISLOSS_E_AG(IA,IGESTO)))) -* INTERSEASONAL ELECTRICITY STORAGE -+SUM(IA$RRRAAA(IR,IA),SUM(IGESTOS$IAGK_HASORPOT(Y,IA,IGESTOS),VESTOLOADT.L(Y,IA,IGESTOS,S,T)*DISLOSS_E_AG(IA,IGESTOS)/(1-DISLOSS_E_AG(IA,IGESTOS)))) -* EVs -$ifi not %EV%==yes $goto NO_EV2 - +( - + VEV_VG2V_BEV.L(Y,IR,S,T) - + VEV_VG2V_PHEV.L(Y,IR,S,T) - )*EV_DISTLOSSLOAD(IR)/(1-EV_DISTLOSSLOAD(IR)) - +( -$ifi %V2G%==yes - VEV_VV2G_BEV.L(Y,IR,S,T) -$ifi %V2G%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T) -$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_BEV.L(Y,IR,S,T)$(cs('v2g',IY411)) -$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T)$(cs('v2g',IY411)) - +0)*EV_DISTLOSSUNLOAD(IR)/(1-EV_DISTLOSSUNLOAD(IR)) -$label NO_EV2 -*CCS -$ifi %CCS%==yes +SUM((IA,G)$(IAGK_HASORPOT(Y,IA,G) AND RRRAAA(IR,IA) AND CCS_G(G)),VGF_T.L(Y,IA,G,S,T) * IM_CO2(G)*IOF0001 * IOF3P6 * CCS_CO2CAPTEFF_G(G)* CCS_DECO2COMP_G(G)*DISLOSS_E_AG(IA,G)/(1-DISLOSS_E_AG(IA,G))) - -$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND2 -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOH2,S,T)*DISLOSS_E_AG(IA,IHYDROGEN_GETOH2)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GETOH2))) -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOHH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOHH2,S,T)*DISLOSS_E_AG(IA,IHYDROGEN_GETOHH2)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GETOHH2))) -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GEHTOH2,S,T)*DISLOSS_E_AG(IA,IHYDROGEN_GEHTOH2)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GEHTOH2))) -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)*DAC_DE(IHYDROGEN_GH2TOBIOMETH)*DISLOSS_E_AG(IA,IHYDROGEN_GH2TOBIOMETH)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GH2TOBIOMETH))) -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASUPGRADING)$(RRRAAA(IR,IA)),VGBIOGASUPGRADING_T.L(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)*BIOGASUPGRADING_DE(IHYDROGEN_GBIOGASUPGRADING)*DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASUPGRADING)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASUPGRADING))) -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASMETHANATION)$(RRRAAA(IR,IA)),VGBIOGASMETHANATION_T.L(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)*METHANATION_DE(IHYDROGEN_GBIOGASMETHANATION)*DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASMETHANATION)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASMETHANATION))) -$label NO_HYDROGEN_DEMAND2 - -*PRODUCTION SIDE -+SUM((IGE,IA,FFF,TECH_TYPE)$((NOT IGETOH(IGE)) AND RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh')*DISLOSS_E_AG(IA,IGE)) -; - -EL_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')$CCCRRR(C,IR)= -*TRANSMISSION LOSSES -+SUM(IRE$IXK_HASORPOT(Y,IRE,IR),VX_T.L(Y,IRE,IR,S,T)*XLOSS(IRE,IR)); - - -*ANNUAL DEMAND -** EXOGENOUS DEMAND - -EL_DEMAND_YCR(Y,C,IR,'EXOGENOUS','TWh')$(CCCRRR(C,IR) AND SUM(DEUSER,IDE_SUMST(IR,DEUSER)))= -SUM((DEUSER,S,T)$IDE_SUMST(IR,DEUSER), IHOURSINST(S,T)*IHOURFRAC*DE(Y,IR,DEUSER) * DE_VAR_T(IR,DEUSER,S,T) / IDE_SUMST(IR,DEUSER))/IOF1000000; - -** ENDOGENOUS DEMAND - -EL_DEMAND_YCR(Y,C,IR,'ENDOGENOUS_ELECT2HEAT','TWh')$CCCRRR(C,IR)= -* HEAT PUMPS CONSUMPTION - SUM((S,T,IA)$RRRAAA(IR,IA), SUM(IGETOH$IAGK_HASORPOT(Y,IA,IGETOH), IHOURSINST(S,T)*IHOURFRAC*VGE_T.L(Y,IA,IGETOH,S,T)))/IOF1000000 -; - -EL_DEMAND_YCR(Y,C,IR,'ENDO_INTRASTO','TWh')$CCCRRR(C,IR)= -* INTRASEASONAL ELECTRICITY STORAGE LOSS -$ifi not %stointers%==all +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),IHOURSINST(S,T)*IHOURFRAC*(VESTOLOADT.L(Y,IA,IGESTO,S,T)-VGE_T.L(Y,IA,IGESTO,S,T))))/IOF1000000 -$ifi %stointers%==all +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),IHOURSINST(S,T)*IHOURFRAC*(VESTOLOADTS.L(Y,IA,IGESTO,S,T)-VGE_T.L(Y,IA,IGESTO,S,T))))/IOF1000000 -; - -EL_DEMAND_YCR(Y,C,IR,'ENDO_INTERSTO','TWh')$CCCRRR(C,IR)= -* INTERSEASONAL ELECTRICITY STORAGE LOSS - +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IGESTOS$IAGK_HASORPOT(Y,IA,IGESTOS),IHOURSINST(S,T)*IHOURFRAC*(VESTOLOADTS.L(Y,IA,IGESTOS,S,T)-VGE_T.L(Y,IA,IGESTOS,S,T))))/IOF1000000 -; - -EL_DEMAND_YCR(Y,C,IR,'ENDO_EV','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_EV','MWh')*IHOURFRAC)/IOF1000000 -; - -EL_DEMAND_YCR(Y,C,IR,'ENDO_OTHERTRANS','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')*IHOURFRAC)/IOF1000000 -; - -EL_DEMAND_YCR(Y,C,IR,'DIST_LOSSES','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')*IHOURFRAC)/IOF1000000 -; - -EL_DEMAND_YCR(Y,C,IR,'TRANS_LOSSES','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')*IHOURFRAC)/IOF1000000 -; - -EL_DEMAND_YCR(Y,C,IR,'ENDO_CCS','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_CCS','MWh')*IHOURFRAC)/IOF1000000 -; - -EL_DEMAND_YCR(Y,C,IR,'ENDO_H2','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_H2','MWh')*IHOURFRAC)/IOF1000000 -; - -EL_DEMAND_YCR(Y,C,IR,'ENDO_BIOMETHANE','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')*IHOURFRAC)/IOF1000000 -; - -* ----------- END OF ELECTRICITY DEMAND -------------- - -* ------------- HEAT DEMAND -------------- -*HOURLY DEMAND -** EXOGENOUS DEMAND - -H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER,IDH_SUMST(IA,DHUSER)))= -SUM((DHUSER)$IDH_SUMST(IA,DHUSER), DH(Y,IA,DHUSER) * DH_VAR_T(IA,DHUSER,S,T) / IDH_SUMST(IA,DHUSER)) - -$ifi not %INDIVUSERS%==yes $goto NO_INDIVUSERSGROUP -$ifi not %GROUP_DEMAND_SHIFT%==yes $goto NO_INDIVUSERSGROUP -+ ( -*Removing default demand - -SUM((DHUSER)$IDH_SUMST(IA,DHUSER), DH(Y,IA,DHUSER) * DH_VAR_T(IA,DHUSER,S,T) / IDH_SUMST(IA,DHUSER)) -*Introducing new allocated demand - +SUM((INDIVUSERS_GROUP,DHUSER)$INDIVUSERS_GROUP_A(IA,DHUSER,INDIVUSERS_GROUP), - VINDIVUSERS_GROUPSHARE.L(Y,IR,DHUSER,INDIVUSERS_GROUP)* DH_VAR_T(IA,DHUSER,S,T)/ IDH_SUMST(IA,DHUSER) - )*SUM((INDIVUSERS_DEMANDTYPE,DHUSER)$INDIVUSERS_DEMANDTYPE_A(IA,DHUSER,INDIVUSERS_DEMANDTYPE), - SUM(IAI$(RRRAAA(IR,IAI) AND INDIVUSERS_DEMANDTYPE_A(IAI,DHUSER,INDIVUSERS_DEMANDTYPE)), DH(Y,IAI,DHUSER)) - ) - )$(INDIVUSERS_AAA(IA) - AND SUM((INDIVUSERS_GROUP,DHUSER),INDIVUSERS_GROUP_A(IA,DHUSER,INDIVUSERS_GROUP)) - AND SUM((INDIVUSERS_DEMANDTYPE,DHUSER),INDIVUSERS_DEMANDTYPE_A(IA,DHUSER,INDIVUSERS_DEMANDTYPE))) -$label NO_INDIVUSERSGROUP -; - -** ENDOGENOUS DEMAND - -H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTRASTO','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= -* INTRASEASONAL HEAT STORAGE -$ifi not %stointers%==all SUM(IGHSTO$IAGK_HASORPOT(Y,IA,IGHSTO),VHSTOLOADT.L(Y,IA,IGHSTO,S,T)) -$ifi %stointers%==all SUM(IGHSTO$IAGK_HASORPOT(Y,IA,IGHSTO),VHSTOLOADTS.L(Y,IA,IGHSTO,S,T)) - -; - -H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTERSTO','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= -* INTERSEASONAL HEAT STORAGE - + SUM(IGHSTOS$IAGK_HASORPOT(Y,IA,IGHSTOS),VHSTOLOADTS.L(Y,IA,IGHSTOS,S,T)) -; - -**LOSSES -H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'DIST_LOSSES','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= -* EXOGENOUS DEMAND -H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh')*DISLOSS_H(IA)/(1-DISLOSS_H(IA)) -; - -$ifi %HEATTRANS%==yes H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'TRANS_LOSSES','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= -$ifi %HEATTRANS%==yes *TRANSMISSION LOSSES -$ifi %HEATTRANS%==yes +SUM(IAE$IXHK_HASORPOT(Y,IAE,IA),VXH_T.L(Y,IAE,IA,S,T)*XHLOSS(IAE,IA)); -$ifi %HEATTRANS%==yes ; - -$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND3 -H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_H2','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= -+SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGH_T.L(Y,IA,IHYDROGEN_GEHTOH2,S,T)) -; - -H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_BIOMETHANE','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= -+ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)*DAC_DH(IHYDROGEN_GH2TOBIOMETH)) -; -$label NO_HYDROGEN_DEMAND3 - - -*ANNUAL DEMAND -** EXOGENOUS DEMAND - -H_DEMAND_YCRA(Y,C,IR,IA,'EXOGENOUS','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER,IDH_SUMST(IA,DHUSER)))= -SUM((S,T),IHOURSINST(S,T)*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh')*IHOURFRAC)/IOF1000000; -; - -** ENDOGENOUS DEMAND -H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_INTRASTO','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= -* INTRASEASONAL HEAT STORAGE LOSS -$ifi not %stointers%==all SUM((S,T,IGHSTO)$IAGK_HASORPOT(Y,IA,IGHSTO),IHOURSINST(S,T)*IHOURFRAC*(VHSTOLOADT.L(Y,IA,IGHSTO,S,T)-VGH_T.L(Y,IA,IGHSTO,S,T)))/IOF1000000 -$ifi %stointers%==all SUM((S,T,IGHSTO)$IAGK_HASORPOT(Y,IA,IGHSTO),IHOURSINST(S,T)*IHOURFRAC*(VHSTOLOADTS.L(Y,IA,IGHSTO,S,T)-VGH_T.L(Y,IA,IGHSTO,S,T)))/IOF1000000 - -; - -H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_INTERSTO','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= - -* INTERSEASONAL HEAT STORAGE LOSS - + SUM((S,T,IGHSTOS)$IAGK_HASORPOT(Y,IA,IGHSTOS),IHOURSINST(S,T)*IHOURFRAC*(VHSTOLOADTS.L(Y,IA,IGHSTOS,S,T)-VGH_T.L(Y,IA,IGHSTOS,S,T)))/IOF1000000 -; - -H_DEMAND_YCRA(Y,C,IR,IA,'DIST_LOSSES','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= - SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'DIST_LOSSES','MWh'))/IOF1000000 -; - -H_DEMAND_YCRA(Y,C,IR,IA,'TRANS_LOSSES','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= - SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'TRANS_LOSSES','MWh'))/IOF1000000 -; - -H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_H2','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= - SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_H2','MWh'))/IOF1000000 -; - -H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_BIOMETHANE','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= - SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_BIOMETHANE','MWh'))/IOF1000000 -; -* ----------- END OF HEAT DEMAND -------------- - -$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND30 -* ------------- H2 DEMAND -------------- - -*HOURLY -** EXOGENOUS DEMAND - -H2_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR))= - IHYDROGEN_DH2_REGION_T_Y(Y,IR,S,T)+ - SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(Y,IA,S,T)) -; - -$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space -H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_REGIONAL','MWh')$(CCCRRR(C,IR))= - VGE_T_FLEXDH2.L(Y,IR,S,T) -; -$label no_flexible_h2_space - -H2_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')$CCCRRR(C,IR)= - IHYDROGEN_DH2_REGION_T_Y(Y,IR,S,T)*DISLOSS_H2(IR)/(1-DISLOSS_H2(IR))+ - SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(Y,IA,S,T)*DISLOSS_H2(IA)/(1-DISLOSS_H2(IA))) -$ifi %flexible_h2_space%==yes + VGE_T_FLEXDH2.L(Y,IR,S,T)*DISLOSS_H2(IR)/(1-DISLOSS_H2(IR)) -; - -** ENDOGENOUS DEMAND - -H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTERSTO','MWh')$CCCRRR(C,IR)= -* INTERSEASONAL H2 STORAGE - +SUM(IA$RRRAAA(IR,IA),SUM(IHYDROGEN_GH2STO$IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO),VHYDROGEN_STOLOADT.L(Y,IA,IHYDROGEN_GH2STO,S,T))) -; - -$ifi %TRANSPORT%==yes H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')$CCCRRR(C,IR)= -$ifi %TRANSPORT%==yes $ifi %TRANSPORT_SYNTHFUEL_COMMODITY%==HYDROGEN +VTRANSDEMAND_T.L(Y,IR,S,T) -$ifi %TRANSPORT%==yes +0; - - -H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_FUELCELL','MWh')$CCCRRR(C,IR)= -*Adding H2 consumption from FUELCELLS generation -+ SUM(IAGK_HASORPOT(Y,IA,G)$(RRRAAA(IR,IA) AND GTECH_TYPE(G,'FUELCELL')),VGF_T.L(Y,IA,G,S,T)) -; - -H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')$CCCRRR(C,IR)= -*Adding H2 consumption from BIOMETHANE-DAC generation -+ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)/GDATA(IHYDROGEN_GH2TOBIOMETH,'GDFE')) -; - - -**LOSSES - -H2_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')$CCCRRR(C,IR)= -*TRANSMISSION LOSSES -+SUM(IRE$IXH2K_HASORPOT(Y,IRE,IR),VXH2_T.L(Y,IRE,IR,S,T)*XH2LOSS(IRE,IR)); - - -*ANNUAL DEMAND -** EXOGENOUS DEMAND - -H2_DEMAND_YCR(Y,C,IR,'EXOGENOUS','TWh')$(CCCRRR(C,IR))= -SUM((S,T), IHOURSINST(S,T)*IHOURFRAC*H2_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh'))/IOF1000000; - -** ENDOGENOUS DEMAND - -H2_DEMAND_YCR(Y,C,IR,'ENDO_INTERSTO','TWh')$CCCRRR(C,IR)= -* INTERSEASONAL H2 STORAGE LOSS - +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IHYDROGEN_GH2STO$IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO),IHOURSINST(S,T)*IHOURFRAC*(VHYDROGEN_STOLOADT.L(Y,IA,IHYDROGEN_GH2STO,S,T)-VHYDROGEN_GH2_T.L(Y,IA,IHYDROGEN_GH2STO,S,T))))/IOF1000000 -; - -H2_DEMAND_YCR(Y,C,IR,'ENDO_FUELCELL','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_FUELCELL','MWh')*IHOURFRAC)/IOF1000000 -; - -H2_DEMAND_YCR(Y,C,IR,'ENDO_OTHERTRANS','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')*IHOURFRAC)/IOF1000000 -; - -H2_DEMAND_YCR(Y,C,IR,'TRANS_LOSSES','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')*IHOURFRAC)/IOF1000000 -; - -H2_DEMAND_YCR(Y,C,IR,'DIST_LOSSES','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')*IHOURFRAC)/IOF1000000 -; - -H2_DEMAND_YCR(Y,C,IR,'ENDO_BIOMETHANE','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')*IHOURFRAC)/IOF1000000 -; - -$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space2 -H2_DEMAND_YCR(Y,C,IR,'ENDO_REGIONAL','TWh')$CCCRRR(C,IR)= - SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_REGIONAL','MWh')*IHOURFRAC)/IOF1000000 -; -$label no_flexible_h2_space2 - -* ----------- END OF H2 DEMAND -------------- -$label NO_HYDROGEN_DEMAND30 - -* -------------------- END OF ENERGY DEMAND ----------------------- - - -* -------------------- TRANSMISSION CAPACITY ----------------------- - -** EXOGENOUS ELECTRICITY CAPACITY - -X_CAP_YCR(Y,C,IR,IRI,'EXOGENOUS','GW')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= -IOF0001*XKFX(Y,IR,IRI) -; - - -** ENDOGENOUS ELECTRIC CAPACITY - -$ifi not %TransInvest%==yes $goto Transmission_investments_end -X_CAP_YCR(Y,C,IR,IRI,'ENDOGENOUS','GW')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= -IOF0001*VXKNACCUMNET.L(Y,IR,IRI) -; -$label Transmission_investments_end - - -* -------------------- END OF TRANSMISSION CAPACITY ----------------------- - -* -------------------- TRANSMISSION FLOW ----------------------- - -** HOURLY TRANSMISSION FLOW - -X_FLOW_YCRST(Y,C,IR,IRI,S,T,'MWh')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= -VX_T.L(Y,IR,IRI,S,T); -; - - -** ANNUAL TRANSMISSION FLOW -X_FLOW_YCR(Y,C,IR,IRI,'TWh')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= -SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*VX_T.L(Y,IR,IRI,S,T))/IOF1000000; -; - - - -* -------------------- END OF TRANSMISSION FLOW ----------------------- - -$ifi NOT %HEATTRANS%==yes $goto no_heattrans -* -------------------- HEAT TRANSMISSION CAPACITY ----------------------- - -** EXOGENOUS HEAT TRANSMISSION CAPACITY - -XH_CAP_YCA(Y,C,IA,IAI,'EXOGENOUS','GW')$(ICA(C,IA) AND (XHKFX(Y,IA,IAI) OR XHKFX_DH(Y,IA,IAI)))= -IOF0001*(XHKFX(Y,IA,IAI) + XHKFX_DH(Y,IA,IAI)) -; - -** ENDOGENOUS HEAT TRANSMISSION CAPACITY - -$ifi not %HeatTransInvest%==yes $goto Heat_Transmission_investments_end -XH_CAP_YCA(Y,C,IA,IAI,'ENDOGENOUS','GW')$(ICA(C,IA) AND IXHK_HASORPOT(Y,IA,IAI))= -IOF0001*VXHKNACCUMNET.L(Y,IA,IAI) -; -$label Heat_Transmission_investments_end - - -* -------------------- END OF HEAT TRANSMISSION CAPACITY ----------------------- - -* -------------------- HEAT TRANSMISSION FLOW ----------------------- - -** HOURLY HEAT TRANSMISSION FLOW - -XH_FLOW_YCAST(Y,C,IA,IAI,S,T,'MWh')$(ICA(C,IA) AND IXHK_HASORPOT(Y,IA,IAI))= -VXH_T.L(Y,IA,IAI,S,T); -; - -** ANNUAL HEAT TRANSMISSION FLOW -XH_FLOW_YCA(Y,C,IA,IAI,'TWh')$(ICA(C,IA) AND IXHK_HASORPOT(Y,IA,IAI))= -SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*VXH_T.L(Y,IA,IAI,S,T))/IOF1000000; -; - -* -------------------- END OF HEAT TRANSMISSION FLOW ----------------------- -$label no_heattrans - - -$ifi NOT %hydrogen%==yes $goto no_hydrogentrans -* -------------------- H2 TRANSMISSION CAPACITY ----------------------- - -** EXOGENOUS H2 TRANSMISSION CAPACITY - -XH2_CAP_YCR(Y,C,IR,IRI,'EXOGENOUS','GW')$(CCCRRR(C,IR) AND XH2KFX(Y,IR,IRI))= -IOF0001*XH2KFX(Y,IR,IRI) -; - -** ENDOGENOUS H2 TRANSMISSION CAPACITY - -$ifi not %H2TransInvest%==yes $goto H2_Transmission_investments_end -XH2_CAP_YCR(Y,C,IR,IRI,'ENDOGENOUS','GW')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= -IOF0001*(VXH2KNACCUMNET.L(Y,IR,IRI)$SUM(IYALIAS2$(YVALUE(IYALIAS2) LE YVALUE(Y)),IXH2KN(IYALIAS2,IR,IRI)) - +VXH2KNACCUMNET_NGTOH2.L(Y,IR,IRI)$SUM(IYALIAS2$(YVALUE(IYALIAS2) LE YVALUE(Y)),IXH2KN_NGTOH2(IYALIAS2,IR,IRI))) -; -$label H2_Transmission_investments_end - - -* -------------------- END OF HEAT TRANSMISSION CAPACITY ----------------------- - -* -------------------- H2 TRANSMISSION FLOW ----------------------- - -** HOURLY H2 TRANSMISSION FLOW - -XH2_FLOW_YCRST(Y,C,IR,IRI,S,T,'MWh')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= -VXH2_T.L(Y,IR,IRI,S,T); -; - -** ANNUAL H2 TRANSMISSION FLOW -XH2_FLOW_YCR(Y,C,IR,IRI,'TWh')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= -SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*VXH2_T.L(Y,IR,IRI,S,T))/IOF1000000; -; - -* -------------------- END OF H2 TRANSMISSION FLOW ----------------------- -$label no_hydrogentrans - -* ---------------------- ECONOMIC OUTPUT ---------------------- - -* ------------- COMMODITY PRICES -------------- - -** ELECTRICITY PRICES - -*HOURLY ELECTRICITY PRICE - -EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')$CCCRRR(C,IR)=OMONEY*QEEQ.M(Y,IR,S,T) -$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) -$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) -/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); - -*AVERAGE ELECTRICITY PRICE - -EL_PRICE_YCR(Y,C,IR,'AVERAGE','Money_per_MWh')$CCCRRR(C,IR)= -SUM((S,T),EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')/(IWEIGHSUMS*IWEIGHSUMT/(WEIGHT_S(S)*WEIGHT_T(T)))); - -$ontext -*EXCLUDED SO FAR -*AVERAGE ELECTRICITY PRICE WEIGTHED BY CONSUMPTION - -EL_PRICE_YCR(Y,C,IR,'AVERAGE_WEIGHTED_BY_CONSUMPTION','Money_per_MWh')$CCCRRR(C,IR)= - SUM((VARIABLE_CATEGORY,S,T), - EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*EL_DEMAND_YCRST(Y,C,IR,S,T,VARIABLE_CATEGORY,'MWh') - ) - /SUM((VARIABLE_CATEGORY,S,T),EL_DEMAND_YCRST(Y,C,IR,S,T,VARIABLE_CATEGORY,'MWh')) -; - -*AVERAGE ELECTRICITY PRICE WEIGTHED BY PRODUCTION - -EL_PRICE_YCR(Y,C,IR,'AVERAGE_WEIGHTED_BY_PRODUCTION','Money_per_MWh')$CCCRRR(C,IR)= - SUM((IGE,IA,FFF,S,T,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGE)), - EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh') - ) - /SUM((IGE,IA,FFF,S,T,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh')) -; -$offtext - -** END OF ELECTRICITY PRICES - -** heatING PRICES - -*HOURLY heatING PRICE - -$ifi %BalancingMarket%==yes $ifi %NOHEATMARKET%==yes $goto NO_HEATMARKET -H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND (SUM(DHUSER, IDH_SUMST(IA,DHUSER)) -$ifi %HEATTRANS%==yes OR SUM(IAE,IXHK_HASORPOT(Y,IAE,IA)) OR SUM(IAI,IXHK_HASORPOT(Y,IA,IAI)) -))=OMONEY*QHEQ.M(Y,IA,S,T) -$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) -$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) -/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); -$label NO_HEATMARKET -$ifi %BalancingMarket%==yes $ifi %NOHEATMARKET%==yes H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=0; - - - -*AVERAGE heatING PRICE - -H_PRICE_YCRA(Y,C,IR,IA,'AVERAGE','Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND (SUM(DHUSER, IDH_SUMST(IA,DHUSER)) -$ifi %HEATTRANS%==yes OR SUM(IAE,IXHK_HASORPOT(Y,IAE,IA)) OR SUM(IAI,IXHK_HASORPOT(Y,IA,IAI)) -))= -SUM((S,T),H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')/(IWEIGHSUMS*IWEIGHSUMT/(WEIGHT_S(S)*WEIGHT_T(T)))); - -$ontext -*EXCLUDED SO FAR -*AVERAGE heatING PRICE WEIGTHED BY CONSUMPTION - -H_PRICE_YCRA(Y,C,IR,IA,'AVERAGE_WEIGHTED_BY_CONSUMPTION','Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER, IDH_SUMST(IA,DHUSER)))= - SUM((VARIABLE_CATEGORY,S,T), - H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,VARIABLE_CATEGORY,'MWh') - ) - /SUM((VARIABLE_CATEGORY,S,T),H_DEMAND_YCRAST(Y,C,IR,IA,S,T,VARIABLE_CATEGORY,'MWh')) -; - -*AVERAGE heatING PRICE WEIGTHED BY PRODUCTION - -H_PRICE_YCRA(Y,C,IR,IA,'AVERAGE_WEIGHTED_BY_PRODUCTION','Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER, IDH_SUMST(IA,DHUSER)))= - SUM((IGH,FFF,S,T,TECH_TYPE)$IAGK_HASORPOT(Y,IA,IGH), - H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh') - ) - /SUM((IGH,FFF,S,T,TECH_TYPE)$IAGK_HASORPOT(Y,IA,IGH),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh')) -; -$offtext - -** END OF heatING PRICES - -$ifi NOT %HYDROGEN%==yes $goto NO_HYDROGEN_PRICE - -*HOURLY HYDROGEN PRICE -H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')$CCCRRR(C,IR)=OMONEY*QHYDROGEN_EQ.M(Y,IR,S,T) -$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) -$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) -/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); - -*AVERAGE Hydrogen PRICE - -H2_PRICE_YCR(Y,C,IR,'AVERAGE','Money_per_MWh')$CCCRRR(C,IR)= -SUM((S,T),H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')/(IWEIGHSUMS*IWEIGHSUMT/(WEIGHT_S(S)*WEIGHT_T(T)))); - - -*HOURLY BIOMETHANE PRICE -BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh')=OMONEY*QBIOMETHANE_EQ.M(Y,S,T) -$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) -$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) -/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); - -$label NO_HYDROGEN_PRICE - -* ------------- END OF COMMODITY PRICES -------------- - - -* ------------- COSTS -------------- - -* -- GENERATION COSTS ----- - -** GENERATION INVESTMENTS - -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and RRRAAA(IR,IA))= - OMONEY*( - SUM(IYALIAS2$((ORD(IYALIAS2) LE ORD(Y)) AND IAGKNY(IYALIAS2,IA,G) AND (NOT IGKN_ES(G))),IYHASANNUITYG(IYALIAS2,Y,G)*VGKN.L(IYALIAS2,IA,G)*GINVCOST(IA,G)*ANNUITYCG(C,G)) -$ifi %OFFSHOREGRID%==yes + SUM(IYALIAS2$((ORD(IYALIAS2) LE ORD(Y)) AND IAGKNY(IYALIAS2,IA,G) AND IGKN_ES(G)),IYHASANNUITYG(IYALIAS2,Y,G)*SUM(XES,VGLAMBDA.L(IYALIAS2,IA,G,XES)*GINVCOST_ES(G,XES))*ANNUITYCG(C,G)) -) -; - -** GENEARTION FIXED COSTS - -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FIXED_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= - OMONEY/IOF1000*GOMFCOST(IA,G)*( - GKFX(Y,IA,G) - +VGKNACCUMNET.L(Y,IA,G) -$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,G)$IGDECOMEXOPOT(Y,IA,G) - ) -; - -** GENERATION O&M COSTS - -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= - OMONEY/IOF1000000* - ( - (IHOURFRAC *GOMVCOSTO(IA,G)*( - SUM((S,T), IHOURSINST(S,T) * VGE_T.L(Y,IA,G,S,T))$IGKE(G) -$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VHYDROGEN_GH2_T.L(Y,IA,G,S,T))$(IHYDROGEN_GH2STO(G) OR IHYDROGEN_GCH4TOH2(G)) -$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VGBIOMETH_T.L(Y,IA,G,S,T))$IHYDROGEN_GH2TOBIOMETH(G) -$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T))$IHYDROGEN_GBIOGASMETHANATION(G) -$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VGBIOGASUPGRADING_T.L(Y,IA,G,S,T))$IHYDROGEN_GBIOGASUPGRADING(G) - )) - + (IHOURFRAC *GOMVCOSTO(IA,G) * GDATA(G,'GDCV') * - ( - + SUM((S,T), IHOURSINST(S,T) * VGH_T.L(Y,IA,G,S,T))))$IGKH(G) - - + (IHOURFRAC *GOMVCOSTIN(IA,G)* - ( - + SUM((S,T), IHOURSINST(S,T) * VGF_T.L(Y,IA,G,S,T)))) - ) ; - -** GENERATION FUEL COSTS - -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FUEL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= - OMONEY/IOF1000000*( - IHOURFRAC *FUELPRICE(Y,IA,FFF)*IOF3P6 -$ifi not %STEPWISEPRICE%==yes $goto No_STEPWISEPRICE - +(QSTEPWISEPRICE_GFTOSTEP.M(Y,C,FFF)/(IDISCOUNTFACTOR(Y)*IWEIGHTY(Y)))$ISTEPWISEPRICE_F(Y,C,FFF) -$label No_STEPWISEPRICE - )* - ( - SUM((S,T), IHOURSINST(S,T) * VGF_T.L(Y,IA,G,S,T) )$IAGK_HASORPOT(Y,IA,G) - )$(IGNOTETOH(G) and (not IGESTO(G)) and (not IGHSTO(G)) and (not IGESTOS(G)) and (not IGHSTOS(G))) - - -* Electricity storages: -$ifi not %stointers%==all +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VESTOLOADT.L(Y,IA,G,S,T))$IGESTO(G) -$ifi %stointers%==all +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VESTOLOADTS.L(Y,IA,G,S,T))$IGESTO(G) - +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VESTOLOADTS.L(Y,IA,G,S,T))$IGESTOS(G) -* Heat storages: -$ifi not %stointers%==all +OMONEY/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VHSTOLOADT.L(Y,IA,G,S,T))$IGHSTO(G) -$ifi %stointers%==all +OMONEY/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VHSTOLOADTS.L(Y,IA,G,S,T))$IGHSTO(G) - +OMONEY/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VHSTOLOADTS.L(Y,IA,G,S,T))$IGHSTOS(G) -* Electricity to heat: - +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGE_T.L(Y,IA,G,S,T))$(IAGK_HASORPOT(Y,IA,G) and IGETOH(G)) - -$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_PRICE2 - +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGE_T.L(Y,IA,G,S,T))$(IHYDROGEN_GETOH2(G) OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G)) - +OMONEY/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VGH_T.L(Y,IA,G,S,T))$IHYDROGEN_GEHTOH2(G) - +OMONEY/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VHYDROGEN_STOLOADT.L(Y,IA,G,S,T))$IHYDROGEN_GH2STO(G) - +OMONEY/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGF_T.L(Y,IA,G,S,T))$IHYDROGEN_GH2FUEL(G) - +OMONEY/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGF_T.L(Y,IA,G,S,T) - + H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VGBIOMETH_T.L(Y,IA,G,S,T)*DAC_DH(G) - + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOMETH_T.L(Y,IA,G,S,T)*DAC_DE(G) - )$IHYDROGEN_GH2TOBIOMETH(G) - +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOGASUPGRADING_T.L(Y,IA,G,S,T)*BIOGASUPGRADING_DE(G) - )$IHYDROGEN_GBIOGASUPGRADING(G) - +OMONEY/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)*METHANATION_DH2(G) - + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)*METHANATION_DE(G) - )$IHYDROGEN_GBIOGASMETHANATION(G) - +OMONEY/IOF1000000*SUM((S,T), BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh')*VGF_T.L(Y,IA,G,S,T))$IGBIOMETHANE(G) -$label NO_HYDROGEN_PRICE2 -; - -** CO2 EMISSIONS COST -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TAX','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= - SUM(GROUP$(GROUP_AAA(GROUP,IA)),OMONEY/IOF1000000*IHOURFRAC *IM_CO2(G)*IOF0001 * IOF3P6 *EMI_POL(Y,C,GROUP,"TAX_CO2") * SUM((S,T), IHOURSINST(S,T)*(VGF_T.L(Y,IA,G,S,T) -$ifi %CCS%==yes -(VGF_T.L(Y,IA,G,S,T)*CCS_CO2CAPTEFF_G(G))$CCS_G(G) -))) -; - -** CO2 TRANSPORT COST -$ifi %CCS%==yes ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TRANSPORT','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G) AND CCS_G(G))= -$ifi %CCS%==yes OMONEY/IOF1000000*IHOURFRAC *IM_CO2(G)*IOF0001 * IOF3P6 * CCS_TRANSPORTCOST * SUM((S,T), IHOURSINST(S,T)*(VGF_T.L(Y,IA,G,S,T))); - - -** OTHER EMISSIONS COST -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OTHER_EMI_TAX','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= - SUM(GROUP$(GROUP_AAA(GROUP,IA)),OMONEY/IOF1000000* - ( SUM((S,T), IHOURSINST(S,T) * (IHOURFRAC *IM_SO2(G)*IOF0001) * IOF3P6 * VGF_T.L(Y,IA,G,S,T))*EMI_POL(Y,C,GROUP,"TAX_SO2") - + SUM((S,T), IHOURSINST(S,T) * (IHOURFRAC *GDATA(G,'GDNOX')*IOF0000001) * IOF3P6 * VGF_T.L(Y,IA,G,S,T))* EMI_POL(Y,C,GROUP,"TAX_NOX") - )) -; - - -** UNIT COMMITMENT COST -$ifi not %UnitComm%==yes $goto No_UC -ECO_G_YCRAG(Y,C,IR,IA,IGUC,FFF,TECH_TYPE,'COSTS','GENERATION_UC_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(IGUC,FFF) AND GTECH_TYPE(IGUC,TECH_TYPE) and IAGK_HASORPOT(Y,IA,IGUC))= -OMONEY/IOF1000000*SUM((S,T), IHOURSINST(S,T)*( - VUCU.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCUCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHUNLD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! startup cost - +VUCD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCDCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHUNLD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! shutdown cost - +VUCON.L(Y,IA,IGUC,S,T)*IHOURFRAC*GDATA(IGUC,'GDUCCOST0')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHUNLD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC))) !! fixed hourly cost - +VUCU_STOLOAD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCUCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHLOAD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! startup cost - +VUCD_STOLOAD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCDCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHLOAD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! shutdown cost - +VUCON_STOLOAD.L(Y,IA,IGUC,S,T)*IHOURFRAC*GDATA(IGUC,'GDUCCOST0')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHLOAD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC))) !! fixed hourly cost - -$ifi %STEPWISE_RAMPING_UC%==ramp_const_cost +SUM(RAMPING_RATE,(VRAMPING_DOWN.L(Y,IA,IGUC,RAMPING_RATE,S,T)*IRAMPING_G_COSTS_DOWN(IGUC,RAMPING_RATE)+VRAMPING_UP.L(Y,IA,IGUC,RAMPING_RATE,S,T)*IRAMPING_G_COSTS_UP(IGUC,RAMPING_RATE))/CHRONOHOUR(S,T)*WEIGHT_T(T)) !! ramping cost -)) -; -$label NO_UC - - -*TAXES -$ifi NOT %TAXES%==yes $goto No_TAXES -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_TAXES','Mmoney')$(CCCRRR(C,IR) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G))= -OMONEY/IOF1000000*( -* Tax(+)/subsidy(-) on fuel use for electricity generation - + SUM((IS3,T), - IHOURSINST(IS3,T) * IHOURFRAC *TAX_F_EL(Y,C,G) * VGE_T.L(Y,IA,G,IS3,T)/ (GDATA(G,'GDFE') * (1$(NOT GEFFRATE(IA,G))+GEFFRATE(IA,G)))) - -* Tax(+)/subsidy(-) on fuel use for heat generation - + SUM((IS3,T), - IHOURSINST(IS3,T) * IHOURFRAC *TAX_F_HEAT(Y,C,G) * GDATA(G,'GDCV') * VGH_T.L(Y,IA,G,IS3,T)/ (GDATA(G,'GDFE') * (1$(NOT GEFFRATE(IA,G))+GEFFRATE(IA,G)))) - -* Tax(+)/subsidy(-) on fuel use - + SUM((IS3,T), - IHOURSINST(IS3,T) * IHOURFRAC *TAX_F(Y,C,G) * VGF_T.L(Y,IA,G,IS3,T)) - -* Tax(+)/subsidy(-) on heat generation - + SUM((IS3,T), - IHOURSINST(IS3,T) * IHOURFRAC *TAX_G_HEAT(Y,C,G) * VGH_T.L(Y,IA,G,IS3,T)) - -* Tax(+)/subsidy(-) on heat generation - + SUM((IS3,T), - IHOURSINST(IS3,T) * IHOURFRAC *TAX_G_EL(Y,C,G) * VGE_T.L(Y,IA,G,IS3,T)) -) -; -$label NO_TAXES - - -*GRID TARIFFS -$ifi NOT %GRIDTARIFFS%==yes $goto No_GRIDTARIFFS -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_GRID_TARIFFS','Mmoney')$(CCCRRR(C,IR) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND (IGETOH(G) -$ifi %HYDROGEN%==yes OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G) OR IHYDROGEN_GETOH2(G) -))= -OMONEY/IOF1000000*( - -* Fixed component and subscribed power (per MW installed) - + IOF1000 * - IGR_PRICE_TECH(Y,IR,'GRDSUBS') * (VGKNACCUMNET.L(Y,IA,G) -$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,G)$IGDECOMEXOPOT(Y,IA,G) - + GKFX(Y,IA,G)) /((GDATA(G,'GDFE') *(1$(NOT GEFFRATE(IA,G))+GEFFRATE(IA,G)))$IGETOH(G) + 1$(NOT IGETOH(G))) - -* Energy charge winter - + SUM((IS3,T)$IGR_TIME('GRDECW',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDECW') * VGE_T.L(Y,IA,G,IS3,T)) -* Energy charge summer - + SUM((IS3,T)$IGR_TIME('GRDECS',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDECS') * VGE_T.L(Y,IA,G,IS3,T)) -* Energy charge TOU step 1 - + SUM((IS3,T)$IGR_TIME('GRDTOU1',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU1') * VGE_T.L(Y,IA,G,IS3,T)) -* Energy charge TOU step 2 - + SUM((IS3,T)$IGR_TIME('GRDTOU2',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU2') * VGE_T.L(Y,IA,G,IS3,T)) -* Energy charge TOU step 3 - + SUM((IS3,T)$IGR_TIME('GRDTOU3',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU3') * VGE_T.L(Y,IA,G,IS3,T)) -* Energy charge TOU step 4 - + SUM((IS3,T)$IGR_TIME('GRDTOU4',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU4') * VGE_T.L(Y,IA,G,IS3,T)) -) -; -$label NO_GRIDTARIFFS - -* -- TRANSMISSION ----- -*ELECTRICITY -** TRANSMISSION INVESTMENTS -ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= - OMONEY*IOF0000001*( - SUM((IYALIAS2)$((IXKN(IYALIAS2,IRI,IR) OR IXKN(IYALIAS2,IR,IRI)) AND (ORD(IYALIAS2) LE ORD(Y)) AND (NOT (IXKN_ES(IR,IRI) OR IXKN_ES(IRI,IR)))), - IOF05*ANNUITYCX(C)*IYHASANNUITYX(IYALIAS2,Y)*VXKN.L(IYALIAS2,IR,IRI)*XINVCOST(IYALIAS2,IR,IRI)) -$ifi %OFFSHOREGRID%==yes +SUM((IYALIAS2)$((IXKN(IYALIAS2,IRI,IR) OR IXKN(IYALIAS2,IR,IRI)) AND (ORD(IYALIAS2) LE ORD(Y)) AND (IXKN_ES(IR,IRI) OR IXKN_ES(IRI,IR))), -$ifi %OFFSHOREGRID%==yes IOF05*ANNUITYCX(C)*IYHASANNUITYX(IYALIAS2,Y)*SUM(XES,VXLAMBDA.L(IYALIAS2,IR,IRI,XES)*XINVCOST_ES(IYALIAS2,IR,IRI,XES))) -) -; -** TRANSMISSION FLOW COSTS -ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= -OMONEY*IOF0000001* SUM((S,T), IHOURSINST(S,T) * (VX_T.L(Y,IR,IRI,S,T) * IHOURFRAC *XCOST(IR,IRI))); - -** TRANSMISSION TRADE COST -ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_TRADE_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= -OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VX_T.L(Y,IRI,IR,S,T) * EL_PRICE_YCRST(Y,C,IRI,S,T,'Money_per_MWh'))); - -** TRANSMISSION TRADE INCOME -ECO_X_YCR(Y,C,IR,IRI,'INCOME','TRANSMISSION_TRADE_INCOME','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= -OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VX_T.L(Y,IR,IRI,S,T) * EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))); - -*HEAT -$ifi not %HEATTRANS%==yes $goto No_HEATTRANS_costs -** TRANSMISSION INVESTMENTS -ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= - OMONEY*IOF0000001*SUM((IYALIAS2)$((IXHKN(IYALIAS2,IAI,IA) OR IXHKN(IYALIAS2,IA,IAI)) AND ORD(IYALIAS2) LE ORD(Y)) , - IOF05*ANNUITYCXH(C)*IYHASANNUITYXH(IYALIAS2,Y)*VXHKN.L(IYALIAS2,IA,IAI)*XHINVCOST(IYALIAS2,IA,IAI) - ); -** TRANSMISSION FLOW -ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= -OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH_T.L(Y,IA,IAI,S,T) * IHOURFRAC *XHCOST(IA,IAI))); - -** TRANSMISSION TRADE COST -ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','TRANSMISSION_TRADE_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= -OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH_T.L(Y,IAI,IA,S,T) * H_PRICE_YCRAST(Y,C,IR,IAI,S,T,'Money_per_MWh'))); - -** TRANSMISSION TRADE INCOME -ECO_XH_YCRA(Y,C,IR,IA,IAI,'INCOME','TRANSMISSION_TRADE_INCOME','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= -OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH_T.L(Y,IA,IAI,S,T) * H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh'))); - - -$label No_HEATTRANS_costs - -*Hydrogen -$ifi not %HYDROGEN%==yes $goto No_H2TRANS_costs - -** TRANSMISSION INVESTMENTS -ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= - OMONEY*IOF0000001*(SUM((IYALIAS2)$((IXH2KN(IYALIAS2,IRI,IR) OR IXH2KN(IYALIAS2,IR,IRI)) AND (NOT (IXKN_ES(IR,IRI) OR IXKN_ES(IRI,IR))) AND ORD(IYALIAS2) LE ORD(Y)) , - IOF05*ANNUITYCXH2(C)*IYHASANNUITYXH2(IYALIAS2,Y)*VXH2KN.L(IYALIAS2,IR,IRI)*XH2INVCOST(IYALIAS2,IR,IRI)) - + SUM((IYALIAS2)$((IXH2KN_NGTOH2(IYALIAS2,IRI,IR) OR IXH2KN_NGTOH2(IYALIAS2,IR,IRI)) AND ORD(IYALIAS2) LE ORD(Y)) , - IOF05*ANNUITYCXH2(C)*IYHASANNUITYXH2(IYALIAS2,Y)*VXH2KN_NGTOH2.L(IYALIAS2,IR,IRI)*XH2INVCOST_NGTOH2(IYALIAS2,IR,IRI)) -$ifi %ES_H2TRANS%==yes +SUM((IYALIAS2)$((IXH2KN(IYALIAS2,IRI,IR) OR IXH2KN(IYALIAS2,IR,IRI)) AND (ORD(IYALIAS2) LE ORD(Y)) AND (IXH2KN_ES(IR,IRI) OR IXH2KN_ES(IRI,IR))), -$ifi %ES_H2TRANS%==yes IOF05*ANNUITYCXH2(C)*IYHASANNUITYXH2(IYALIAS2,Y)*SUM(XES,VXH2LAMBDA.L(IYALIAS2,IR,IRI,XES)*XH2INVCOST_ES(IYALIAS2,IR,IRI,XES))) -$ifi %ES_H2TRANS%==yes ) - ) -; - -** TRANSMISSION FLOW -ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= -OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH2_T.L(Y,IR,IRI,S,T) * IHOURFRAC *XH2COST(IR,IRI))); - -** TRANSMISSION TRADE COST -ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_TRADE_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= -OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH2_T.L(Y,IR,IRI,S,T) * H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))); - -** TRANSMISSION TRADE INCOME -ECO_XH2_YCR(Y,C,IR,IRI,'INCOME','TRANSMISSION_TRADE_INCOME','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= -OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH2_T.L(Y,IR,IRI,S,T) * H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))); - - -$label No_H2TRANS_costs - -* ------------- END OF COSTS -------------- - -* ------------- OBJECTIVE FUNCTION -------------- - -OBJ_YCR(Y,C,IR,'GENERATION_FUEL_COSTS','Mmoney')$CCCRRR(C,IR)= - -*GENERATION COSTS -SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND NOT((IGESTOALL(G) OR IGHSTOALL(G) OR IGETOH(G) -$ifi %STEPWISEPRICE%==yes OR ISTEPWISEPRICE_F(Y,C,FFF) -$ifi %HYDROGEN%==yes OR IHYDROGEN_GETOH2(G) OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G) OR IHYDROGEN_GH2STO(G) OR IHYDROGEN_GH2TOE(G) OR IHYDROGEN_GH2TOEH(G) OR IHYDROGEN_GH2TOBIOMETH(G) OR IGBIOMETHANE(G) -))), -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FUEL_COSTS','Mmoney') -) - -$ifi not %STEPWISEPRICE%==yes $goto No_STEPWISEPRICE2 - +SUM(STEPWISEPRICE_FFF$(ISTEPWISEPRICE_F(Y,C,STEPWISEPRICE_FFF) AND SUM(STEPWISEPRICE_L,VSTEPWISEPRICE_VGF_T_STEP.L(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF))), - OMONEY/IOF1000000*( - (0+ SUM((S,T,IA,G)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND IGF(G,STEPWISEPRICE_FFF)), IHOURSINST(S,T) * VGF_T.L(Y,IA,G,S,T)*IOF3P6)*IHOURFRAC)* - SUM(STEPWISEPRICE_L,STEPWISEPRICE_FUELPRICE_STEP(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF)*VSTEPWISEPRICE_VGF_T_STEP.L(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF)) - /SUM(STEPWISEPRICE_L,VSTEPWISEPRICE_VGF_T_STEP.L(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF)) - ) - ) -$label No_STEPWISEPRICE2 - -; - -OBJ_YCR(Y,C,IR,'GENERATION_OPPORTUNITY_COSTS_STORAGE','Mmoney')$CCCRRR(C,IR)= -$ifi %import_results%==yes $ifi %ADDESTOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGESTOS)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGESTOS)),IHOURSINST(S,T)*ESTOVOLTSVAL(Y,IA,IGESTOS,S,T)*IHOURFRAC*(VGE_T.L(Y,IA,IGESTOS,S,T)/GDATA(IGESTOS,'GDFE')-VESTOLOADTS.L(Y,IA,IGESTOS,S,T))) -$ifi %import_results%==yes $ifi %ADDHSTOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGHSTOS)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGHSTOS)),IHOURSINST(S,T)*HSTOVOLTSVAL(Y,IA,IGHSTOS,S,T)*IHOURFRAC*(VGH_T.L(Y,IA,IGHSTOS,S,T)/GDATA(IGHSTOS,'GDFE')-VHSTOLOADTS.L(Y,IA,IGHSTOS,S,T))) -$ifi %import_results%==yes $ifi %ADDESTOVOLT%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGESTO)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGESTO)),IHOURSINST(S,T)*ESTOVOLTVAL(Y,IA,IGESTO,S,T)*IHOURFRAC*(VGE_T.L(Y,IA,IGESTO,S,T)/GDATA(IGESTO,'GDFE')-VESTOLOADT.L(Y,IA,IGESTO,S,T))) -$ifi %import_results%==yes $ifi %ADDHSTOVOLT%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGHSTO)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGHSTO)),IHOURSINST(S,T)*HSTOVOLTVAL(Y,IA,IGHSTO,S,T)*IHOURFRAC*(VGH_T.L(Y,IA,IGHSTO,S,T)/GDATA(IGHSTO,'GDFE')-VHSTOLOADT.L(Y,IA,IGHSTO,S,T))) -$ifi %import_results%==yes $ifi %HYDROGEN%==yes $ifi %ADDH2STOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T,IA,IHYDROGEN_GH2STO)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO)),IHOURSINST(S,T)*H2STOVOLTSVAL(Y,IA,IHYDROGEN_GH2STO,S,T)*IHOURFRAC*(VHYDROGEN_GH2_T.L(Y,IA,IHYDROGEN_GH2STO,S,T)/GDATA(IHYDROGEN_GH2STO,'GDFE')-VHYDROGEN_STOLOADT.L(Y,IA,IHYDROGEN_GH2STO,S,T))) -$ifi %import_results%==yes $ifi %HYDROGEN%==yes $ifi %ADDBIOMETHSTOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T)$(SUM((IA,IGBIOMETHANE),IAGK_HASORPOT(Y,IA,IGBIOMETHANE)) AND SUM((IA,IHYDROGEN_GH2TOBIOMETH),IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH))),IHOURSINST(S,T)*BIOMETHSTOVOLTSVAL(Y,S,T)*IHOURFRAC*(VBIOMETH_STOUNLOADT.L(Y,S,T)-VBIOMETH_STOLOADT.L(Y,S,T)) ) -+0; - -OBJ_YCR(Y,C,IR,'GENERATION_REDISPATCH_COMPENSATION_COST','Mmoney')$CCCRRR(C,IR)= -$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IGE))$(NOT (IGETOH(IGE)) AND RRRAAA(IR,IA) AND GE_T(Y,IA,IGE,S,T)),IHOURFRAC*ELECTRICITY_PRICE(Y,IR,S,T)*IHOURSINST(S,T)*(1-DISLOSS_E_AG(IA,IGE))*VGE_T_DOWN.L(Y,IA,IGE,S,T)) -$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IGH))$(RRRAAA(IR,IA) AND GH_T(Y,IA,IGH,S,T)),IHOURFRAC*HEAT_PRICE(Y,IA,S,T)*IHOURSINST(S,T)*VGH_T_DOWN.L(Y,IA,IGH,S,T)) -$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN))$(RRRAAA(IR,IA) AND GH2_T(Y,IA,IHYDROGEN,S,T)),IHOURFRAC*HYDROGEN_PRICE(Y,IR,S,T)*IHOURSINST(S,T)*VGH2_T_DOWN.L(Y,IA,IHYDROGEN,S,T)) -$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH))$(RRRAAA(IR,IA) AND GBIOMETHANE_T(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)),IHOURFRAC*BIOMETHANE_PRICE(Y,S,T)*IHOURSINST(S,T)*VGBIOMETHANE_T_DOWN.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)) -$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASUPGRADING))$(RRRAAA(IR,IA) AND GBIOGASUPGRADING_T(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)),IHOURFRAC*BIOMETHANE_PRICE(Y,S,T)*IHOURSINST(S,T)*VGBIOGASUPGRADING_T_DOWN.L(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)) -$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASMETHANATION))$(RRRAAA(IR,IA) AND GBIOGASMETHANATION_T(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)),IHOURFRAC*BIOMETHANE_PRICE(Y,S,T)*IHOURSINST(S,T)*VGBIOGASMETHANATION_T_DOWN.L(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)) -+0; - - -OBJ_YCR(Y,C,IR,'HYDRO_PROFILE','Mmoney')$CCCRRR(C,IR)= -OMONEY*IOF0000001*SUM((IA,IGHYRS)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGHYRS)), SUM((S,T), HYPPROFILS(IA,S)*IHOURFRAC* IHOURSINST(S,T) - * VGE_T.L(Y,IA,IGHYRS,S,T))) -; - -OBJ_YCR(Y,C,IR,'GENERATION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CAPITAL_COSTS','Mmoney') -) -; - -OBJ_YCR(Y,C,IR,'GENERATION_FIXED_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FIXED_COSTS','Mmoney') -) -; - -OBJ_YCR(Y,C,IR,'GENERATION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OPERATIONAL_COSTS','Mmoney') -) -; - -OBJ_YCR(Y,C,IR,'GENERATION_CO2_TAX','Mmoney')$CCCRRR(C,IR)= -SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TAX','Mmoney') -) -; - -$ifi %CCS%==yes OBJ_YCR(Y,C,IR,'GENERATION_CO2_TRANSPORT','Mmoney')$CCCRRR(C,IR)= -$ifi %CCS%==yes SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND CCS_G(G)),ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TRANSPORT','Mmoney')); - -OBJ_YCR(Y,C,IR,'GENERATION_OTHER_EMI_TAX','Mmoney')$CCCRRR(C,IR)= -SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OTHER_EMI_TAX','Mmoney') -) -; - -OBJ_YCR(Y,C,IR,'GENERATION_UC_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_UC_COSTS','Mmoney') -) -; - -OBJ_YCR(Y,C,IR,'TRANSMISSION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM(IRI$IXK_HASORPOT(Y,IR,IRI),ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_CAPITAL_COSTS','Mmoney')) -; - -OBJ_YCR(Y,C,IR,'TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM(IRI$IXK_HASORPOT(Y,IR,IRI), ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_OPERATIONAL_COSTS','Mmoney')) -; - -$ifi not %HEATTRANS%==yes $goto No_HEATTRANS_costs_2 -OBJ_YCR(Y,C,IR,'HEAT_TRANSMISSION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM((IA,IAI)$(RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI)),ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_CAPITAL_COSTS','Mmoney')) -; - -OBJ_YCR(Y,C,IR,'HEAT_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM((IA,IAI)$(RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI)),ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')) -; -$label No_HEATTRANS_costs_2 - -$ifi not %HYDROGEN%==yes $goto No_H2_costs_2 -OBJ_YCR(Y,C,IR,'H2_TRANSMISSION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM(IRI$IXH2K_HASORPOT(Y,IR,IRI),ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_CAPITAL_COSTS','Mmoney')) -; - -OBJ_YCR(Y,C,IR,'H2_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= -SUM(IRI$IXH2K_HASORPOT(Y,IR,IRI), ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')) -; -$label No_H2_costs_2 - - -$ifi NOT %TAXES%==yes $goto No_TAXES2 -OBJ_YCR(Y,C,IR,'TAXES','Mmoney')$CCCRRR(C,IR)= -SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_TAXES','Mmoney')) -+OMONEY/IOF1000000*( - -* Tax on electricity consumption - + SUM(DEUSER, TAX_DE(C,DEUSER)*IHOURFRAC * SUM((IS3,T), IHOURSINST(IS3,T) * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0)) ) - -$ifi %DFLEXQUANT%==yes + SUM((DEUSER), *IHOURFRACTAX_DE(C,DEUSER) *( -$ifi %DFLEXQUANT%==yes SUM(DEF_U1,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_U1) ) - SUM(DEF_D1,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_D1) ) -$ifi %DFLEXQUANT%==yes + SUM(DEF_U2,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_U2) ) - SUM(DEF_D2,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_D2) ) -$ifi %DFLEXQUANT%==yes + SUM(DEF_U3,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_U3) ) - SUM(DEF_D3,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_D3) )) - - -+SUM(IA$RRRAAA(IR,IA), -* Tax on heat consumption - + SUM(DHUSER, TAX_DH(C,DHUSER)*IHOURFRAC * DH(Y,IA,DHUSER)) - -$ifi %DFLEXQUANT%==yes + SUM((DHUSER), TAX_DH(C,DHUSER)*IHOURFRAC * ( -$ifi %DFLEXQUANT%==yes SUM(DHF_U1,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_U1) ) - SUM(DHF_D1,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_D1) ) -$ifi %DFLEXQUANT%==yes + SUM(DHF_U2,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_U2) ) - SUM(DHF_D2,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_D2) ) -$ifi %DFLEXQUANT%==yes + SUM(DHF_U3,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_U3) ) - SUM(DHF_D3,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_D3) ) ) -) -) -; -$label NO_TAXES2 - - -*GRID TARIFFS2 -$ifi NOT %GRIDTARIFFS%==yes $goto No_GRIDTARIFFS2 -OBJ_YCR(Y,C,IR,'GRID_TARIFFS','Mmoney')$CCCRRR(C,IR)= -SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND (IGETOH(G) -$ifi %HYDROGEN%==yes OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G) OR IHYDROGEN_GETOH2(G) -)), ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_GRID_TARIFFS','Mmoney')) - -+OMONEY/IOF1000000*( - -* Demand charge winter - + IOF1000 * SUM((MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCW',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP1.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDCW'))/(IGR_MONTHSINSIM/card(MMM)) !! Demand charge winter -* Demand charge summer - + IOF1000 * SUM((MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCS',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP1.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDCS'))/(IGR_MONTHSINSIM/card(MMM)) !! Demand charge summer -* Demand charge 2 (e.g for spring and fall months) - + IOF1000 * SUM((MMM)$(SUM((IS3,T)$IGR_TIME('GRDDC2',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP1.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDC2'))/(IGR_MONTHSINSIM/card(MMM)) !! Demand charge 2 - -* Demand charge TOU - + IOF1000 * SUM((MMM), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP2.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDCTOU'))/(IGR_MONTHSINSIM/card(MMM)) -* Demand charge yearly - + IOF1000 * SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAPY.L(Y,IA)) * IGR_PRICE_TECH(Y,IR,'GRDDCY') - -* Tariffs on user groups - + SUM((IS3,T,DEUSER)$IGR_TIME('GRDECW',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDECW') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) - + SUM((IS3,T,DEUSER)$IGR_TIME('GRDECS',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDECS') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) - + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU1',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU1') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) - + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU2',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU2') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) - + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU3',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU3') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) - + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU4',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU4') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) - - + IOF1000 * SUM((DEUSER,MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCW',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), VDEUSER_CAP1.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCW'))/(IGR_MONTHSINSIM/CARD(MMM)) - + IOF1000 * SUM((DEUSER,MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCS',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), VDEUSER_CAP1.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCS'))/(IGR_MONTHSINSIM/CARD(MMM)) - + IOF1000 * SUM((DEUSER,MMM)$(SUM((IS3,T)$IGR_TIME('GRDDC2',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), VDEUSER_CAP1.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDC2'))/(IGR_MONTHSINSIM/CARD(MMM)) - + IOF1000 * SUM((DEUSER,MMM), VDEUSER_CAP2.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCTOU'))/(IGR_MONTHSINSIM/card(MMM)) - + IOF1000 * SUM((DEUSER), VDEUSER_CAPY.L(Y,IR,DEUSER) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCY')) - -) - -; -$label NO_GRIDTARIFFS2 - -*ADD OTHER COSTS(?) - - -* ------------- END OF OBJECTIVE FUNCTION -------------- - - -* ------------- INCOME -------------- - -** ELECTRICITY SALES -ECO_G_YCRAG(Y,C,IR,IA,IGE,FFF,TECH_TYPE,'INCOME','ELECTRICITY_SALE','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) and IGNOTETOH(IGE))= - OMONEY*IOF0000001* - SUM((S,T), IHOURSINST(S,T)*VGE_T.L(Y,IA,IGE,S,T)*EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')) -; - -** HEAT SALES -ECO_G_YCRAG(Y,C,IR,IA,IGH,FFF,TECH_TYPE,'INCOME','HEAT_SALE','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= - OMONEY*IOF0000001* - SUM((S,T), IHOURSINST(S,T)*VGH_T.L(Y,IA,IGH,S,T)*H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')) -; - -$ifi not %BalancingMarket%==yes $goto NO_TSOREDISPATCH1 -$ifi not %BALANCINGRUNPURPOSE%==TSOREDISPATCH $goto NO_TSOREDISPATCH1 -ECO_G_YCRAG(Y,C,IR,IA,IGE,FFF,TECH_TYPE,'INCOME','ELECTRICITY_REDISPATCH_COMPENSATION','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) and IGNOTETOH(IGE))= - OMONEY*IOF0000001*( - SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*(1-DISLOSS_E_AG(IA,IGE))*VGE_T_DOWN.L(Y,IA,IGE,S,T)*ELECTRICITY_PRICE(Y,IR,S,T))) -; - -ECO_G_YCRAG(Y,C,IR,IA,IGH,FFF,TECH_TYPE,'INCOME','HEAT_REDISPATCH_COMPENSATION','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= - OMONEY*IOF0000001* - SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGH_T_DOWN.L(Y,IA,IGH,S,T)*HEAT_PRICE(Y,IA,S,T)) -; -$label NO_TSOREDISPATCH1 - -$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_INCOME -** HYDROGEN SALES -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','H2_SALE','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G) AND NOT(IHYDROGEN_GH2TOBIOMETH(G)))= - OMONEY*IOF0000001* - SUM((S,T), IHOURSINST(S,T)*PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'HYDROGEN',TECH_TYPE,'MWh')*H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')) -; - -** BIOMETHANE SALES -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','BIOMETHANE_SALE','Mmoney')$((IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASUPGRADING(G) OR IHYDROGEN_GBIOGASMETHANATION(G)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= - OMONEY*IOF0000001*( - +SUM((S,T), IHOURSINST(S,T)*VGBIOMETH_T.L(Y,IA,G,S,T)*BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh'))$IHYDROGEN_GH2TOBIOMETH(G) - +SUM((S,T), IHOURSINST(S,T)*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)*BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh'))$IHYDROGEN_GBIOGASMETHANATION(G) - +SUM((S,T), IHOURSINST(S,T)*VGBIOGASUPGRADING_T.L(Y,IA,G,S,T)*BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh'))$IHYDROGEN_GBIOGASUPGRADING(G) -) -; - -$ifi not %BalancingMarket%==yes $goto NO_TSOREDISPATCH2 -$ifi not %BALANCINGRUNPURPOSE%==TSOREDISPATCH $goto NO_TSOREDISPATCH2 -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','HYDROGEN_REDISPATCH_COMPENSATION','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G))= - OMONEY*IOF0000001* - SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGH2_T_DOWN.L(Y,IA,G,S,T)*HYDROGEN_PRICE(Y,IR,S,T)) -; - -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','BIOMETHANE_REDISPATCH_COMPENSATION','Mmoney')$((IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASUPGRADING(G) OR IHYDROGEN_GBIOGASMETHANATION(G)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= - OMONEY*IOF0000001*( - +SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGBIOMETHANE_T_DOWN.L(Y,IA,G,S,T)*BIOMETHANE_PRICE(Y,S,T))$IHYDROGEN_GH2TOBIOMETH(G) - +SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGBIOGASMETHANATION_T_DOWN.L(Y,IA,G,S,T)*BIOMETHANE_PRICE(Y,S,T))$IHYDROGEN_GBIOGASMETHANATION(G) - +SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGBIOGASUPGRADING_T_DOWN.L(Y,IA,G,S,T)*BIOMETHANE_PRICE(Y,S,T))$IHYDROGEN_GBIOGASUPGRADING(G) -) -; -$label NO_TSOREDISPATCH2 - -$label NO_HYDROGEN_INCOME - -* ------------- END OF INCOME -------------- - -* ------------- PROFIT -------------- -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'PROFIT','TOTAL_PROFIT','Mmoney')$IAGK_HASORPOT(Y,IA,G)= -SUM(SUBCATEGORY, ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME',SUBCATEGORY,'Mmoney')-ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS',SUBCATEGORY,'Mmoney') -) -; - -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'PROFIT','ENERGY_SPECIFIC_PROFIT','Money_per_MWh')$(IAGK_HASORPOT(Y,IA,G) AND SUM(COMMODITY,PRO_YCRAGF(Y,C,IR,IA,G,FFF,COMMODITY,TECH_TYPE,'TWh')) > 0 ) = -ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'PROFIT','TOTAL_PROFIT','Mmoney')/SUM(COMMODITY,PRO_YCRAGF(Y,C,IR,IA,G,FFF,COMMODITY,TECH_TYPE,'TWh')) -; -* ------------- END OF PROFIT -------------- - -* --------- END OF ECONOMIC OUTPUT ----------- - -* ---------------------- ENVIRONMENT ---------------------- - -* ------------- CO2 EMISSIONS ------------- - -EMI_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'kton')$(F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh'))= -(F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh') -$ifi %CCS%==yes -(F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh')*CCS_CO2CAPTEFF_G(G))$CCS_G(G) -)*IM_CO2(G)*IOF3P6 -; - -* ------------- END OF CO2 EMISSIONS ------------- - -* ---------------------- END OF ENVIRONMENT ---------------------- - -*---------------ELECTRICITY BALANCE------------ -*GENERATION -EL_BALANCE_YCRST(Y,C,IR,'CONDENSING',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','CONDENSING','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'CHP-BACK-PRESSURE',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','CHP-BACK-PRESSURE','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'CHP-EXTRACTION',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','CHP-EXTRACTION','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'INTER-STO',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','INTERSEASONAL-ELECT-STORAGE','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'INTRA-STO',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','INTRASEASONAL-ELECT-STORAGE','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'HYDRO-RESERVOIRS',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','HYDRO-RESERVOIRS','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'HYDRO-RUN-OF-RIVER',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','HYDRO-RUN-OF-RIVER','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'WIND-ON',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','WIND-ON','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'WIND-OFF',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','WIND-OFF','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'SOLAR-PV',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','SOLAR-PV','MWh')); -EL_BALANCE_YCRST(Y,C,IR,'HYDRO-WAVE ',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','HYDRO-WAVE','MWh')); -$ifi %HYDROGEN%==yes EL_BALANCE_YCRST(Y,C,IR,'FUELCELL',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','FUELCELL','MWh')); - -*DEMAND -EL_BALANCE_YCRST(Y,C,IR,'DEMAND_EXO',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh'); -EL_BALANCE_YCRST(Y,C,IR,'DEMAND_P2H',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDOGENOUS_ELECT2HEAT','MWh'); -EL_BALANCE_YCRST(Y,C,IR,'DEMAND_INTRASTO',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTRASTO','MWh'); -EL_BALANCE_YCRST(Y,C,IR,'DEMAND_INTERSTO',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTERSTO','MWh'); -EL_BALANCE_YCRST(Y,C,IR,'DEMAND_EV',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_EV','MWh'); -EL_BALANCE_YCRST(Y,C,IR,'DEMAND_OTHERTRANS',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh'); -EL_BALANCE_YCRST(Y,C,IR,'DEMAND_DISTLOSSES',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh'); -EL_BALANCE_YCRST(Y,C,IR,'DEMAND_CCS',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_CCS','MWh'); -$ifi %HYDROGEN%==yes EL_BALANCE_YCRST(Y,C,IR,'DEMAND_P2G',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_H2','MWh')+EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh'); - - -*TRANSMISSION -EL_BALANCE_YCRST(Y,C,IR,'NETEXPORT',S,T,'MWh')$CCCRRR(C,IR)=SUM(IRE$IXK_HASORPOT(Y,IR,IRE),VX_T.L(Y,IR,IRE,S,T))-SUM(IRI$IXK_HASORPOT(Y,IRI,IR),VX_T.L(Y,IRI,IR,S,T)*(1-XLOSS(IRI,IR))); - -*CURTAILMENT -EL_BALANCE_YCRST(Y,C,IR,'CURTAILMENT',S,T,'MWh')$CCCRRR(C,IR)= -SUM((IGE,TECH_TYPE,IA,FFF)$(RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE)), -CURT_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh') -); - -*PRICE -EL_BALANCE_YCRST(Y,C,IR,'PRICE',S,T,'Money_per_MWh')$CCCRRR(C,IR)=EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'); -*---------------END ELECTRICITY BALANCE------------ - - -*---------------HEAT BALANCE------------ -*GENERATION -H_BALANCE_YCRAST(Y,C,IR,IA,'P2H',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','ELECT-TO-HEAT','MWh')); -H_BALANCE_YCRAST(Y,C,IR,IA,'CHP-BACK-PRESSURE',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','CHP-BACK-PRESSURE','MWh')); -H_BALANCE_YCRAST(Y,C,IR,IA,'CHP-EXTRACTION',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','CHP-EXTRACTION','MWh')); -H_BALANCE_YCRAST(Y,C,IR,IA,'INTER-STO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','INTERSEASONAL-HEAT-STORAGE','MWh')); -H_BALANCE_YCRAST(Y,C,IR,IA,'INTRA-STO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','INTRASEASONAL-HEAT-STORAGE','MWh')); -H_BALANCE_YCRAST(Y,C,IR,IA,'BOILERS',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','BOILERS','MWh')); -H_BALANCE_YCRAST(Y,C,IR,IA,'SOLAR-HEATING',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','SOLAR-HEATING','MWh')); -$ifi %HYDROGEN%==yes H_BALANCE_YCRAST(Y,C,IR,IA,'FUELCELL',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','FUELCELL','MWh')); - - -*DEMAND -H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_EXO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh'); -H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_INTRASTO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTRASTO','MWh'); -H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_INTERSTO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTERSTO','MWh'); -H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_DISTLOSSES',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'DIST_LOSSES','MWh'); -$ifi %HYDROGEN%==yes H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_P2G',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_H2','MWh')+ H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_BIOMETHANE','MWh'); - -*TRANSMISSION -$ifi %HEATTRANS%==yes H_BALANCE_YCRAST(Y,C,IR,IA,'NETEXPORT',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM(IAE$IXHK_HASORPOT(Y,IA,IAE),VXH_T.L(Y,IA,IAE,S,T))-SUM(IAI$IXHK_HASORPOT(Y,IAI,IA),VXH_T.L(Y,IAI,IA,S,T)*(1-XHLOSS(IAI,IA))); - -*CURTAILMENT -H_BALANCE_YCRAST(Y,C,IR,IA,'CURTAILMENT',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= -SUM((IGH,TECH_TYPE,FFF)$(IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE)), -CURT_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh') -); - -*PRICE -H_BALANCE_YCRAST(Y,C,IR,IA,'PRICE',S,T,'Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh'); -*---------------END HEAT BALANCE------------ - - - -execute_unload "MainResults.gdx" ECO_G_YCRAG,ECO_X_YCR,OBJ_YCR,EL_PRICE_YCR,EL_PRICE_YCRST,PRO_YCRAGFST,EL_DEMAND_YCRST,EL_DEMAND_YCR, -H_DEMAND_YCRAST,H_DEMAND_YCRA,PRO_YCRAGF,H_PRICE_YCRAST,H_PRICE_YCRA,G_CAP_YCRAF,G_STO_YCRAF,X_CAP_YCR,X_FLOW_YCRST,X_FLOW_YCR,F_CONS_YCRAST,F_CONS_YCRA,EMI_YCRAG, -EL_BALANCE_YCRST,CURT_YCRAGFST,CURT_YCRAGF,H_BALANCE_YCRAST - -$ifi %HEATTRANS%==yes ,XH_CAP_YCA,XH_FLOW_YCAST,XH_FLOW_YCA,ECO_XH_YCRA -$ifi %HYDROGEN%==yes ,H2_PRICE_YCRST,H2_PRICE_YCR,BIOMETH_PRICE_YST,XH2_CAP_YCR, XH2_FLOW_YCRST,XH2_FLOW_YCR,ECO_XH2_YCR,H2_DEMAND_YCRST,H2_DEMAND_YCR -; - - -*Establishing modified sets and parameters to original for further calculations - -$ifi not %stointers%==all $goto NO_STOINTERS2 -*Modification of STORAGE -IGESTOS(IGESTO) = YES; IGHSTOS(IGHSTO) = YES; -IGESTO(IGESTO) = NO; IGHSTO(IGHSTO) = NO; -$label NO_STOINTERS2 - -$ifi not %RollingSeasons%==yes $goto NO_ROLLINGSEASONS -*Modification of IHOURSINST -IHOURSINST(SSS,TTT)=0; -LOOP(IS3LOOPSET$(ORD(IS3LOOPSET) LE (CARD(S)-ROLLINGSEASONSNUMBER+1)), - IS3(S)=NO; - IS3(S)$((ORD(S) LE (ORD(IS3LOOPSET)+ROLLINGSEASONSNUMBER-1)) AND (ORD(S) GE ORD(IS3LOOPSET)) )=YES; - IWEIGHSUMS=SUM(IS3, WEIGHT_S(IS3)); - IHOURSINST(IS3,T)=IOF8760*WEIGHT_S(IS3)*WEIGHT_T(T)/(IWEIGHSUMS*SUM(ITALIAS, WEIGHT_T(ITALIAS)))/IHOURFRAC; -); - -$label NO_ROLLINGSEASONS - -*Deleting files to release memory: -G_CAP_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS)=0; -G_STO_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS)=0; -PRO_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS)=0; -PRO_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS)=0; -F_CONS_YCRAST(Y,C,RRR,AAA,G,FFF,SSS,TTT,TECH_TYPE,UNITS)=0; -F_CONS_YCRA(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS)=0; -X_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS)=0; -X_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS)=0; -X_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS)=0; -ECO_G_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,CATEGORY,SUBCATEGORY,UNITS)=0; -ECO_X_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS)=0; -OBJ_YCR(Y,C,RRR,SUBCATEGORY,UNITS)=0; -EL_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS)=0; -EL_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS)=0; -H_PRICE_YCRA(Y,C,RRR,AAA,PRICE_CATEGORY,UNITS)=0; -H_PRICE_YCRAST(Y,C,RRR,AAA,SSS,TTT,UNITS)=0; -EL_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS)=0; -EL_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS)=0; -H_DEMAND_YCRAST(Y,C,RRR,AAA,SSS,TTT,VARIABLE_CATEGORY,UNITS)=0; -H_DEMAND_YCRA(Y,C,RRR,AAA,VARIABLE_CATEGORY,UNITS)=0; -EMI_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS)=0; -CURT_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS)=0; -CURT_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS)=0; -EL_BALANCE_YCRST(Y,C,RRR,EL_BAL_TYPE,SSS,TTT,UNITS)=0; -H_BALANCE_YCRAST(Y,C,RRR,AAA,H_BAL_TYPE,SSS,TTT,UNITS)=0; -$ifi %HYDROGEN%==yes H2_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS)=0; -$ifi %HYDROGEN%==yes H2_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS)=0; -$ifi %HYDROGEN%==yes BIOMETH_PRICE_YST(Y,SSS,TTT,UNITS)=0; -$ifi %HEATTRANS%==yes XH_CAP_YCA(Y,C,IAAAE,IAAAI,VARIABLE_CATEGORY,UNITS)=0; -$ifi %HEATTRANS%==yes XH_FLOW_YCAST(Y,C,IAAAE,IAAAI,SSS,TTT,UNITS)=0; -$ifi %HEATTRANS%==yes XH_FLOW_YCA(Y,C,IAAAE,IAAAI,UNITS)=0; -$ifi %HEATTRANS%==yes ECO_XH_YCRA(Y,C,RRR,AAA,IAAAI,CATEGORY,SUBCATEGORY,UNITS)=0; -$ifi %HYDROGEN%==yes XH2_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS)=0; -$ifi %HYDROGEN%==yes XH2_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS)=0; -$ifi %HYDROGEN%==yes XH2_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS)=0; -$ifi %HYDROGEN%==yes ECO_XH2_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS)=0; -$ifi %HYDROGEN%==yes H2_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS)=0; -$ifi %HYDROGEN%==yes H2_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS)=0; - - - - +*Create output file + +SET CATEGORY /COSTS,INCOME,PROFIT, Market_Value/; +SET SUBCATEGORY /ELECTRICITY_SALE,HEAT_SALE,H2_SALE,BIOMETHANE_SALE,GENERATION_CAPITAL_COSTS,GENERATION_FIXED_COSTS, + GENERATION_OPERATIONAL_COSTS,GENERATION_FUEL_COSTS,GENERATION_TAXES,GENERATION_GRID_TARIFFS,TRANSMISSION_CAPITAL_COSTS,TRANSMISSION_OPERATIONAL_COSTS, + TRANSMISSION_TRADE_INCOME,TRANSMISSION_TRADE_COSTS,HEAT_TRANSMISSION_CAPITAL_COSTS,HEAT_TRANSMISSION_OPERATIONAL_COSTS, + H2_TRANSMISSION_CAPITAL_COSTS,H2_TRANSMISSION_OPERATIONAL_COSTS,GENERATION_CO2_TAX,GENERATION_CO2_TRANSPORT,GENERATION_UC_COSTS, + GENERATION_OTHER_EMI_TAX,GENERATION_OPPORTUNITY_COSTS,HYDRO_PROFILE,TAXES,GRID_TARIFFS,TOTAL_PROFIT,ENERGY_SPECIFIC_PROFIT, + GENERATION_OPPORTUNITY_COSTS_STORAGE,GENERATION_REDISPATCH_COMPENSATION_COST,ELECTRICITY_REDISPATCH_COMPENSATION, + HEAT_REDISPATCH_COMPENSATION,HYDROGEN_REDISPATCH_COMPENSATION,BIOMETHANE_REDISPATCH_COMPENSATION + /; +SET COMMODITY /ELECTRICITY,HEAT,HYDROGEN,BIOMETHANE/; +SET TECH_TYPE /CONDENSING,CHP-BACK-PRESSURE,CHP-EXTRACTION,BOILERS,ELECT-TO-HEAT,HEATPUMP,INTERSEASONAL-HEAT-STORAGE,INTERSEASONAL-ELECT-STORAGE,INTRASEASONAL-HEAT-STORAGE,INTRASEASONAL-ELECT-STORAGE,HYDRO-RESERVOIRS,HYDRO-RUN-OF-RIVER,WIND-ON,WIND-OFF,SOLAR-PV,SOLAR-HEATING,HYDRO-WAVE,HEAT-PUMP,EL-BOILER,FUELCELL,ELECTROLYZER,H2-STORAGE,BIOMETH-DAC,HUB-OFF,STEAMREFORMING,OPTIFLOW/; +SET GTECH_TYPE(GGG,TECH_TYPE); +SET PRICE_CATEGORY /AVERAGE,AVERAGE_WEIGHTED_BY_CONSUMPTION,AVERAGE_WEIGHTED_BY_PRODUCTION/; +SET VARIABLE_CATEGORY /EXOGENOUS,EXO_TRANS,ENDOGENOUS,DECOMMISSIONING,ENDOGENOUS_ELECT2HEAT,ENDO_INTRASTO,ENDO_INTERSTO,ENDO_EV,ENDO_HEATPUMP,ENDO_ELBOILER,ENDO_OTHERTRANS,DIST_LOSSES,TRANS_LOSSES,ENDO_CCS,ENDO_H2,ENDO_BIOMETHANE,ENDO_FUELCELL,ENDO_REGIONAL,ENDO_OPTIFLOW/; +SET EL_BAL_TYPE /CURTAILMENT,NETEXPORT,PRICE,DEMAND_EXO,DEMAND_EXOTRANS,DEMAND_LOSS,DEMAND_INTERSTO,DEMAND_INTRASTO,DEMAND_P2H,DEMAND_EV,CONDENSING,CHP-BACK-PRESSURE,CHP-EXTRACTION,ELECT-TO-HEAT,INTER-STO,INTRA-STO,HYDRO-RESERVOIRS,HYDRO-RUN-OF-RIVER,WIND-ON,WIND-OFF,SOLAR-PV,HYDRO-WAVE,FUELCELL,DEMAND_OTHERTRANS,DEMAND_DISTLOSSES,DEMAND_CCS,DEMAND_P2G/; +SET H_BAL_TYPE /CURTAILMENT,NETEXPORT,PRICE,DEMAND_EXO,DEMAND_LOSS,DEMAND_INTERSTO,DEMAND_INTRASTO,BOILERS,CHP-BACK-PRESSURE,CHP-EXTRACTION,INTER-STO,INTRA-STO,SOLAR-HEATING,P2H,FUELCELL,DEMAND_P2G,DEMAND_DISTLOSSES/; +SET UNITS /GW,TWh,MWh,Money_per_MWh,Mmoney,kton,GWh/; + +$ifi not %TRANSPORT%==yes $goto NO_TRANSPORT_SET; +SET IDEUSER_TRANS(DEUSER) "Subset of electricity users containing trains, busses, and simple EVs"; +IDEUSER_TRANS('TRANS_TRAINS') = YES; +IDEUSER_TRANS('TRANS_BUS') = YES; +IDEUSER_TRANS('TRANS_EV') = YES; +$label NO_TRANSPORT_SET; + + GTECH_TYPE(G,'CONDENSING')$IGCND(G) = YES; + GTECH_TYPE(G,'CHP-BACK-PRESSURE')$IGBPR(G) = YES; + GTECH_TYPE(G,'CHP-EXTRACTION')$IGEXT(G) = YES; + GTECH_TYPE(G,'BOILERS')$IGHOB(G) = YES; + GTECH_TYPE(G,'ELECT-TO-HEAT')$IGETOH(G) = YES; +* GTECH_TYPE(G,'HEATPUMP')$IGHP(G) = YES; + GTECH_TYPE(G,'INTRASEASONAL-HEAT-STORAGE')$(GDATA(G,'GDTYPE') EQ GHSTO) = YES; + GTECH_TYPE(G,'INTERSEASONAL-HEAT-STORAGE')$(GDATA(G,'GDTYPE') EQ GHSTOS) = YES; + GTECH_TYPE(G,'INTRASEASONAL-ELECT-STORAGE')$(GDATA(G,'GDTYPE') EQ GESTO) = YES; + GTECH_TYPE(G,'INTERSEASONAL-ELECT-STORAGE')$(GDATA(G,'GDTYPE') EQ GESTOS) = YES; + GTECH_TYPE(G,'HYDRO-RESERVOIRS')$IGHYRS(G) = YES; + GTECH_TYPE(G,'HYDRO-RUN-OF-RIVER')$IGHYRR(G) = YES; + GTECH_TYPE(G,'WIND-ON')$(IGWND(G) AND GDATA(G,'GDTECHGROUP') EQ WINDTURBINE_ONSHORE) = YES; + GTECH_TYPE(G,'WIND-OFF')$(IGWND(G) AND GDATA(G,'GDTECHGROUP') EQ WINDTURBINE_OFFSHORE) = YES; + GTECH_TYPE(G,'SOLAR-PV')$IGSOLE(G) = YES; + GTECH_TYPE(G,'SOLAR-HEATING')$IGSOLH(G) = YES; + GTECH_TYPE(G,'HYDRO-WAVE')$IGWAVE(G) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'FUELCELL')$(GDATA(G,'GDTECHGROUP') EQ FUELCELL) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'ELECTROLYZER')$(GDATA(G,'GDTECHGROUP') EQ ELECTROLYZER) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'H2-STORAGE')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GH2STO) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'BIOMETH-DAC')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GH2TOBIOMETH) = YES; +$ifi %HYDROGEN%==yes GTECH_TYPE(G,'STEAMREFORMING')$(GDATA(G,'GDTYPE') EQ HYDROGEN_GCH4TOH2) = YES; +$ifi %OFFSHOREGRID%==yes GTECH_TYPE(G,'HUB-OFF')$(GDATA(G,'GDTYPE') EQ HUB_OFF) = YES; + +PARAMETER G_CAP_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS) "Generation capacity for each year, country, region, area, technology, fuel, commodity, technology type and variable type (GW)"; +PARAMETER G_STO_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS) "Generation storage for each year, country, region, area, technology, fuel, commodity, technology type and variable type (GWh)"; +PARAMETER PRO_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS) "Energy Production for each year, country, region, area, technology, fuel, season, hour, commodity and technology type (MWh)" ; +PARAMETER PRO_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS) "Annual Energy Production for each year, country, region, area, technology, fuel, commodity and technology type (TWh)"; +PARAMETER F_CONS_YCRAST(Y,C,RRR,AAA,G,FFF,SSS,TTT,TECH_TYPE,UNITS) "Fuel consumption for each year, country, region, area, technology, fuel, season, hour and technology type (MWh)"; +PARAMETER F_CONS_YCRA(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS) "Fuel consumption for each year, country, region, area, technology, fuel and technology type (TWh)"; +PARAMETER X_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS) "Transmission capacity for each year, country, from region to region (GW)"; +PARAMETER X_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS) "Transmission flow for each year, country, from region to region, for each season and hour (MWh)"; +PARAMETER X_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS) "Transmission flow for each year, country, from region to region (TWh)"; +PARAMETER ECO_G_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,CATEGORY,SUBCATEGORY,UNITS) "Generation Economic Output for each year, country, region, fuel, technology type, area and technology (Mmoney)"; +PARAMETER ECO_X_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS) "Electric Transmission Economic Output for each year, country and region (Mmoney)"; +PARAMETER OBJ_YCR(Y,C,RRR,SUBCATEGORY,UNITS) "Objective function (Mmoney)"; +PARAMETER EL_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS) "Average Electricity Prices for each region (money/MWh)"; +PARAMETER EL_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS) "Hourly Electricity Prices for each region (money/MWh)"; +PARAMETER H_PRICE_YCRA(Y,C,RRR,AAA,PRICE_CATEGORY,UNITS) "Average heating Prices for each area(money/MWh)"; +PARAMETER H_PRICE_YCRAST(Y,C,RRR,AAA,SSS,TTT,UNITS) "Hourly heating Prices for each area (money(MWh)"; +PARAMETER EL_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS) "Aggregated Hourly Electricity Demand (MWh)"; +PARAMETER EL_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS) "Aggregated annual Electricity Demand (TWh)"; +PARAMETER H_DEMAND_YCRAST(Y,C,RRR,AAA,SSS,TTT,VARIABLE_CATEGORY,UNITS) "Aggregated Hourly heat Demand (MWh)"; +PARAMETER H_DEMAND_YCRA(Y,C,RRR,AAA,VARIABLE_CATEGORY,UNITS) "Aggregated Annual heat Demand (MWh)"; +PARAMETER EMI_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS) "Annual CO2 emissions(ktons)"; +PARAMETER CURT_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS) "Hourly energy curtailment per country, region, area, technology, fuel, hour and technology type (MWh)"; +PARAMETER CURT_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS) "Hourly energy curtailment per country, region, area, technology, fuel, hour and technology type (MWh)"; +PARAMETER EL_BALANCE_YCRST(Y,C,RRR,EL_BAL_TYPE,SSS,TTT,UNITS) "Hourly electricity balance per country, region, and type (MWh)"; +PARAMETER H_BALANCE_YCRAST(Y,C,RRR,AAA,H_BAL_TYPE,SSS,TTT,UNITS) "Hourly heat balance per country, region, area and type (MWh)"; +$ifi %HYDROGEN%==yes PARAMETER H2_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS) "Average Hydrogen Prices for each region (money/MWh)"; +$ifi %HYDROGEN%==yes PARAMETER H2_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS) "Average Hydrogen Prices for each region (money/MWh)"; +$ifi %HYDROGEN%==yes PARAMETER H2_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS) "Hourly hydrogen Prices for each region (money/MWh)"; +$ifi %HYDROGEN%==yes PARAMETER BIOMETH_PRICE_YST(Y,SSS,TTT,UNITS) "Hourly biomethane Prices for each region (money/MWh)"; +$ifi %HYDROGEN%==yes PARAMETER XH2_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS) "H2 Transmission capacity for each year, country, from region to region (GW)"; +$ifi %HYDROGEN%==yes PARAMETER XH2_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS) "H2 Transmission flow for each year, country, from region to region, for each season and hour (MWh)"; +$ifi %HYDROGEN%==yes PARAMETER XH2_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS) "H2 Transmission flow for each year, country, from region to region (TWh)"; +$ifi %HYDROGEN%==yes PARAMETER ECO_XH2_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS) "H2 Transmission Economic Output for each year, country and region (Mmoney)"; +$ifi %HYDROGEN%==yes PARAMETER H2_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS) "Aggregated Hourly H2 Demand (MWh)"; +$ifi %HYDROGEN%==yes PARAMETER H2_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS) "Aggregated annual H2 Demand (TWh)"; + + + +**Additional Addon output +*HEATRANS +$ifi %HEATTRANS%==yes PARAMETER XH_CAP_YCA(Y,C,IAAAE,IAAAI,VARIABLE_CATEGORY,UNITS) "Heat Transmission capacity for each year, country, from area to area (GW)"; +$ifi %HEATTRANS%==yes PARAMETER XH_FLOW_YCAST(Y,C,IAAAE,IAAAI,SSS,TTT,UNITS) "Heat Transmission flow for each year, country, from areas to area, for each season and hour (MWh)"; +$ifi %HEATTRANS%==yes PARAMETER XH_FLOW_YCA(Y,C,IAAAE,IAAAI,UNITS) "Heat Transmission flow for each year, country, from area to area (TWh)"; +$ifi %HEATTRANS%==yes PARAMETER ECO_XH_YCRA(Y,C,RRR,AAA,IAAAI,CATEGORY,SUBCATEGORY,UNITS) "Heat Transmission Economic Output for each year, country and region and area (Mmoney)"; + + +$ifi not %stointers%==all $goto NO_STOINTERS +*Modification of STORAGE sets so calculation are done correcting its type: +IGHSTO(G) = 0; +IGHSTOS(G) = 0; +IGESTO(G) = 0; +IGESTOS(G) = 0; +IGHSTO(G) = YES$(GDATA(G,'GDTYPE') EQ GHSTO); +IGHSTOS(G) = YES$(GDATA(G,'GDTYPE') EQ GHSTOS); +IGESTO(G) = YES$(GDATA(G,'GDTYPE') EQ GESTO); +IGESTOS(G) = YES$(GDATA(G,'GDTYPE') EQ GESTOS); +$label NO_STOINTERS + +*Modification of IHOURSINST +$ifi %RollingSeasons%==yes PARAMETER IHOURSINTROLLINGSEASON(S,T) "Length of time segment (hours) used in rolling season mode"; +$ifi %RollingSeasons%==yes IWEIGHSUMS=SUM(SSS$(ORD(SSS) LE ROLLINGSEASONSNUMBER), WEIGHT_S(SSS)); +$ifi %RollingSeasons%==yes IHOURSINTROLLINGSEASON(S,T)=IOF8760*WEIGHT_S(S)*WEIGHT_T(T)/(IWEIGHSUMS*SUM(ITALIAS, WEIGHT_T(ITALIAS)))/IHOURFRAC; + +IWEIGHSUMS = SUM(S, WEIGHT_S(S)); +IWEIGHSUMT = SUM(T, WEIGHT_T(T)); +IHOURSINST(SSS,TTT)=0; +IHOURSINST(S,T)=IOF8760*WEIGHT_S(S)*WEIGHT_T(T)/(IWEIGHSUMS*IWEIGHSUMT)/IHOURFRAC; + + + +* -------------------- ENERGY CAPACITY --------------------- + +* ------------- ELECTRICITY CAPACITY -------------- + +** EXOGENOUS ELECTRICITY CAPACITY + +G_CAP_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'EXOGENOUS','GW')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND NOT(IHYDROGEN(IGE)))= +IOF0001*GKFX(Y,IA,IGE)/(1$((NOT IGESTO(IGE)) AND (NOT IGESTOS(IGE)))+GDATA(IGE,'GDSTOHUNLD')$((IGESTO(IGE)) OR IGESTOS(IGE))) +; + + +** ENDOGENOUS ELECTRIC CAPACITY ACCUMULATED INVESTMENTS +G_CAP_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'ENDOGENOUS','GW')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND NOT(IHYDROGEN(IGE)))= +IOF0001*VGKNACCUMNET.L(Y,IA,IGE)/(1$((NOT IGESTO(IGE)) AND (NOT IGESTOS(IGE)))+GDATA(IGE,'GDSTOHUNLD')$((IGESTO(IGE)) OR IGESTOS(IGE))) +; + +** ENDOGENOUS ELECTRICITY CAPACITY ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'DECOMMISSIONING','GW')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGE) AND NOT(IHYDROGEN(IGE)))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGE)/(1$((NOT IGESTO(IGE)) AND (NOT IGESTOS(IGE)))+GDATA(IGE,'GDSTOHUNLD')$((IGESTO(IGE)) OR IGESTOS(IGE))) +; + + +* ------------- END OF ELECTRICITY CAPACITY -------------- + +* ------------- HEAT CAPACITY -------------- + +** EXOGENOUS HEAT CAPACITY + +G_CAP_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'EXOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= +(IOF0001*GKFX(Y,IA,IGH)/((1$((NOT IGHSTO(IGH)) AND (NOT IGHSTOS(IGH)))+GDATA(IGH,'GDSTOHUNLD')$((IGHSTO(IGH)) OR IGHSTOS(IGH)))*(GDATA(IGH,'GDCB')$IGBPR(IGH)+ (GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV'))$IGEXT(IGH)+1$(NOT (IGBPR(IGH) OR IGEXT(IGH))))))$(NOT IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) ++(IOF0001*GKFX(Y,IA,IGH)*(((GDATA(IGH,'GDCB')/GDATA(IGH,'GDBYPASSC')+1)/(GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV')))$IGEXT(IGH) + (1/GDATA(IGH,'GDBYPASSC')+1/GDATA(IGH,'GDCB'))$IGBPR(IGH)))$(IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) +$ifi %HYDROGEN%==yes +(IOF0001*GKFX(Y,IA,IGH)/GDATA(IGH,'GDCB'))$(IHYDROGEN_GETOHH2(IGH) OR IHYDROGEN_GH2TOEH(IGH)) +; + +** ENDOGENOUS HEAT CAPACITY ACCUMULATED INVESTMENTS +G_CAP_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'ENDOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= +(IOF0001*VGKNACCUMNET.L(Y,IA,IGH)/((1$((NOT IGHSTO(IGH)) AND (NOT IGHSTOS(IGH)))+GDATA(IGH,'GDSTOHUNLD')$((IGHSTO(IGH)) OR IGHSTOS(IGH)))*(GDATA(IGH,'GDCB')$IGBPR(IGH)+ (GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV'))$IGEXT(IGH)+1$(NOT (IGBPR(IGH) OR IGEXT(IGH))))))$(NOT IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) ++(IOF0001*VGKNACCUMNET.L(Y,IA,IGH)*(((GDATA(IGH,'GDCB')/GDATA(IGH,'GDBYPASSC')+1)/(GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV')))$IGEXT(IGH) + (1/GDATA(IGH,'GDBYPASSC')+1/GDATA(IGH,'GDCB'))$IGBPR(IGH)))$(IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) +$ifi %HYDROGEN%==yes +(IOF0001*VGKNACCUMNET.L(Y,IA,IGH)/GDATA(IGH,'GDCB'))$(IHYDROGEN_GETOHH2(IGH) OR IHYDROGEN_GH2TOEH(IGH)) +; + +** ENDOGENOUS HEAT CAPACITY ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'DECOMMISSIONING','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGH))= +$ifi %DECOM%==yes -(IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH)/((1$((NOT IGHSTO(IGH)) AND (NOT IGHSTOS(IGH)))+GDATA(IGH,'GDSTOHUNLD')$((IGHSTO(IGH)) OR IGHSTOS(IGH)))*(GDATA(IGH,'GDCB')$IGBPR(IGH)+ (GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV'))$IGEXT(IGH)+1$(NOT (IGBPR(IGH) OR IGEXT(IGH))))))$(NOT IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) +$ifi %DECOM%==yes -(IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH)*(((GDATA(IGH,'GDCB')/GDATA(IGH,'GDBYPASSC')+1)/(GDATA(IGH,'GDCB')+GDATA(IGH,'GDCV')))$IGEXT(IGH) + (1/GDATA(IGH,'GDBYPASSC')+1/GDATA(IGH,'GDCB'))$IGBPR(IGH)))$(IGBYPASS(IGH) AND NOT(IHYDROGEN(IGH))) +$ifi %DECOM%==yes $ifi %HYDROGEN%==yes -(IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH)/GDATA(IGH,'GDCB'))$(IHYDROGEN_GETOHH2(IGH) OR IHYDROGEN_GH2TOEH(IGH)) +; + +* ------------- END OF HEAT CAPACITY -------------- + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_CAPACITY +* ------------- HYDROGEN CAPACITY -------------- + +** EXOGENOUS HYDROGEN CAPACITY + +G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'EXOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G) AND NOT(IHYDROGEN_GH2TOBIOMETH(G)))= +IOF0001*GKFX(Y,IA,G)*(1$IHYDROGEN_GH2STO(G)+GDATA(G,'GDFE')$(NOT(IHYDROGEN_GH2STO(G))))/(1$(NOT IHYDROGEN_GH2STO(G))+GDATA(G,'GDSTOHUNLD')$IHYDROGEN_GH2STO(G)) +; + + +** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED INVESTMENTS +G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'ENDOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G) AND NOT(IHYDROGEN_GH2TOBIOMETH(G)))= +IOF0001*VGKNACCUMNET.L(Y,IA,G)*(1$IHYDROGEN_GH2STO(G)+GDATA(G,'GDFE')$(NOT(IHYDROGEN_GH2STO(G))))/(1$(NOT IHYDROGEN_GH2STO(G))+GDATA(G,'GDSTOHUNLD')$IHYDROGEN_GH2STO(G)) +; + +** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'DECOMMISSIONING','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,G) AND IHYDROGEN(G) AND NOT(IHYDROGEN_GH2TOBIOMETH(G)))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,G)*(1$IHYDROGEN_GH2STO(G)+GDATA(G,'GDFE')$(NOT(IHYDROGEN_GH2STO(G))))/(1$(NOT IHYDROGEN_GH2STO(G))+GDATA(G,'GDSTOHUNLD')$IHYDROGEN_GH2STO(G)) +; + +* ------------- END OF HYDROGEN CAPACITY -------------- + +* ------------- BIOMETHANE CAPACITY -------------- + +** EXOGENOUS HYDROGEN CAPACITY + +G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'EXOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN_GH2TOBIOMETH(G))= +IOF0001*GKFX(Y,IA,G) +; + +** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED INVESTMENTS +G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'ENDOGENOUS','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN_GH2TOBIOMETH(G))= +IOF0001*VGKNACCUMNET.L(Y,IA,G) +; + +** ENDOGENOUS HYDROGEN CAPACITY ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_CAP_YCRAF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'DECOMMISSIONING','GW')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,G) AND IHYDROGEN_GH2TOBIOMETH(G))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,G) +; + +* ------------- END OF BIOMETHANE CAPACITY -------------- +$label NO_HYDROGEN_CAPACITY + +* ---------------- END OF ENERGY CAPACITY ----------------- + +* -------------------- ENERGY STORAGE --------------------- + +* ------------- ELECTRICITY STORAGE -------------- + +** EXOGENOUS ELECTRICITY STORAGE + +G_STO_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'EXOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND (IGESTO(IGE) OR IGESTOS(IGE) OR IGHYRS(IGE)) )= +IOF0001*GKFX(Y,IA,IGE)*(1$(NOT IGHYRS(IGE)) + HYRSMAXVOL_G(IA,IGE)$IGHYRS(IGE)) +; + +** ENDOGENOUS ELECTRIC STORAGE ACCUMULATED INVESTMENTS +G_STO_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'ENDOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND (IGESTO(IGE) OR IGESTOS(IGE) OR IGHYRS(IGE)) )= +IOF0001*VGKNACCUMNET.L(Y,IA,IGE)*(1$(NOT IGHYRS(IGE)) + HYRSMAXVOL_G(IA,IGE)$IGHYRS(IGE)) +; + +** ENDOGENOUS ELECTRICITY STORAGE ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_STO_YCRAF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'DECOMMISSIONING','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGE) AND (IGESTO(IGE) OR IGESTOS(IGE) OR IGHYRS(IGE)) )= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGE)*(1$(NOT IGHYRS(IGE)) + HYRSMAXVOL_G(IA,IGE)$IGHYRS(IGE)) +; + +* ------------- END OF ELECTRICITY CAPACITY -------------- + +* ------------- HEAT STORAGE -------------- + +** EXOGENOUS HEAT STORAGE + +G_STO_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'EXOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND (IGHSTO(IGH) OR IGHSTOS(IGH)))= +IOF0001*GKFX(Y,IA,IGH) +; + +** ENDOGENOUS HEAT STORAGE ACCUMULATED INVESTMENTS +G_STO_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'ENDOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND (IGHSTO(IGH) OR IGHSTOS(IGH)))= +IOF0001*VGKNACCUMNET.L(Y,IA,IGH) +; + +** ENDOGENOUS HEAT STORAGE ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_STO_YCRAF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'DECOMMISSIONING','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IGH) AND (IGHSTO(IGH) OR IGHSTOS(IGH)))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IGH) +; + +* ------------- END OF HEAT STORAGE -------------- + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_STORAGE +* ------------- HYDROGEN STORAGE -------------- + +** EXOGENOUS HYDROGEN STORAGE + +G_STO_YCRAF(Y,C,IR,IA,IHYDROGEN_GH2STO,FFF,'HYDROGEN',TECH_TYPE,'EXOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO) AND IGF(IHYDROGEN_GH2STO,FFF) AND GTECH_TYPE(IHYDROGEN_GH2STO,TECH_TYPE) )= +IOF0001*GKFX(Y,IA,IHYDROGEN_GH2STO) +; + +** ENDOGENOUS HYDROGEN STORAGE ACCUMULATED INVESTMENTS +G_STO_YCRAF(Y,C,IR,IA,IHYDROGEN_GH2STO,FFF,'HYDROGEN',TECH_TYPE,'ENDOGENOUS','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO) AND IGF(IHYDROGEN_GH2STO,FFF) AND GTECH_TYPE(IHYDROGEN_GH2STO,TECH_TYPE))= +IOF0001*VGKNACCUMNET.L(Y,IA,IHYDROGEN_GH2STO) +; + +** ENDOGENOUS HYDROGEN STORAGE ACCUMULATED DECOMMISSIONING +$ifi %DECOM%==yes G_STO_YCRAF(Y,C,IR,IA,IHYDROGEN_GH2STO,FFF,'HYDROGEN',TECH_TYPE,'DECOMMISSIONING','GWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO) AND IGF(IHYDROGEN_GH2STO,FFF) AND GTECH_TYPE(IHYDROGEN_GH2STO,TECH_TYPE) AND IGDECOMEXOPOT(Y,IA,IHYDROGEN_GH2STO))= +$ifi %DECOM%==yes -IOF0001*VDECOM_EXO_ACCUM.L(Y,IA,IHYDROGEN_GH2STO) +; +* ------------- END OF HYDROGEN STORAGE -------------- +$label NO_HYDROGEN_STORAGE + +* ---------------- END OF ENERGY STORAGE ----------------- + + + + +* -------------------- ENERGY PRODUCTION --------------------- + +** ELECTRICITY PRODUCTION HOURLY +PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE))= + VGE_T.L(Y,IA,IGE,S,T); + +** ELECTRICITY PRODUCTION ANNUALLY +PRO_YCRAGF(Y,C,IR,IA,IGE,FFF,'ELECTRICITY',TECH_TYPE,'TWh')$((not IGETOH(IGE)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE))= + SUM((S,T),IHOURSINST(S,T)*VGE_T.L(Y,IA,IGE,S,T)*IHOURFRAC)/IOF1000000; + +** HEAT PRODUCTION HOURLY +PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= + VGH_T.L(Y,IA,IGH,S,T); + +** HEAT PRODUCTION ANNUALY +PRO_YCRAGF(Y,C,IR,IA,IGH,FFF,'HEAT',TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= + SUM((S,T),IHOURSINST(S,T)*VGH_T.L(Y,IA,IGH,S,T)*IHOURFRAC)/IOF1000000; + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_PRODUCTION +** HYDROGEN PRODUCTION HOURLY +PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'HYDROGEN',TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G) AND NOT(IHYDROGEN_GH2TOBIOMETH(G)) )= + +(VGE_T.L(Y,IA,G,S,T)*GDATA(G,'GDFE'))$IHYDROGEN_GETOH2(G) + +(VGE_T.L(Y,IA,G,S,T)*GDATA(G,'GDFE'))$IHYDROGEN_GETOHH2(G) + +(VGE_T.L(Y,IA,G,S,T)*GDATA(G,'GDFE'))$IHYDROGEN_GEHTOH2(G) + +(VHYDROGEN_GH2_T.L(Y,IA,G,S,T))$(IHYDROGEN_GCH4TOH2(G) OR IHYDROGEN_GH2STO(G)) +; + +** HYDROGEN PRODUCTION ANNUALY +PRO_YCRAGF(Y,C,IR,IA,G,FFF,'HYDROGEN',TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G) AND NOT(IHYDROGEN_GH2TOBIOMETH(G)))= + SUM((S,T),IHOURSINST(S,T)*PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'HYDROGEN',TECH_TYPE,'MWh')*IHOURFRAC)/IOF1000000 +; + +** BIOMETHANE PRODUCTION HOURLY +PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'BIOMETHANE',TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN_GH2TOBIOMETH(G))= + VGBIOMETH_T.L(Y,IA,G,S,T) +; + +** BIOMETHANE PRODUCTION ANNUALY +PRO_YCRAGF(Y,C,IR,IA,G,FFF,'BIOMETHANE',TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN_GH2TOBIOMETH(G))= + SUM((S,T),IHOURSINST(S,T)*PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'BIOMETHANE',TECH_TYPE,'MWh')*IHOURFRAC)/IOF1000000 +; +$label NO_HYDROGEN_PRODUCTION + +* ---------------- END OF ENERGY PRODUCTION ----------------- + + +* -------------------- FUEL CONSUMPTION --------------------- + +** HOURLY FUEL CONSUMPTION +F_CONS_YCRAST(Y,C,IR,IA,G,FFF,S,T,TECH_TYPE,'MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= + VGF_T.L(Y,IA,G,S,T); + +** ANNUAL FUEL CONSUMPTION +F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= + SUM((S,T),IHOURSINST(S,T)*VGF_T.L(Y,IA,G,S,T)*IHOURFRAC)/IOF1000000; + +* OPTIFLOW FUEL CONSUMPTION +$ifi not %OPTIFLOW%==yes $goto NO_OPTIFLOW_FUEL_USE +$ifi not %baloptfuelbridge%==yes $goto NO_OPTIFLOW_FUEL_USE +** HOURLY +* Currently, a random biomass tech is used to represent fuel consumption from OptiFlow +F_CONS_YCRAST(Y,C,IR,IA,'EBAVERE_ST_WOODCHI_BP',FFF,S,T,'OPTIFLOW','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA))= + SUM((PROCSOURCE,FLOW)$(IFPROC(FFF,PROCSOURCE) AND IFFLOW(FFF,FLOW)),VFLOWSOURCE.L(Y,IA,PROCSOURCE,FLOW,S,T))/IOF3P6; +** ANNUAL +F_CONS_YCRA(Y,C,IR,IA,'EBAVERE_ST_WOODCHI_BP',FFF,'OPTIFLOW','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA))= + (SUM((S,T,PROCSOURCE,FLOW)$(IFPROC(FFF,PROCSOURCE) AND IFFLOW(FFF,FLOW)),IHOURSINST(S,T)*VFLOWSOURCE.L(Y,IA,PROCSOURCE,FLOW,S,T)*IHOURFRAC)/IOF3P6)/IOF1000000; +$label NO_OPTIFLOW_FUEL_USE +; + + + + + +* ---------------- END OF FUEL CONSUMPTION ----------------- + +* ---------------- ENERGY CURTAILMENT ----------------------- +*HOURLY CURTAILMENT +CURT_YCRAGFST(Y,C,IR,IA,IGHYRR,FFF,S,T,'ELECTRICITY','HYDRO-RUN-OF-RIVER','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGHYRR) AND IGF(IGHYRR,FFF) AND GTECH_TYPE(IGHYRR,'HYDRO-RUN-OF-RIVER') AND IWTRRRSUM(IA) > 0)= +(WTRRRFLH(IA) * ( + GKFX(Y,IA,IGHYRR) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGHYRR) + + VGKNACCUMNET.L(Y,IA,IGHYRR) + ) * WTRRRVAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGHYRR,S,T)) + IGKRATE(IA,IGHYRR,S,T))) / IWTRRRSUM(IA) +-VGE_T.L(Y,IA,IGHYRR,S,T); + +CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-ON','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-ON') AND IWND_SUMST(IA) > 0)= +$ifi %WNDFLH_DOL%==AAA (WNDFLH(IA) * ( +$ifi %WNDFLH_DOL%==AAA_GGG (WNDFLH(IA,IGWND) * ( + GKFX(Y,IA,IGWND) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGWND) + + VGKNACCUMNET.L(Y,IA,IGWND) + ) * WND_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGWND,S,T)) + IGKRATE(IA,IGWND,S,T))) / IWND_SUMST(IA) +-VGE_T.L(Y,IA,IGWND,S,T); + +CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-OFF','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-OFF') AND IWND_SUMST(IA) > 0)= +$ifi %WNDFLH_DOL%==AAA (WNDFLH(IA) * ( +$ifi %WNDFLH_DOL%==AAA_GGG (WNDFLH(IA,IGWND) * ( + GKFX(Y,IA,IGWND) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGWND) + + VGKNACCUMNET.L(Y,IA,IGWND) + ) * WND_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGWND,S,T)) + IGKRATE(IA,IGWND,S,T))) / IWND_SUMST(IA) +-VGE_T.L(Y,IA,IGWND,S,T); + +CURT_YCRAGFST(Y,C,IR,IA,IGSOLE,FFF,S,T,'ELECTRICITY','SOLAR-PV','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLE) AND IGF(IGSOLE,FFF) AND GTECH_TYPE(IGSOLE,'SOLAR-PV') AND ISOLESUMST(IA) > 0)= +$ifi %SOLEFLH_DOL%==AAA (SOLEFLH(IA) * ( +$ifi %SOLEFLH_DOL%==AAA_GGG (SOLEFLH(IA,IGSOLE) * ( + GKFX(Y,IA,IGSOLE) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGSOLE) + + VGKNACCUMNET.L(Y,IA,IGSOLE) + ) * SOLE_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGSOLE,S,T)) + IGKRATE(IA,IGSOLE,S,T))) / ISOLESUMST(IA) +-VGE_T.L(Y,IA,IGSOLE,S,T); + +CURT_YCRAGFST(Y,C,IR,IA,IGSOLH,FFF,S,T,'HEAT','SOLAR-HEATING','MWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLH) AND IGF(IGSOLH,FFF) AND GTECH_TYPE(IGSOLH,'SOLAR-HEATING') AND ISOLHSUMST(IA) > 0)= +$ifi %SOLHFLH_DOL%==AAA (SOLHFLH(IA) * ( +$ifi %SOLHFLH_DOL%==AAA_GGG (SOLHFLH(IA,IGSOLH) * ( + GKFX(Y,IA,IGSOLH) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGSOLH) + + VGKNACCUMNET.L(Y,IA,IGSOLH) + ) * SOLH_VAR_T(IA,S,T) * (1$(NOT IGKRATE(IA,IGSOLH,S,T)) + IGKRATE(IA,IGSOLH,S,T))) / ISOLHSUMST(IA) +-VGH_T.L(Y,IA,IGSOLH,S,T); + + +*ANNUAL CURTAILMENT +CURT_YCRAGF(Y,C,IR,IA,IGHYRR,FFF,'ELECTRICITY','HYDRO-RUN-OF-RIVER','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGHYRR) AND IGF(IGHYRR,FFF) AND GTECH_TYPE(IGHYRR,'HYDRO-RUN-OF-RIVER'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGHYRR,FFF,S,T,'ELECTRICITY','HYDRO-RUN-OF-RIVER','MWh')*IHOURFRAC)/IOF1000000 +; +CURT_YCRAGF(Y,C,IR,IA,IGWND,FFF,'ELECTRICITY','WIND-ON','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-ON'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-ON','MWh')*IHOURFRAC)/IOF1000000 +; +CURT_YCRAGF(Y,C,IR,IA,IGWND,FFF,'ELECTRICITY','WIND-OFF','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGWND) AND IGF(IGWND,FFF) AND GTECH_TYPE(IGWND,'WIND-OFF'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGWND,FFF,S,T,'ELECTRICITY','WIND-OFF','MWh')*IHOURFRAC)/IOF1000000 +; +CURT_YCRAGF(Y,C,IR,IA,IGSOLE,FFF,'ELECTRICITY','SOLAR-PV','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLE) AND IGF(IGSOLE,FFF) AND GTECH_TYPE(IGSOLE,'SOLAR-PV'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGSOLE,FFF,S,T,'ELECTRICITY','SOLAR-PV','MWh')*IHOURFRAC)/IOF1000000 +; +CURT_YCRAGF(Y,C,IR,IA,IGSOLH,FFF,'HEAT','SOLAR-HEATING','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGSOLH) AND IGF(IGSOLH,FFF) AND GTECH_TYPE(IGSOLH,'SOLAR-HEATING'))= +SUM((S,T),IHOURSINST(S,T)*CURT_YCRAGFST(Y,C,IR,IA,IGSOLH,FFF,S,T,'HEAT','SOLAR-HEATING','MWh')*IHOURFRAC)/IOF1000000 +; + +*Curtailment of hydro reservoirs should be analyzed by aggregating the technology set +CURT_YCRAGF(Y,C,IR,IA,IGHYRS,FFF,'ELECTRICITY','HYDRO-RESERVOIRS','TWh')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGHYRS) AND IGF(IGHYRS,FFF) AND GTECH_TYPE(IGHYRS,'HYDRO-RESERVOIRS'))= +SUM(S, + IHYINF_S(IA,S) * + ( + GKFX(Y,IA,IGHYRS) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,IGHYRS) + +VGKNACCUMNET.L(Y,IA,IGHYRS) + ) + -SUM(T,IHYRST(S,T)*VGE_T.L(Y,IA,IGHYRS,S,T)) + )/IOF1000000*IHOURFRAC +; + + +* ---------------- END OF ENERGY CURTAILMENT ----------------------- + +* ------------------------- ENERGY DEMAND ---------------------- + +* ------------- ELECTRICITY DEMAND -------------- + +*HOURLY +** EXOGENOUS DEMAND + +$ifi %TRANSPORT%==yes EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR) AND SUM(DEUSER$(NOT IDEUSER_TRANS(DEUSER)),IDE_SUMST(IR,DEUSER)))= +$ifi %TRANSPORT%==yes SUM((DEUSER)$(IDE_SUMST(IR,DEUSER) AND (NOT IDEUSER_TRANS(DEUSER))), DE(Y,IR,DEUSER) * DE_VAR_T(IR,DEUSER,S,T) / IDE_SUMST(IR,DEUSER)) + +$ifi not %TRANSPORT%==yes EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR) AND SUM(DEUSER,IDE_SUMST(IR,DEUSER)))= +$ifi not %TRANSPORT%==yes SUM((DEUSER)$(IDE_SUMST(IR,DEUSER)), DE(Y,IR,DEUSER) * DE_VAR_T(IR,DEUSER,S,T) / IDE_SUMST(IR,DEUSER)) + + +$ifi not %DEMANDRESPONSE%==yes $goto NO_DEMANDRESPONSE +* Downward regulation for DR shed technologies: +- SUM(IADR(Y,IA,DR_TECH_SHED)$(RRRAAA(IR,IA) AND CCCRRR(C,IR)), VDR_DOWN.L(Y,IA,DR_TECH_SHED,S,T)) +* Balance between upward and downward regulation for DR shift technologies: +*TODO - efficiency +- SUM(IADR(Y,IA,DR_TECH_SHIFT)$(RRRAAA(IR,IA) AND CCCRRR(C,IR)), VDR_DOWN.L(Y,IA,DR_TECH_SHIFT,S,T)) + SUM(IADR(Y,IA,DR_TECH_SHIFT)$(RRRAAA(IR,IA) AND CCCRRR(C,IR)), VDR_UP.L(Y,IA,DR_TECH_SHIFT,S,T)) +$label NO_DEMANDRESPONSE +; + +$ifi %TRANSPORT%==yes EL_DEMAND_YCRST(Y,C,IR,S,T,'EXO_TRANS','MWh')$(CCCRRR(C,IR) AND SUM(IDEUSER_TRANS,IDE_SUMST(IR,IDEUSER_TRANS)))= +$ifi %TRANSPORT%==yes SUM((IDEUSER_TRANS)$IDE_SUMST(IR,IDEUSER_TRANS), DE(Y,IR,IDEUSER_TRANS) * DE_VAR_T(IR,IDEUSER_TRANS,S,T) / IDE_SUMST(IR,IDEUSER_TRANS)) +; + +** ENDOGENOUS DEMAND + +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDOGENOUS_ELECT2HEAT','MWh')$CCCRRR(C,IR)= +* P2H CONSUMPTION + SUM(IA$RRRAAA(IR,IA), SUM(IGETOH$IAGK_HASORPOT(Y,IA,IGETOH), VGE_T.L(Y,IA,IGETOH,S,T))) +; + +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTRASTO','MWh')$CCCRRR(C,IR)= +* INTRASEASONAL ELECTRICITY STORAGE +$ifi not %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADT.L(Y,IA,IGESTO,S,T))) +$ifi %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADTS.L(Y,IA,IGESTO,S,T))) +; + +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTERSTO','MWh')$CCCRRR(C,IR)= +* INTERSEASONAL ELECTRICITY STORAGE + +SUM(IA$RRRAAA(IR,IA),SUM(IGESTOS$IAGK_HASORPOT(Y,IA,IGESTOS),VESTOLOADTS.L(Y,IA,IGESTOS,S,T))) +; + +$ifi not %EV%==yes $goto NO_EV +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_EV','MWh')$CCCRRR(C,IR)= + + VEV_VG2V_BEV.L(Y,IR,S,T) + + VEV_VG2V_PHEV.L(Y,IR,S,T) +$ifi %V2G%==yes - VEV_VV2G_BEV.L(Y,IR,S,T) +$ifi %V2G%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T) +$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_BEV.L(Y,IR,S,T)$(cs('v2g',IY411)) +$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T)$(cs('v2g',IY411)) +; +$label NO_EV + +$ifi %TRANSPORT%==yes EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')$CCCRRR(C,IR)= +$ifi %TRANSPORT%==yes $ifi %TRANSPORT_SYNTHFUEL_COMMODITY%==ELECTRICITY +VTRANSDEMAND_T.L(Y,IR,S,T) +$ifi %TRANSPORT%==yes +0; + +$ifi %CCS%==yes EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_CCS','MWh')$CCCRRR(C,IR)= +$ifi %CCS%==yes SUM((IA,G)$(IAGK_HASORPOT(Y,IA,G) AND RRRAAA(IR,IA) AND CCS_G(G)),VGF_T.L(Y,IA,G,S,T) * IM_CO2(G)*IOF0001 * IOF3P6 * CCS_CO2CAPTEFF_G(G)* CCS_DECO2COMP_G(G)); + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_H2','MWh')$CCCRRR(C,IR)= ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOH2,S,T)) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOHH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOHH2,S,T)) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GEHTOH2,S,T)) +; + +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')$CCCRRR(C,IR)= +*Adding electricity consumption from BIOMETHANE-DAC generation ++ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)*DAC_DE(IHYDROGEN_GH2TOBIOMETH)) +; +$label NO_HYDROGEN_DEMAND + +$ifi not %OPTIFLOW%==yes $goto NO_OPTIFLOW_DEMAND_EL +EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OPTIFLOW','MWh')$CCCRRR(C,IR)= + +SUM(IA$(RRRAAA(IR,IA)),VFLOWBUFFER.L(Y,IA,'ElecBuffer','ELECFLOW',S,T)) +; +$label NO_OPTIFLOW_DEMAND_EL + +**LOSSES +EL_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')$CCCRRR(C,IR)= +* EXOGENOUS DEMAND +EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')*DISLOSS_E(IR)/(1-DISLOSS_E(IR)) +* P2H CONSUMPTION ++SUM(IA$RRRAAA(IR,IA), SUM(IGETOH$IAGK_HASORPOT(Y,IA,IGETOH), VGE_T.L(Y,IA,IGETOH,S,T)*DISLOSS_E_AG(IA,IGETOH)/(1-DISLOSS_E_AG(IA,IGETOH)))) +* INTRASEASONAL ELECTRICITY STORAGE +$ifi not %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADT.L(Y,IA,IGESTO,S,T)*DISLOSS_E_AG(IA,IGESTO)/(1-DISLOSS_E_AG(IA,IGESTO)))) +$ifi %stointers%==all +SUM(IA$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),VESTOLOADTS.L(Y,IA,IGESTO,S,T)*DISLOSS_E_AG(IA,IGESTO)/(1-DISLOSS_E_AG(IA,IGESTO)))) +* INTERSEASONAL ELECTRICITY STORAGE ++SUM(IA$RRRAAA(IR,IA),SUM(IGESTOS$IAGK_HASORPOT(Y,IA,IGESTOS),VESTOLOADT.L(Y,IA,IGESTOS,S,T)*DISLOSS_E_AG(IA,IGESTOS)/(1-DISLOSS_E_AG(IA,IGESTOS)))) +* EVs +$ifi not %EV%==yes $goto NO_EV2 + +( + + VEV_VG2V_BEV.L(Y,IR,S,T) + + VEV_VG2V_PHEV.L(Y,IR,S,T) + )*EV_DISTLOSSLOAD(IR)/(1-EV_DISTLOSSLOAD(IR)) + +( +$ifi %V2G%==yes - VEV_VV2G_BEV.L(Y,IR,S,T) +$ifi %V2G%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T) +$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_BEV.L(Y,IR,S,T)$(cs('v2g',IY411)) +$ifi %STEPCHARGSCHEME%==yes - VEV_VV2G_PHEV.L(Y,IR,S,T)$(cs('v2g',IY411)) + +0)*EV_DISTLOSSUNLOAD(IR)/(1-EV_DISTLOSSUNLOAD(IR)) +$label NO_EV2 +*CCS +$ifi %CCS%==yes +SUM((IA,G)$(IAGK_HASORPOT(Y,IA,G) AND RRRAAA(IR,IA) AND CCS_G(G)),VGF_T.L(Y,IA,G,S,T) * IM_CO2(G)*IOF0001 * IOF3P6 * CCS_CO2CAPTEFF_G(G)* CCS_DECO2COMP_G(G)*DISLOSS_E_AG(IA,G)/(1-DISLOSS_E_AG(IA,G))) + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND2 ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOH2,S,T)*DISLOSS_E_AG(IA,IHYDROGEN_GETOH2)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GETOH2))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GETOHH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GETOHH2,S,T)*DISLOSS_E_AG(IA,IHYDROGEN_GETOHH2)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GETOHH2))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGE_T.L(Y,IA,IHYDROGEN_GEHTOH2,S,T)*DISLOSS_E_AG(IA,IHYDROGEN_GEHTOH2)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GEHTOH2))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)*DAC_DE(IHYDROGEN_GH2TOBIOMETH)*DISLOSS_E_AG(IA,IHYDROGEN_GH2TOBIOMETH)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GH2TOBIOMETH))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASUPGRADING)$(RRRAAA(IR,IA)),VGBIOGASUPGRADING_T.L(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)*BIOGASUPGRADING_DE(IHYDROGEN_GBIOGASUPGRADING)*DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASUPGRADING)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASUPGRADING))) ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASMETHANATION)$(RRRAAA(IR,IA)),VGBIOGASMETHANATION_T.L(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)*METHANATION_DE(IHYDROGEN_GBIOGASMETHANATION)*DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASMETHANATION)/(1-DISLOSS_E_AG(IA,IHYDROGEN_GBIOGASMETHANATION))) +$label NO_HYDROGEN_DEMAND2 + +*PRODUCTION SIDE ++SUM((IGE,IA,FFF,TECH_TYPE)$((NOT IGETOH(IGE)) AND RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh')*DISLOSS_E_AG(IA,IGE)) +; + +EL_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')$CCCRRR(C,IR)= +*TRANSMISSION LOSSES ++SUM(IRE$IXK_HASORPOT(Y,IRE,IR),VX_T.L(Y,IRE,IR,S,T)*XLOSS(IRE,IR)); + + +*ANNUAL DEMAND +** EXOGENOUS DEMAND + +$ifi %TRANSPORT%==yes EL_DEMAND_YCR(Y,C,IR,'EXOGENOUS','TWh')$(CCCRRR(C,IR) AND SUM(DEUSER$(NOT IDEUSER_TRANS(DEUSER)),IDE_SUMST(IR,DEUSER)))= +$ifi %TRANSPORT%==yes SUM((DEUSER,S,T)$(IDE_SUMST(IR,DEUSER) AND (NOT IDEUSER_TRANS(DEUSER))), IHOURSINST(S,T)*IHOURFRAC*DE(Y,IR,DEUSER) * DE_VAR_T(IR,DEUSER,S,T) / IDE_SUMST(IR,DEUSER))/IOF1000000; + +$ifi not %TRANSPORT%==yes EL_DEMAND_YCR(Y,C,IR,'EXOGENOUS','TWh')$(CCCRRR(C,IR) AND SUM(DEUSER,IDE_SUMST(IR,DEUSER)))= +$ifi not %TRANSPORT%==yes SUM((DEUSER,S,T)$(IDE_SUMST(IR,DEUSER)), IHOURSINST(S,T)*IHOURFRAC*DE(Y,IR,DEUSER) * DE_VAR_T(IR,DEUSER,S,T) / IDE_SUMST(IR,DEUSER))/IOF1000000; + +$ifi %TRANSPORT%==yes EL_DEMAND_YCR(Y,C,IR,'EXO_TRANS','TWh')$(CCCRRR(C,IR) AND SUM(IDEUSER_TRANS,IDE_SUMST(IR,IDEUSER_TRANS)))= +$ifi %TRANSPORT%==yes SUM((IDEUSER_TRANS,S,T)$IDE_SUMST(IR,IDEUSER_TRANS), IHOURSINST(S,T)*IHOURFRAC*DE(Y,IR,IDEUSER_TRANS) * DE_VAR_T(IR,IDEUSER_TRANS,S,T) / IDE_SUMST(IR,IDEUSER_TRANS))/IOF1000000; + +** ENDOGENOUS DEMAND + +EL_DEMAND_YCR(Y,C,IR,'ENDOGENOUS_ELECT2HEAT','TWh')$CCCRRR(C,IR)= +* HEAT PUMPS CONSUMPTION + SUM((S,T,IA)$RRRAAA(IR,IA), SUM(IGETOH$IAGK_HASORPOT(Y,IA,IGETOH), IHOURSINST(S,T)*IHOURFRAC*VGE_T.L(Y,IA,IGETOH,S,T)))/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_INTRASTO','TWh')$CCCRRR(C,IR)= +* INTRASEASONAL ELECTRICITY STORAGE LOSS +$ifi not %stointers%==all +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),IHOURSINST(S,T)*IHOURFRAC*(VESTOLOADT.L(Y,IA,IGESTO,S,T)-VGE_T.L(Y,IA,IGESTO,S,T))))/IOF1000000 +$ifi %stointers%==all +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IGESTO$IAGK_HASORPOT(Y,IA,IGESTO),IHOURSINST(S,T)*IHOURFRAC*(VESTOLOADTS.L(Y,IA,IGESTO,S,T)-VGE_T.L(Y,IA,IGESTO,S,T))))/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_INTERSTO','TWh')$CCCRRR(C,IR)= +* INTERSEASONAL ELECTRICITY STORAGE LOSS + +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IGESTOS$IAGK_HASORPOT(Y,IA,IGESTOS),IHOURSINST(S,T)*IHOURFRAC*(VESTOLOADTS.L(Y,IA,IGESTOS,S,T)-VGE_T.L(Y,IA,IGESTOS,S,T))))/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_EV','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_EV','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_OTHERTRANS','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'DIST_LOSSES','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'TRANS_LOSSES','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_CCS','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_CCS','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_H2','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_H2','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_OPTIFLOW','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OPTIFLOW','MWh')*IHOURFRAC)/IOF1000000 +; + +EL_DEMAND_YCR(Y,C,IR,'ENDO_BIOMETHANE','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')*IHOURFRAC)/IOF1000000 +; + +* ----------- END OF ELECTRICITY DEMAND -------------- + +* ------------- HEAT DEMAND -------------- +*HOURLY DEMAND +** EXOGENOUS DEMAND + +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER,IDH_SUMST(IA,DHUSER)))= +SUM((DHUSER)$IDH_SUMST(IA,DHUSER), DH(Y,IA,DHUSER) * DH_VAR_T(IA,DHUSER,S,T) / IDH_SUMST(IA,DHUSER)) + +$ifi not %INDIVUSERS%==yes $goto NO_INDIVUSERSGROUP +$ifi not %GROUP_DEMAND_SHIFT%==yes $goto NO_INDIVUSERSGROUP ++ ( +*Removing default demand + -SUM((DHUSER)$IDH_SUMST(IA,DHUSER), DH(Y,IA,DHUSER) * DH_VAR_T(IA,DHUSER,S,T) / IDH_SUMST(IA,DHUSER)) +*Introducing new allocated demand + +SUM((INDIVUSERS_GROUP,DHUSER)$INDIVUSERS_GROUP_A(IA,DHUSER,INDIVUSERS_GROUP), + VINDIVUSERS_GROUPSHARE.L(Y,IR,DHUSER,INDIVUSERS_GROUP)* DH_VAR_T(IA,DHUSER,S,T)/ IDH_SUMST(IA,DHUSER) + )*SUM((INDIVUSERS_DEMANDTYPE,DHUSER)$INDIVUSERS_DEMANDTYPE_A(IA,DHUSER,INDIVUSERS_DEMANDTYPE), + SUM(IAI$(RRRAAA(IR,IAI) AND INDIVUSERS_DEMANDTYPE_A(IAI,DHUSER,INDIVUSERS_DEMANDTYPE)), DH(Y,IAI,DHUSER)) + ) + )$(INDIVUSERS_AAA(IA) + AND SUM((INDIVUSERS_GROUP,DHUSER),INDIVUSERS_GROUP_A(IA,DHUSER,INDIVUSERS_GROUP)) + AND SUM((INDIVUSERS_DEMANDTYPE,DHUSER),INDIVUSERS_DEMANDTYPE_A(IA,DHUSER,INDIVUSERS_DEMANDTYPE))) +$label NO_INDIVUSERSGROUP +; + +** ENDOGENOUS DEMAND + +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTRASTO','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +* INTRASEASONAL HEAT STORAGE +$ifi not %stointers%==all SUM(IGHSTO$IAGK_HASORPOT(Y,IA,IGHSTO),VHSTOLOADT.L(Y,IA,IGHSTO,S,T)) +$ifi %stointers%==all SUM(IGHSTO$IAGK_HASORPOT(Y,IA,IGHSTO),VHSTOLOADTS.L(Y,IA,IGHSTO,S,T)) + +; + +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTERSTO','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +* INTERSEASONAL HEAT STORAGE + + SUM(IGHSTOS$IAGK_HASORPOT(Y,IA,IGHSTOS),VHSTOLOADTS.L(Y,IA,IGHSTOS,S,T)) +; + +**LOSSES +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'DIST_LOSSES','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +* EXOGENOUS DEMAND +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh')*DISLOSS_H(IA)/(1-DISLOSS_H(IA)) +; + +$ifi %HEATTRANS%==yes H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'TRANS_LOSSES','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +$ifi %HEATTRANS%==yes *TRANSMISSION LOSSES +$ifi %HEATTRANS%==yes +SUM(IAE$IXHK_HASORPOT(Y,IAE,IA),VXH_T.L(Y,IAE,IA,S,T)*XHLOSS(IAE,IA)); +$ifi %HEATTRANS%==yes ; + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND3 +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_H2','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= ++SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GEHTOH2)$(RRRAAA(IR,IA)), VGH_T.L(Y,IA,IHYDROGEN_GEHTOH2,S,T)) +; + +$ifi not %OPTIFLOW%==yes $goto NO_OPTIFLOW_DEMAND_H +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_OPTIFLOW','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +* +SUM(IA$(RRRAAA(IR,IA)),VFLOWBUFFER.L(Y,IA,'HeatBuffer','HEATFLOW',S,T)) + +VFLOWBUFFER.L(Y,IA,'HeatBuffer','HEATFLOW',S,T) +; +$label NO_OPTIFLOW_DEMAND_H + +H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_BIOMETHANE','MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= ++ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)*DAC_DH(IHYDROGEN_GH2TOBIOMETH)) +; +$label NO_HYDROGEN_DEMAND3 + + +*ANNUAL DEMAND +** EXOGENOUS DEMAND + +H_DEMAND_YCRA(Y,C,IR,IA,'EXOGENOUS','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER,IDH_SUMST(IA,DHUSER)))= +SUM((S,T),IHOURSINST(S,T)*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh')*IHOURFRAC)/IOF1000000; +; + +** ENDOGENOUS DEMAND +H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_INTRASTO','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +* INTRASEASONAL HEAT STORAGE LOSS +$ifi not %stointers%==all SUM((S,T,IGHSTO)$IAGK_HASORPOT(Y,IA,IGHSTO),IHOURSINST(S,T)*IHOURFRAC*(VHSTOLOADT.L(Y,IA,IGHSTO,S,T)-VGH_T.L(Y,IA,IGHSTO,S,T)))/IOF1000000 +$ifi %stointers%==all SUM((S,T,IGHSTO)$IAGK_HASORPOT(Y,IA,IGHSTO),IHOURSINST(S,T)*IHOURFRAC*(VHSTOLOADTS.L(Y,IA,IGHSTO,S,T)-VGH_T.L(Y,IA,IGHSTO,S,T)))/IOF1000000 + +; + +H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_INTERSTO','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + +* INTERSEASONAL HEAT STORAGE LOSS + + SUM((S,T,IGHSTOS)$IAGK_HASORPOT(Y,IA,IGHSTOS),IHOURSINST(S,T)*IHOURFRAC*(VHSTOLOADTS.L(Y,IA,IGHSTOS,S,T)-VGH_T.L(Y,IA,IGHSTOS,S,T)))/IOF1000000 +; + +H_DEMAND_YCRA(Y,C,IR,IA,'DIST_LOSSES','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'DIST_LOSSES','MWh'))/IOF1000000 +; + +H_DEMAND_YCRA(Y,C,IR,IA,'TRANS_LOSSES','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'TRANS_LOSSES','MWh'))/IOF1000000 +; + +H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_H2','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_H2','MWh'))/IOF1000000 +; + +H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_OPTIFLOW','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + SUM((S,T),IHOURSINST(S,T)*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_OPTIFLOW','MWh')*IHOURFRAC)/IOF1000000 +; + +H_DEMAND_YCRA(Y,C,IR,IA,'ENDO_BIOMETHANE','TWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_BIOMETHANE','MWh'))/IOF1000000 +; +* ----------- END OF HEAT DEMAND -------------- + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_DEMAND30 +* ------------- H2 DEMAND -------------- + +*HOURLY +** EXOGENOUS DEMAND + +H2_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh')$(CCCRRR(C,IR))= + IHYDROGEN_DH2_REGION_T_Y(Y,IR,S,T)+ + SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(Y,IA,S,T)) +; + +$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space +H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_REGIONAL','MWh')$(CCCRRR(C,IR))= + VGE_T_FLEXDH2.L(Y,IR,S,T) +; +$label no_flexible_h2_space + +H2_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')$CCCRRR(C,IR)= + IHYDROGEN_DH2_REGION_T_Y(Y,IR,S,T)*DISLOSS_H2(IR)/(1-DISLOSS_H2(IR))+ + SUM(IA$RRRAAA(IR,IA),IHYDROGEN_DH2_AREA_T_Y(Y,IA,S,T)*DISLOSS_H2(IA)/(1-DISLOSS_H2(IA))) +$ifi %flexible_h2_space%==yes + VGE_T_FLEXDH2.L(Y,IR,S,T)*DISLOSS_H2(IR)/(1-DISLOSS_H2(IR)) +; + +** ENDOGENOUS DEMAND + +H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTERSTO','MWh')$CCCRRR(C,IR)= +* INTERSEASONAL H2 STORAGE + +SUM(IA$RRRAAA(IR,IA),SUM(IHYDROGEN_GH2STO$IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO),VHYDROGEN_STOLOADT.L(Y,IA,IHYDROGEN_GH2STO,S,T))) +; + +$ifi %TRANSPORT%==yes H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')$CCCRRR(C,IR)= +$ifi %TRANSPORT%==yes $ifi %TRANSPORT_SYNTHFUEL_COMMODITY%==HYDROGEN +VTRANSDEMAND_T.L(Y,IR,S,T) +$ifi %TRANSPORT%==yes +0; + + +H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_FUELCELL','MWh')$CCCRRR(C,IR)= +*Adding H2 consumption from FUELCELLS generation ++ SUM(IAGK_HASORPOT(Y,IA,G)$(RRRAAA(IR,IA) AND GTECH_TYPE(G,'FUELCELL')),VGF_T.L(Y,IA,G,S,T)) +; + +H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')$CCCRRR(C,IR)= +*Adding H2 consumption from BIOMETHANE-DAC generation ++ SUM(IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH)$(RRRAAA(IR,IA)),VGBIOMETH_T.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)/GDATA(IHYDROGEN_GH2TOBIOMETH,'GDFE')) +; + +$ifi not %OPTIFLOW%==yes $goto NO_OPTIFLOW_DEMAND_H2 +H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OPTIFLOW','MWh')$CCCRRR(C,IR)= + +SUM(IA$(RRRAAA(IR,IA)),VFLOWSOURCE.L(Y,IA,'HydrogenSource_MWh','HYDROGENFLOW_MWh',S,T)) +; +$label NO_OPTIFLOW_DEMAND_H2 + + +**LOSSES + +H2_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')$CCCRRR(C,IR)= +*TRANSMISSION LOSSES ++SUM(IRE$IXH2K_HASORPOT(Y,IRE,IR),VXH2_T.L(Y,IRE,IR,S,T)*XH2LOSS(IRE,IR)); + + +*ANNUAL DEMAND +** EXOGENOUS DEMAND + +H2_DEMAND_YCR(Y,C,IR,'EXOGENOUS','TWh')$(CCCRRR(C,IR))= +SUM((S,T), IHOURSINST(S,T)*IHOURFRAC*H2_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh'))/IOF1000000; + +** ENDOGENOUS DEMAND + +H2_DEMAND_YCR(Y,C,IR,'ENDO_INTERSTO','TWh')$CCCRRR(C,IR)= +* INTERSEASONAL H2 STORAGE LOSS + +SUM((S,T,IA)$RRRAAA(IR,IA),SUM(IHYDROGEN_GH2STO$IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO),IHOURSINST(S,T)*IHOURFRAC*(VHYDROGEN_STOLOADT.L(Y,IA,IHYDROGEN_GH2STO,S,T)-VHYDROGEN_GH2_T.L(Y,IA,IHYDROGEN_GH2STO,S,T))))/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'ENDO_FUELCELL','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_FUELCELL','MWh')*IHOURFRAC)/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'ENDO_OTHERTRANS','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh')*IHOURFRAC)/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'ENDO_OPTIFLOW','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OPTIFLOW','MWh')*IHOURFRAC)/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'TRANS_LOSSES','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'TRANS_LOSSES','MWh')*IHOURFRAC)/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'DIST_LOSSES','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh')*IHOURFRAC)/IOF1000000 +; + +H2_DEMAND_YCR(Y,C,IR,'ENDO_BIOMETHANE','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh')*IHOURFRAC)/IOF1000000 +; + +$ifi not %flexible_h2_space%==yes $goto no_flexible_h2_space2 +H2_DEMAND_YCR(Y,C,IR,'ENDO_REGIONAL','TWh')$CCCRRR(C,IR)= + SUM((S,T),IHOURSINST(S,T)*H2_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_REGIONAL','MWh')*IHOURFRAC)/IOF1000000 +; +$label no_flexible_h2_space2 + +* ----------- END OF H2 DEMAND -------------- +$label NO_HYDROGEN_DEMAND30 + +* -------------------- END OF ENERGY DEMAND ----------------------- + + +* -------------------- TRANSMISSION CAPACITY ----------------------- + +** EXOGENOUS ELECTRICITY CAPACITY + +X_CAP_YCR(Y,C,IR,IRI,'EXOGENOUS','GW')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +IOF0001*XKFX(Y,IR,IRI) +; + + +** ENDOGENOUS ELECTRIC CAPACITY + +$ifi not %TransInvest%==yes $goto Transmission_investments_end +X_CAP_YCR(Y,C,IR,IRI,'ENDOGENOUS','GW')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +IOF0001*VXKNACCUMNET.L(Y,IR,IRI) +; +$label Transmission_investments_end + + +* -------------------- END OF TRANSMISSION CAPACITY ----------------------- + +* -------------------- TRANSMISSION FLOW ----------------------- + +** HOURLY TRANSMISSION FLOW + +X_FLOW_YCRST(Y,C,IR,IRI,S,T,'MWh')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +VX_T.L(Y,IR,IRI,S,T); +; + + +** ANNUAL TRANSMISSION FLOW +X_FLOW_YCR(Y,C,IR,IRI,'TWh')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*VX_T.L(Y,IR,IRI,S,T))/IOF1000000; +; + + + +* -------------------- END OF TRANSMISSION FLOW ----------------------- + +$ifi NOT %HEATTRANS%==yes $goto no_heattrans +* -------------------- HEAT TRANSMISSION CAPACITY ----------------------- + +** EXOGENOUS HEAT TRANSMISSION CAPACITY + +XH_CAP_YCA(Y,C,IA,IAI,'EXOGENOUS','GW')$(ICA(C,IA) AND (XHKFX(Y,IA,IAI) OR XHKFX_DH(Y,IA,IAI)))= +IOF0001*(XHKFX(Y,IA,IAI) + XHKFX_DH(Y,IA,IAI)) +; + +** ENDOGENOUS HEAT TRANSMISSION CAPACITY + +$ifi not %HeatTransInvest%==yes $goto Heat_Transmission_investments_end +XH_CAP_YCA(Y,C,IA,IAI,'ENDOGENOUS','GW')$(ICA(C,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +IOF0001*VXHKNACCUMNET.L(Y,IA,IAI) +; +$label Heat_Transmission_investments_end + + +* -------------------- END OF HEAT TRANSMISSION CAPACITY ----------------------- + +* -------------------- HEAT TRANSMISSION FLOW ----------------------- + +** HOURLY HEAT TRANSMISSION FLOW + +XH_FLOW_YCAST(Y,C,IA,IAI,S,T,'MWh')$(ICA(C,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +VXH_T.L(Y,IA,IAI,S,T); +; + +** ANNUAL HEAT TRANSMISSION FLOW +XH_FLOW_YCA(Y,C,IA,IAI,'TWh')$(ICA(C,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*VXH_T.L(Y,IA,IAI,S,T))/IOF1000000; +; + +* -------------------- END OF HEAT TRANSMISSION FLOW ----------------------- +$label no_heattrans + + +$ifi NOT %hydrogen%==yes $goto no_hydrogentrans +* -------------------- H2 TRANSMISSION CAPACITY ----------------------- + +** EXOGENOUS H2 TRANSMISSION CAPACITY + +XH2_CAP_YCR(Y,C,IR,IRI,'EXOGENOUS','GW')$(CCCRRR(C,IR) AND XH2KFX(Y,IR,IRI))= +IOF0001*XH2KFX(Y,IR,IRI) +; + +** ENDOGENOUS H2 TRANSMISSION CAPACITY + +$ifi not %H2TransInvest%==yes $goto H2_Transmission_investments_end +XH2_CAP_YCR(Y,C,IR,IRI,'ENDOGENOUS','GW')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +IOF0001*(VXH2KNACCUMNET.L(Y,IR,IRI)$SUM(IYALIAS2$(YVALUE(IYALIAS2) LE YVALUE(Y)),IXH2KN(IYALIAS2,IR,IRI)) + +VXH2KNACCUMNET_NGTOH2.L(Y,IR,IRI)$SUM(IYALIAS2$(YVALUE(IYALIAS2) LE YVALUE(Y)),IXH2KN_NGTOH2(IYALIAS2,IR,IRI))) +; +$label H2_Transmission_investments_end + + +* -------------------- END OF HEAT TRANSMISSION CAPACITY ----------------------- + +* -------------------- H2 TRANSMISSION FLOW ----------------------- + +** HOURLY H2 TRANSMISSION FLOW + +XH2_FLOW_YCRST(Y,C,IR,IRI,S,T,'MWh')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +VXH2_T.L(Y,IR,IRI,S,T); +; + +** ANNUAL H2 TRANSMISSION FLOW +XH2_FLOW_YCR(Y,C,IR,IRI,'TWh')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +SUM((S,T),IHOURSINST(S,T)*IHOURFRAC*VXH2_T.L(Y,IR,IRI,S,T))/IOF1000000; +; + +* -------------------- END OF H2 TRANSMISSION FLOW ----------------------- +$label no_hydrogentrans + +* ---------------------- ECONOMIC OUTPUT ---------------------- + +* ------------- COMMODITY PRICES -------------- + +** ELECTRICITY PRICES + +*HOURLY ELECTRICITY PRICE + +EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')$CCCRRR(C,IR)=OMONEY*QEEQ.M(Y,IR,S,T) +$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) +$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) +/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); + +*AVERAGE ELECTRICITY PRICE + +EL_PRICE_YCR(Y,C,IR,'AVERAGE','Money_per_MWh')$CCCRRR(C,IR)= +SUM((S,T),EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')/(IWEIGHSUMS*IWEIGHSUMT/(WEIGHT_S(S)*WEIGHT_T(T)))); + +$ontext +*EXCLUDED SO FAR +*AVERAGE ELECTRICITY PRICE WEIGTHED BY CONSUMPTION + +EL_PRICE_YCR(Y,C,IR,'AVERAGE_WEIGHTED_BY_CONSUMPTION','Money_per_MWh')$CCCRRR(C,IR)= + SUM((VARIABLE_CATEGORY,S,T), + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*EL_DEMAND_YCRST(Y,C,IR,S,T,VARIABLE_CATEGORY,'MWh') + ) + /SUM((VARIABLE_CATEGORY,S,T),EL_DEMAND_YCRST(Y,C,IR,S,T,VARIABLE_CATEGORY,'MWh')) +; + +*AVERAGE ELECTRICITY PRICE WEIGTHED BY PRODUCTION + +EL_PRICE_YCR(Y,C,IR,'AVERAGE_WEIGHTED_BY_PRODUCTION','Money_per_MWh')$CCCRRR(C,IR)= + SUM((IGE,IA,FFF,S,T,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGE)), + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh') + ) + /SUM((IGE,IA,FFF,S,T,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh')) +; +$offtext + +** END OF ELECTRICITY PRICES + +** heatING PRICES + +*HOURLY heatING PRICE + +$ifi %BalancingMarket%==yes $ifi %NOHEATMARKET%==yes $goto NO_HEATMARKET +H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND (SUM(DHUSER, IDH_SUMST(IA,DHUSER)) +$ifi %HEATTRANS%==yes OR SUM(IAE,IXHK_HASORPOT(Y,IAE,IA)) OR SUM(IAI,IXHK_HASORPOT(Y,IA,IAI)) +))=OMONEY*QHEQ.M(Y,IA,S,T) +$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) +$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) +/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); +$label NO_HEATMARKET +$ifi %BalancingMarket%==yes $ifi %NOHEATMARKET%==yes H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=0; + + + +*AVERAGE heatING PRICE + +H_PRICE_YCRA(Y,C,IR,IA,'AVERAGE','Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND (SUM(DHUSER, IDH_SUMST(IA,DHUSER)) +$ifi %HEATTRANS%==yes OR SUM(IAE,IXHK_HASORPOT(Y,IAE,IA)) OR SUM(IAI,IXHK_HASORPOT(Y,IA,IAI)) +))= +SUM((S,T),H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')/(IWEIGHSUMS*IWEIGHSUMT/(WEIGHT_S(S)*WEIGHT_T(T)))); + +$ontext +*EXCLUDED SO FAR +*AVERAGE heatING PRICE WEIGTHED BY CONSUMPTION + +H_PRICE_YCRA(Y,C,IR,IA,'AVERAGE_WEIGHTED_BY_CONSUMPTION','Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER, IDH_SUMST(IA,DHUSER)))= + SUM((VARIABLE_CATEGORY,S,T), + H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*H_DEMAND_YCRAST(Y,C,IR,IA,S,T,VARIABLE_CATEGORY,'MWh') + ) + /SUM((VARIABLE_CATEGORY,S,T),H_DEMAND_YCRAST(Y,C,IR,IA,S,T,VARIABLE_CATEGORY,'MWh')) +; + +*AVERAGE heatING PRICE WEIGTHED BY PRODUCTION + +H_PRICE_YCRA(Y,C,IR,IA,'AVERAGE_WEIGHTED_BY_PRODUCTION','Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND SUM(DHUSER, IDH_SUMST(IA,DHUSER)))= + SUM((IGH,FFF,S,T,TECH_TYPE)$IAGK_HASORPOT(Y,IA,IGH), + H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh') + ) + /SUM((IGH,FFF,S,T,TECH_TYPE)$IAGK_HASORPOT(Y,IA,IGH),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh')) +; +$offtext + +** END OF heatING PRICES + +$ifi NOT %HYDROGEN%==yes $goto NO_HYDROGEN_PRICE + +*HOURLY HYDROGEN PRICE +H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')$CCCRRR(C,IR)=OMONEY*QHYDROGEN_EQ.M(Y,IR,S,T) +$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) +$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) +/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); + +*AVERAGE Hydrogen PRICE + +H2_PRICE_YCR(Y,C,IR,'AVERAGE','Money_per_MWh')$CCCRRR(C,IR)= +SUM((S,T),H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')/(IWEIGHSUMS*IWEIGHSUMT/(WEIGHT_S(S)*WEIGHT_T(T)))); + + +*HOURLY BIOMETHANE PRICE +BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh')=OMONEY*QBIOMETHANE_EQ.M(Y,S,T) +$ifi %RollingSeasons%==yes /IHOURSINTROLLINGSEASON(S,T) +$ifi not %RollingSeasons%==yes /IHOURSINST(S,T) +/IDISCOUNTFACTOR(Y)/IWEIGHTY(Y); + +$label NO_HYDROGEN_PRICE + +* ------------- END OF COMMODITY PRICES -------------- + + +* ------------- COSTS -------------- + +* -- GENERATION COSTS ----- + +** GENERATION INVESTMENTS + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and RRRAAA(IR,IA))= + OMONEY*( + SUM(IYALIAS2$((ORD(IYALIAS2) LE ORD(Y)) AND IAGKNY(IYALIAS2,IA,G) AND (NOT IGKN_ES(G))),IYHASANNUITYG(IYALIAS2,Y,G)*VGKN.L(IYALIAS2,IA,G)*GINVCOST(IA,G)*ANNUITYCG(C,G)) +$ifi %OFFSHOREGRID%==yes + SUM(IYALIAS2$((ORD(IYALIAS2) LE ORD(Y)) AND IAGKNY(IYALIAS2,IA,G) AND IGKN_ES(G)),IYHASANNUITYG(IYALIAS2,Y,G)*SUM(XES,VGLAMBDA.L(IYALIAS2,IA,G,XES)*GINVCOST_ES(G,XES))*ANNUITYCG(C,G)) +) +; + +** GENEARTION FIXED COSTS + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FIXED_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + OMONEY/IOF1000*GOMFCOST(IA,G)*( + GKFX(Y,IA,G) + +VGKNACCUMNET.L(Y,IA,G) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,G)$IGDECOMEXOPOT(Y,IA,G) + ) +; + +** GENERATION O&M COSTS + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + OMONEY/IOF1000000* + ( + (IHOURFRAC *GOMVCOSTO(IA,G)*( + SUM((S,T), IHOURSINST(S,T) * VGE_T.L(Y,IA,G,S,T))$IGKE(G) +$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VHYDROGEN_GH2_T.L(Y,IA,G,S,T))$(IHYDROGEN_GH2STO(G) OR IHYDROGEN_GCH4TOH2(G)) +$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VGBIOMETH_T.L(Y,IA,G,S,T))$IHYDROGEN_GH2TOBIOMETH(G) +$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T))$IHYDROGEN_GBIOGASMETHANATION(G) +$ifi %HYDROGEN%==yes + SUM((S,T), IHOURSINST(S,T)*VGBIOGASUPGRADING_T.L(Y,IA,G,S,T))$IHYDROGEN_GBIOGASUPGRADING(G) + )) + + (IHOURFRAC *GOMVCOSTO(IA,G) * GDATA(G,'GDCV') * + ( + + SUM((S,T), IHOURSINST(S,T) * VGH_T.L(Y,IA,G,S,T))))$IGKH(G) + + + (IHOURFRAC *GOMVCOSTIN(IA,G)* + ( + + SUM((S,T), IHOURSINST(S,T) * VGF_T.L(Y,IA,G,S,T)))) + ) ; + +** GENERATION FUEL COSTS + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FUEL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + OMONEY/IOF1000000*( + IHOURFRAC *FUELPRICE(Y,IA,FFF)*IOF3P6 +$ifi not %STEPWISEPRICE%==yes $goto No_STEPWISEPRICE + +(QSTEPWISEPRICE_GFTOSTEP.M(Y,C,FFF)/(IDISCOUNTFACTOR(Y)*IWEIGHTY(Y)))$ISTEPWISEPRICE_F(Y,C,FFF) +$label No_STEPWISEPRICE + )* + ( + SUM((S,T), IHOURSINST(S,T) * VGF_T.L(Y,IA,G,S,T) )$IAGK_HASORPOT(Y,IA,G) + )$(IGNOTETOH(G) and (not IGESTO(G)) and (not IGHSTO(G)) and (not IGESTOS(G)) and (not IGHSTOS(G))) + + +* Electricity storages: +$ifi not %stointers%==all +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VESTOLOADT.L(Y,IA,G,S,T))$IGESTO(G) +$ifi %stointers%==all +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VESTOLOADTS.L(Y,IA,G,S,T))$IGESTO(G) + +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VESTOLOADTS.L(Y,IA,G,S,T))$IGESTOS(G) +* Heat storages: +$ifi not %stointers%==all +OMONEY/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VHSTOLOADT.L(Y,IA,G,S,T))$IGHSTO(G) +$ifi %stointers%==all +OMONEY/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VHSTOLOADTS.L(Y,IA,G,S,T))$IGHSTO(G) + +OMONEY/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VHSTOLOADTS.L(Y,IA,G,S,T))$IGHSTOS(G) +* Electricity to heat: + +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGE_T.L(Y,IA,G,S,T))$(IAGK_HASORPOT(Y,IA,G) and IGETOH(G)) + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_PRICE2 + +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGE_T.L(Y,IA,G,S,T))$(IHYDROGEN_GETOH2(G) OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G)) + +OMONEY/IOF1000000*SUM((S,T), H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VGH_T.L(Y,IA,G,S,T))$IHYDROGEN_GEHTOH2(G) + +OMONEY/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VHYDROGEN_STOLOADT.L(Y,IA,G,S,T))$IHYDROGEN_GH2STO(G) + +OMONEY/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGF_T.L(Y,IA,G,S,T))$IHYDROGEN_GH2FUEL(G) + +OMONEY/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGF_T.L(Y,IA,G,S,T) + + H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')*VGBIOMETH_T.L(Y,IA,G,S,T)*DAC_DH(G) + + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOMETH_T.L(Y,IA,G,S,T)*DAC_DE(G) + )$IHYDROGEN_GH2TOBIOMETH(G) + +OMONEY/IOF1000000*SUM((S,T), EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOGASUPGRADING_T.L(Y,IA,G,S,T)*BIOGASUPGRADING_DE(G) + )$IHYDROGEN_GBIOGASUPGRADING(G) + +OMONEY/IOF1000000*SUM((S,T), H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)*METHANATION_DH2(G) + + EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)*METHANATION_DE(G) + )$IHYDROGEN_GBIOGASMETHANATION(G) + +OMONEY/IOF1000000*SUM((S,T), BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh')*VGF_T.L(Y,IA,G,S,T))$IGBIOMETHANE(G) +$label NO_HYDROGEN_PRICE2 +; + +** CO2 EMISSIONS COST +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TAX','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + SUM(GROUP$(GROUP_AAA(GROUP,IA)),OMONEY/IOF1000000*IHOURFRAC *IM_CO2(G)*IOF0001 * IOF3P6 *EMI_POL(Y,C,GROUP,"TAX_CO2") * SUM((S,T), IHOURSINST(S,T)*(VGF_T.L(Y,IA,G,S,T) +$ifi %CCS%==yes -(VGF_T.L(Y,IA,G,S,T)*CCS_CO2CAPTEFF_G(G))$CCS_G(G) +))) +; + +** CO2 TRANSPORT COST +$ifi %CCS%==yes ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TRANSPORT','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G) AND CCS_G(G))= +$ifi %CCS%==yes OMONEY/IOF1000000*IHOURFRAC *IM_CO2(G)*IOF0001 * IOF3P6 * CCS_TRANSPORTCOST * SUM((S,T), IHOURSINST(S,T)*(VGF_T.L(Y,IA,G,S,T))); + + +** OTHER EMISSIONS COST +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OTHER_EMI_TAX','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and IAGK_HASORPOT(Y,IA,G))= + SUM(GROUP$(GROUP_AAA(GROUP,IA)),OMONEY/IOF1000000* + ( SUM((S,T), IHOURSINST(S,T) * (IHOURFRAC *IM_SO2(G)*IOF0001) * IOF3P6 * VGF_T.L(Y,IA,G,S,T))*EMI_POL(Y,C,GROUP,"TAX_SO2") + + SUM((S,T), IHOURSINST(S,T) * (IHOURFRAC *GDATA(G,'GDNOX')*IOF0000001) * IOF3P6 * VGF_T.L(Y,IA,G,S,T))* EMI_POL(Y,C,GROUP,"TAX_NOX") + )) +; + + +** UNIT COMMITMENT COST +$ifi not %UnitComm%==yes $goto No_UC +ECO_G_YCRAG(Y,C,IR,IA,IGUC,FFF,TECH_TYPE,'COSTS','GENERATION_UC_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IGF(IGUC,FFF) AND GTECH_TYPE(IGUC,TECH_TYPE) and IAGK_HASORPOT(Y,IA,IGUC))= +OMONEY/IOF1000000*SUM((S,T), IHOURSINST(S,T)*( + VUCU.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCUCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHUNLD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! startup cost + +VUCD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCDCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHUNLD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! shutdown cost + +VUCON.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCCOST0')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHUNLD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC))) !! fixed hourly cost + +VUCU_STOLOAD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCUCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHLOAD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! startup cost + +VUCD_STOLOAD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCDCOST')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHLOAD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC)))/CHRONOHOUR(S,T)*WEIGHT_T(T) !! shutdown cost + +VUCON_STOLOAD.L(Y,IA,IGUC,S,T)*GDATA(IGUC,'GDUCCOST0')*GDATA(IGUC,'GDUCUNITSIZE')/(1$((NOT IGESTO(IGUC)) AND (NOT IGESTOS(IGUC)) AND (NOT IGHSTO(IGUC)) AND (NOT IGHSTOS(IGUC))) + GDATA(IGUC,'GDSTOHLOAD')$(IGESTO(IGUC) OR IGESTOS(IGUC) OR IGHSTO(IGUC) OR IGHSTOS(IGUC))) !! fixed hourly cost + +$ifi %STEPWISE_RAMPING_UC%==ramp_const_cost +SUM(RAMPING_RATE,(VRAMPING_DOWN.L(Y,IA,IGUC,RAMPING_RATE,S,T)*IRAMPING_G_COSTS_DOWN(IGUC,RAMPING_RATE)+VRAMPING_UP.L(Y,IA,IGUC,RAMPING_RATE,S,T)*IRAMPING_G_COSTS_UP(IGUC,RAMPING_RATE))/CHRONOHOUR(S,T)) !! ramping cost +)) +; +$label NO_UC + + +*TAXES +$ifi NOT %TAXES%==yes $goto No_TAXES +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_TAXES','Mmoney')$(CCCRRR(C,IR) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G))= +OMONEY/IOF1000000*( +* Tax(+)/subsidy(-) on fuel use for electricity generation + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_F_EL(Y,C,G) * VGE_T.L(Y,IA,G,IS3,T)/ (GDATA(G,'GDFE') * (1$(NOT GEFFRATE(IA,G))+GEFFRATE(IA,G)))) + +* Tax(+)/subsidy(-) on fuel use for heat generation + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_F_HEAT(Y,C,G) * GDATA(G,'GDCV') * VGH_T.L(Y,IA,G,IS3,T)/ (GDATA(G,'GDFE') * (1$(NOT GEFFRATE(IA,G))+GEFFRATE(IA,G)))) + +* Tax(+)/subsidy(-) on fuel use + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_F(Y,C,G) * VGF_T.L(Y,IA,G,IS3,T)) + +* Tax(+)/subsidy(-) on heat generation + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_G_HEAT(Y,C,G) * VGH_T.L(Y,IA,G,IS3,T)) + +* Tax(+)/subsidy(-) on heat generation + + SUM((IS3,T), + IHOURSINST(IS3,T) * IHOURFRAC *TAX_G_EL(Y,C,G) * VGE_T.L(Y,IA,G,IS3,T)) +) +; +$label NO_TAXES + + +*GRID TARIFFS +$ifi NOT %GRIDTARIFFS%==yes $goto No_GRIDTARIFFS +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_GRID_TARIFFS','Mmoney')$(CCCRRR(C,IR) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND (IGETOH(G) +$ifi %HYDROGEN%==yes OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G) OR IHYDROGEN_GETOH2(G) OR IHYDROGEN_GH2TOBIOMETH(G) +))= +OMONEY/IOF1000000*( + +* Fixed component and subscribed power (per MW installed) + + IOF1000 * + IGR_PRICE_TECH(Y,IR,'GRDSUBS') * (VGKNACCUMNET.L(Y,IA,G) +$ifi %DECOM%==yes -VDECOM_EXO_ACCUM.L(Y,IA,G)$IGDECOMEXOPOT(Y,IA,G) + + GKFX(Y,IA,G)) /((GDATA(G,'GDFE') *(1$(NOT GEFFRATE(IA,G))+GEFFRATE(IA,G)))$IGETOH(G) + 1$(NOT IGETOH(G))) + +* Energy charge winter + + SUM((IS3,T)$IGR_TIME('GRDECW',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDECW') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge summer + + SUM((IS3,T)$IGR_TIME('GRDECS',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDECS') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge TOU step 1 + + SUM((IS3,T)$IGR_TIME('GRDTOU1',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU1') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge TOU step 2 + + SUM((IS3,T)$IGR_TIME('GRDTOU2',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU2') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge TOU step 3 + + SUM((IS3,T)$IGR_TIME('GRDTOU3',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU3') * VGE_T.L(Y,IA,G,IS3,T)) +* Energy charge TOU step 4 + + SUM((IS3,T)$IGR_TIME('GRDTOU4',IR,IS3,T), IHOURSINST(IS3,T) * IHOURFRAC *IGR_PRICE_TECH(Y,IR,'GRDTOU4') * VGE_T.L(Y,IA,G,IS3,T)) +) +; +$label NO_GRIDTARIFFS + +* -- TRANSMISSION ----- +*ELECTRICITY +** TRANSMISSION INVESTMENTS +ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= + OMONEY*IOF0000001*( + SUM((IYALIAS2)$((IXKN(IYALIAS2,IRI,IR) OR IXKN(IYALIAS2,IR,IRI)) AND (ORD(IYALIAS2) LE ORD(Y)) AND (NOT (IXKN_ES(IR,IRI) OR IXKN_ES(IRI,IR)))), + IOF05*ANNUITYCX(C)*IYHASANNUITYX(IYALIAS2,Y)*VXKN.L(IYALIAS2,IR,IRI)*XINVCOST(IYALIAS2,IR,IRI)) +$ifi %OFFSHOREGRID%==yes +SUM((IYALIAS2)$((IXKN(IYALIAS2,IRI,IR) OR IXKN(IYALIAS2,IR,IRI)) AND (ORD(IYALIAS2) LE ORD(Y)) AND (IXKN_ES(IR,IRI) OR IXKN_ES(IRI,IR))), +$ifi %OFFSHOREGRID%==yes IOF05*ANNUITYCX(C)*IYHASANNUITYX(IYALIAS2,Y)*SUM(XES,VXLAMBDA.L(IYALIAS2,IR,IRI,XES)*XINVCOST_ES(IYALIAS2,IR,IRI,XES))) +) +; +** TRANSMISSION FLOW COSTS +ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +OMONEY*IOF0000001* SUM((S,T), IHOURSINST(S,T) * (VX_T.L(Y,IR,IRI,S,T) * IHOURFRAC *XCOST(IR,IRI))); + +** TRANSMISSION TRADE COST +ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_TRADE_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VX_T.L(Y,IRI,IR,S,T) * EL_PRICE_YCRST(Y,C,IRI,S,T,'Money_per_MWh'))); + +** TRANSMISSION TRADE INCOME +ECO_X_YCR(Y,C,IR,IRI,'INCOME','TRANSMISSION_TRADE_INCOME','Mmoney')$(CCCRRR(C,IR) AND IXK_HASORPOT(Y,IR,IRI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VX_T.L(Y,IR,IRI,S,T) * EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))); + +*HEAT +$ifi not %HEATTRANS%==yes $goto No_HEATTRANS_costs +** TRANSMISSION INVESTMENTS +ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= + OMONEY*IOF0000001*SUM((IYALIAS2)$((IXHKN(IYALIAS2,IAI,IA) OR IXHKN(IYALIAS2,IA,IAI)) AND ORD(IYALIAS2) LE ORD(Y)) , + IOF05*ANNUITYCXH(C)*IYHASANNUITYXH(IYALIAS2,Y)*VXHKN.L(IYALIAS2,IA,IAI)*XHINVCOST(IYALIAS2,IA,IAI) + ); +** TRANSMISSION FLOW +ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH_T.L(Y,IA,IAI,S,T) * IHOURFRAC *XHCOST(IA,IAI))); + +** TRANSMISSION TRADE COST +ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','TRANSMISSION_TRADE_COSTS','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH_T.L(Y,IAI,IA,S,T) * H_PRICE_YCRAST(Y,C,IR,IAI,S,T,'Money_per_MWh'))); + +** TRANSMISSION TRADE INCOME +ECO_XH_YCRA(Y,C,IR,IA,IAI,'INCOME','TRANSMISSION_TRADE_INCOME','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH_T.L(Y,IA,IAI,S,T) * H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh'))); + + +$label No_HEATTRANS_costs + +*Hydrogen +$ifi not %HYDROGEN%==yes $goto No_H2TRANS_costs + +** TRANSMISSION INVESTMENTS +ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_CAPITAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= + OMONEY*IOF0000001*(SUM((IYALIAS2)$((IXH2KN(IYALIAS2,IRI,IR) OR IXH2KN(IYALIAS2,IR,IRI)) AND (NOT (IXKN_ES(IR,IRI) OR IXKN_ES(IRI,IR))) AND ORD(IYALIAS2) LE ORD(Y)) , + IOF05*ANNUITYCXH2(C)*IYHASANNUITYXH2(IYALIAS2,Y)*VXH2KN.L(IYALIAS2,IR,IRI)*XH2INVCOST(IYALIAS2,IR,IRI)) + + SUM((IYALIAS2)$((IXH2KN_NGTOH2(IYALIAS2,IRI,IR) OR IXH2KN_NGTOH2(IYALIAS2,IR,IRI)) AND ORD(IYALIAS2) LE ORD(Y)) , + IOF05*ANNUITYCXH2(C)*IYHASANNUITYXH2(IYALIAS2,Y)*VXH2KN_NGTOH2.L(IYALIAS2,IR,IRI)*XH2INVCOST_NGTOH2(IYALIAS2,IR,IRI)) +$ifi %ES_H2TRANS%==yes +SUM((IYALIAS2)$((IXH2KN(IYALIAS2,IRI,IR) OR IXH2KN(IYALIAS2,IR,IRI)) AND (ORD(IYALIAS2) LE ORD(Y)) AND (IXH2KN_ES(IR,IRI) OR IXH2KN_ES(IRI,IR))), +$ifi %ES_H2TRANS%==yes IOF05*ANNUITYCXH2(C)*IYHASANNUITYXH2(IYALIAS2,Y)*SUM(XES,VXH2LAMBDA.L(IYALIAS2,IR,IRI,XES)*XH2INVCOST_ES(IYALIAS2,IR,IRI,XES))) +$ifi %ES_H2TRANS%==yes ) + ) +; + +** TRANSMISSION FLOW +ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH2_T.L(Y,IR,IRI,S,T) * IHOURFRAC *XH2COST(IR,IRI))); + +** TRANSMISSION TRADE COST +ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_TRADE_COSTS','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH2_T.L(Y,IR,IRI,S,T) * H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))); + +** TRANSMISSION TRADE INCOME +ECO_XH2_YCR(Y,C,IR,IRI,'INCOME','TRANSMISSION_TRADE_INCOME','Mmoney')$(CCCRRR(C,IR) AND IXH2K_HASORPOT(Y,IR,IRI))= +OMONEY*IOF0000001*SUM((S,T), IHOURSINST(S,T) * (VXH2_T.L(Y,IR,IRI,S,T) * H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'))); + + +$label No_H2TRANS_costs + +* ------------- END OF COSTS -------------- + +* ------------- OBJECTIVE FUNCTION -------------- + +OBJ_YCR(Y,C,IR,'GENERATION_FUEL_COSTS','Mmoney')$CCCRRR(C,IR)= + +*GENERATION COSTS +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND NOT((IGESTOALL(G) OR IGHSTOALL(G) OR IGETOH(G) +$ifi %STEPWISEPRICE%==yes OR ISTEPWISEPRICE_F(Y,C,FFF) +$ifi %HYDROGEN%==yes OR IHYDROGEN_GETOH2(G) OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G) OR IHYDROGEN_GH2STO(G) OR IHYDROGEN_GH2TOE(G) OR IHYDROGEN_GH2TOEH(G) OR IHYDROGEN_GH2TOBIOMETH(G) OR IGBIOMETHANE(G) +))), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FUEL_COSTS','Mmoney') +) + +$ifi not %STEPWISEPRICE%==yes $goto No_STEPWISEPRICE2 + +SUM(STEPWISEPRICE_FFF$(ISTEPWISEPRICE_F(Y,C,STEPWISEPRICE_FFF) AND SUM(STEPWISEPRICE_L,VSTEPWISEPRICE_VGF_T_STEP.L(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF))), + OMONEY/IOF1000000*( + (0+ SUM((S,T,IA,G)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND IGF(G,STEPWISEPRICE_FFF)), IHOURSINST(S,T) * VGF_T.L(Y,IA,G,S,T)*IOF3P6)*IHOURFRAC)* + SUM(STEPWISEPRICE_L,STEPWISEPRICE_FUELPRICE_STEP(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF)*VSTEPWISEPRICE_VGF_T_STEP.L(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF)) + /SUM(STEPWISEPRICE_L,VSTEPWISEPRICE_VGF_T_STEP.L(Y,C,STEPWISEPRICE_L,STEPWISEPRICE_FFF)) + ) + ) +$label No_STEPWISEPRICE2 + +; + +OBJ_YCR(Y,C,IR,'GENERATION_OPPORTUNITY_COSTS','Mmoney')$CCCRRR(C,IR)= +$ifi %import_results%==yes $ifi %ADDESTOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGESTOS)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGESTOS)),IHOURSINST(S,T)*ESTOVOLTSVAL(Y,IA,IGESTOS,S,T)*IHOURFRAC*(VGE_T.L(Y,IA,IGESTOS,S,T)/GDATA(IGESTOS,'GDFE')-VESTOLOADTS.L(Y,IA,IGESTOS,S,T))) +$ifi %import_results%==yes $ifi %ADDHSTOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGHSTOS)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGHSTOS)),IHOURSINST(S,T)*HSTOVOLTSVAL(Y,IA,IGHSTOS,S,T)*IHOURFRAC*(VGH_T.L(Y,IA,IGHSTOS,S,T)/GDATA(IGHSTOS,'GDFE')-VHSTOLOADTS.L(Y,IA,IGHSTOS,S,T))) +$ifi %import_results%==yes $ifi %ADDESTOVOLT%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGESTO)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGESTO)),IHOURSINST(S,T)*ESTOVOLTVAL(Y,IA,IGESTO,S,T)*IHOURFRAC*(VGE_T.L(Y,IA,IGESTO,S,T)/GDATA(IGESTO,'GDFE')-VESTOLOADT.L(Y,IA,IGESTO,S,T))) +$ifi %import_results%==yes $ifi %ADDHSTOVOLT%==price +OMONEY*IOF0000001*SUM((S,T,IA,IGHSTO)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGHSTO)),IHOURSINST(S,T)*HSTOVOLTVAL(Y,IA,IGHSTO,S,T)*IHOURFRAC*(VGH_T.L(Y,IA,IGHSTO,S,T)/GDATA(IGHSTO,'GDFE')-VHSTOLOADT.L(Y,IA,IGHSTO,S,T))) +$ifi %import_results%==yes $ifi %HYDROGEN%==yes $ifi %ADDH2STOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T,IA,IHYDROGEN_GH2STO)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2STO)),IHOURSINST(S,T)*H2STOVOLTSVAL(Y,IA,IHYDROGEN_GH2STO,S,T)*IHOURFRAC*(VHYDROGEN_GH2_T.L(Y,IA,IHYDROGEN_GH2STO,S,T)/GDATA(IHYDROGEN_GH2STO,'GDFE')-VHYDROGEN_STOLOADT.L(Y,IA,IHYDROGEN_GH2STO,S,T))) +$ifi %import_results%==yes $ifi %HYDROGEN%==yes $ifi %ADDBIOMETHSTOVOLTS%==price +OMONEY*IOF0000001*SUM((S,T)$(SUM((IA,IGBIOMETHANE),IAGK_HASORPOT(Y,IA,IGBIOMETHANE)) AND SUM((IA,IHYDROGEN_GH2TOBIOMETH),IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH))),IHOURSINST(S,T)*BIOMETHSTOVOLTSVAL(Y,S,T)*IHOURFRAC*(VBIOMETH_STOUNLOADT.L(Y,S,T)-VBIOMETH_STOLOADT.L(Y,S,T)) ) ++0; + +OBJ_YCR(Y,C,IR,'GENERATION_REDISPATCH_COMPENSATION_COST','Mmoney')$CCCRRR(C,IR)= +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IGE))$(NOT (IGETOH(IGE)) AND RRRAAA(IR,IA) AND GE_T(Y,IA,IGE,S,T)),IHOURFRAC*ELECTRICITY_PRICE(Y,IR,S,T)*IHOURSINST(S,T)*(1-DISLOSS_E_AG(IA,IGE))*VGE_T_DOWN.L(Y,IA,IGE,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IGH))$(RRRAAA(IR,IA) AND GH_T(Y,IA,IGH,S,T)),IHOURFRAC*HEAT_PRICE(Y,IA,S,T)*IHOURSINST(S,T)*VGH_T_DOWN.L(Y,IA,IGH,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN))$(RRRAAA(IR,IA) AND GH2_T(Y,IA,IHYDROGEN,S,T)),IHOURFRAC*HYDROGEN_PRICE(Y,IR,S,T)*IHOURSINST(S,T)*VGH2_T_DOWN.L(Y,IA,IHYDROGEN,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN_GH2TOBIOMETH))$(RRRAAA(IR,IA) AND GBIOMETHANE_T(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)),IHOURFRAC*BIOMETHANE_PRICE(Y,S,T)*IHOURSINST(S,T)*VGBIOMETHANE_T_DOWN.L(Y,IA,IHYDROGEN_GH2TOBIOMETH,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASUPGRADING))$(RRRAAA(IR,IA) AND GBIOGASUPGRADING_T(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)),IHOURFRAC*BIOMETHANE_PRICE(Y,S,T)*IHOURSINST(S,T)*VGBIOGASUPGRADING_T_DOWN.L(Y,IA,IHYDROGEN_GBIOGASUPGRADING,S,T)) +$ifi %import_results%==yes $ifi %ADDENERGYDISPATCH%==yes $ifi %BalancingMarket%==yes $ifi %BALANCINGRUNPURPOSE%==TSOREDISPATCH $ifi %HYDROGEN%==yes +OMONEY*IOF0000001*SUM((S,T,IAGK_HASORPOT(Y,IA,IHYDROGEN_GBIOGASMETHANATION))$(RRRAAA(IR,IA) AND GBIOGASMETHANATION_T(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)),IHOURFRAC*BIOMETHANE_PRICE(Y,S,T)*IHOURSINST(S,T)*VGBIOGASMETHANATION_T_DOWN.L(Y,IA,IHYDROGEN_GBIOGASMETHANATION,S,T)) ++0; + + +OBJ_YCR(Y,C,IR,'HYDRO_PROFILE','Mmoney')$CCCRRR(C,IR)= +OMONEY*IOF0000001*SUM((IA,IGHYRS)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,IGHYRS)), SUM((S,T), HYPPROFILS(IA,S)*IHOURFRAC* IHOURSINST(S,T) + * VGE_T.L(Y,IA,IGHYRS,S,T))) +; + +OBJ_YCR(Y,C,IR,'GENERATION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CAPITAL_COSTS','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'GENERATION_FIXED_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_FIXED_COSTS','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'GENERATION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OPERATIONAL_COSTS','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'GENERATION_CO2_TAX','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TAX','Mmoney') +) +; + +$ifi %CCS%==yes OBJ_YCR(Y,C,IR,'GENERATION_CO2_TRANSPORT','Mmoney')$CCCRRR(C,IR)= +$ifi %CCS%==yes SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND CCS_G(G)),ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_CO2_TRANSPORT','Mmoney')); + +OBJ_YCR(Y,C,IR,'GENERATION_OTHER_EMI_TAX','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_OTHER_EMI_TAX','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'GENERATION_UC_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_UC_COSTS','Mmoney') +) +; + +OBJ_YCR(Y,C,IR,'TRANSMISSION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM(IRI$IXK_HASORPOT(Y,IR,IRI),ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_CAPITAL_COSTS','Mmoney')) +; + +OBJ_YCR(Y,C,IR,'TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM(IRI$IXK_HASORPOT(Y,IR,IRI), ECO_X_YCR(Y,C,IR,IRI,'COSTS','TRANSMISSION_OPERATIONAL_COSTS','Mmoney')) +; + +$ifi not %HEATTRANS%==yes $goto No_HEATTRANS_costs_2 +OBJ_YCR(Y,C,IR,'HEAT_TRANSMISSION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,IAI)$(RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI)),ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_CAPITAL_COSTS','Mmoney')) +; + +OBJ_YCR(Y,C,IR,'HEAT_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,IAI)$(RRRAAA(IR,IA) AND IXHK_HASORPOT(Y,IA,IAI)),ECO_XH_YCRA(Y,C,IR,IA,IAI,'COSTS','HEAT_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')) +; +$label No_HEATTRANS_costs_2 + +$ifi not %HYDROGEN%==yes $goto No_H2_costs_2 +OBJ_YCR(Y,C,IR,'H2_TRANSMISSION_CAPITAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM(IRI$IXH2K_HASORPOT(Y,IR,IRI),ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_CAPITAL_COSTS','Mmoney')) +; + +OBJ_YCR(Y,C,IR,'H2_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')$CCCRRR(C,IR)= +SUM(IRI$IXH2K_HASORPOT(Y,IR,IRI), ECO_XH2_YCR(Y,C,IR,IRI,'COSTS','H2_TRANSMISSION_OPERATIONAL_COSTS','Mmoney')) +; +$label No_H2_costs_2 + + +$ifi NOT %TAXES%==yes $goto No_TAXES2 +OBJ_YCR(Y,C,IR,'TAXES','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G)), ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_TAXES','Mmoney')) ++OMONEY/IOF1000000*( + +* Tax on electricity consumption + + SUM(DEUSER, TAX_DE(C,DEUSER)*IHOURFRAC * SUM((IS3,T), IHOURSINST(IS3,T) * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0)) ) + +$ifi %DFLEXQUANT%==yes + SUM((DEUSER), *IHOURFRACTAX_DE(C,DEUSER) *( +$ifi %DFLEXQUANT%==yes SUM(DEF_U1,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_U1) ) - SUM(DEF_D1,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_D1) ) +$ifi %DFLEXQUANT%==yes + SUM(DEF_U2,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_U2) ) - SUM(DEF_D2,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_D2) ) +$ifi %DFLEXQUANT%==yes + SUM(DEF_U3,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_U3) ) - SUM(DEF_D3,VDEF_T.L(Y,IR,DEUSER,IS3,T,DEF_D3) )) + + ++SUM(IA$RRRAAA(IR,IA), +* Tax on heat consumption + + SUM(DHUSER, TAX_DH(C,DHUSER)*IHOURFRAC * DH(Y,IA,DHUSER)) + +$ifi %DFLEXQUANT%==yes + SUM((DHUSER), TAX_DH(C,DHUSER)*IHOURFRAC * ( +$ifi %DFLEXQUANT%==yes SUM(DHF_U1,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_U1) ) - SUM(DHF_D1,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_D1) ) +$ifi %DFLEXQUANT%==yes + SUM(DHF_U2,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_U2) ) - SUM(DHF_D2,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_D2) ) +$ifi %DFLEXQUANT%==yes + SUM(DHF_U3,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_U3) ) - SUM(DHF_D3,VDHF_T.L(Y,IA,DHUSER,IS3,T,DHF_D3) ) ) +) +) +; +$label NO_TAXES2 + + +*GRID TARIFFS2 +$ifi NOT %GRIDTARIFFS%==yes $goto No_GRIDTARIFFS2 +OBJ_YCR(Y,C,IR,'GRID_TARIFFS','Mmoney')$CCCRRR(C,IR)= +SUM((IA,G,FFF,TECH_TYPE)$(RRRAAA(IR,IA) AND IAGK_HASORPOT(Y,IA,G) AND (IGETOH(G) +$ifi %HYDROGEN%==yes OR IHYDROGEN_GEHTOH2(G) OR IHYDROGEN_GETOHH2(G) OR IHYDROGEN_GETOH2(G) OR IHYDROGEN_GH2TOBIOMETH(G) +)), ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS','GENERATION_GRID_TARIFFS','Mmoney')) + ++OMONEY/IOF1000000*( + +* Demand charge winter + + IOF1000 * SUM((MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCW',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP1.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDCW'))/(IGR_MONTHSINSIM/card(MMM)) !! Demand charge winter +* Demand charge summer + + IOF1000 * SUM((MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCS',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP1.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDCS'))/(IGR_MONTHSINSIM/card(MMM)) !! Demand charge summer +* Demand charge 2 (e.g for spring and fall months) + + IOF1000 * SUM((MMM)$(SUM((IS3,T)$IGR_TIME('GRDDC2',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP1.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDC2'))/(IGR_MONTHSINSIM/card(MMM)) !! Demand charge 2 + +* Demand charge TOU + + IOF1000 * SUM((MMM), SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAP2.L(Y,IA,MMM)) * IGR_PRICE_TECH(Y,IR,'GRDDCTOU'))/(IGR_MONTHSINSIM/card(MMM)) +* Demand charge yearly + + IOF1000 * SUM(IA$(SUM(IGETOH,IAGK_HASORPOT(Y,IA,IGETOH)) AND RRRAAA(IR,IA)), VGETOH_CAPY.L(Y,IA)) * IGR_PRICE_TECH(Y,IR,'GRDDCY') + +* Tariffs on user groups + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDECW',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDECW') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDECS',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDECS') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU1',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU1') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU2',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU2') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU3',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU3') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + SUM((IS3,T,DEUSER)$IGR_TIME('GRDTOU4',IR,IS3,T), IHOURSINST(IS3,T)*IHOURFRAC * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDTOU4') * VDENET_T.L(Y,IR,DEUSER,IS3,T)$(IDE_SUMST(IR,DEUSER) GT 0) ) + + + IOF1000 * SUM((DEUSER,MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCW',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), VDEUSER_CAP1.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCW'))/(IGR_MONTHSINSIM/CARD(MMM)) + + IOF1000 * SUM((DEUSER,MMM)$(SUM((IS3,T)$IGR_TIME('GRDDCS',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), VDEUSER_CAP1.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCS'))/(IGR_MONTHSINSIM/CARD(MMM)) + + IOF1000 * SUM((DEUSER,MMM)$(SUM((IS3,T)$IGR_TIME('GRDDC2',IR,IS3,T), ISSSTTTMMM(IS3,T,MMM))), VDEUSER_CAP1.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDC2'))/(IGR_MONTHSINSIM/CARD(MMM)) + + IOF1000 * SUM((DEUSER,MMM), VDEUSER_CAP2.L(Y,IR,DEUSER,MMM) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCTOU'))/(IGR_MONTHSINSIM/card(MMM)) + + IOF1000 * SUM((DEUSER), VDEUSER_CAPY.L(Y,IR,DEUSER) * IGR_PRICE_DEUSER(Y,IR,DEUSER,'GRDDCY')) + +) + +; +$label NO_GRIDTARIFFS2 + +*ADD OTHER COSTS(?) + + +* ------------- END OF OBJECTIVE FUNCTION -------------- + + +* ------------- INCOME -------------- + +** ELECTRICITY SALES +ECO_G_YCRAG(Y,C,IR,IA,IGE,FFF,TECH_TYPE,'INCOME','ELECTRICITY_SALE','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) and IGNOTETOH(IGE))= + OMONEY*IOF0000001* + SUM((S,T), IHOURSINST(S,T)*VGE_T.L(Y,IA,IGE,S,T)*EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')) +; + +** HEAT SALES +ECO_G_YCRAG(Y,C,IR,IA,IGH,FFF,TECH_TYPE,'INCOME','HEAT_SALE','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= + OMONEY*IOF0000001* + SUM((S,T), IHOURSINST(S,T)*VGH_T.L(Y,IA,IGH,S,T)*H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh')) +; + +$ifi not %BalancingMarket%==yes $goto NO_TSOREDISPATCH1 +$ifi not %BALANCINGRUNPURPOSE%==TSOREDISPATCH $goto NO_TSOREDISPATCH1 +ECO_G_YCRAG(Y,C,IR,IA,IGE,FFF,TECH_TYPE,'INCOME','ELECTRICITY_REDISPATCH_COMPENSATION','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE) and IGNOTETOH(IGE))= + OMONEY*IOF0000001*( + SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*(1-DISLOSS_E_AG(IA,IGE))*VGE_T_DOWN.L(Y,IA,IGE,S,T)*ELECTRICITY_PRICE(Y,IR,S,T))) +; + +ECO_G_YCRAG(Y,C,IR,IA,IGH,FFF,TECH_TYPE,'INCOME','HEAT_REDISPATCH_COMPENSATION','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE))= + OMONEY*IOF0000001* + SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGH_T_DOWN.L(Y,IA,IGH,S,T)*HEAT_PRICE(Y,IA,S,T)) +; +$label NO_TSOREDISPATCH1 + +$ifi not %HYDROGEN%==yes $goto NO_HYDROGEN_INCOME +** HYDROGEN SALES +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','H2_SALE','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G) AND NOT(IHYDROGEN_GH2TOBIOMETH(G)))= + OMONEY*IOF0000001* + SUM((S,T), IHOURSINST(S,T)*PRO_YCRAGFST(Y,C,IR,IA,G,FFF,S,T,'HYDROGEN',TECH_TYPE,'MWh')*H2_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh')) +; + +** BIOMETHANE SALES +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','BIOMETHANE_SALE','Mmoney')$((IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASUPGRADING(G) OR IHYDROGEN_GBIOGASMETHANATION(G)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= + OMONEY*IOF0000001*( + +SUM((S,T), IHOURSINST(S,T)*VGBIOMETH_T.L(Y,IA,G,S,T)*BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh'))$IHYDROGEN_GH2TOBIOMETH(G) + +SUM((S,T), IHOURSINST(S,T)*VGBIOGASMETHANATION_T.L(Y,IA,G,S,T)*BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh'))$IHYDROGEN_GBIOGASMETHANATION(G) + +SUM((S,T), IHOURSINST(S,T)*VGBIOGASUPGRADING_T.L(Y,IA,G,S,T)*BIOMETH_PRICE_YST(Y,S,T,'Money_per_MWh'))$IHYDROGEN_GBIOGASUPGRADING(G) +) +; + +$ifi not %BalancingMarket%==yes $goto NO_TSOREDISPATCH2 +$ifi not %BALANCINGRUNPURPOSE%==TSOREDISPATCH $goto NO_TSOREDISPATCH2 +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','HYDROGEN_REDISPATCH_COMPENSATION','Mmoney')$(CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE) AND IHYDROGEN(G))= + OMONEY*IOF0000001* + SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGH2_T_DOWN.L(Y,IA,G,S,T)*HYDROGEN_PRICE(Y,IR,S,T)) +; + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME','BIOMETHANE_REDISPATCH_COMPENSATION','Mmoney')$((IHYDROGEN_GH2TOBIOMETH(G) OR IHYDROGEN_GBIOGASUPGRADING(G) OR IHYDROGEN_GBIOGASMETHANATION(G)) AND CCCRRR(C,IR) and RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,G) AND IGF(G,FFF) AND GTECH_TYPE(G,TECH_TYPE))= + OMONEY*IOF0000001*( + +SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGBIOMETHANE_T_DOWN.L(Y,IA,G,S,T)*BIOMETHANE_PRICE(Y,S,T))$IHYDROGEN_GH2TOBIOMETH(G) + +SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGBIOGASMETHANATION_T_DOWN.L(Y,IA,G,S,T)*BIOMETHANE_PRICE(Y,S,T))$IHYDROGEN_GBIOGASMETHANATION(G) + +SUM((S,T), IHOURFRAC*IHOURSINST(S,T)*VGBIOGASUPGRADING_T_DOWN.L(Y,IA,G,S,T)*BIOMETHANE_PRICE(Y,S,T))$IHYDROGEN_GBIOGASUPGRADING(G) +) +; +$label NO_TSOREDISPATCH2 + +$label NO_HYDROGEN_INCOME + +* ------------- END OF INCOME -------------- + +* ------------- PROFIT -------------- +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'PROFIT','TOTAL_PROFIT','Mmoney')$IAGK_HASORPOT(Y,IA,G)= +SUM(SUBCATEGORY, ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'INCOME',SUBCATEGORY,'Mmoney')-ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'COSTS',SUBCATEGORY,'Mmoney') +) +; + +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'PROFIT','ENERGY_SPECIFIC_PROFIT','Money_per_MWh')$(IAGK_HASORPOT(Y,IA,G) AND SUM(COMMODITY,PRO_YCRAGF(Y,C,IR,IA,G,FFF,COMMODITY,TECH_TYPE,'TWh')) > 0 ) = +ECO_G_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'PROFIT','TOTAL_PROFIT','Mmoney')/SUM(COMMODITY,PRO_YCRAGF(Y,C,IR,IA,G,FFF,COMMODITY,TECH_TYPE,'TWh')) +; +* ------------- END OF PROFIT -------------- + +* --------- END OF ECONOMIC OUTPUT ----------- + +* ---------------------- ENVIRONMENT ---------------------- + +* ------------- CO2 EMISSIONS ------------- + +EMI_YCRAG(Y,C,IR,IA,G,FFF,TECH_TYPE,'kton')$(F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh'))= +(F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh') +$ifi %CCS%==yes -(F_CONS_YCRA(Y,C,IR,IA,G,FFF,TECH_TYPE,'TWh')*CCS_CO2CAPTEFF_G(G))$CCS_G(G) +)*IM_CO2(G)*IOF3P6 +; + +* ------------- END OF CO2 EMISSIONS ------------- + +* ---------------------- END OF ENVIRONMENT ---------------------- + +*---------------ELECTRICITY BALANCE------------ +*GENERATION +EL_BALANCE_YCRST(Y,C,IR,'CONDENSING',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','CONDENSING','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'CHP-BACK-PRESSURE',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','CHP-BACK-PRESSURE','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'CHP-EXTRACTION',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','CHP-EXTRACTION','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'INTER-STO',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','INTERSEASONAL-ELECT-STORAGE','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'INTRA-STO',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','INTRASEASONAL-ELECT-STORAGE','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'HYDRO-RESERVOIRS',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','HYDRO-RESERVOIRS','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'HYDRO-RUN-OF-RIVER',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','HYDRO-RUN-OF-RIVER','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'WIND-ON',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','WIND-ON','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'WIND-OFF',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','WIND-OFF','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'SOLAR-PV',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','SOLAR-PV','MWh')); +EL_BALANCE_YCRST(Y,C,IR,'HYDRO-WAVE ',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','HYDRO-WAVE','MWh')); +$ifi %HYDROGEN%==yes EL_BALANCE_YCRST(Y,C,IR,'FUELCELL',S,T,'MWh')$CCCRRR(C,IR)=SUM((IA,IGE,FFF)$(RRRAAA(IR,IA) AND IGF(IGE,FFF) AND IAGK_HASORPOT(Y,IA,IGE)),PRO_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY','FUELCELL','MWh')); + +*DEMAND +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_EXO',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'EXOGENOUS','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_EXOTRANS',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'EXO_TRANS','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_P2H',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDOGENOUS_ELECT2HEAT','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_INTRASTO',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTRASTO','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_INTERSTO',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_INTERSTO','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_EV',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_EV','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_OTHERTRANS',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_OTHERTRANS','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_DISTLOSSES',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'DIST_LOSSES','MWh'); +EL_BALANCE_YCRST(Y,C,IR,'DEMAND_CCS',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_CCS','MWh'); +$ifi %HYDROGEN%==yes EL_BALANCE_YCRST(Y,C,IR,'DEMAND_P2G',S,T,'MWh')$CCCRRR(C,IR)=EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_H2','MWh')+EL_DEMAND_YCRST(Y,C,IR,S,T,'ENDO_BIOMETHANE','MWh'); + + +*TRANSMISSION +EL_BALANCE_YCRST(Y,C,IR,'NETEXPORT',S,T,'MWh')$CCCRRR(C,IR)=SUM(IRE$IXK_HASORPOT(Y,IR,IRE),VX_T.L(Y,IR,IRE,S,T))-SUM(IRI$IXK_HASORPOT(Y,IRI,IR),VX_T.L(Y,IRI,IR,S,T)*(1-XLOSS(IRI,IR))); + +*CURTAILMENT +EL_BALANCE_YCRST(Y,C,IR,'CURTAILMENT',S,T,'MWh')$CCCRRR(C,IR)= +SUM((IGE,TECH_TYPE,IA,FFF)$(RRRAAA(IR,IA) and IAGK_HASORPOT(Y,IA,IGE) AND IGF(IGE,FFF) AND GTECH_TYPE(IGE,TECH_TYPE)), +CURT_YCRAGFST(Y,C,IR,IA,IGE,FFF,S,T,'ELECTRICITY',TECH_TYPE,'MWh') +); + +*PRICE +EL_BALANCE_YCRST(Y,C,IR,'PRICE',S,T,'Money_per_MWh')$CCCRRR(C,IR)=EL_PRICE_YCRST(Y,C,IR,S,T,'Money_per_MWh'); +*---------------END ELECTRICITY BALANCE------------ + + +*---------------HEAT BALANCE------------ +*GENERATION +H_BALANCE_YCRAST(Y,C,IR,IA,'P2H',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','ELECT-TO-HEAT','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'CHP-BACK-PRESSURE',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','CHP-BACK-PRESSURE','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'CHP-EXTRACTION',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','CHP-EXTRACTION','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'INTER-STO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','INTERSEASONAL-HEAT-STORAGE','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'INTRA-STO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','INTRASEASONAL-HEAT-STORAGE','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'BOILERS',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','BOILERS','MWh')); +H_BALANCE_YCRAST(Y,C,IR,IA,'SOLAR-HEATING',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','SOLAR-HEATING','MWh')); +$ifi %HYDROGEN%==yes H_BALANCE_YCRAST(Y,C,IR,IA,'FUELCELL',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM((IGH,FFF)$(IGF(IGH,FFF) AND IAGK_HASORPOT(Y,IA,IGH)),PRO_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT','FUELCELL','MWh')); + + +*DEMAND +H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_EXO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'EXOGENOUS','MWh'); +H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_INTRASTO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTRASTO','MWh'); +H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_INTERSTO',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_INTERSTO','MWh'); +H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_DISTLOSSES',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'DIST_LOSSES','MWh'); +$ifi %HYDROGEN%==yes H_BALANCE_YCRAST(Y,C,IR,IA,'DEMAND_P2G',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_H2','MWh')+ H_DEMAND_YCRAST(Y,C,IR,IA,S,T,'ENDO_BIOMETHANE','MWh'); + +*TRANSMISSION +$ifi %HEATTRANS%==yes H_BALANCE_YCRAST(Y,C,IR,IA,'NETEXPORT',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=SUM(IAE$IXHK_HASORPOT(Y,IA,IAE),VXH_T.L(Y,IA,IAE,S,T))-SUM(IAI$IXHK_HASORPOT(Y,IAI,IA),VXH_T.L(Y,IAI,IA,S,T)*(1-XHLOSS(IAI,IA))); + +*CURTAILMENT +H_BALANCE_YCRAST(Y,C,IR,IA,'CURTAILMENT',S,T,'MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= +SUM((IGH,TECH_TYPE,FFF)$(IAGK_HASORPOT(Y,IA,IGH) AND IGF(IGH,FFF) AND GTECH_TYPE(IGH,TECH_TYPE)), +CURT_YCRAGFST(Y,C,IR,IA,IGH,FFF,S,T,'HEAT',TECH_TYPE,'MWh') +); + +*PRICE +H_BALANCE_YCRAST(Y,C,IR,IA,'PRICE',S,T,'Money_per_MWh')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))=H_PRICE_YCRAST(Y,C,IR,IA,S,T,'Money_per_MWh'); +*---------------END HEAT BALANCE------------ + +* IF OPTIFLOW EXISTS, ALSO CALCULATE OPTIFLOW OUTPUT +$ifi %OPTIFLOW%==yes $if EXIST '../../base/output/Optiflow_OutputFile.inc' $INCLUDE '../../base/output/Optiflow_OutputFile.inc'; + +execute_unload "MainResults.gdx" G_CAP_YCRAF,PRO_YCRAGF,F_CONS_YCRA,EMI_YCRAG,X_CAP_YCR,ECO_G_YCRAG,ECO_X_YCR,OBJ_YCR,EL_PRICE_YCR,EL_PRICE_YCRST,PRO_YCRAGFST,EL_DEMAND_YCRST,EL_DEMAND_YCR, +H_DEMAND_YCRAST,H_DEMAND_YCRA,H_PRICE_YCRAST,H_PRICE_YCRA,G_STO_YCRAF,X_FLOW_YCRST,X_FLOW_YCR,F_CONS_YCRAST, +EL_BALANCE_YCRST,CURT_YCRAGFST,CURT_YCRAGF,H_BALANCE_YCRAST + +$ifi %HEATTRANS%==yes ,XH_CAP_YCA,XH_FLOW_YCAST,XH_FLOW_YCA,ECO_XH_YCRA +$ifi %HYDROGEN%==yes ,H2_PRICE_YCRST,H2_PRICE_YCR,BIOMETH_PRICE_YST,XH2_CAP_YCR, XH2_FLOW_YCRST,XH2_FLOW_YCR,ECO_XH2_YCR,H2_DEMAND_YCRST,H2_DEMAND_YCR +$ifi %OPTIFLOW%==yes ,VFLOW_Opti_C,VFLOWTRANS_Opti_A,VFLOWTRANS_Opti_C,ECO_PROC_YCRAP,VPROCKAPNEW,VPROCKAPACCUMNET +; + + +*Establishing modified sets and parameters to original for further calculations + +$ifi not %stointers%==all $goto NO_STOINTERS2 +*Modification of STORAGE +IGESTOS(IGESTO) = YES; IGHSTOS(IGHSTO) = YES; +IGESTO(IGESTO) = NO; IGHSTO(IGHSTO) = NO; +$label NO_STOINTERS2 + +$ifi not %RollingSeasons%==yes $goto NO_ROLLINGSEASONS +*Modification of IHOURSINST +IHOURSINST(SSS,TTT)=0; +LOOP(IS3LOOPSET$(ORD(IS3LOOPSET) LE (CARD(S)-ROLLINGSEASONSNUMBER+1)), + IS3(S)=NO; + IS3(S)$((ORD(S) LE (ORD(IS3LOOPSET)+ROLLINGSEASONSNUMBER-1)) AND (ORD(S) GE ORD(IS3LOOPSET)) )=YES; + IWEIGHSUMS=SUM(IS3, WEIGHT_S(IS3)); + IHOURSINST(IS3,T)=IOF8760*WEIGHT_S(IS3)*WEIGHT_T(T)/(IWEIGHSUMS*SUM(ITALIAS, WEIGHT_T(ITALIAS)))/IHOURFRAC; +); + +$label NO_ROLLINGSEASONS + +*Deleting files to release memory: +G_CAP_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS)=0; +G_STO_YCRAF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,VARIABLE_CATEGORY,UNITS)=0; +PRO_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS)=0; +PRO_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS)=0; +F_CONS_YCRAST(Y,C,RRR,AAA,G,FFF,SSS,TTT,TECH_TYPE,UNITS)=0; +F_CONS_YCRA(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS)=0; +X_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS)=0; +X_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS)=0; +X_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS)=0; +ECO_G_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,CATEGORY,SUBCATEGORY,UNITS)=0; +ECO_X_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS)=0; +OBJ_YCR(Y,C,RRR,SUBCATEGORY,UNITS)=0; +EL_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS)=0; +EL_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS)=0; +H_PRICE_YCRA(Y,C,RRR,AAA,PRICE_CATEGORY,UNITS)=0; +H_PRICE_YCRAST(Y,C,RRR,AAA,SSS,TTT,UNITS)=0; +EL_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS)=0; +EL_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS)=0; +H_DEMAND_YCRAST(Y,C,RRR,AAA,SSS,TTT,VARIABLE_CATEGORY,UNITS)=0; +H_DEMAND_YCRA(Y,C,RRR,AAA,VARIABLE_CATEGORY,UNITS)=0; +EMI_YCRAG(Y,C,RRR,AAA,G,FFF,TECH_TYPE,UNITS)=0; +CURT_YCRAGFST(Y,C,RRR,AAA,G,FFF,SSS,TTT,COMMODITY,TECH_TYPE,UNITS)=0; +CURT_YCRAGF(Y,C,RRR,AAA,G,FFF,COMMODITY,TECH_TYPE,UNITS)=0; +EL_BALANCE_YCRST(Y,C,RRR,EL_BAL_TYPE,SSS,TTT,UNITS)=0; +H_BALANCE_YCRAST(Y,C,RRR,AAA,H_BAL_TYPE,SSS,TTT,UNITS)=0; +$ifi %HYDROGEN%==yes H2_PRICE_YCRST(Y,C,RRR,SSS,TTT,UNITS)=0; +$ifi %HYDROGEN%==yes H2_PRICE_YCR(Y,C,RRR,PRICE_CATEGORY,UNITS)=0; +$ifi %HYDROGEN%==yes BIOMETH_PRICE_YST(Y,SSS,TTT,UNITS)=0; +$ifi %HEATTRANS%==yes XH_CAP_YCA(Y,C,IAAAE,IAAAI,VARIABLE_CATEGORY,UNITS)=0; +$ifi %HEATTRANS%==yes XH_FLOW_YCAST(Y,C,IAAAE,IAAAI,SSS,TTT,UNITS)=0; +$ifi %HEATTRANS%==yes XH_FLOW_YCA(Y,C,IAAAE,IAAAI,UNITS)=0; +$ifi %HEATTRANS%==yes ECO_XH_YCRA(Y,C,RRR,AAA,IAAAI,CATEGORY,SUBCATEGORY,UNITS)=0; +$ifi %HYDROGEN%==yes XH2_CAP_YCR(Y,C,IRRRE,IRRRI,VARIABLE_CATEGORY,UNITS)=0; +$ifi %HYDROGEN%==yes XH2_FLOW_YCRST(Y,C,IRRRE,IRRRI,SSS,TTT,UNITS)=0; +$ifi %HYDROGEN%==yes XH2_FLOW_YCR(Y,C,IRRRE,IRRRI,UNITS)=0; +$ifi %HYDROGEN%==yes ECO_XH2_YCR(Y,C,RRR,IRRRI,CATEGORY,SUBCATEGORY,UNITS)=0; +$ifi %HYDROGEN%==yes H2_DEMAND_YCRST(Y,C,RRR,SSS,TTT,VARIABLE_CATEGORY,UNITS)=0; +$ifi %HYDROGEN%==yes H2_DEMAND_YCR(Y,C,RRR,VARIABLE_CATEGORY,UNITS)=0; + diff --git a/base/output/Optiflow_OutputFile.inc b/base/output/Optiflow_OutputFile.inc index 1f1e0ec3..8091f1a6 100644 --- a/base/output/Optiflow_OutputFile.inc +++ b/base/output/Optiflow_OutputFile.inc @@ -132,8 +132,8 @@ VFLOW_Opti_C(Y,C,IPROCFROM,IPROCTO,FLOW)=SUM(IA$ICA(C,IA),VFLOW_Opti_A(Y,IA,IPRO *FLOWS source Parameter VFLOWSOURCE_Opti_A(Y,AAA,PROCSOURCE,FLOW) 'Source FLOWS at an area level per year (ton/year)'; -VFLOWSOURCE_Opti_A(Y,IA,PROCSOURCE,FLOW)= SUM((S,T),VFLOWSOURCE.L(Y,IA,PROCSOURCE,FLOW,S,T)*IHOURSINSTWWT(S,T)); - +VFLOWSOURCE_Opti_A(Y,IA,PROCSOURCE,FLOW)$(NOT PROC_T(PROCSOURCE))= SUM((S,T),VFLOWSOURCE.L(Y,IA,PROCSOURCE,FLOW,S,T)*IHOURSINSTWWT(S,T)); +VFLOWSOURCE_Opti_A(Y,IA,PROCSOURCE,FLOW)$(PROC_T(PROCSOURCE))= SUM((S,T),VFLOWSOURCE.L(Y,IA,PROCSOURCE,FLOW,S,T)*IHOURSINST(S,T)); Parameter VFLOWSOURCE_Opti_C(Y,CCC,PROCSOURCE,FLOW) 'Source FLOWS at a country level per year (ton/year)'; VFLOWSOURCE_Opti_C(Y,C,PROCSOURCE,FLOW)=SUM(IA$ICA(C,IA),VFLOWSOURCE_Opti_A(Y,IA,PROCSOURCE,FLOW)); @@ -155,6 +155,38 @@ VFLOWSTORAGE_Opti_A(Y,IA,PROCSTORAGE,FLOW)= SUM((S,T),VSTORAGEVOL.L(Y,IA,PROCS Parameter VFLOWSTORAGE_Opti_C(Y,CCC,PROC,FLOW) 'Storage FLOWS at an area level per year (u/year)'; VFLOWSTORAGE_Opti_C(Y,C,PROCSTORAGE,FLOW)= SUM(IA$ICA(C,IA),VFLOWSTORAGE_Opti_A(Y,IA,PROCSTORAGE,FLOW)); +* Transport in OptiFlow +Parameter VFLOWTRANS_Opti_A(Y,IAAAE,IAAAI,PROC,FLOW) 'Transport flows between areas per year (PJ/year)'; +VFLOWTRANS_Opti_A(Y,IAE,IAI,PROC,FLOW)= SUM((S,T),VFLOWTRANS.L(Y,IAE,IAI,PROC,FLOW,S,T)*IHOURSINST(S,T))*IOF0000001; + +ALIAS(C,ICE,ICI); +Parameter VFLOWTRANS_Opti_C(Y,ICE,ICI,PROC,FLOW) 'Transport flows between countries per year (PJ/year)'; +VFLOWTRANS_Opti_C(Y,ICE,ICI,PROC,FLOW)=SUM((IAE,IAI)$(ICA(ICE,IAE) AND ICA(ICI,IAI) AND (NOT ICA(ICE,IAI))),VFLOWTRANS_Opti_A(Y,IAE,IAI,PROC,FLOW)); + +* Costs in OptiFlow +SET COST_TYPE /INVESTMENT,FIXED,OPERATIONAL/; +SET UNIT /Mmoney,PJ/; +Parameter ECO_PROC_YCRAP(Y,C,RRR,AAA,PROC,COST_TYPE,UNIT) "Cost of processes in OptiFlow for year country, region, and area"; +* Investment cost +ECO_PROC_YCRAP(Y,C,IR,IA,PROC,'INVESTMENT','Mmoney')$(CCCRRR(C,IR) AND RRRAAA(IR,IA))= + OMONEY*( + SUM(IYALIAS2$(IAPROCKAPNEW(IYALIAS2,IA,PROC) AND (ORD(IYALIAS2) LE ORD(Y))), + PROCDATA(PROC,'PROCINVCOST')*VPROCKAPNEW.L(IYALIAS2,IA,PROC)*ANNUITYCPROC(C,PROC)*IYHASANNUITYPROC(IYALIAS2,Y,PROC)) +); + +ECO_PROC_YCRAP(Y,C,IR,IA,PROC,'FIXED','Mmoney')$(CCCRRR(C,IR) AND RRRAAA(IR,IA) AND IAPROCKAPNEW_notY(IA,PROC))= + OMONEY/IOF1000000*PROCDATA(PROC,'PROCFIXCOST')*( + VPROCKAPACCUMNET.L(Y,IA,PROC) +); + +OBJ_YCR(Y,C,IR,'OPTIFLOW_INVESTMENT','Mmoney')$CCCRRR(C,IR)= + SUM((IA,PROC)$(RRRAAA(IR,IA)), + ECO_PROC_YCRAP(Y,C,IR,IA,PROC,'INVESTMENT','Mmoney') +); +OBJ_YCR(Y,C,IR,'OPTIFLOW_FIXED','Mmoney')$CCCRRR(C,IR)= + SUM((IA,PROC)$(RRRAAA(IR,IA)), + ECO_PROC_YCRAP(Y,C,IR,IA,PROC,'FIXED','Mmoney') +); * RE-fuel prices @@ -177,7 +209,8 @@ RE_fuel_Price $offtext execute_unload "Optiflow_MainResults.gdx" VOBJ,VGKN,VX_T,VXKN, -VFLOW,VFLOWTRANS,VPROCKAPNEW, +*VFLOW +VFLOWTRANS,VPROCKAPNEW,VPROCKAPACCUMNET,VFLOWTRANS_Opti_A,VFLOWTRANS_Opti_C,ECO_PROC_YCRAP,OBJ_YCR *RE_GasFuel_AST_Opti,RE_Fuel_AST_Opti_A,RE_Fuel_AST_Opti_C,RE_Gas_AST_Opti,RE_Gas_AST_Opti_A,RE_Gas_AST_Opti_C, *Resource_use_Opti_C,Resource_use_AST_Opti,Resource_use_Opti_A, VFLOW_Opti_A,VFLOW_Opti_C,VFLOWSOURCE_Opti_A,VFLOWSOURCE_Opti_C,VFLOWBUFFER_Opti_C