Skip to content
Merged
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
26 changes: 26 additions & 0 deletions main.gms
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,16 @@ parameter
;
cm_implicitQttyTarget_tolerance = 0.01; !! def = 0.01, i.e. regipol implicit quantity targets must be met within 1% of target deviation
*'
parameter
cm_implicitPriceTarget_tolerance "tolerance for regipol implicit FE price target deviations convergence."
;
cm_implicitPriceTarget_tolerance = 0.05; !! def = 0.05, i.e. regipol implicit FE price targets must be met within 5% of price deviation
*'
parameter
cm_implicitPePriceTarget_tolerance "tolerance for regipol implicit PE price target deviations convergence."
;
cm_implicitPePriceTarget_tolerance = 0.05; !! def = 0.05, i.e. regipol implicit PE price targets must be met within 5% of price deviation
*'
parameter
cm_emiMktTargetDelay "number of years for delayed price change in the emission tax convergence algorithm. Not applied to first target set."
;
Expand Down Expand Up @@ -1233,11 +1243,27 @@ parameter
*' * 0 (off)
*' * 1 (on), default
*'
parameter
cm_TaxConv_tolerance "tolerance for the nash tax convergence check: maximum absolute net tax revenue relative to GDP."
;
cm_TaxConv_tolerance = 0.001; !! def = 0.001, i.e. absolute net tax revenue must be smaller than 0.1% of GDP in all regions and periods
*' maximum allowed absolute value of net tax revenue as a share of GDP for the tax convergence check (cm_TaxConvCheck)
*'
parameter
cm_maxFadeOutPriceAnticip "switch to determine maximum allowed fadeout price anticipation to consider that the model converged."
;
cm_maxFadeOutPriceAnticip = 1e-4; !! def = 1e-4, the fadeout price anticipation term needs to be lower than 1e-4 to consider that the model converged.
*'
parameter
cm_nashObjVal_tolerance "nash convergence tolerance: maximum accepted decrease of a region's objective value relative to its last optimal solution (only for modelstat 7 iterations)."
;
cm_nashObjVal_tolerance = 1e-4; !! def = 1e-4, rather arbitrary; objective value decreases smaller than this are accepted as if the solution were optimal
*'
parameter
cm_DevPriceAnticip_tolFactor "nash convergence: price-anticipation deviation tolerance expressed as a fraction of the goods surplus tolerance p80_surplusMaxTolerance('good')."
;
cm_DevPriceAnticip_tolFactor = 0.1; !! def = 0.1, i.e. price-anticipation deviations until 2100 must be below 10% of the goods imbalance threshold
*'
parameter
cm_flex_tax "switch for enabling flexibility tax"
;
Expand Down
2 changes: 2 additions & 0 deletions modules/47_regipol/none/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,5 @@ vm_demFeNonEnergySector,input,added by codeCheck
sm_MtCO2_2_GtC,input,not needed
pm_emiLULUCF_GrassiShift,input,not needed
vm_co2CCS,input,not needed
cm_implicitPriceTarget_tolerance,input,not needed
cm_implicitPePriceTarget_tolerance,input,not needed
8 changes: 4 additions & 4 deletions modules/47_regipol/regiCarbonPrice/postsolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ $ifthen.cm_implicitPriceTarget not "%cm_implicitPriceTarget%" == "off"

*** updating implicit price target tax for next iteration (iteration+1)
loop((t,regi,entyFe,entySe,sector)$pm_implicitPriceTarget(t,regi,entyFe,entySe,sector),
if((abs(p47_implicitPrice_dev(t,regi,entyFe,entySe,sector)) gt 0.05), !! convergence criteria not reached
if((abs(p47_implicitPrice_dev(t,regi,entyFe,entySe,sector)) gt cm_implicitPriceTarget_tolerance), !! convergence criteria not reached
if((pm_FEPrice_by_SE_Sector(t,regi,entySe,entyFe,sector) lt 1e-5), !! repeat tax if there is no price
p47_implicitPriceTax(t,regi,entyFe,entySe,sector) = p47_implicitPriceTax(t,regi,entyFe,entySe,sector);
else
Expand All @@ -830,7 +830,7 @@ $ifthen.cm_implicitPriceTarget not "%cm_implicitPriceTarget%" == "off"

*** convergence criteria
pm_implicitPrice_NotConv(regi,sector,entyFe,entySe,t) = 0;
pm_implicitPrice_NotConv(regi,sector,entyFe,entySe,t)$(abs(p47_implicitPrice_dev(t,regi,entyFe,entySe,sector)) gt 0.05) = p47_implicitPrice_dev(t,regi,entyFe,entySe,sector); !! target did not converged = prices deviate more than 5% from target
pm_implicitPrice_NotConv(regi,sector,entyFe,entySe,t)$(abs(p47_implicitPrice_dev(t,regi,entyFe,entySe,sector)) gt cm_implicitPriceTarget_tolerance) = p47_implicitPrice_dev(t,regi,entyFe,entySe,sector); !! target did not converged = prices deviate more than the tolerance from target
*** additional convergence checks:
*** ignoring non existent prices from price convergence check
pm_implicitPrice_ignConv(regi,sector,entyFe,entySe,t)$((pm_implicitPrice_NotConv(regi,sector,entyFe,entySe,t)) AND (pm_FEPrice_by_SE_Sector(t,regi,entySe,entyFe,sector) lt 1e-5)) = 1; !!1 = non existent price
Expand Down Expand Up @@ -888,7 +888,7 @@ $ifthen.cm_implicitPePriceTarget not "%cm_implicitPePriceTarget%" == "off"

*** updating implicit price target tax for next iteration (iteration+1)
loop((t,regi,entyPe)$pm_implicitPePriceTarget(t,regi,entyPe),
if((abs(p47_implicitPePrice_dev(t,regi,entyPe)) gt 0.05), !! convergence criteria not reached
if((abs(p47_implicitPePrice_dev(t,regi,entyPe)) gt cm_implicitPePriceTarget_tolerance), !! convergence criteria not reached
if((pm_PEPrice(t,regi,entyPe) lt 1e-5), !! repeat tax if there is no price
p47_implicitPePriceTax(t,regi,entyPe) = p47_implicitPePriceTax(t,regi,entyPe);
else
Expand All @@ -901,7 +901,7 @@ $ifthen.cm_implicitPePriceTarget not "%cm_implicitPePriceTarget%" == "off"

*** convergence criteria
pm_implicitPePrice_NotConv(regi,entyPe,t) = 0;
pm_implicitPePrice_NotConv(regi,entyPe,t)$(abs(p47_implicitPePrice_dev(t,regi,entyPe)) gt 0.05) = p47_implicitPePrice_dev(t,regi,entyPe); !! target did not converged = prices deviate more than 5% from target
pm_implicitPePrice_NotConv(regi,entyPe,t)$(abs(p47_implicitPePrice_dev(t,regi,entyPe)) gt cm_implicitPePriceTarget_tolerance) = p47_implicitPePrice_dev(t,regi,entyPe); !! target did not converged = prices deviate more than the tolerance from target
*** additional convergence checks:
*** ignoring non existent prices from price convergence check
pm_implicitPePrice_ignConv(regi,entyPe,t)$((pm_implicitPePrice_NotConv(regi,entyPe,t)) AND (pm_PEPrice(t,regi,entyPe) lt 1e-5)) = 1; !!1 = non existent price
Expand Down
12 changes: 6 additions & 6 deletions modules/80_optimization/nash/postsolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ loop(regi,
!! no last iteration if this is the first; NA value in p80_repyLastOptim is
!! sticky, so test this separately
if ( p80_repy(regi,'modelstat') eq 7
!! The 1E-4 are quite arbitrary. One should do more research on how
!! the solution differs over iteration when status 7 occurs.
AND p80_convNashObjVal_iter(iteration,regi) lt - 1e-4,
!! cm_nashObjVal_tolerance (def 1e-4) is rather arbitrary. One should do more
!! research on how the solution differs over iteration when status 7 occurs.
AND p80_convNashObjVal_iter(iteration,regi) lt - cm_nashObjVal_tolerance,
s80_bool = 0;
p80_messageShow("nonopt") = YES;
display "Not all regions were status 2 in the last iteration. The deviation of the objective function from the last optimal solution is too large to be accepted:";
Expand All @@ -324,7 +324,7 @@ if(sm_fadeoutPriceAnticip gt cm_maxFadeOutPriceAnticip,

*' criterion "Deviation due to price anticipation": are the resulting deviations sufficiently small?
*' compare to 1/10th of the cutoff for goods imbalance
if(p80_DevPriceAnticipGlobAllMax2100Iter(iteration) gt 0.1 * p80_surplusMaxTolerance("good"),
if(p80_DevPriceAnticipGlobAllMax2100Iter(iteration) gt cm_DevPriceAnticip_tolFactor * p80_surplusMaxTolerance("good"),
s80_bool=0;
p80_messageShow("DevPriceAnticip") = YES;
);
Expand All @@ -341,15 +341,15 @@ loop(regi,
loop(t,
p80_convNashTaxrev_iter(iteration,t,regi) = vm_taxrev.l(t,regi) / vm_cesIO.l(t,regi,"inco");
if (cm_TaxConvCheck eq 1,
if( abs(p80_convNashTaxrev_iter(iteration,t,regi)) gt 0.001,
if( abs(p80_convNashTaxrev_iter(iteration,t,regi)) gt cm_TaxConv_tolerance,
s80_bool = 0;
p80_messageShow("taxconv") = YES;
);
);
);
);

*** additional criterion: Were regional climate targets reached?
*** additional criterion: Were regional climate targets reached?
$ifthen.emiMkt not "%cm_emiMktTarget%" == "off"
loop((ttot,ttot2,ext_regi,emiMktExt)$pm_emiMktTarget_dev(ttot,ttot2,ext_regi,emiMktExt),
if(NOT(pm_allTargetsConverged(ext_regi) eq 1),
Expand Down
5 changes: 4 additions & 1 deletion modules/80_optimization/negishi/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,7 @@ pm_regionalBudget_absDevTol,input,added by codeCheck
sm_magpieIter,switch,not needed
sm_magpieIterEnd,switch,not needed
cm_MAgPIE_Nash,switch,not needed
pm_taxCO2eq, parameter, not needed
pm_taxCO2eq,parameter,not needed
cm_TaxConv_tolerance,input,not needed
cm_nashObjVal_tolerance,input,not needed
cm_DevPriceAnticip_tolFactor,input,not needed
3 changes: 3 additions & 0 deletions modules/80_optimization/testOneRegi/not_used.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,6 @@ pm_regionalBudget_absDevTol, input,added by codeCheck
sm_magpieIter,switch,not needed
sm_magpieIterEnd,switch,not needed
cm_MAgPIE_Nash,switch,not needed
cm_TaxConv_tolerance,input,not needed
cm_nashObjVal_tolerance,input,not needed
cm_DevPriceAnticip_tolFactor,input,not needed
Loading