diff --git a/core/declarations.gms b/core/declarations.gms index ff9472f5552d52d613a501fbb482647a593493f5..46911c459a9e0d560f7a987700f02439f02a6e81 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -302,7 +302,6 @@ vm_prodFe(ttot,all_regi,all_enty,all_enty,all_te) "fe production. [TWa]" v_costFu(ttot,all_regi) "fuel costs" vm_costFuEx(ttot,all_regi,all_enty) "fuel costs from exhaustible energy [tril$US]" vm_pebiolc_price(ttot,all_regi) "bioenergy price according to MAgPIE supply curves" -vm_pebiolc_price_shifted(ttot,all_regi) "bioenergy price according to shifted MAgPIE supply curves, required only for calculation of the bioenergy tax" v_costOM(ttot,all_regi) "o&m costs" v_costInv(ttot,all_regi) "investment costs" diff --git a/core/preloop.gms b/core/preloop.gms index 49bf48ecd4923ecb85d237ba05e58fa12d513baf..32b254d8dafe2d0b4e7337925db86ec1b656a49d 100644 --- a/core/preloop.gms +++ b/core/preloop.gms @@ -70,7 +70,6 @@ vm_capDistr.l(t,regi,te,rlf) = 0; vm_cap.l(t,regi,te,rlf) = 0; vm_fuExtr.l(ttot,regi,"pebiolc","1")$(ttot.val ge 2005) = 0; vm_pebiolc_price.l(ttot,regi)$(ttot.val ge 2005) = 0; -vm_pebiolc_price_shifted.l(ttot,regi)$(ttot.val ge 2005) = 0; *** overwrite default targets with gdx values if wanted Execute_Loadpoint 'input' p_emi_budget1_gdx = sm_budgetCO2eqGlob; diff --git a/modules/21_tax/on/equations.gms b/modules/21_tax/on/equations.gms index 5baf7adc3c6de62c15f952addf8e5b322036da18..d56a841a3bde8371398336e55c542c73a082547d 100644 --- a/modules/21_tax/on/equations.gms +++ b/modules/21_tax/on/equations.gms @@ -163,7 +163,7 @@ v21_taxrevSO2(t,regi) =g= p21_tau_so2_tax(t,regi) * vm_emiTe(t,regi,"so2") *' Documentation of overall tax approach is above at q21_taxrev. ***--------------------------------------------------------------------------- q21_taxrevBio(t,regi)$(t.val ge max(2010,cm_startyear)).. -v21_taxrevBio(t,regi) =g= v21_tau_bio(t) * vm_fuExtr(t,regi,"pebiolc","1") * vm_pebiolc_price_shifted(t,regi) +v21_taxrevBio(t,regi) =g= v21_tau_bio(t) * vm_fuExtr(t,regi,"pebiolc","1") * vm_pebiolc_price(t,regi) - p21_taxrevBio0(t,regi); ***--------------------------------------------------------------------------- diff --git a/modules/21_tax/on/postsolve.gms b/modules/21_tax/on/postsolve.gms index 6b31e9da6bdf1c8633a2c9d7dfbe0e5243d9ef82..75f2c5f720fc462f8eb59729e289c88100989ce1 100644 --- a/modules/21_tax/on/postsolve.gms +++ b/modules/21_tax/on/postsolve.gms @@ -39,7 +39,7 @@ p21_taxrevPE2SE0(ttot,regi) = SUM(pe2se(enty,enty2,te), ); p21_taxrevXport0(ttot,regi) = SUM(tradePe(enty), p21_tau_XpRes_tax(ttot,regi,enty) * vm_Xport.l(ttot,regi,enty)); p21_taxrevSO20(ttot,regi) = p21_tau_so2_tax(ttot,regi) * vm_emiTe.l(ttot,regi,"so2"); -p21_taxrevBio0(ttot,regi) = v21_tau_bio.l(ttot) * vm_fuExtr.l(ttot,regi,"pebiolc","1") * vm_pebiolc_price_shifted.l(ttot,regi); +p21_taxrevBio0(ttot,regi) = v21_tau_bio.l(ttot) * vm_fuExtr.l(ttot,regi,"pebiolc","1") * vm_pebiolc_price.l(ttot,regi); p21_implicitDiscRate0(ttot,regi) = sum(ppfKap(in), p21_implicitDiscRateMarg(ttot,regi,in) * vm_cesIO.l(ttot,regi,in) ); ***DK: for reporting only p21_tau_bioenergy_tax(t) = v21_tau_bio.l(t); diff --git a/modules/21_tax/on/presolve.gms b/modules/21_tax/on/presolve.gms index 40ec9210b3c1d8f4e5fdd8f16367cb5a2d16be79..9d3df36c77bc2a0948ec33bfb37b0f57b4035196 100644 --- a/modules/21_tax/on/presolve.gms +++ b/modules/21_tax/on/presolve.gms @@ -40,7 +40,7 @@ p21_taxrevPE2SE0(ttot,regi) = SUM(pe2se(enty,enty2,te), ); p21_taxrevXport0(ttot,regi) = SUM(tradePe(enty), p21_tau_XpRes_tax(ttot,regi,enty) * vm_Xport.l(ttot,regi,enty)); p21_taxrevSO20(ttot,regi) = p21_tau_so2_tax(ttot,regi) * vm_emiTe.l(ttot,regi,"so2"); -p21_taxrevBio0(ttot,regi) = v21_tau_bio.l(ttot) * vm_fuExtr.l(ttot,regi,"pebiolc","1")*vm_pebiolc_price_shifted.l(ttot,regi); +p21_taxrevBio0(ttot,regi) = v21_tau_bio.l(ttot) * vm_fuExtr.l(ttot,regi,"pebiolc","1")*vm_pebiolc_price.l(ttot,regi); p21_implicitDiscRate0(ttot,regi) = sum(ppfKap(in), p21_implicitDiscRateMarg(ttot,regi,in) * vm_cesIO.l(ttot,regi,in) ); *** EOF ./modules/21_tax/on/presolve.gms diff --git a/modules/30_biomass/magpie_40/declarations.gms b/modules/30_biomass/magpie_40/declarations.gms index 1784e83a2695d3da7049a0cfc336b411f80e0a97..ac44c9ca426291994943a62a959e7cfb0ec2bfe0 100644 --- a/modules/30_biomass/magpie_40/declarations.gms +++ b/modules/30_biomass/magpie_40/declarations.gms @@ -58,7 +58,6 @@ v30_multcost(ttot,all_regi) "cost markup factor for deviations from deman equations q30_costFuBio(ttot,all_regi) "total costs of bioenergy production" q30_pebiolc_price(ttot,all_regi) "MAgPIE emulator: calculates the price of pebiolc according to MAgPIE supply curves" -q30_pebiolc_price_base(ttot,all_regi) "MAgPIE emulator: calculates the price of pebiolc according to MAgPIE supply curves" q30_pebiolc_costs(ttot,all_regi) "MAgPIE emulator: calculates the costs of pebiolc according to MAgPIE supply curves" q30_priceshift "calculates shift factor by minimizing least squares of price differences between MAgPIE output and MAgPIE emulator" q30_limitXpBio(ttot,all_regi) "only purpose grown bioenergy may be exported, no residues" diff --git a/modules/30_biomass/magpie_40/equations.gms b/modules/30_biomass/magpie_40/equations.gms index e0463af61d00ee9031263f5e0b439bc8dc8cd6ec..a3a96f8e1c599ca1ebf6deb1746d682e5e8b6027 100644 --- a/modules/30_biomass/magpie_40/equations.gms +++ b/modules/30_biomass/magpie_40/equations.gms @@ -13,10 +13,11 @@ *' *' **Total fuel costs for biomass** *' The first part, summing over *peren2rlf30*, represents costs for biomass with fixed prices. -*' The second part that includes *v30_pebiolc_costs* represents costs for biomass with continous supply curves from MAgPIE. -*' In coupled runs *v30_multcost* is a cost markup factor improving the optimization performance by penalizing -*' (too) large jumps in the demand in between two coupling iterations. It converges to 1 and therefore does not affect the outcome. -*' The last part, containing *pm_costsTradePeFinancial*, represents additional tradecosts (only for purpose grown lignocellulosic biomass). +*' The second part that includes *v30_pebiolc_costs* represents costs for biomass with continous +*' supply curves from MAgPIE. In coupled runs *v30_multcost* is a cost markup factor improving +*' the optimization performance by penalizing (too) large jumps in the demand between two coupling +*' iterations. It converges to 1 and therefore does not affect the outcome. The last part, containing +*' *pm_costsTradePeFinancial*, represents additional tradecosts (only for purpose grown lignocellulosic biomass). q30_costFuBio(ttot,regi)$(ttot.val ge cm_startyear).. vm_costFuBio(ttot,regi) @@ -28,21 +29,13 @@ $if %cm_MAgPIE_coupling% == "off" (v30_pebiolc_costs(ttot,regi)) + sum(peren2cont30(enty,rlf), vm_fuExtr(ttot,regi,enty,rlf) * pm_costsTradePeFinancial(regi,"use",enty)); -*' **Calculate cost markup factor for coupled runs** -*' It penalizes large jumps from the previous coupling iteration and converges to 1, as the difference between *vm_fuExtr* and -*' *p30_pebiolc_demandmag* vanish when the coupling converges over iterations. -q30_costAdj(ttot,regi)$(ttot.val ge cm_startyear).. - v30_multcost(ttot,regi) - =e= - power((vm_fuExtr(ttot,regi,"pebiolc","1")-p30_pebiolc_demandmag(ttot,regi))/ (p30_pebiolc_demandmag(ttot,regi) + 0.15),2) * 0.4 + 1 -; - ***--------------------------------------------------------------------------- *** MAgPIE EMULATOR ***--------------------------------------------------------------------------- -*' **Caclulate bioenergy price according to MAgPIE supply curves** -*' The equation is mainly used by shift factor calculation in the preloop. In main solve it is only required for bioenergy tax. +*' **Caclulate bioenergy prices according to MAgPIE supply curves** +*' The equation is used by shift factor calculation in the preloop stage. In the main solve stage the price is only used to apply +*' the bioenergy tax. q30_pebiolc_price(ttot,regi)$(ttot.val ge cm_startyear).. vm_pebiolc_price(ttot,regi) @@ -52,16 +45,6 @@ q30_pebiolc_price(ttot,regi)$(ttot.val ge cm_startyear).. + i30_bioen_price_b(ttot,regi) * (vm_fuExtr(ttot,regi,"pebiolc","1") + sm_eps) ) * v30_pricemult(ttot,regi); -*' **Calculate bioenergy price according to shifted MAgPIE supply curves** -*' Required only to calculate the bioenergy tax. For historic reasons there exist both *vm_pebiolc_price_shifted* and -*' *vm_pebiolc_price*. Could be refactored some time. - -q30_pebiolc_price_base(ttot,regi)$(ttot.val ge cm_startyear).. - vm_pebiolc_price_shifted(ttot,regi) - =e= - vm_pebiolc_price(ttot,regi) -; - *' **MAgPIE EMULATOR** *' Calculates bioenergy costs of purpose grown lignocellulosic biomass by integrating the linear price supply curve. *' It contains optional shift and scaling of supply curves in coupled runs. @@ -96,6 +79,21 @@ q30_priceshift$(s30_switch_shiftcalc eq 1).. ) ; +***--------------------------------------------------------------------------- +*** COUPLING CONVERGENCE +***--------------------------------------------------------------------------- + +*' **Calculate cost markup factor for coupled runs** +*' It penalizes deviations in the demand for purpose grown bioenergy from the previous coupling iteration +*' by increasing the costs proportional to the deviation. The scaling factor converges to 1, as the +*' difference between *vm_fuExtr* and *p30_pebiolc_demandmag* vanishes when the coupling converges over +*' iterations. +q30_costAdj(ttot,regi)$(ttot.val ge cm_startyear).. + v30_multcost(ttot,regi) + =e= + power((vm_fuExtr(ttot,regi,"pebiolc","1")-p30_pebiolc_demandmag(ttot,regi))/ (p30_pebiolc_demandmag(ttot,regi) + 0.15),2) * 0.4 + 1 +; + ***--------------------------------------------------------------------------- *** Definition of resource constraints for biomass ***--------------------------------------------------------------------------- diff --git a/modules/30_biomass/magpie_40/preloop.gms b/modules/30_biomass/magpie_40/preloop.gms index ed365c66c26da0a943a9c82f4e6f402337d2e6c3..1e77dedba7fd2d659d43b8133aa484f8e479d948 100644 --- a/modules/30_biomass/magpie_40/preloop.gms +++ b/modules/30_biomass/magpie_40/preloop.gms @@ -77,9 +77,7 @@ $endif ***------------ Step 3: calculate bioenergy costs ------------- *** The costs are calculated applying the regular cost equation. *** This equation integrates the shifted (!) price supply curve over the demand. -*** Since the price shift factor is required for this it has been calcualted before (see above). -*** There is no cost shift factor (anymore) since there is no cost emulator (anymore), -*** because the costs are calculated by integrating the shifted price supply curve. +*** It requires the price shift factor to be calcualted before (see above). solve model_biopresolve_c using cns; !!! nothing has to be optimized here, just pure calculation