Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make sure lower bound on vm_cesIO is at least the offset_quantity, to prevent negative net energy consumption #1404

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
3 changes: 2 additions & 1 deletion modules/01_macro/singleSectorGr/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

*nb* lower bounds on CES values
vm_cons.lo(t,regi) = 1e-3;
vm_cesIO.lo(t,regi,in)$( NOT in_industry_dyn37(in) ) = 1e-6;
vm_cesIO.lo(t,regi,in)$( NOT in_industry_dyn37(in) )
= max(1e-6, abs(pm_cesdata(t,regi,in,"offset_quantity")));
vm_cesIOdelta.lo(t,regi,in_putty) = 1e-6;

*** fix energy inputs to CES structure in t0 to the parameter values
Expand Down
10 changes: 7 additions & 3 deletions modules/29_CES_parameters/calibrate/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ if (smax((t,regi_dyn29(regi),ipf)$( t.val gt 2005
sm_tmp = 5; !! last iteration with bounds on industry
loop (pf_industry_relaxed_bounds_dyn37(in),
vm_cesIO.lo(t_29(t),regi_dyn29(regi),in)
= pm_cesdata(t,regi,in,"quantity")
!! goes from 0.95 to 1e-12 in -0.2 steps
* max(1e-12, 0.95 + min(0, (1 - sm_CES_calibration_iteration) / sm_tmp));
= max(
( pm_cesdata(t,regi,in,"quantity")
!! goes from 0.95 to 1e-12 in -0.2 steps
* max(1e-12, 0.95 + min(0, (1 - sm_CES_calibration_iteration) / sm_tmp))
),
abs(pm_cesdata(t,regi,in,"offset_quantity"))
);

vm_cesIO.up(t,regi_dyn29(regi),in)
= ( pm_cesdata(t,regi,in,"quantity")
Expand Down
8 changes: 7 additions & 1 deletion modules/36_buildings/services_putty/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ vm_enerSerAdj.fx("2005",regi,in) = 0;

if ((cm_noReboundEffect eq 1 ), !! Fix the upper bound of vm_cesIO to the level of input_ref if no rebound is allowed
vm_cesIO.up(t,regi,in)$(sameAs(in,"esswb") OR sameAs(in,"uealb") OR sameAs(in,"uecwb")) = (1 + 1e-14) * p36_cesIONoRebound(t,regi,in);
vm_cesIO.lo(t,regi,in)$(sameAs(in,"esswb") OR sameAs(in,"uealb") OR sameAs(in,"uecwb")) = (1 - 1e-14) * p36_cesIONoRebound(t,regi,in);
vm_cesIO.lo(t,regi,in)$( sameAs(in,"esswb")
OR sameAs(in,"uealb")
OR sameAs(in,"uecwb") )
= max(
(1 - 1e-14) * p36_cesIONoRebound(t,regi,in),
abs(pm_cesdata(t,regi,in,"offset_quantity"))
);
vm_cesIOdelta.up(t,regi,in)$(sameAs(in,"esswb") OR sameAs(in,"uealb") OR sameAs(in,"uecwb")) = (1 + 1e-14) * p36_cesIONoRebound_putty(t,regi,in);
vm_cesIOdelta.lo(t,regi,in)$(sameAs(in,"esswb") OR sameAs(in,"uealb") OR sameAs(in,"uecwb")) = (1 - 1e-14) * p36_cesIONoRebound_putty(t,regi,in);
);
Expand Down
10 changes: 8 additions & 2 deletions modules/36_buildings/services_with_capital/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@
*** | Contact: [email protected]
*** SOF ./modules/36_buildings/services_with_capital/bounds.gms
if ((cm_noReboundEffect eq 1 ), !! Fix the upper bound of vm_cesIO to the level of input_ref if no rebound is allowed
vm_cesIO.up(t,regi,in)$(sameAs(in,"esswb") OR sameAs(in,"uealb") OR sameAs(in,"uecwb")) = (1 + 1e-14) * p36_cesIONoRebound(t,regi,in);
vm_cesIO.lo(t,regi,in)$(sameAs(in,"esswb") OR sameAs(in,"uealb") OR sameAs(in,"uecwb")) = (1 - 1e-14) * p36_cesIONoRebound(t,regi,in);
vm_cesIO.up(t,regi,in)$(sameAs(in,"esswb") OR sameAs(in,"uealb") OR sameAs(in,"uecwb")) = (1 + 1e-14) * p36_cesIONoRebound(t,regi,in);
vm_cesIO.lo(t,regi,in)$( sameAs(in,"esswb")
OR sameAs(in,"uealb")
OR sameAs(in,"uecwb") )
= max(
(1 - 1e-14) * p36_cesIONoRebound(t,regi,in),
abs(pm_cesdata(t,regi,in,"offset_quantity"))
);
);


Expand Down
3 changes: 2 additions & 1 deletion modules/37_industry/fixed_shares/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ loop ((secInd37,enty)$( NOT macBaseInd37(enty,secInd37) ),
vm_macBaseInd.fx(ttot,regi,enty,secInd37)$( ttot.val ge 2005 ) = 0;
);

vm_cesIO.lo(t,regi,in_industry_dyn37(in)) = 1e-6;
vm_cesIO.lo(t,regi,in_industry_dyn37(in))
= max(1e-6, abs(pm_cesdata(t,regi,in,"offset_quantity")));

*** Upper bound for exponent to avoid exponential gams overflow (if > 20 -> 3^20 > 1e10 what would cause GAMS to get an overflow x**y error)
v37_costExponent.up(t,regi) = 20;
Expand Down
10 changes: 7 additions & 3 deletions modules/37_industry/subsectors/bounds.gms
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ $endif.secondary_steel_bound
$endif.CES_parameters

vm_cesIO.fx("2005",regi,ppfkap_industry_dyn37(in))
= pm_cesdata("2005",regi,in,"quantity");
= max(
pm_cesdata("2005",regi,in,"quantity"),
abS(pm_cesdata("2005",regi,in,"offset_quantity"))
);

*** Set lower bound for secondary steel electricity to 1 % of the lowest
*** existing lower bound (should be far above sm_eps) to avoid CONOPT getting
Expand All @@ -101,14 +104,15 @@ loop (in$( sameas(in,"feel_steel_secondary") ),
* smax(ttot$( vm_cesIO.lo(ttot,regi,in) gt sm_eps),
vm_cesIO.lo(ttot,regi,in)
)
)
),
abs(pm_cesdata(t,regi,in,"offset_quantity"))
);
);

*** Default lower bounds on all industry pfs
vm_cesIO.lo(t,regi_dyn29(regi),in_industry_dyn37(in))$(
0 eq vm_cesIO.lo(t,regi,in) )
= sm_eps;
= max(sm_eps, abs(pm_cesdata(t,regi,in,"offset_quantity")));

*' Limit biomass solids use in industry to 25% (or historic shares, if they are higher)
*' of baseline solids
Expand Down
Loading