Skip to content

Commit

Permalink
Merge pull request #1150 from Renato-Rodrigues/cm_flex_tax
Browse files Browse the repository at this point in the history
potential fix to cm_flex_tax bug
  • Loading branch information
Renato-Rodrigues authored Jan 12, 2023
2 parents 0d1328f + e767f0e commit dea5353
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 18 deletions.
2 changes: 1 addition & 1 deletion modules/32_power/DTcoup/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ q32_flexPriceBalance(t,regi)$(cm_FlexTaxFeedback eq 1)..
q32_flexAdj(t,regi,te)$(teFlexTax(te))..
vm_flexAdj(t,regi,te)
=e=
(1-v32_flexPriceShare(t,regi,te)) * pm_SEPrice(t,regi,"seel")$(cm_flex_tax eq 1 AND t.val ge 2025)
(1-v32_flexPriceShare(t,regi,te)) * pm_SEPrice(t,regi,"seel")$((cm_flex_tax eq 1) AND (t.val ge 2025) and (pm_SEPrice(t,regi,"seel") gt 0))
;

*** EOF ./modules/32_power/DTcoup/equations.gms
2 changes: 1 addition & 1 deletion modules/32_power/IntC/equations.gms
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ q32_flexPriceBalance(t,regi)$(cm_FlexTaxFeedback eq 1)..
q32_flexAdj(t,regi,te)$(teFlexTax(te))..
vm_flexAdj(t,regi,te)
=e=
(1-v32_flexPriceShare(t,regi,te)) * pm_SEPrice(t,regi,"seel")$(cm_flex_tax eq 1 AND t.val ge 2025)
(1-v32_flexPriceShare(t,regi,te)) * pm_SEPrice(t,regi,"seel")$((cm_flex_tax eq 1) AND (t.val ge 2025) and (pm_SEPrice(t,regi,"seel") gt 0))
;

*** EOF ./modules/32_power/IntC/equations.gms
16 changes: 0 additions & 16 deletions modules/32_power/IntC/presolve.gms
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,10 @@
*** | Contact: [email protected]
*** SOF ./modules/32_power/IntC/presolve.gms


*** calculation of SE electricity price (useful for internal use and reporting purposes)
pm_SEPrice(t,regi,entySE)$( abs(qm_budget.m(t,regi)) gt sm_eps
AND sameas(entySE,"seel") )
= q32_balSe.m(t,regi,entySE)
/ qm_budget.m(t,regi);

if (cm_flex_tax eq 1,
if (smin((t,regi)$( t.val ge 2025 ), pm_SEprice(t,regi,"seel")) lt 0,
put logfile,
"Negative seel prices with the potential to crash q32_flexAdj:" /;
loop ((t,regi)$( pm_SEprice(t,regi,"seel") lt 0 AND t.val ge 2025 ),
put pm_SEprice.tn(t,regi,"seel"), " = ", pm_SEprice(t,regi,"seel") /;
);

putclose " ", logfile /;

execute_unload "abort.gdx";
abort "negative seel prices that could crash q32_flexAdj";
);
);

*** EOF ./modules/32_power/IntC/presolve.gms

0 comments on commit dea5353

Please sign in to comment.