Skip to content

Commit

Permalink
Merge pull request #1774 from laurinks/expoLinear-bugfix
Browse files Browse the repository at this point in the history
bug fix in 45_carbonprice realization expoLinear
  • Loading branch information
laurinks authored Aug 8, 2024
2 parents 70554eb + 595d9a4 commit 5a7e479
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
15 changes: 8 additions & 7 deletions modules/45_carbonprice/expoLinear/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ elseif cm_co2_tax_startyear gt 0,
s45_co2_tax_startyear = cm_co2_tax_startyear * sm_DptCO2_2_TDpGtC;
);

*LKS* code cleaning: usage of ttot should be replaced by t.
*LB* calculate tax path until cm_expoLinear_yearStart (defaults to 2060)
pm_taxCO2eq(ttot,regi)$(ttot.val ge cm_startyear) = s45_co2_tax_startyear*cm_co2_tax_growth**(ttot.val-cm_startyear);
*LB* use linear tax path from cm_expoLinear_yearStart on
p45_tau_co2_tax_inc(regi) = sum(ttot$(ttot.val eq cm_expoLinear_yearStart),((pm_taxCO2eq(ttot, regi) - pm_taxCO2eq(ttot - 1, regi)) / (pm_ttot_val(ttot) - pm_ttot_val(ttot - 1))));
pm_taxCO2eq(ttot,regi)$(ttot.val gt cm_expoLinear_yearStart) = sum(t$(t.val eq cm_expoLinear_yearStart), pm_taxCO2eq(t, regi) + p45_tau_co2_tax_inc(regi) * (pm_ttot_val(ttot) - pm_ttot_val(t))) ;
*** calculate tax path until cm_expoLinear_yearStart (defaults to 2060)
pm_taxCO2eq(t,regi) = s45_co2_tax_startyear*cm_co2_tax_growth**(t.val-cm_startyear);
*** use linear tax path from cm_expoLinear_yearStart on (with slope given by last timestep before cm_expoLinear_yearStart)
p45_tau_co2_tax_inc(regi) = sum(ttot$(ttot.val eq cm_expoLinear_yearStart),
((pm_taxCO2eq(ttot, regi) - pm_taxCO2eq(ttot - 1, regi)) / (pm_ttot_val(ttot) - pm_ttot_val(ttot - 1)))); !! Using ttot to make use of pm_ttot_val
pm_taxCO2eq(t,regi)$(t.val gt cm_expoLinear_yearStart) = sum(t2$(t2.val eq cm_expoLinear_yearStart), pm_taxCO2eq(t2, regi))
+ p45_tau_co2_tax_inc(regi) * (t.val - cm_expoLinear_yearStart);
*** set carbon price constant after 2110 to prevent huge carbon prices which lead to convergence problems
pm_taxCO2eq(ttot,regi)$(ttot.val gt 2110) = pm_taxCO2eq("2110",regi);
pm_taxCO2eq(t,regi)$(t.val gt 2110) = pm_taxCO2eq("2110",regi);

display pm_taxCO2eq;
display p45_tau_co2_tax_inc;
Expand Down
8 changes: 5 additions & 3 deletions modules/45_carbonprice/expoLinear/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
*** | Contact: [email protected]
*** SOF ./modules/45_carbonprice/expoLinear/declarations.gms

scalars
s45_tau_co2_tax_inc "Linear annual increase in carbon price T$/GtC/yr"
s45_co2_tax_startyear "level of CO2 tax in start year converted from $/t CO2eq to T$/GtC"
scalar
s45_co2_tax_startyear "level of CO2 tax in start year in T$/GtC"
;
parameter
p45_tau_co2_tax_inc(all_regi) "Linear annual increase in carbon price T$/GtC/yr"
;

*** EOF ./modules/45_carbonprice/expoLinear/declarations.gms

0 comments on commit 5a7e479

Please sign in to comment.