Skip to content

Commit

Permalink
Merge pull request #1762 from Renato-Rodrigues/seFeSectorSharePenaliz…
Browse files Browse the repository at this point in the history
…ation

Penalty for secondary energy share deviation in sectors
  • Loading branch information
Renato-Rodrigues authored Nov 7, 2024
2 parents 5917b09 + b71fbed commit 18e9c19
Show file tree
Hide file tree
Showing 7 changed files with 401 additions and 12 deletions.
215 changes: 215 additions & 0 deletions config/scenario_config_21_EU11_2040_target.csv

Large diffs are not rendered by default.

25 changes: 25 additions & 0 deletions core/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ pm_shFeCes(ttot,all_regi,all_enty,all_in,all_teEs) "Final energy shares for CE

pm_shfe_up(ttot,all_regi,all_enty,emi_sectors) "Final energy shares exogenous upper bounds per sector"
pm_shfe_lo(ttot,all_regi,all_enty,emi_sectors) "Final energy shares exogenous lower bounds per sector"
p_shSeFe(ttot,all_regi,all_enty) "Initial share of energy carrier subtype in final energy demand of the aggregated carrier type (eg 'the share of bio-based FE liquids in all FE liquids') [0..1]"
p_shSeFeSector(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "Initial share of energy carrier subtype in final energy demand of the aggregated carrier type for each sector/emiMarket combination (eg 'bio-based FE liquids share in all FE liquids within ETS transport') [0..1]"
pm_shGasLiq_fe_up(ttot,all_regi,emi_sectors) "Final energy gases plus liquids shares exogenous upper bounds per sector"
pm_shGasLiq_fe_lo(ttot,all_regi,emi_sectors) "Final energy gases plus liquids shares exogenous lower bounds per sector"

Expand Down Expand Up @@ -429,6 +431,8 @@ v_shGreenH2(ttot,all_regi) "share of green hydrogen in all hydrogen by 2030 [0
v_shBioTrans(ttot,all_regi) "Share of biofuels in transport liquids from 2025 onwards. Value between 0 and 1."

v_shfe(ttot,all_regi,all_enty,emi_sectors) "share of final energy in sector total final energy [0..1]"
v_shSeFe(ttot,all_regi,all_enty) "share of energy carrier subtype in final energy demand of the aggregated carrier type (eg 'the share of bio-based FE liquids in all FE liquids') [0..1]"
v_shSeFeSector(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "share of energy carrier subtype in final energy demand of the aggregated carrier type per sector/emiMarket combination (eg 'the share of bio-based FE liquids in all FE liquids used in ETS-covered transport') [0..1]"
v_shGasLiq_fe(ttot,all_regi,emi_sectors) "share of gases and liquids in sector final energy [0..1]"

vm_emiCdrAll(ttot,all_regi) "all CDR emissions"
Expand All @@ -447,7 +451,17 @@ vm_demFeForEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Final energy which
vm_prodEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy services (unit determined by conversion factor pm_fe2es)."
vm_transpGDPscale(ttot,all_regi) "dampening factor to align edge-t non-energy transportation costs with historical GDP data"

$ifthen.seFeSectorShareDev not "%cm_seFeSectorShareDevMethod%" == "off"
v_penSeFeSectorShare(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "penalty cost for secondary energy share deviation between sectors, for each sector/emiMarket combination"
vm_penSeFeSectorShareDevCost(ttot,all_regi) "total penalty cost for secondary energy share deviation between sectors"
$endif.seFeSectorShareDev

$ifthen.minMaxSeFeSectorShareDev "%cm_seFeSectorShareDevMethod%" == "minMaxAvrgShare"
v_NegPenSeFeSectorShare(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "min-max negative penalty for secondary energy share deviation in sectors"
v_PosPenSeFeSectorShare(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "min-max positive penalty for secondary energy share deviation in sectors"
$endif.minMaxSeFeSectorShareDev
;

***----------------------------------------------------------------------------------------
*** EQUATIONS
***----------------------------------------------------------------------------------------
Expand Down Expand Up @@ -552,6 +566,8 @@ q_shGreenH2(ttot,all_regi) "share of green hydrogen in all hydrogen"
q_shBioTrans(ttot,all_regi) "Define the share of biofuels in transport liquids from 2025 on."

q_shfe(ttot,all_regi,all_enty,emi_sectors) "share of final energy carrier in the sector final energy"
q_shSeFe(ttot,all_regi,all_enty) "share of energy carrier subtype in final energy demand of the aggregated carrier type (eg 'the share of bio-based FE liquids in all FE liquids')"
q_shSeFeSector(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "share of energy carrier subtype in final energy demand of the aggregated carrier type for each sector/emiMarket combination (eg 'the share of bio-based FE liquids in all FE liquids within ETS-covered transport"
q_shGasLiq_fe(ttot,all_regi,emi_sectors) "share of gases and liquids in sector final energy"

q_shbiofe_up(ttot,all_regi,all_enty,emi_sectors,all_emiMkt) "share of biomass per carrier in sector final energy (upper bound)"
Expand All @@ -565,6 +581,15 @@ $IFTHEN.sehe_upper not "%cm_sehe_upper%" == "off"
q_heat_limit(ttot,all_regi) "equation to limit maximum level of secondary energy district heating and heat pumps use"
$ENDIF.sehe_upper

$ifthen.seFeSectorShareDev not "%cm_seFeSectorShareDevMethod%" == "off"
q_penSeFeSectorShareDevCost(ttot,all_regi) "total penalty cost for secondary energy share deviation in sectors"
q_penSeFeSectorShareDev(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "penalty for secondary energy share deviation in sectors"
$endif.seFeSectorShareDev

$ifthen.minMaxSeFeSectorShareDev "%cm_seFeSectorShareDevMethod%" == "minMaxAvrgShare"
q_minMaxPenSeFeSectorShareDev(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "min-max penalty balance for secondary energy share deviation in sectors"
$endif.minMaxSeFeSectorShareDev

$ifthen.limitSolidsFossilRegi not %cm_limitSolidsFossilRegi% == "off"
q_fossilSolidsLimitReg(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "limit solids fossil to be lower or equal to previous year values in each (sector x emiMkt) combination"
$endif.limitSolidsFossilRegi
Expand Down
108 changes: 102 additions & 6 deletions core/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -1052,32 +1052,52 @@ q_shBioTrans(t,regi)..
;

***---------------------------------------------------------------------------
*' Share of final energy carrier in sector
*' Shares of final energy carrier in sector
***---------------------------------------------------------------------------

q_shfe(t,regi,entyFe,sector)$(pm_shfe_up(t,regi,entyFe,sector) OR pm_shfe_lo(t,regi,entyFe,sector))..
v_shfe(t,regi,entyFe,sector)
* sum(emiMkt$sector2emiMkt(sector,emiMkt),
sum(se2fe(entySe,entyFe2,te)$(entyFe2Sector(entyFe2,sector)),
vm_demFeSector(t,regi,entySe,entyFe2,sector,emiMkt)))
vm_demFeSector_afterTax(t,regi,entySe,entyFe2,sector,emiMkt)))
=e=
sum(emiMkt$sector2emiMkt(sector,emiMkt),
sum(se2fe(entySe,entyFe,te),
vm_demFeSector(t,regi,entySe,entyFe,sector,emiMkt)))
vm_demFeSector_afterTax(t,regi,entySe,entyFe,sector,emiMkt)))
;

q_shSeFe(t,regi,entySe)$(entySeBio(entySe) OR entySeSyn(entySe) OR entySeFos(entySe)).. !! share of energy carrier subtype in final energy demand of the aggregated carrier type (eg 'the share of bio-based FE liquids in all FE liquids')
v_shSeFe(t,regi,entySe)
* sum((sector,emiMkt)$sector2emiMkt(sector,emiMkt),
sum(seAgg$seAgg2se(seAgg,entySe), !! determining the aggregate SE carrier type (liquids, gases, ...)
sum(entySe2$seAgg2se(seAgg,entySe2), !! summing over the bio/fos/syn variants of the chosen SE carrier"
sum(entyFe$(sefe(entySe2,entyFe) AND entyFe2Sector(entyFe,sector)),
vm_demFeSector_afterTax(t,regi,entySe2,entyFe,sector,emiMkt)))))
=e=
sum((sector,emiMkt)$sector2emiMkt(sector,emiMkt),
sum(entyFe$(sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector)),
vm_demFeSector_afterTax(t,regi,entySe,entyFe,sector,emiMkt)))
;

q_shSeFeSector(t,regi,entySe,entyFe,sector,emiMkt)$((entySeBio(entySe) OR entySeSyn(entySe) OR entySeFos(entySe)) AND (sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt)))..
v_shSeFeSector(t,regi,entySe,entyFe,sector,emiMkt)
* sum(entySe2$sefe(entySe2,entyFe),
vm_demFeSector_afterTax(t,regi,entySe2,entyFe,sector,emiMkt))
=e=
vm_demFeSector_afterTax(t,regi,entySe,entyFe,sector,emiMkt)
;

q_shGasLiq_fe(t,regi,sector)$(pm_shGasLiq_fe_up(t,regi,sector) OR pm_shGasLiq_fe_lo(t,regi,sector))..
v_shGasLiq_fe(t,regi,sector)
* sum(emiMkt$sector2emiMkt(sector,emiMkt),
sum(se2fe(entySe,entyFe,te)$(entyFe2Sector(entyFe,sector)),
vm_demFeSector(t,regi,entySe,entyFe,sector,emiMkt)))
vm_demFeSector_afterTax(t,regi,entySe,entyFe,sector,emiMkt)))
=e=
sum(emiMkt$sector2emiMkt(sector,emiMkt),
sum(se2fe(entySe,entyFe,te)$(SAMEAS(entyFe,"fegas") OR SAMEAS(entyFe,"fehos")),
vm_demFeSector(t,regi,entySe,entyFe,sector,emiMkt)))
vm_demFeSector_afterTax(t,regi,entySe,entyFe,sector,emiMkt)))
;


*limit secondary energy district heating and heat pumps
$IFTHEN.sehe_upper not "%cm_sehe_upper%" == "off"
q_heat_limit(t,regi)$(t.val gt 2020)..
Expand Down Expand Up @@ -1127,6 +1147,82 @@ q_shbiofe_lo(t,regi,entyFe,sector,emiMkt)$(pm_secBioShare(t,regi,entyFe,sector)
sum((entySeBio,te)$se2fe(entySeBio,entyFe,te), vm_demFeSector_afterTax(t,regi,entySeBio,entyFe,sector,emiMkt))
;

***---------------------------------------------------------------------------
*' Penalty for secondary energy share deviation in sectors
***---------------------------------------------------------------------------

$ifthen.seFeSectorShareDev "%cm_seFeSectorShareDevMethod%" == "sqSectorShare"
q_penSeFeSectorShareDev(t,regi,entySe,entyFe,sector,emiMkt)$(
(t.val ge 2025) AND !!disable share incentives for historical years in buildings, industry and CDR as this should be handled by historical bounds
( sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt) ) AND !!only create the equation for valid cobinations of entySe, entyFe, sector and emiMkt
( (entySeBio(entySe) OR entySeSyn(entySe)) ) AND !!share incentives only need to be applied to n-1 secondary energy carriers
( NOT(sameas(sector,"build") AND (sameas(entyFE,"fesos"))) ) !!disable buildings solids share incentives
)..
v_penSeFeSectorShare(t,regi,entySe,entyFe,sector,emiMkt)
=e=
power(v_shSeFeSector(t,regi,entySe,entyFe,sector,emiMkt) ,2)
* (1$sameas("%c_seFeSectorShareDevUnit%","share") + ( vm_demFeSector_afterTax(t,regi,entySe,entyFe,sector,emiMkt) )$(sameas("%c_seFeSectorShareDevUnit%","energy")) ) !!define deviation in share or energy units
;
$elseIf.seFeSectorShareDev "%cm_seFeSectorShareDevMethod%" == "sqSectorAvrgShare"
q_penSeFeSectorShareDev(t,regi,entySe,entyFe,sector,emiMkt)$(
(t.val ge 2025) AND !!disable share incentives for historical years in buildings, industry and CDR as this should be handled by historical bounds
( sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt) ) AND !!only create the equation for valid cobinations of entySe, entyFe, sector and emiMkt
( (entySeBio(entySe) OR entySeSyn(entySe)) ) AND !!share incentives only need to be applied to n-1 secondary energy carriers
( NOT(sameas(sector,"build") AND (sameas(entyFE,"fesos"))) ) !!disable buildings solids share incentives
)..
v_penSeFeSectorShare(t,regi,entySe,entyFe,sector,emiMkt)
=e=
power(v_shSeFe(t,regi,entySe) - v_shSeFeSector(t,regi,entySe,entyFe,sector,emiMkt) ,2)
* (1$sameas("%c_seFeSectorShareDevUnit%","share") + ( vm_demFeSector_afterTax(t,regi,entySe,entyFe,sector,emiMkt) )$(sameas("%c_seFeSectorShareDevUnit%","energy")) ) !!define deviation in share or energy units
;
$elseIf.seFeSectorShareDev "%cm_seFeSectorShareDevMethod%" == "minMaxAvrgShare"
q_penSeFeSectorShareDev(t,regi,entySe,entyFe,sector,emiMkt)$(
(t.val ge 2025) AND !!disable share incentives for historical years in buildings, industry and CDR as this should be handled by historical bounds
( sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt) ) AND !!only create the equation for valid cobinations of entySe, entyFe, sector and emiMkt
( (entySeBio(entySe) OR entySeSyn(entySe)) ) AND !!share incentives only need to be applied to n-1 secondary energy carriers
( NOT(sameas(sector,"build") AND (sameas(entyFE,"fesos"))) ) !!disable buildings solids share incentives
)..
v_penSeFeSectorShare(t,regi,entySe,entyFe,sector,emiMkt)
=e=
v_NegPenSeFeSectorShare(t,regi,entySe,entyFe,sector,emiMkt)
+ v_PosPenSeFeSectorShare(t,regi,entySe,entyFe,sector,emiMkt)
;

q_minMaxPenSeFeSectorShareDev(t,regi,entySe,entyFe,sector,emiMkt)$(
(t.val ge 2025) AND !!disable share incentives for historical years in buildings, industry and CDR as this should be handled by historical bounds
( sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt) ) AND !!only create the equation for valid cobinations of entySe, entyFe, sector and emiMkt
( (entySeBio(entySe) OR entySeSyn(entySe)) ) AND !!share incentives only need to be applied to n-1 secondary energy carriers
( NOT(sameas(sector,"build") AND (sameas(entyFE,"fesos"))) ) !!disable buildings solids share incentives
)..
(
v_shSeFe(t,regi,entySe)
- v_shSeFeSector(t,regi,entySe,entyFe,sector,emiMkt)
+ v_NegPenSeFeSectorShare(t,regi,entySe,entyFe,sector,emiMkt)
- v_PosPenSeFeSectorShare(t,regi,entySe,entyFe,sector,emiMkt)
)
* !!define deviation in share or energy units
( 1$sameas("%c_seFeSectorShareDevUnit%","share") +
(sum(seAgg$seAgg2se(seAgg,entySe),
sum(entyFe2$(seAgg2fe(seAgg,entyFe2) AND entyFe2Sector(entyFe2,sector)),
sum(entySe2$(seAgg2se(seAgg,entySe2) AND sefe(entySe2,entyFe2) AND entyFe2Sector(entyFe2,sector)),
vm_demFeSector_afterTax(t,regi,entySe2,entyFe2,sector,emiMkt))))
)$sameas("%c_seFeSectorShareDevUnit%","energy")
)
=e=
0
;
$endif.seFeSectorShareDev

$ifthen.penSeFeSectorShareDevCost not "%cm_seFeSectorShareDevMethod%" == "off"
q_penSeFeSectorShareDevCost(t,regi)..
vm_penSeFeSectorShareDevCost(t,regi)
=e=
sum((entySe,entyFe,sector,emiMkt)$( sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt) ),
v_penSeFeSectorShare(t,regi,entySe,entyFe,sector,emiMkt)
) * c_seFeSectorShareDevScale
;
$endif.penSeFeSectorShareDevCost

***---------------------------------------------------------------------------
*' Limit solids fossil to be lower or equal to previous year values
***---------------------------------------------------------------------------
Expand Down
28 changes: 28 additions & 0 deletions core/preloop.gms
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,32 @@ if (cm_startyear gt 2005,
Execute_Loadpoint 'input_ref' vm_capEarlyReti.l = vm_capEarlyReti.l;
);

*** initialize the carrier subtype shares in final energy demand such that the starting point for the model is "all sectors have the same bio/fos/syn shares for a given carrier type" when cm_seFeSectorShareDevMethod is enabled
p_shSeFe(t,regi,entySe)$((entySeBio(entySe) OR entySeSyn(entySe) OR entySeFos(entySe)) AND sum(seAgg$seAgg2se(seAgg,entySe), sum((sector,emiMkt)$sector2emiMkt(sector,emiMkt), sum(entySe2$seAgg2se(seAgg,entySe2), sum(entyFe$(sefe(entySe2,entyFe) AND entyFe2Sector(entyFe,sector)), vm_demFeSector.l(t,regi,entySe2,entyFe,sector,emiMkt))))) ) =
sum((sector,emiMkt)$sector2emiMkt(sector,emiMkt), sum(entyFe$(sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector)), vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt)))
/
sum(seAgg$seAgg2se(seAgg,entySe), sum((sector,emiMkt)$sector2emiMkt(sector,emiMkt), sum(entySe2$seAgg2se(seAgg,entySe2), sum(entyFe$(sefe(entySe2,entyFe) AND entyFe2Sector(entyFe,sector)), vm_demFeSector.l(t,regi,entySe2,entyFe,sector,emiMkt)))));
v_shSeFe.l(t,regi,entySe)$p_shSeFe(t,regi,entySe) = p_shSeFe(t,regi,entySe);

$ifthen.penSeFeSectorShareDevCost not "%cm_seFeSectorShareDevMethod%" == "off"
vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt)$(
( p_shSeFe(t,regi,entySe) ) AND
(t.val ge 2025) AND !!disable share incentives for historical years in buildings, industry and CDR as this should be handled by historical bounds
( entySeBio(entySe) OR entySeSyn(entySe) OR entySeFos(entySe) ) AND !! only redefine vm_demFeSector for entySeBio, entySeSyn and entySeFos items
( sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt) ) AND !!only create the equation for valid cobinations of entySe, entyFe, sector and emiMkt
( (entySeBio(entySe) OR entySeSyn(entySe)) ) AND !!share incentives only need to be applied to n-1 secondary energy carriers
( NOT(sameas(sector,"build") AND (sameas(entyFE,"fesos"))) ) !!disable buildings solids share incentives
) =
sum(entySe2$sefe(entySe2,entyFe), vm_demFeSector.l(t,regi,entySe2,entyFe,sector,emiMkt))
* p_shSeFe(t,regi,entySe);
vm_demFeSector_afterTax.l(t,regi,entySe,entyFe,sector,emiMkt) = vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt);
$endif.penSeFeSectorShareDevCost

p_shSeFeSector(t,regi,entySe,entyFe,sector,emiMkt)$((entySeBio(entySe) OR entySeSyn(entySe) OR entySeFos(entySe)) AND (sefe(entySe,entyFe) AND entyFe2Sector(entyFe,sector) AND sector2emiMkt(sector,emiMkt)) AND sum(entySe2$sefe(entySe2,entyFe), vm_demFeSector.l(t,regi,entySe2,entyFe,sector,emiMkt)) ) =
vm_demFeSector.l(t,regi,entySe,entyFe,sector,emiMkt)
/
sum(entySe2$sefe(entySe2,entyFe), vm_demFeSector.l(t,regi,entySe2,entyFe,sector,emiMkt))
;
v_shSeFeSector.l(t,regi,entySe,entyFe,sector,emiMkt)$p_shSeFeSector(t,regi,entySe,entyFe,sector,emiMkt) = p_shSeFeSector(t,regi,entySe,entyFe,sector,emiMkt);

*** EOF ./core/preloop.gms
Loading

0 comments on commit 18e9c19

Please sign in to comment.