Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions modules/04_PE_FE_parameters/iea2014/declarations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
*** SOF ./modules/04_PE_FE_parameters/iea2014/declarations.gms

parameter
pm_IO_input(all_regi,all_enty,all_enty,all_te) "Energy input based on IEA data"
pm_IO_input(all_regi,all_enty,all_enty,all_te) "Energy input based on IEA data"
p04_IO_output(all_regi,all_enty,all_enty,all_te) "Energy output based on IEA data"
p04_x_enty2te_dyn04(all_regi,all_enty,all_enty,all_te,all_te) "parameter for the allocation of energy flow to technologies"
pm_prodCouple(all_regi,all_enty,all_enty,all_te,all_enty) "own consumption"
pm_prodCouple(all_regi,all_enty,all_enty,all_te,all_enty) "share of couple production. Value 0.2 means 20EJ of couple product for 100EJ of main product; value -0.03 means 3EJ of own consumption for 100EJ of main product."
p04_aux_data(all_regi,char, all_te) "auxiliary parameter to store the initial mix0 and eta values for gas electricity before splitting it to ngcc and ngt (needed as long as calibration routine sets ngt to 0)"
p04_shareNGTinGas(all_regi) "Share of ngt in electricity produced from gas"
pm_fuExtrOwnCons(all_regi, all_enty, all_enty) "energy own consumption in the extraction sector with first enty being the output produced and the second enty being the input required"
Expand All @@ -20,8 +20,8 @@ pm_histfegrowth(all_regi,all_enty) "average growth
p04_prodCoupleGlob(all_enty,all_enty,all_te,all_enty) "global couple products"


p04_IO_output_beforeFix(ttot,all_regi,all_enty,all_enty,all_te) "Energy output based on IEA data as read in from input data before correction from FE trajectories"
p04_IO_output_beforeFix_Total(ttot,all_regi,all_enty) "Energy output based on IEA data as read in from input data before correction from FE trajectories summed over SE"
p04_IO_output_beforeFix(ttot,all_regi,all_enty,all_enty,all_te) "Energy output based on IEA data as read in from input data before correction from FE trajectories"
p04_IO_output_beforeFix_Total(ttot,all_regi,all_enty) "Energy output based on IEA data as read in from input data before correction from FE trajectories summed over SE"
;

*** EOF ./modules/04_PE_FE_parameters/iea2014/declarations.gms
21 changes: 10 additions & 11 deletions modules/80_optimization/nash/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,18 @@
*** | REMIND License Exception, version 1.0 (see LICENSE file).
*** | Contact: [email protected]
*** SOF ./modules/80_optimization/nash/bounds.gms
*override fixing of vm_perm set in 41_emicapregi/none/bounds.gms
*mlb 20150609* allow negative permits to compute efficient solution

if(cm_emiscen = 6, !! budget run
$ifthen.emiopt %emicapregi% == 'none'
if(cm_emiscen eq 6,
vm_perm.lo(t,regi) = -10;
vm_perm.up(t,regi) = 10000;
);
vm_perm.up(t,regi) = 10000; !! override fixing of vm_perm set in 41_emicapregi/none/bounds.gms
vm_perm.lo(t,regi) = -10; !! mlb 20150609: allow negative permits to compute efficient solution
$endif.emiopt

*ML* in nash with permit allocation only total budgets are meaningful; allowing permit trade
*only for the initial policy period avoids indeterminacy, hence numerical problems
loop(ttot$(ttot.val ne cm_startyear),
vm_Xport.fx(ttot,regi,"perm")$(cm_emiscen eq 6) = 0;
vm_Mport.fx(ttot,regi,"perm")$(cm_emiscen eq 6) = 0 ;
*** ML: in nash with permit allocation only total budgets are meaningful;
*** allowing permit trade only for the initial policy period avoids indeterminacy, hence numerical problems
loop(ttot $ (ttot.val ne cm_startyear),
vm_Xport.fx(ttot,regi,"perm") = 0;
vm_Mport.fx(ttot,regi,"perm") = 0;
);
);
*** EOF ./modules/80_optimization/nash/bounds.gms
115 changes: 58 additions & 57 deletions modules/80_optimization/nash/datainput.gms
Original file line number Diff line number Diff line change
Expand Up @@ -5,76 +5,75 @@
*** | REMIND License Exception, version 1.0 (see LICENSE file).
*** | Contact: [email protected]
*** SOF ./modules/80_optimization/nash/datainput.gms
pm_w(regi) = 1;

o80_trackSurplusSign(ttot,trade,iteration)$(NOT tradeSe(trade)) = 0;

*MLB 20130920* initialization only
pm_cumEff(t, regi, in) = 100;
*** Negishi weights, not used in Nash
pm_w(regi) = 1;

*MLB 20140109* initialization of climate externality is sensitive
pm_co2eqForeign(t, regi) = (1 - pm_shPerm(t,regi)) * pm_emicapglob(t);

***convergence mode
if(cm_nash_autoconverge gt 0,

*** set max number of iterations
cm_iteration_max = 100;

if(cm_nash_autoconverge eq 1,
***convergences thresholds - coarse
p80_surplusMaxTolerance(tradePe) = 1.5 * sm_EJ_2_TWa; !! convert EJ/yr into internal unit TWa
p80_surplusMaxTolerance("good") = 100/1000; !! in internal unit, trillion Dollar
p80_surplusMaxTolerance("perm") = 300 * 12/44 / 1000; !! convert MtCO2eq into internal unit GtC
);
if(cm_nash_autoconverge eq 2,
***convergences thresholds - fine
p80_surplusMaxTolerance(tradePe) = 0.3 * sm_EJ_2_TWa; !! convert EJ/yr into internal unit TWa
p80_surplusMaxTolerance("good") = 20/1000; !! in internal unit, trillion Dollar
p80_surplusMaxTolerance("perm") = 70 * 12/44 / 1000 ; !! convert MtCO2eq into internal unit GtC
);
if(cm_nash_autoconverge eq 3,
***convergences thresholds - very coarse
p80_surplusMaxTolerance(tradePe) = 2* 1.5 * sm_EJ_2_TWa; !! convert EJ/yr into internal unit TWa
p80_surplusMaxTolerance("good") = 2* 100/1000; !! in internal unit, trillion Dollar
p80_surplusMaxTolerance("perm") = 2* 300 * 12/44 / 1000; !! convert MtCO2eq into internal unit GtC
);
*** convergence with trade surplus thresholds
if(cm_nash_autoconverge > 0,
cm_iteration_max = 100; !! set max number of iterations

*** default values for cm_nash_autoconverge = 1 - coarse
p80_surplusMaxTolerance(tradePe) = 1.5 * sm_EJ_2_TWa; !! 1.5 EJ/yr, converted into internal unit TWa
p80_surplusMaxTolerance("good") = 0.1; !! 0.1 trillion Dollar
p80_surplusMaxTolerance("perm") = 350 * 12/44 / 1000; !! 350 MtCO2eq, converted into internal unit GtC

loop(trade $ (tradePe(trade) or tradeMacro(trade)),
*** convergences thresholds - fine
p80_surplusMaxTolerance(trade) $ (cm_nash_autoconverge = 2) = 0.2 * p80_surplusMaxTolerance(trade);
*** convergences thresholds - very coarse
p80_surplusMaxTolerance(trade) $ (cm_nash_autoconverge = 3) = 2 * p80_surplusMaxTolerance(trade);
);
);


*Nash adjustment costs. Involves a trade-off: If set too low, markets jump far away from clearance. Set too high, changes in trade patten over iterations are very slow, convergence takes many many iterations. Default value around 150
*** --------------- Technical parameters for Nash price algorithm ---------------

*** Nash adjustment costs (default value around 150).
*** Multiplicator to penalise trade patterns deviations from the last iteration. Involves a trade-off:
*** - if too low, markets jump far away from clearance.
*** - if too high, changes in trade patten over iterations are very slow, convergence takes many many iterations.
p80_etaAdj(tradePe) = 80;
p80_etaAdj("good") = 100;
p80_etaAdj("perm") = 10;

*LB* parameter for nash price algorithm within the optimization.
*** LB: parameter for nash price algorithm within the optimization.
*** Multiplicator to price anticipation
p80_etaXp(tradePe) = 0.1;
p80_etaXp("good") = 0.1;
p80_etaXp("perm") = 0.2;

*LB* parameter for Nash price algorithm between different iterations
p80_etaLT(trade) = 0;
p80_etaLT("perm") = 0.03;

***These parameters are pretty sensitive. If market surpluses diverge, try higher values (up to 1). If surpluses oscillate, try lower values.
*** LB: parameter for Nash price algorithm between different iterations. These parameters are pretty sensitive:
*** - if market surpluses diverge, try higher values (up to 1).
*** - if surpluses oscillate, try lower values.

*** short term price ajustment elasticity
p80_etaST(tradePe) = 0.3;
p80_etaST("pebiolc") = 0.8; !! AJS: bio market seems to like this
p80_etaST("peur") = 0.2; !! uranium market is more sensitive, so choose lower etaST
p80_etaST("good") = 0.25;
p80_etaST("perm") = 0.3;
$ifi %banking% == "banking" p80_etaST("perm") = 0.2; !! in banking mode, the permit market reacts more sensitively.
$ifi %emicapregi% == "budget" p80_etaST("perm") = 0.25; !! in budget mode, the permit market reacts more sensitively.

$ifi %banking% == "banking" p80_etaST("perm") = 0.2; !! in banking mode, the permit market reacts more sensitively.
$ifi %emicapregi% == "budget" p80_etaST("perm") = 0.25; !! in budget mode, the permit market reacts more sensitively.
*** long term price ajustment elasticity
p80_etaLT(trade) = 0;
p80_etaLT("perm") = 0.03;

*AJS* bio market seems to like this:
p80_etaST("pebiolc") = 0.8;
***peur market is more sensitive, so choose lower etaST
p80_etaST("peur") = 0.2;

*** --------------- Initialise convergence process parameters ---------------
s80_converged = 0;

***initialize some convergence process parameters
s80_fadeoutPriceAnticipStartingPeriod = 0;
sm_fadeoutPriceAnticip = 1;
*AJS*technical stuff. We want GAMS to import values for the following variables/parameters from the gdx, it would not do that unless you set them a (any) value beforehand.

*** parameter for spillover externality (aggregated productivity level)
pm_cumEff(t, regi, in) = 100;

*** auxiliary parameter to track how long the surplus for an item (ttot, trade) had the same sign over iterations
o80_trackSurplusSign(ttot,trade,iteration) $ (not tradeSe(trade)) = 0;

*** AJS: need to set (any) values for the following variables/parameters so that GAMS imports them from the gdx
pm_pvp(ttot,trade)$(ttot.val ge 2005) = NA;
p80_pvpFallback(ttot,trade)$(ttot.val ge 2005) = NA;
pm_Xport0(ttot,regi,trade)$(ttot.val ge 2005) = NA;
Expand All @@ -95,21 +94,23 @@ pm_capCumForeign(ttot,regi,teLearn)$(ttot.val ge 2005)=0;
qm_co2eqCum.m(regi) = 0;
q80_budgetPermRestr.m(regi) = 0;

***read in price paths as fallback option
***p80_pvpFallback(ttot,trade) = 0;
*** read in price paths as fallback option
*** p80_pvpFallback(ttot,trade) = 0;
$include "./modules/80_optimization/nash/input/prices_NASH.inc";

***EMIOPT------------------------------------------------------------------------------
if ( cm_emiscen eq 6,
*** --------------- Emissions initialisation ---------------
*** emissions, which are part of the climate policy, of other regions (nash relevant)
*** MLB 20140109: initialisation of climate externality is sensitive
pm_co2eqForeign(t, regi) = (1 - pm_shPerm(t,regi)) * pm_emicapglob(t); !! (1 - emission permit shares) * global emission cap

$ifthen.emiopt %emicapregi% == "none"
*AJS* initialize
if (cm_emiscen = 6, !! budget
p80_eoMargEmiCum(regi) = 0;
p80_eoMargPermBudg(regi) = 0;
*** ML 20150609 * initialization of permit budget shares (emiopt version, no permit trade)
*** convergence sensitive to initial allocation
*** ML 20161808 * If you change pm_shPerm, ensure that sum(regi, pm_shPerm) = 1; otherwise, a mismatch between global
*** ML 20150609: initialisation of permit budget shares (emiopt version, no permit trade), convergence sensitive to initial allocation
*** ML 20161808: If you change pm_shPerm, ensure that sum(regi, pm_shPerm) = 1; otherwise, a mismatch between global
*** and regional budgets will likely disturb results in runs with iterative adjustment
pm_shPerm("2050",regi) = pm_pop("2050",regi)/ sum(regi2, pm_pop("2050",regi2) );
$endif.emiopt
pm_shPerm("2050",regi) = pm_pop("2050",regi) / sum(regi2, pm_pop("2050",regi2));
);
$endif.emiopt
*** EOF ./modules/80_optimization/nash/datainput.gms
Loading