From 896c2daa93831c68d66c62080ff189292ae4b893 Mon Sep 17 00:00:00 2001 From: TheisUM <129399536+TheisUM@users.noreply.github.com> Date: Wed, 10 Jul 2024 14:49:10 +0200 Subject: [PATCH] Secondary merge, Theis' stuff to master --- base/addons/CCS/bb4/CCS_balbase4.inc | 7 + base/addons/CCS/bb4/CCS_eqndecdef.inc | 20 + base/addons/CCS/bb4/CCS_qlimco2c.inc | 3 +- base/addons/CCS/bb4/CCS_qlimco2na.inc | 3 +- base/addons/CCS/bb4/CCS_qobj.inc | 7 +- base/addons/DECOM/DECOM_balbase4.inc | 1 + base/addons/DECOM/DECOM_eqndecdef.inc | 3 +- base/addons/DECOM/DECOM_ipardecdef.inc | 8 +- base/addons/_hooks/annuitycgadditions.inc | 2 +- base/addons/_hooks/balbase4.inc | 1 + base/addons/_hooks/eqndecdef.inc | 1 + base/addons/_hooks/ipardecdef.inc | 1 + base/addons/_hooks/qgmaxaf.inc | 7 + base/addons/_hooks/qgmaxcf.inc | 7 + base/addons/_hooks/qgmaxrf.inc | 7 + base/addons/_hooks/qhydrogen_eq.inc | 2 +- base/addons/_hooks/qhydrogen_eq_area.inc | 1 + base/addons/_hooks/qlimco2c.inc | 2 +- base/addons/_hooks/qlimco2na.inc | 1 + base/addons/_hooks/varassign.inc | 1 + .../optiflow/agkndisc/agkndisc20090331.pdf | Bin 71895 -> 73610 bytes .../optiflow/bb4/optiflow_annuities.inc | 72 + .../addons/optiflow/bb4/optiflow_balbase4.inc | 2 +- .../optiflow/bb4/optiflow_eqndecdef.inc | 44 +- .../optiflow/bb4/optiflow_ipardecdef.inc | 14 + .../optiflow/bb4/optiflow_isetdecdef.inc | 37 + .../optiflow/bb4/optiflow_pardefine.inc | 29 +- base/addons/optiflow/bb4/optiflow_qeeq.inc | 3 +- base/addons/optiflow/bb4/optiflow_qgmaxaf.inc | 7 + base/addons/optiflow/bb4/optiflow_qgmaxcf.inc | 7 + base/addons/optiflow/bb4/optiflow_qgmaxrf.inc | 7 + .../optiflow/bb4/optiflow_qh2eq_area.inc | 11 + .../optiflow/bb4/optiflow_qh2eq_region.inc | 12 + .../addons/optiflow/bb4/optiflow_qlimco2c.inc | 8 + .../optiflow/bb4/optiflow_qlimco2na.inc | 8 + base/addons/optiflow/bb4/optiflow_qobj.inc | 16 +- .../optiflow/bb4/optiflow_varassign.inc | 4 + .../optiflow/bb4/optiflow_vardeclare.inc | 8 +- base/model/Balmorelbb4.inc | 66 +- base/model/Balmorelbb4.sim | 1 + base/model/balopt.opt | 2124 +++++----- base/model/bb4datainc.inc | 10 + base/output/OUTPUT_SUMMARY(old).inc | 1645 ++++++++ base/output/OUTPUT_SUMMARY.inc | 3455 +++++++++-------- base/output/Optiflow_OutputFile.inc | 39 +- 45 files changed, 4917 insertions(+), 2797 deletions(-) create mode 100644 base/addons/CCS/bb4/CCS_balbase4.inc create mode 100644 base/addons/CCS/bb4/CCS_eqndecdef.inc create mode 100644 base/addons/_hooks/qgmaxaf.inc create mode 100644 base/addons/_hooks/qgmaxcf.inc create mode 100644 base/addons/_hooks/qgmaxrf.inc create mode 100644 base/addons/optiflow/bb4/optiflow_annuities.inc create mode 100644 base/addons/optiflow/bb4/optiflow_ipardecdef.inc create mode 100644 base/addons/optiflow/bb4/optiflow_qgmaxaf.inc create mode 100644 base/addons/optiflow/bb4/optiflow_qgmaxcf.inc create mode 100644 base/addons/optiflow/bb4/optiflow_qgmaxrf.inc create mode 100644 base/addons/optiflow/bb4/optiflow_qh2eq_area.inc create mode 100644 base/addons/optiflow/bb4/optiflow_qh2eq_region.inc create mode 100644 base/addons/optiflow/bb4/optiflow_qlimco2c.inc create mode 100644 base/addons/optiflow/bb4/optiflow_qlimco2na.inc create mode 100644 base/addons/optiflow/bb4/optiflow_varassign.inc create mode 100644 base/output/OUTPUT_SUMMARY(old).inc 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 5b21b838ed54f6780858ea87f6901d2e2ae1181c..f6dc3eeb9d74c46fa41e5ab68f8f915ebaed5a50 100644 GIT binary patch delta 14171 zcmb_j2Urx#vi@3vI5Olc$be!ZZDd&#M3M?BQNTbF5K)38l{VI#gFxSN~mA-PRwHUvfsipP847nK%(p2tTzgIj!DGW_;UnUstt#Iv&DdrVktq_rFV zg*&)JCWR+PPfw0dq=a}dBI$>6dd9dlIx#8Pc}iF!#pS~1s4&SFTWCYlTJnC~NP^Ck zA4G4GSBC$LVBjfvJX}Qqm!S&&P##n8gOX76#+|(l^yw5uJE%CIh^ytgTc>vti~HY- z1-kAm7Mmkcic?rpBo^6vjGMP};COTA(LN?@)_;<;vb#TKo>Ce>vy|lN5lRDr^#mm> zs2|Y2Fhk9a;6_mZ9^jF3*>{7-xzm&0ro+Pf{OyZtjnR1j$pI)67 z%~nPdT0KU`4qHoPTvYNDio<3J#l4e~6C=Z7Nh0<3vvCu0@0{08yLv$FqbW%ooKmBF z;0m3WqE#}5q_3*jb*IFCG@&}%lo)XJe$2~bv(~hZTgu&XPIYS|N8I|$<@%BGfSe-W zPPHFG^aa&^@+hi?qCco|6__rxnc6sDJ55aoGaMwh^3x3}x-2lwWySQ;&y=-zdG&dUlF3JESi#_#8m3UL(@21l(8TkwH67$g0?`SYIfyL&si};h zNlCjml>N2s39{y zyubQ7{PXgy<*LI!+pH6&7Y!cr9?b0--ds95FyUIAfDmTmOEoCP08U2?aAQ*pD&Xz! z#-Z4FD>1*h6dT(b{FX%!S@WYa-Fm@JWHt`PknPl&! z+j1dOe$i)8D1kJkqYbQ~daVIA@z(|;IvF&lgKof}2LUrugXRce$6-ZEmm~G|QT@ia zCsiNpLkhDHy`YzEH!y+Iy>`i=-6TE5aJd{diEoBEI_Ui;qdTJ)KM09ZqfgWhceZ+U z!9fWY*l33aDrG62e1ndzUYNRW;?UQP7%h8apqbS>R)hF-U5Dd&f~yc+rBFl(1q(>} zTW?P=jp4=^bt8Ml45z#3o{h)fiiLDW#7c_cQ)a9)EcS*wV*^R`3FK&Iw)a5$& zO<3TG=w_2)(oMoLrPRgyg`%u}U8y)-YEn95Fj=hCXE=)K+M+uilmEhs;p~#JbRNYRXJ>=Om@hqWv3U<{GjGWeDZ3ZAvO5VQ z7#Kv`g0qAj5vuN@s+(Tr9stVeRJ$^Tzt`58Fi&H!hZ!-u`BO*o1yk zQorR3Nyrx->u(Y2a9(|T?vKEK8zbHnonx%K+)V0Y?4%AiFi9tqq29+ew| z8b&ChJWj^#%ktIzd0FSw5Sppb(_HvxU1M16pX4u^&+DGL^tNC6WbqT47|;{!Kxe=d zeUv-mtYj&Mlv3{>juMTwb1M5A7JbEl;fSIe1{lJkd>-Hm1|S@0q=ViDoU&V(Wjy`< zGWCAB*5{r~s`q_^=$L_mp2Yaq16~IYIBvcW(fbDSVA!L91~ARffoa_U`DPCi!H1@~ zqc%x+6>p$eerh8h%Rlx~pzU_8*i6!s%?GtX_)2qa=)1#wBtAkvng_y%hs9(l4_mO? zIz6>;0H#bWZ9==W3NBk_Eddo|SHB(GWHC>6Z8_Mhk+lQ{SpaM(hHfXj;bKgZ_U`Pc z6}MW>lKa1UYTS-C-R7w=Gr{a)XYk*;YJ7?9%3voKAj*z`_qMa&&wH$|=P z?BC8|Fp`7O(Tj^=a0^p@=Hi+WJX{v=BzS2-8}Km}IrDMH)qL+xc**VT0LW|~E|=F4 zFX@3ccCh{tHg@8(a+A#%Sp2s(?ov##6(m@b1nc>%u{sBDsd^QZhSx=s#JBZxHt9xR zF}g8m=;DR-$Z=$Y^6Ye-AN~Pb=bb`yy&zJR*gm^dA#JYtkNjp;7h^=b+Zy+T4PmGy z-W7DLEf=`oY-^!N5_jF)5nX2+3XE`sEC!&%g=HAGP3`(XFIT%ky(F8dGS=&_*_&Uz zbUwT&Rq6M`2CDKkSv=p)5NV>S7lUR_*Ae&oi1=_y(EA4er2|gBcEtBT3iURn3VNk) zs`vT3euO5wAunONKK20=x|ZCV?Rc_upxqXi>+IBsHQ#402A~~0N(pIbw;Y3m$$mUA z@zFjIN_U63@<;&Vs~uLr_z6QDU^C|r?G4(qCg~GHR|KQnsV24kSL>-;nB59aPt>qW*2n9g?_W$2Kb&!D_S* zSNc(H-h3mugd}#RXYs2)jN6z3^KNo{3T(_DHc%dYS4Q-~VIHvW_1@;LwmZDFp?0dW zW}kg-)YPNk_dCr11{XS&b`9=a*^Ss~8_T*Y?SO9W#;2I=(|ME1MhP9jotdLkZ(fI^ z0Kna#9o+dgoDPRMt?1GptkKdXT;f8mbm;}c?{yggwVz$=;WyjW7~6@rYoHdo&o3Mi zRNmLbLwM%w47q8!*@X}TxrWD~l_W9qwAQ>7`-^wBgw55>%-`0y{!C@QrFWMA$CH%@ zG$X5xcCeELHJ&UacF+JrtFs0=`!g~c;9;zgacAf^ZaLsrd8`k-i0C=P=POCJ0hKpG zhad^*7p*s9Y5+2*?pmIXkkW_|yrOd@j`SLFaVvNTsO~*k$5n-!bm) z{$7Bt5LtoESdUB&i-`^&78ey0Nnskk$&s=C;Fd^F7q@6=z_k zn*n_q?p{+_*=p>?nKAh*YEG}F0Pm;ioG@>2OK$2Sn?83~sX* zdaOqu4a5!a74`msU4zQ!cS`B|-o_((iHD73Z&i4hC?bFV8NrBt=}`zgXOEgjO8650 zkN!F;*pi}rr!LlcQf@ck*OlHGB$4CsZJ^=1@llz+7t!0C7u5W?SGjW|tXm&H9X%7# z>7xhr0DR{x`lz>;qz{fx0JJ1IeUQY0v&TSMCcZxh(_wcf_i@y4cP4SJx2vP65Q4hsM?z!>ly@6k8%b}82{V%$F$r`G+*PEo5`58zZ=NfO}H1h$M z18H!I{Epy}QDf7A%=5AN5NMKgroRI)Qts~pb@BlwP?`ly6K_PeK{x>P>Hy~+3F58SF^Z?-N!>cVO)=K<_65T2~}B9hl_93 zXMf(s$~OAzSajldXdXGv2{j_~NvHbjZ zz{m+-u|#Z*4PX8~`i}iw?*5ghWbwg?a}e~l3?9ZDvhl$YhRFS|62V^6dHhr=vGnHx z|Io`VueEM$W;mhW1Y0`5ujj@|f`cDtG&7Y@97^?8U+CmM`oqlGysfr=Aqz{@?vI(N zN1}&a( zt@{1n$GbeQT^Hm2rt;`c;QDan2#7_#M?S-8hzC*lwE7;k7EC;EiXN`o9W4OH9z{Fp zi>3Y(<`!j;^EIkz!T!j58$r4gRc^hF6WTd9)V$kdwVQo49EE}JL{}N%DRw?5+tQ*mWq5!d+c1(psiO=EV z6h)U9%jVm%CEzX54Lv2s15|b-#$1J>Sgld-uU1~FsJT=@(r;ocAvYjjn###rvACgO z#m?Vv)T1=UW^l_dl0@ivrS2EbI!#jKrI@f$AbR_7?Qd7J@TfS?vtKqHS-0o!^woC} z?HB9Z9TkkwYPy2xjj_EHk=RB~#x5O*^b<5xCQqJh)%#d_)aalM1!#uVpJ2(#p8Akp z`Mf;+yBtbI^t3oWto!D;^I!v$IGk9XiV1y5ZN~H7 zOhojHzubWWXVy}vE}ONVkv?{|ft0Pqv-^q%?wg$p)Q8OZ2K~5mIcgF?(j7D9myCMz z8jxe|1Zb+Bi(^%#w6RbIrEv*jW!2}9#yw@Q71yR=kUW}ZX-!xPXC`Q*{Hi-tS2Mu% z@VADZBQD_vw;p?^V;-VFb^|!d)@#jyUkBPs5p84AB+G=3y(vU z#UdX34qe1<$C=69+mL-jS|jSQbtSWo6BSIf=!y zp+$X?iuXdbAY18Zc25VyMCccRl)0F-1nb6cYn*9aRXpA{m>Ds zv^lBy-#kg$K6?<*ippjIm9^Pc`oz8+H$xH@?NeV~nCfEbFd;H$>%^yhhD;^t``J3o zLVd|LhG<87$yYU^QnjRFV~cS6U%y3t-i`$YmeIx3?xG^4MGnWkHFlEn&( zTe@%{@xcE0-Krx8M<%Sxbxq-WKmFdE*!S}6d5GO}or%sjFQwrtFZ)}E7E^SuWgbc- z(K_9>HI$@dmr=m$vSqr!Ytgbm;NthPO;B!JJ``&1FUL_L$`x~|m)jqwH-_cX#w4L` zxqHv}!E3nFH#yYW4Jb}*)l0dXoPMMw)$LstNq@-2*B=%u4nui=g#bwDth6vEzHf^U zTai*q65dVowk{ddoZHm!Y{S@@*GS@aOs%imqe;7^MI+A5qWc;Y`o|%AkE&vjSdEQ_VNAs|Q^DNI9^KMS# z!+s<^3_=5?3zoN3-@hKy&vEm9+M+n*tJD@Yz$J*}H$|7xY>?qSjc-6)SA_$S;@ztV zY;Z?bV}pxbgHuL}*YuVnQb>Bon!L6>Z6`Viy)h<;yve#__N+s(8+ox5_FYQMXcS;uDh&|bw`o-y~@Mkx*3K!1Ux;`Wk`1N*u zW!#My2EF6^kaSbN8AxxJI`pLA)^EjgjRD;rR)MG{>vgb`WxF0r?7!aM5Q|j2HlXI| zew&)@x1IAcHs5Kz`_qGwl&)Am8oH?#^aDot1*T926bzGsgZYv(>&q+gF!IDz7|aR>OAAKz3Q-1v3oZ8C3@Pn%MFH)XUFxUtES(M`9_ z*v!l}V<;cLd6Xt*NqgyvCwo_z6|xjEcSIfmyxBYiT0d+Cx0Y5d1#?58`KR9U@JKl%j9xcFm_Ifg}Fc(C^Mwo=ck`ld`oC7RAUo zcw1g+bK-iBppnnwQ`h9a%-z=t{`!YLg%_HA>X*IregN5{Z5X#MZ5s+DQDo32zgdxt z2jpLbn^zZM%XnC%t4dM*oyty(GRkY1^6(vKR(`t$h``!z2Ibi8j_rzDvwZ`jINlC( z6=EDo%&Dv%tL3)~B%@?=m>^28Q#WY?^St{ouR=u{?Q z*Pf39&*6U`aMIbkdqawZxou%$%g(oUU3)%k?1M0anAnmny*=qNxMW&oU7rroC5PSS z>OgeK=P}p2Ogz~+x?~AEW$%Lbn2E7v!5-gq6c-lOJ7Y-0$9Iq4nVr4bznhlh@F-Me zcQSR@+t|0EX!5u<={x1owdJ8ZPit3+EtA@;IIl6&=uduNCWVZm%xAMM=V+o8iyYDI zKc$u0n@M7Zg7dwKTLmv)-o1;a%{JF7*NB<+Zb8i#RSUEJy`nN6p1F1_&g##&#O}1` zUjLqy;=G0lBL_D+l|yc7F9nNQx3@3syRUn3z+|^?KGc-$qZp^3|DtH;__E6rMK=PY z=dLaUt9Z9h2)zdEA7(^M{Pp`{xXzZDN_!N)#uc3%GCr3i&PjNt)Am0GI$;Omz+7q% zU`N3GV60dX>kcx>?WYGZI4B+(rB9S6l`e}nFfhNF|LIrF&x!>*9)_%+HW@4|`VhW& zS#`*s$w_LxD&uQ*H(NB|>xgj>a7S%S!dzH{p)bY2tX)Asmoj=QyuNd)mn3_%ayOaC`|2nsj0}5F<~f!S9@t zUa)3&PqHmY;!C%T7gv=`W=j&cRLea%?-|9@3ec<{Gx{el&w8g+8@FWQi+*0<)}1m{ zMYBD3qy@zd-;#e`aQ-2p!%yMJ@8v1XSNGEa@+5JQq{B|gH>cB=_f0SlN#AJ5Lv&*qPG)+Y8I6%);~5qZt2uKAM(--WK_bqYCLfc4 z6tkg~6(pTqQ4OuWXZJD6Ek=KXju7p74&N5XoI4}+G%YIi+tALf(xmP8l*()kiJDL8 z9=Tau_F=sxSmw{lS&+z(6Sd3`!PngLw=g4q7jQ0szJPDm0_xtSl%?J5cQoyS^P1>i z&d^J)Dhrx(s$7Ae+A4fxeXYVdOYX&)=3r5|OCWu;TEJX+$(bwZ$uATRp0`=$<;y>E zmm7L+=@L1aD_$uK{rAX;;g1fvq#rGdo*nOuyT(pI2k7LqU5$5@mt$I`JpUtVWRid4 zC=sGYwt$c0(XOLL4i|TpP0d+d_JuXcylmu-oN6Yc$!q+3J(6Ap`_^9SF9oYwTLNLb?@!(OJ9sD|14eiJL+eN zP(>#WS-Q<~bK8DqVfuqVKd-fx96A@XG-jD)%w^<0M$zWHqRRO{t6ScUI(zn5+{R>! ziI6L}GKO(RlH>gk!)rBzD5}V8(YtZi-#rE!Yt&&9 zBHlN5HR}ePYP@|7Rkkj<+q0e|Dx46la^0xia4oLefH!NrsP=GF_J%v#?BY!29@Rv& zv5aH)u&RgJ(#KGdONedlaKEK$q0XchpCW-Y;*9#I;g0*j7-8$h^qc;eH=-xM}ww*roW*BIv@FrVG*hN>4 z%BfbcYu%UKGu_7LmXwq1(d+3G@%F=?EO~kI!lGk>=1a!o5!ZdjVKZ*ju2+C~^0#oj z&AO$nM$C{q%|CmuTyybB{T%~$00P~bi812REgS-Vy47Eu7?bq)Lj9YtL-!>@(|zj) z!RRsd6sR`7-q3_3-VZGq`KxxynvxaSThgXKqkjDQZZb^!)205+lMLX+61}^AmLn3` z*BXudHnzBE$$|8c+pf>ixBSYABPGc%18yB4iTrZA=TSSmx13qG#dI&sv^DL)$Z>0~ zRGQ!GE@ygsKRoIQZ7`Rj;L?Uk(x2}dMk^D&pK?!LyO>u!4CZoc6aaT~8^J-NcQ@j= zv$j#cJ8{hR!%RM+-!;ZVeems(ZTj4K8~c*?Z(|SL;?8_%J#YsnKY4eXp)|ec0PZ%J&^}j0M>_R>I}2y;Xg}sG4)0X7bkAVgW-=p|4@J}?9W3Sk#iqqLY5cN#~%5^nvjoicG?_#jW!`I zpE$tpP)>_uDQAbjc# zB#%Bd)g+0VMNjG!MlZXR-|F>v?LL4d`sGs`hU-7$LN;Zs%@H=kn$I&hG>TK7St5v2 zN>|^nn6I(B5VGLUV}Vt}7s*hrco78SnqRQ+l+BVVbuIjPEs2`|7oon#Gw6^A6eC>wf0@n?Krf@e0EVpgRD2fYoTMGt$_5i&wQ*M z!!Icy-O4Z6Rq6A!7#ixoa?OZ?5bruzyjkFoH?Mddx2c}q@buZ%>2)_1Vb4@2Nwm=a zTR2G)%H8%o+Mc+tCjN``FkSc) zzok3#Q!fxsR@vj+lFhSX;e%X!*JcBeNqacN#W9)>u3^q}+$ek5#x%H*MId~D-X zFeW8E)VV_D60gfMoyWuZXPF}%o-@A9i?W>)9HRbOnD;?e3c}JGcTcB)aX1)2*>*w0a$tZS9N6juNQ4NH8$ujy!VR(qid7+UA@toF95JF$qD2UWAWHNcAuc>PIDC4?O3nFK z4_1FK-oFPj?6ZB5$g&#>YC}R%PB&x-6nAt(4u}*z>xKZcL_Tt8Du^#ClS2>>i0;WD zNPUT{I!h{rkQ9#KEiKZ$d$byUZDxyRn)w?^|0MbwVUd2c+D({Xmfo6?Lb@(|a?=p)N z%jpVN-&Eds=A=H*fntD_hdq!ph|`Ba77PfB zyajU_nbA>#GTIEoHAn;=muM=9e8tc$DkCAqNQxX( zP>ux8MAa(D47`ReU_kaof=F4FnSi5;oPa>GD(c^9KX#E(@d}HAcRtoWkxB6>iQ$n+ z6vh=FQsk|U^a9w-RXW9Ho~VOgV(k@{h;Q&Ep1kZ<=g4v*i8=m3nxM z9dMb~#e2JdEEZ3U?c&9<)j%pv?TqreB8uz&gFZzW8c5r*olX~qgsc876&q4?MFYVD zanU;sqzjj)vKGVc_y|UPoKTQ>lRZ7U-bo$V|KE;Gp9-f;2bLux@#7KMN!eB`7K^bU zxObKO7C;^l9)5?%cF7T3(8{PnR!X?Pm9)gAr^G;3Q+jF4?_hkgLpn5wUq3pB!E2iM zC}uUHVCPE~!`d??IVL&|Di{Xv>FzfL{uMz4R7fv=aRL=Sfv7b;{$(dhO^loj4+-JD z43uqulntK`-oRv1l&OU@?IleDmW>UN#D7#=TOAj}PNzCPURX(;s7{6ii!a31+@U-E zfYt0!$F{W<0JKT!L?+tpTtH`5=NUNy8-8c990AWphD3r42_9D<=-i#h<=b|yW5K^m zfmM}qQ6WQu#RYA&HHlRxVDW6)<(83DiIRW%<{LdLlG%~gKJoEzumODFeLXU6ay$j| dO80P5a#&)rcmoSamVgh>;mpijJ>5v+e*o5_l79dI delta 12465 zcmbt*2Urx(&+smN7Y>wO1dcBK`f-S;AP6YES*Ri+N|BC@0~8feL86|5s93QVEMP(G zihzn;!G^t{__Kkc?<^J$@%Mk<@B8yS47;!paMXaKDlEvlPPKb?8j!ub92_+pJ$>@X$ z)DR{^Z0xULbPA#0Ph75v38|#5f7Nt-3FT6HP$*>#$E5nhWhp-}miB`T z=^$v74gez=Uj*SRqX~;;20@)n0O-rwx{DLe{x1k;!CF}jM3hrxN;JiRt(U8>^XRdb z&Ypfu#($)|O*RP84-qcv9JI922{EaY=qx5fK*6P?CPzoclbN?4 zj~Q2Z=Zsp`#a;d08IrpvH7e|CfZ{aOgOk8e$sQ*lN@<49z>9a|o*kIJykpEl_PSF_ z>u<4$uHjeq)dm-AEbeEDV_??LR0@k}B*3>H8;!~DH-*t7pYX1{(qkj5%h6-NmYgNG^wl?kc}ILuJf!=<4_Z7_nqqc#zo)NPbbho_8MR8I@>dCKLt zt{n-v>LyU3ZU+z4HKj;+OoQ+0>Ijv(MzBA%xqeFF=Qd-BZ!=dWy?fiC9p=iSGbu%; z9@%szr5Ju23Yqq(5Q}fuONI7p z-AZUZ*FHGBd>#fi1MJXxOd7C70^16zx{J}vM%@A=bEcjuYF+g&N%|=ZZSZ`w&|?_MG%ax`00iD)hb4sL%SkpiXy^#a<@x*CojtunX)#zrGys!^CS$<7Dmuh(Bm-JJ(^5ye~q5CV+h2y zeG=@swC1coCUYf;RgON!aPL3*!!*06CV8yKL+x1d) zW}JDa`e7Kf3^YPZiJMPS#tPj|5Dr!JxA#YhJnfxoPSPOPd<0spI`aYW)Z7KEEp*kf z*TF~Z^XBPKy}PKtX`$_@*6}y|Ut$np!6(PQ82BP=V6|l)2J0+1I^?HIX%Vv1G%D^7 zxjE*0%Cy4NX>Sf4Xl<%_jlnyMEHr7dr3kg8)le1Er?QOB2VeO$;w?qiw5mhqtT0p^+eR}v1X#r&#fI{pbame@3OL)zZV6qhu8xCwiRL) zq-Tv-lpFqG52&?d{anj#Y~pLqrZ)O7yU{Cfs8qI{E=ffWqyIH>V2i8VZ==(V^8XMz za6!n{K&I!n(+cnn^!FZyoK}GQ|KhV6*+DWSo58c;1Cuitd^j?Yz>$aP96xA4zjST@ zq@mwBE@g#q(hA&p=8(ekgEKr|aVx~`?Z|pGna$>iSs{qx+oPpgjamYl`CedY=YgJP z*d^IWlZ+?R1J!q5SMpg^6?Hk9_NjE{8jaWn-K!Qu=I7nOhPvNWm?2dE5)`~X_Xq|$ zf@sA}GpeMsW?6nIX;T`mk3pe8Uy2x@Nq?w=;11J`*p*wFf%7C@64D_ z4j42_4p&zDd;mHf$3ozc(XeyKEJ=({1KXiRXkhJ7M?}u|p?VU8Ef@?d(!vTS8(cD5 zrrF=hVSi*8|1kTrjyRs?{iN0m(mxP>IGUPPt%_N)Ffu`i038eIxOY1V+eTUI$8z0%Pn^c ztu;0nDL8f_U2;lcemVGzh#HSAp=BIZ%}pD8{?59{SsFPd8*Y^zJ6&S!+t*%jdYD1t z5R<`g)6rujI6bySobhfHy%_K9ta}*epndu~+=FFq1v2Ew($VKp#O6L*i;!+J9W-WC zi`w`dLxUXTeI+(ut{yn$I7vX0`{YrWcHLiy7dI&4#_l&CV#N1EJQVQ}KP?>RPj4lz z9^D46cc??!I!8`*i;j(%luEbbqR4+(N>p^h&u8jbL%mqD7!1%Hsrz%1?xT;tmxo7? z53*J$!baxRJvA~eHfmTxOk6Y_VewCmjt@fKR`7!?*I3j|85=6fi;Ij&p>xDyyxvx5 z$S=KO()mo@uNM}bFJL3YKO${5o!fn)`Vn^9ark_(b@(ze6vm9w*TA-i%zQOq=Bfen z=Z9nCKPu{ZEq|hJgDlP{BPwb+G-`kaakIHeaY={14=a7*N32a)M-QGS+}~X5)hJBD zCw+UkLHer;vG-tQI|eeIgOEzQdm1TY>?oa>xA*LCD!zXsC*1Km5rZsG9{O1AX&{3I z1*L~!aNn~Wa=oTV5Cn93g;^5*ljp0q*4hv3YS7E36^#63KH$yRm>mD}`0IkF#O#FU zg|jBuc07FKnSnu`w}mX(%$oa7b30UdCxL~}VYK<5_=M`+b&J@?{4(qN62GOjcWbAV zx?I{+aC)Y!;?vR#W?{6-DBlbm?)d2;=uST;80_ytl3Rm9cNLx)jC}PXe_Qn7sJ{W+ z^Vf&({>ES&uoW%_n97F+%kMmKw5;SHn*f=>>5vncfS73yT#ew1g49h_$Y)MBbzFq+ zPHz`INLSg-X2(V%vWvovv{N)iKwv3XEDmJ(~z*kDznK6Uq*EYqe{S9ZFXBuv;^ z9pOy_$8nZyV%)iTF?%bo-^hQzg^{m2?LcgDCr#RO&%w5gw^tffUR5dx+tMdV32n;P z?b~qT)kZ&SbetJCOb@HBxPK8m%Emiy5v_){c~Ot0=L;U1%&0DUs zI6pLqB-^vT+C2=ZJ<|y5KZU>hU3wd_C)2loo|A`Xd&UgTdb@z| zysCb8y)xu{EJ>a62ic#Z$B%ZYzGpj7po&3RWsquJu3g5gwDi6Zf! zE%VZK{%51*#?@14kTRhJ6rz~XWrTIMdoH&L~6tuHBZhdIc4DxTBUHwR*f1< zg&V5{iw}Laurgb?>cRPo|6q_39SWDDM}x)0AyOMW7U@C4#AS4BN^-=74@uTzbwWa) zA4=G}uI=#ZCrX*K9W#?!cV1pefLRRXg2Q8`qxN2m6>60xX~MusZk0)s9^*P>e7WoJ zqn8&vkMTdEvhvDwyGEV8o2D3qBkQYNpcRG6ZPgGn48LgSoNi0_fEG1>(mV_wbK z8Qn5gs6AmZRK-#1of_{tuCG00_IMnzR7_8@<^OKH^b+)7aDs;WzZfc>xSe8BZsD(n zs{6~&s1kX=VZY1~vQ(_!wh7s4E{pp+DbU+gF}ZfkZqxVUa12t3BN6vLiIxfkqa)_+ z#nTs#H(odn`H9vJq*PTVtGHJ1Jb&jKTXvXIX5Oo9e3u3>>HGNML9Qr!F+cw33t+Cr+Gb zqjx|U;~84E3QM>79!7jW(k?vxq*mA|iDjZxK@t}{lFmT?WGdU>k-QPL?~=zOIs;Sa zs7+5X@2^gC;~u?ay*0dG`0kT#*ggz)rwl{i-lb5-5cO0ma86B?B>V|Dl`4?X(|~WO zBM}rNg3WE(B>h zS#&c0pCKsxoMu`nIXx6dU=wDdt1DdJi(3d&}BpfU2Z7Q%{II|mS^;SSPjyN=gY zoTQs~-QBM;;{B_wU*a~7t(G7lHp>`|UXoP^2EtFEmCYgv;m{nZ1*2ZRkb-g9j(`bb5}xH?)c)_&MY;ln#>#n32-wRu_b%$ zNN$P`2Ey64h@!o-k0KVP&e?!kwLBh-%A-V9mgfk~c>_UuZW4}FX3YJLL&p4SVCHjR zVm@_tT9Y3pODM|<6i|Xlc0ss2aiu!UCB%Ga`5gi>7MQ~71-S^JLBR~vmKEf&q)F2h z7C0M!%ra`xuGqGV2waotI;%8K@!YBx!`N^C@!tBWIQ{BWnsCoPo2;3cC7-+@c%cR4 zE@U7Cl?!dWcWk~Eo-}ty|Hb8*!>t|1MHj3Od1T};S%VyGv#9^s8BZR4jeI%)|S z)MNYVt`gHsCN?GwZZwsD+Uj}^T4D+nD$nn1+E$u=>w?Qg-w*=Wi#{ryRyufm^=HAR zY2QRfuLCgd@C+=wOhLADW< z1h^HAlvO1=rrLExKxq+OlT>+C(6T45;`SVS_3$KjwGY)Q9Vw+T7+ftHjSyKcS%cb! zB|{KTv|=M*7OSIok76?kMPy-%0c1fJOu!!Hz#?ETs4V3pz>!O>j5{|ZMi!-2k-o2T z*DvsDD|~hHaamwSlfD9ZJMNOd>x1!I+mHe;HAdiPm$C^g8(WpAHWGPOa+!%9p*3`- zpuTfzi>175o*oD`HAYW2(9xdwp}pXSI{|*nJo=G^G5hA(Z`6NK-eSUMoC=1W%Y2KM zQ?8q_+}S`{hgLCt!cqVARdnr``)9*El-37MtIpc5cz2tBY%6;kf3^>wAU zFT6~LuH6Y%mEj)=Xj@K4462KmxHhavpE;8jXR4#!G8fLs;bj~o%!KF;#APshAl+m~)pLZ`V^Yk*!xi9frn%9y-!aQ@Z! z!yTC)oE{0jO7uHEoE3Q4NS8MH3q(6;VTU0Z7w$=b@jtG6j!w+myQf|f1H@Pyzp7!jt;V*-KhL*o8OH^&wTHJ zR|OC9Du(Egxvy8UaxYw2c#s_){Z7s(a*V+n*Ew#pS795?MN7 z0cYTnSq29^?|D2_JQ`A@m2WQVO_({=92%utd~?$MH#E4o#R|S|F#*G^L($mDTgy;O zZnLC~k*3W&T^Fbtuq9BN2F}||Q2&%|)|D%_^`pY7t=pHvkR9HrvuMZkzl8xkN1gvN z3`p3i2a9%Udi+Zmz(l^eI~Cl0USW18f&X@3>Hg9a2Z*0oSg0cO~;L>2yEh*<-!UnylHVn#Zk3$#9Eo$ zTRFPlOGf9=G2Ix;8I1Y@6|89PQ0(^is?%y~Y3b6=Eyu5~diJat1p%zxDe{C&?#*%T zgKjz1A{V`za^IJCQ||BM?%^pVn@j09ChnG&7NI=$pOW3-9uo9vAyoReHYchA>N4GK7 z1bo@=Ek_Wo@*ek|u7R-!B9w`M=*wr9#m)om;x^SpwexccxN=}B3_nOQ5Pz^jfvA4Q zTT+v|)F5s$GU-)usJpD{f;4vV;b;U<9RhXLfvC^$P>B+@|Ap%O>pHul7jw3z-$o~n zLr#bTwZl{_GUjj`oH^VMRY&x-$)>6r>q8ZH&YBCpEY*1Pe0P3KX-6av<*1k8%*!tw$GuUCjbGS+f=4NH~@SuaEhle#cs-Jo!N)`{_kFgBd8Vl~b#QzL(Y- zDq%CcH)n+=j96E4hJWTh2KBXh`s8D~H4jQ=e%@^{(aOk5MQfWjzKv8k zH4KuE2TSVF&O^iTVu(0l1anTfA#4pNVpIsBVO!3|mq&$*jgu_Hg{uc}Fz`A_C5ld; z^h9*1o??K@sXJhB`lw6O&||IB&(Fa}OeiJ9Z9Q98^T^e@rEe{^=|Kmz<+JzSir znkhOz{51o@7dI%ZUv;iN8IbNTJqAVmU_m8Uei;-dlg~vn{mr5>dM13)uVa zl#9%6QrE_;U8lRcZaS7Hy!ZWUQ^&zQr{WgIEwYZQN5-d#ssNm6@=_w?Zj4D?QulF1 zfnacQR|A+`5$a(h-)^oeqn9msGjsih>gzK16_VR4l&)n@D;&38N*+#L*$>mM+LC1b z+%G;y-nm*4aOkQon)~+EOR()48}41Ba!&x-9PU|_ zn0?m1nIK4?qH?vqNjrGR(M-*|qIrNm`F6-b z_pVEmmLDw2UzauYG4Z9V(_om|KNrl}#%qVt;9B!^M4L|wf-I@Ee-cw6`}x?)b%xuC z^;!4a$1HC+ZP_9#X?T0*Bq(gLL^x|(#-n!NT~AW)5&Lk{`Qo}^G|0Kjhw8i5@bs=J zDBjbOIbheG!A14Udx^06o;!kXyT=2Q`&2-da(^~_x}OKL9<)K+!{M;!;Y2MBI_>z% zf-h%pMLc<%?{MLmlVsJhyT@lMZ!O2b{8c=NUZsM<>rezd z`87kD_$bqgYPqj%5aMgE9Z;**2B_W9770pkQYG~e)p>6&fbZKtG-C7HDe9!}vi>cX zO7=+Rl$tM>e4YRJoAnkGgt|S7n!jBicC-h8#Jh12_AU!r-W`#=!$1dn3 zqCb}yExw9(rtuW6iUu2RxiIuD=B1pP@8o~LL%)1_W+_B>`~x&F?r=i$#dWMuB<;-< z9@yN->M$;ns79WqbGQs#Ezr#9hDCRo35~?&f)tLtNUy7mOOC{>e`O4PaO}pc0 z^>U75ac<>G_NyCE_UQ5Ysh6+G3?u7O2)Ok%N`X|6*zsUf@{WU#(Q(ARi^7)KMO82R zebYy$YsNPLt{_XBvXHht?8%I=C|Q~D-LSIcyA`g4)$EmPAYc03zm(wWltAon!42^U zEc1&+S6~0b?x`32ck!xdk_4`&DeiE@ON64e61eK1U%7Uk-4D3#(3So3Ld=g`JNnd9 zH|YM<<7!6zawk*{3!(VsYS;oQcmFp}!{MN8*>6XKF1frejRmB86)aSjbeTP+vKHOcX7JTS+P?&_p1G`>GpE zRXua+EKO$q_Y2<+FaI1oYl*UU8%@+Dg%99M(Ym}J+}m>XTIkWP;l>j-VEx^n7qprt zjgu)7Em8Ws%gbN2xkY8udcv)spx}agU02ZS!Ivj#ihQMUeIr6&*zeoSrE_eLzp+p# znYcaVa81Bx!}nIV<_U&y+R1yzTL{rgX*^$^+}T)|^zv!u?tYmfTNxbfcu|B5ZZ9g8 z!9^mrEY4DNHKoa%3zrOs=Bun$LNr|#4@W?^WpTEuEN$=6%}Z2fU)){SS-EqYBW;F1 zCNh-6Lv@L%t*?V?hA#5=+P3WG`pDH{lgG710(pFv=%75VC%P_=8{r0`ukv^*j){^KaFpB=RVv`g zB2yY(CQXKPo+CsJG&~2F6L~A50SSuuHU%tW-%|5cyN}CyIMPI>N;uzyIK1SdLl{w6 z*wteAXtz$aJy~B9uyn*Q-?I&##K^d_6XO>Y(nJMHcpSq2SqXO*IrPI(l35hjuY1a! z{czsF$Ng|sWST`?{c#kiij0*J8^y}_TJ+3T!I8Tc6{z6;=nwJ@*`f)mcmaC;po*L5 zYW3ZmJvBekAT``nG+qsN5^Yq&&6r}Fq|brVCo(3QwDpTlNlZ(QicXXq+CdQwmlJuwZDkK)Xcu@h3pb(8H!XLXYi`WxM!+_C%Q=DWG;FD4{*_ZZO@ zjsGMiPS0(cf8nmXOzS7o)a)gtZkENCjML{P$Dh*XbQ?v{e1ymTH(Q)Oc={AfdrL|5 zRufl4hVow)onralWy}+~XyJxvjXa|##70u*3W|Fks&nuKtX>x+#Vf%-tT4S>L4RJV z`-@(S)BT@E2!CG56PMV}5vau4W7?TE3~CSVe} zZ#e zK7+?YnE&WwGyB4EnP}a5!SMuK>fS`JJ|TlEpwzWjC-s7suvZ_`&W?{P%^!U{yFcO3 zNXDPUu=qUgpL4MI93H|a?1hlQwBsVJ?bXL&^Z9=c=CHYTfA%rZ?OwF%y~gqxoIX-u zu#pUZ!wG+g8UgbD6c>YQ*M~cvfJa@)=rsvLz!vmFFGx5)57xEYk zWD9yDFoZB1V~+x`vutjz-KThTi>gX zX~&@Mj`i;2v$=io2?T%Y44)xnQW0|R!FD`WACB#qeL1n?+WomqJb@jx@q6LpGgy>k z`J<03=$<#F_ul@?KIT!EpMDKaO^!s@SCYH`x4=JkdNjIwf -* 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