diff --git a/CHANGELOG.md b/CHANGELOG.md index 0a06da4d3..44225984a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - **45_carbonprice** remove outdated realizations: NDC2constant, NPi2018, diffPhaseIn2Constant, diffPhaseIn2Lin, diffPhaseInLin2LinFlex, diffPriceSameCost [[#1480](https://github.com/remindmodel/remind/pull/1480)] +- **36_buildings** remove outdated realizations: services_putty, services_with_capital + [[#1509] (https://github.com/remindmodel/remind/pull/1509)] ## [3.2.1] - 2023-07-13 (incomplete) diff --git a/core/datainput.gms b/core/datainput.gms index 02567d391..ee9180179 100644 --- a/core/datainput.gms +++ b/core/datainput.gms @@ -194,10 +194,10 @@ $if not "%cm_learnRate%" == "off" parameter p_new_learnRate(all_te) / %cm_learnR $if not "%cm_learnRate%" == "off" fm_dataglob("learn",te)$p_new_learnRate(te)=p_new_learnRate(te); *RP* the new cost data in generisdata_tech is now in $2015. As long as the model runs in $2005, these values have first to be converted to D2005 by dividing by 1.2 downwards -fm_dataglob("inco0",te) = sm_D2015_2_D2005 * fm_dataglob("inco0",te); -fm_dataglob("incolearn",te) = sm_D2015_2_D2005 * fm_dataglob("incolearn",te); -fm_dataglob("omv",te) = sm_D2015_2_D2005 * fm_dataglob("omv",te); -p_inco0(ttot,regi,te) = sm_D2015_2_D2005 * p_inco0(ttot,regi,te); +fm_dataglob("inco0",te) = s_D2015_2_D2005 * fm_dataglob("inco0",te); +fm_dataglob("incolearn",te) = s_D2015_2_D2005 * fm_dataglob("incolearn",te); +fm_dataglob("omv",te) = s_D2015_2_D2005 * fm_dataglob("omv",te); +p_inco0(ttot,regi,te) = s_D2015_2_D2005 * p_inco0(ttot,regi,te); *RP* rescale the global CSP investment costs in REMIND: Originally we assume a SM3/12h setup, while the cost data from IEA for the short term seems rather based on a SM2/6h setup (with 40% average CF) *** Accordingly, also decrease long-term costs in REMIND to 0.7 of the current values @@ -231,10 +231,10 @@ $ENDIF.WindOff *** inco0 (and incolearn) are given in $/kW (or $/(tC/a) for ccs-related tech or $/(t/a) for process-based industry) *** convert to REMIND units, i.e., T$/TW (or T$/(GtC/a) for ccs-related tech or T$/(Gt/a) for process-based industry) *** note that factor for $/kW -> T$/TW is the same as for $/(tC/a) -> T$/(GtC/a) -fm_dataglob("inco0",te) = sm_DpKW_2_TDpTW * fm_dataglob("inco0",te); -fm_dataglob("incolearn",te) = sm_DpKW_2_TDpTW * fm_dataglob("incolearn",te); +fm_dataglob("inco0",te) = s_DpKW_2_TDpTW * fm_dataglob("inco0",te); +fm_dataglob("incolearn",te) = s_DpKW_2_TDpTW * fm_dataglob("incolearn",te); fm_dataglob("omv",te) = s_DpKWa_2_TDpTWa * fm_dataglob("omv",te); -p_inco0(ttot,regi,te) = sm_DpKW_2_TDpTW * p_inco0(ttot,regi,te); +p_inco0(ttot,regi,te) = s_DpKW_2_TDpTW * p_inco0(ttot,regi,te); table fm_dataemiglob(all_enty,all_enty,all_te,all_enty) "read-in of emissions factors co2,cco2" diff --git a/core/declarations.gms b/core/declarations.gms index a81c05f3e..6cceac44c 100644 --- a/core/declarations.gms +++ b/core/declarations.gms @@ -38,8 +38,6 @@ pm_taxemiMkt_iteration(iteration,ttot,all_regi,all_emiMkt) "CO2 or CO2eq region pm_emissionsForeign(tall,all_regi,all_enty) "total emissions of other regions (nash relevant)" pm_co2eqForeign(tall,all_regi) "emissions, which are part of the climate policy, of other regions (nash relevant)" pm_cesdata(tall,all_regi,all_in,cesParameter) "parameters of the CES function" -pm_cesdata_putty(tall,all_regi,all_in,cesParameter) "quantities for the putty clay factors" -pm_capital_lifetime_exp(all_regi,all_in) "number of years for which 25% of the CES capital stocks remains" f_pop(tall,all_regi,all_POPscen) "population data for all possible scenarios" pm_pop(tall,all_regi) "population data [bn people]" pm_gdp(tall,all_regi) "GDP data [trn US$ 2005]" @@ -261,9 +259,6 @@ p_FEPrice_by_Sector_iter(iteration,ttot,all_regi,all_enty,sector) p_FEPrice_by_EmiMkt_iter(iteration,ttot,all_regi,all_enty,emiMkt) "parameter to save iteration FE marginal price per emission market (tr$2005/TWa)" p_FEPrice_by_FE_iter(iteration,ttot,all_regi,all_enty) "parameter to save iteration FE marginal price (tr$2005/TWa)" -pm_tau_fe_tax(ttot,all_regi,emi_sectors,all_enty) "tax path for final energy" -pm_tau_fe_sub(ttot,all_regi,emi_sectors,all_enty) "subsidy path for final energy" - *** climate related pm_globalMeanTemperature(tall) "global mean temperature anomaly" pm_globalMeanTemperatureZeroed1900(tall) "global mean temperature anomaly, zeroed around 1900" @@ -372,7 +367,6 @@ v_changeProdStartyearSlack(ttot,all_regi,all_te) "slack variable to allow a positive variables ***---------------------------------------------------------------------------------------- ***-------------------------------------------------MACRO module--------------------------- -vm_enerSerAdj(tall,all_regi,all_in) "adjustment costs for energy service transformations" vm_esCapInv(ttot,all_regi,all_teEs) "investment for energy end-use capital at the energy service level" ***---------------------------------------------------------------------------------------- *-----------------------------------------------ESM module--------------------------------- @@ -476,7 +470,7 @@ q_costTeCapital(tall,all_regi,all_te) "calculation of investment q_balPe(ttot,all_regi,all_enty) "balance of primary energy (pe)" q_balSe(ttot,all_regi,all_enty) "balance of secondary energy (se)" -qm_balFe(ttot,all_regi,all_enty,all_enty,all_te) "balance of final energy (fe)" +q_balFe(ttot,all_regi,all_enty,all_enty,all_te) "balance of final energy (fe)" q_balFeAfterTax(ttot,all_regi,all_enty,all_enty,emi_sectors,all_emiMkt) "balance of final energy after considering FE sectoral taxes (fe)" q_transPe2se(ttot,all_regi,all_enty,all_enty,all_te) "energy tranformation pe to se" @@ -576,8 +570,6 @@ o_modelstat "critical solver status fo pm_conv_TWa_EJ "conversion from TWa to EJ" /31.536/, sm_c_2_co2 "conversion from c to co2" /3.666666666667/, *** conversion factors of time units -sm_year_2_day "days per year" /365/, -sm_day_2_hour "hours per day" /24/, sm_mega_2_non "mega to non" /1e+6/, sm_giga_2_non "giga to non" /1e+9/, sm_trillion_2_non "trillion to non" /1e+12/, @@ -592,7 +584,7 @@ sm_TWa_2_kWh "tera Watt year to kilo Wa *RP* multiply this number by the conversion factor s_xxx_2_yyy to get the new value in Unit yyy. s_NO2_2_N "convert NO2 to N [14 / (14 + 2 * 16)]" / .304 / s_DpKWa_2_TDpTWa "convert Dollar per kWa to TeraDollar per TeraWattYear" /0.001/ -sm_DpKW_2_TDpTW "convert Dollar per kW to TeraDollar per TeraWatt" /0.001/ +s_DpKW_2_TDpTW "convert Dollar per kW to TeraDollar per TeraWatt" /0.001/ sm_DpGJ_2_TDpTWa "multipl. factor to convert (Dollar per GJoule) to (TerraDollar per TWyear)" / 31.54e-03/ s_gwpCH4 "Global Warming Potentials of CH4, AR5 WG1 CH08 Table 8.7" /28/ s_gwpN2O "Global Warming Potentials of N2O, AR5 WG1 CH08 Table 8.7" /265/ @@ -603,7 +595,7 @@ sm_tgch4_2_pgc "conversion factor 100-yr s_MtCH4_2_TWa "Energy content of methane. MtCH4 --> TWa: 1 MtCH4 = 1.23 * 10^6 toe * 42 GJ/toe * 10^-9 EJ/GJ * 1 TWa/31.536 EJ = 0.001638 TWa (BP statistical review)" /0.001638/ -sm_D2015_2_D2005 "Convert $2015 to $2005 by dividing by 1.2: 1/1.2 = 0.8333" /0.8333/ +s_D2015_2_D2005 "Convert $2015 to $2005 by dividing by 1.2: 1/1.2 = 0.8333" /0.8333/ sm_DptCO2_2_TDpGtC "Conversion multiplier to go from $/tCO2 to T$/GtC: 44/12/1000" /0.00366667/ s_co2pipe_leakage "Leakage rate of CO2 pipelines. [0..1]" diff --git a/core/equations.gms b/core/equations.gms index 44cc44428..4a403237f 100644 --- a/core/equations.gms +++ b/core/equations.gms @@ -215,7 +215,7 @@ q_transSe2se(t,regi,se2se(enty,enty2,te)).. ***--------------------------------------------------------------------------- *** FE Balance ***--------------------------------------------------------------------------- -qm_balFe(t,regi,entySe,entyFe,te)$se2fe(entySe,entyFe,te).. +q_balFe(t,regi,entySe,entyFe,te)$se2fe(entySe,entyFe,te).. vm_prodFe(t,regi,entySe,entyFe,te) =e= sum((sector2emiMkt(sector,emiMkt),entyFE2sector(entyFE,sector)), diff --git a/core/sets_calculations.gms b/core/sets_calculations.gms index 9085ace5c..65d23b534 100644 --- a/core/sets_calculations.gms +++ b/core/sets_calculations.gms @@ -68,12 +68,7 @@ ppf("lab") = YES; *** calculate intermediate production factors ipf(all_in) = in(all_in) - ppf(all_in); -ipf_putty(all_in) = in_putty(all_in) - ppf_putty(all_in); -loop ( out, -ppfIO_putty(in)$(cesOut2cesIn(out,in) - AND ipf_putty(in) - AND NOT in_putty(out)) = YES; -); + *** Initialise cesLevel2cesIO and cesRev2cesIO loop (counter$( ord(counter) eq 1 ), cesLevel2cesIO(counter,"inco") = YES; !! the root is at the lowest level @@ -114,29 +109,9 @@ loop ((cesRev2cesIO(counter,in),cesOut2cesIn(in,in2)), cesOut2cesIn_below(in,in2) = YES; ); -in_below_putty(in) = NO; -loop (ppf_putty, -in_below_putty(in)$cesOut2cesIn_below(ppf_putty,in) = YES; -); - - *** Aliasing of mappings is not available in all GAMS versions cesOut2cesIn2(out,in) = cesOut2cesIn(out,in); - -*** Computing the reference complentary factors - -$offOrder -sm_tmp = 0; -loop (cesOut2cesIn(out,in) $ in_complements(in), - if ( NOT ord(out) eq sm_tmp, - sm_tmp = ord(out); - loop (cesOut2cesIn2(out,in2), - complements_ref(in,in2) = YES; - ); - ); - ); - $onOrder *** TODO this should be reworked with Robert when revising the transport module loop(ue2ppfen(enty,ppfEn), diff --git a/main.gms b/main.gms index 788a686d7..3b2adf18d 100755 --- a/main.gms +++ b/main.gms @@ -328,8 +328,6 @@ $setglobal transport edge_esm !! def = edge_esm *'--------------------- 36_buildings --------------------------------- *' *' * (simple): representation of final energy demand via a CES function calibrated to EDGE-Buildings' demand trajectories -*' * (services_with_capital): representation of the demand by energy service with capital -*' * (services_putty): representation of the demand by energy service with capital and with putty-clay for buildings insulation $setglobal buildings simple !! def = simple *'--------------------- 37_industry ---------------------------------- *' @@ -951,21 +949,11 @@ parameter *' * (3) Energy Efficiency policy: higher discount rate until cm_start_year and 25% of the initial value afterwards. *' * (4) Energy Efficiency policy: higher discount rate until cm_start_year, decreasing to 25% value linearly until 2030. *' -parameter - cm_noReboundEffect "Switch for allowing a rebound effect when closing the efficiency gap (cm_DiscRateScen)" -; - cm_noReboundEffect = 0; -*' price sensitivity of logit function for heating and cooking technological choice parameter c_H2InBuildOnlyAfter "Switch to fix H2 in buildings to zero until given year" ; c_H2InBuildOnlyAfter = 2150; !! def = 2150 (rule out H2 in buildings) *' For all years until the given year, FE demand for H2 in buildings is set to zero -parameter - cm_priceSensiBuild "Price sensitivity of energy carrier choice in buildings" -; - cm_priceSensiBuild = -3; -*' price sensitivity of logit function for heating and cooking technological choice parameter c_peakBudgYr "date of net-zero CO2 emissions for peak budget runs without overshoot" ; @@ -1052,11 +1040,6 @@ parameter ; cm_build_H2costDecayEnd = 0.1; !! def = 0.1 *' -parameter - cm_build_AdjCostActive "Activate adjustment cost to penalise inter-temporal variation of area-specific weatherisation demand and space cooling efficiency slope (only in putty)" -; - cm_build_AdjCostActive = 0; !! def = 0: Adjustment cost deactivated (set to 1 to activate) !! regexp = 0|1 -*' parameter cm_indst_H2costAddH2Inv "additional h2 distribution costs for low diffusion levels (default value: 3.25$kg = 0.1 $/kWh)" ; @@ -1091,16 +1074,6 @@ parameter *' * (0) none *' * (1) no fossil carbon and capture in Germany *' -parameter - cm_logitCal_markup_conv_b "value to which logit calibration markup of standard fe2ue technologies in detailed buildings module converges to" -; - cm_logitCal_markup_conv_b = 0.8; !! def = 0.8 -*' long-term convergence value of detailed buildings fe2ue conventional techs price markup -parameter - cm_logitCal_markup_newtech_conv_b "value to which logit calibration markup of new fe2ue technologies in detailed buildings module converges to" -; - cm_logitCal_markup_newtech_conv_b = 0.3; !! def = 0.3 -*' long-term convergence value of detailed buildings fe2ue new techs price markup parameter cm_startIter_EDGET "starting iteration of EDGE-T" ; diff --git a/modules/01_macro/singleSectorGr/bounds.gms b/modules/01_macro/singleSectorGr/bounds.gms index 9a8483ed7..3e394d4d9 100644 --- a/modules/01_macro/singleSectorGr/bounds.gms +++ b/modules/01_macro/singleSectorGr/bounds.gms @@ -10,18 +10,12 @@ vm_cons.lo(t,regi) = 1e-3; 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 vm_cesIO.fx(t0(tall),regi,in)$( ppfEn(in) - OR ppfIO_putty(in) OR industry_ue_calibration_target_dyn37(in) ) = pm_cesdata(tall,regi,in,"quantity"); -vm_cesIOdelta.fx(t0(tall),regi,in)$( ppfEn(in) OR in_putty(in) ) - = pm_cesdata_putty(tall,regi,in,"quantity"); - - *** set macro investments to bound in 2005 vm_invMacro.fx("2005",regi,"kap") = p01_boundInvMacro(regi); *cb 2012-05-23 lower bound for capital investment to avoid "zero investment" problem for the conopt solver diff --git a/modules/01_macro/singleSectorGr/declarations.gms b/modules/01_macro/singleSectorGr/declarations.gms index a48c46842..19abfa479 100644 --- a/modules/01_macro/singleSectorGr/declarations.gms +++ b/modules/01_macro/singleSectorGr/declarations.gms @@ -10,8 +10,8 @@ ***------------------------------------------------------------------------------- parameters pm_delta_kap(all_regi,all_in) "Depreciation rate of capital." -pm_cumDeprecFactor_old(ttot,all_regi,all_in) "Investment depreciation within a period, applied to the investment of t -1." -pm_cumDeprecFactor_new(ttot,all_regi,all_in) "Investment depreciation within a period, applied to the investment of t." +p01_cumDeprecFactor_old(ttot,all_regi,all_in) "Investment depreciation within a period, applied to the investment of t -1." +p01_cumDeprecFactor_new(ttot,all_regi,all_in) "Investment depreciation within a period, applied to the investment of t." p01_ppfen_ratios(ttot,all_regi,all_in,all_in) "Limit ratio of two primary production factors of energy (ppfEn)." pm_ppfen_shares(ttot,all_regi,all_in,all_in) "Limit the share of one ppfEn in total CES nest inputs." pm_consPC(tall,all_regi) "Consumption per capita" @@ -33,11 +33,9 @@ vm_cesIO(tall,all_regi,all_in) "Production fact vm_invMacro(ttot,all_regi,all_in) "Investment for capital for ttot" v01_invMacroAdj(ttot,all_regi,all_in) "Adjustment costs of macro economic investments" vm_invInno(ttot,all_regi,all_in) "Investment into innovation" -vm_invImi(ttot, all_regi,all_in) "Investment into imitation" - -*** putty-clay variables -vm_cesIOdelta(tall,all_regi,all_in) "Putty-clay production factor" -; +vm_invImi(ttot, all_regi,all_in) "Investment into imitation" +v01_enerSerAdj(tall,all_regi,all_in) "adjustment costs for energy service transformations" +; ***------------------------------------------------------------ ------------------- *** EQUATIONS ***------------------------------------------------------------ ------------------- @@ -45,17 +43,11 @@ equations qm_budget(ttot,all_regi) "Budget balance" q01_balLab(ttot,all_regi) "Labour balance" q01_cesIO(ttot,all_regi,all_in) "Production function" -q01_prodCompl(ttot,all_regi,all_in,all_in) "Constraints for perfect complements in the CES tree" q01_kapMo(ttot,all_regi,all_in) "Capital motion equation" q01_kapMo0(t0,all_regi,all_in) "Initial condition for capital" q01_invMacroAdj(ttot,all_regi,all_in) "Adjustment costs for macro economic investments" q01_limitShPpfen(ttot,all_regi,all_in,all_in) "Limit the share of one ppfEn in total CES nest inputs" q01_limtRatioPpfen(ttot,all_regi,all_in,all_in) "Limit the ratio of two ppfEn" -*** putty-clay equations -q01_cesIO_puttyclay(ttot,all_regi,all_in) "Putty-clay production function" -q01_puttyclay(ttot,all_regi,all_in) "Putty-clay Correspondance between variations in input and past stocks of input" -q01_prodCompl_putty(ttot,all_regi,all_in,all_in) "Putty-Clay constraints for perfect complements in the CES tree" -q01_kapMo_putty(ttot,all_regi,all_in) "Putty-clay capital motion equation" ; *** EOF ./modules/01_macro/singleSectorGr/declarations.gms diff --git a/modules/01_macro/singleSectorGr/equations.gms b/modules/01_macro/singleSectorGr/equations.gms index 44b148ae5..9712992d2 100644 --- a/modules/01_macro/singleSectorGr/equations.gms +++ b/modules/01_macro/singleSectorGr/equations.gms @@ -45,7 +45,7 @@ qm_budget(ttot,regi)$( ttot.val ge cm_startyear ) .. + sum(tradeCap, vm_costTradeCap(ttot,regi,tradeCap)) + vm_taxrev(ttot,regi)$(ttot.val ge 2010) + vm_costAdjNash(ttot,regi) - + sum(in_enerSerAdj(in), vm_enerSerAdj(ttot,regi,in)) + + sum(in_enerSerAdj(in), v01_enerSerAdj(ttot,regi,in)) + sum(teEs, vm_esCapInv(ttot,regi,teEs)) + vm_costpollution(ttot,regi) + pm_totLUcosts(ttot,regi) @@ -88,7 +88,7 @@ q01_balLab(t,regi).. *** Keep in mind to adjust the calculation of derivatives and shares *** in ./core/reswrite.inc if you change the structure of this function. ***--------------------------------------------------------------------------- -q01_cesIO(t,regi,ipf(out))$( NOT ipf_putty(out) ) .. +q01_cesIO(t,regi,ipf(out)).. vm_cesIO(t,regi,out) =e= !! use exp(log(a) * b) = a ** b because the latter is not accurate in GAMS for @@ -99,40 +99,26 @@ q01_cesIO(t,regi,ipf(out))$( NOT ipf_putty(out) ) .. pm_cesdata(t,regi,in,"xi") * exp( log( - pm_cesdata(t,regi,in,"eff") - * vm_effGr(t,regi,in) - * vm_damageProdFactor(t,regi,in) - * vm_cesIO(t,regi,in) - ) - * pm_cesdata(t,regi,out,"rho") - ) + pm_cesdata(t,regi,in,"eff") + * vm_effGr(t,regi,in) + * vm_damageProdFactor(t,regi,in) + * vm_cesIO(t,regi,in) + ) + * pm_cesdata(t,regi,out,"rho") + ) ) ) * (1 / pm_cesdata(t,regi,out,"rho")) ) ; -***--------------------------------------------------------------------------- -*' Constraints for perfect complements in the CES tree -***--------------------------------------------------------------------------- -q01_prodCompl(t,regi,in,in2) $ (complements_ref(in,in2) AND (( NOT in_putty(in2)) OR ppfIO_putty(in2))) .. - vm_cesIO(t,regi,in) - =e= - pm_cesdata(t,regi,in2,"compl_coef") - * vm_cesIO(t,regi,in2) -; - - - ***--------------------------------------------------------------------------- *' The capital stock is calculated recursively. Its amount in the previous time *' step is devaluated by an annual depreciation factor and enlarged by investments. *' Both depreciation and investments are expressed as annual values, *' so the time step length is taken into account. ***--------------------------------------------------------------------------- -q01_kapMo(ttot,regi,ppfKap(in))$( - NOT in_putty(in) - AND ord(ttot) lt card(ttot) +q01_kapMo(ttot,regi,ppfKap(in))$(ord(ttot) lt card(ttot) AND pm_ttot_val(ttot+1) ge max(2010, cm_startyear) AND pm_cesdata("2005",regi,in,"quantity") gt 0 ) .. vm_cesIO(ttot+1,regi,in) @@ -140,8 +126,8 @@ q01_kapMo(ttot,regi,ppfKap(in))$( vm_cesIO(ttot,regi,in) * (1 - pm_delta_kap(regi,in)) ** (pm_ttot_val(ttot+1) - pm_ttot_val(ttot)) - + pm_cumDeprecFactor_old(ttot+1,regi,in) * vm_invMacro(ttot,regi,in) - + pm_cumDeprecFactor_new(ttot+1,regi,in) * vm_invMacro(ttot+1,regi,in) + + p01_cumDeprecFactor_old(ttot+1,regi,in) * vm_invMacro(ttot,regi,in) + + p01_cumDeprecFactor_new(ttot+1,regi,in) * vm_invMacro(ttot+1,regi,in) ; ***--------------------------------------------------------------------------- @@ -183,49 +169,4 @@ q01_limtRatioPpfen(t,regi,in,in2)$( p01_ppfen_ratios(t,regi,in,in2) ) .. * (vm_cesIO(t,regi,in2) + pm_cesdata(t,regi,in,"offset_quantity")) ; - -***--------------------------------------------------------------------------- -*** Start of Putty-Clay equations -*' Putty-Clay production function: -***--------------------------------------------------------------------------- -q01_cesIO_puttyclay(t,regi,ipf_putty(out)) .. - vm_cesIOdelta(t,regi,out) - =e= - sum(cesOut2cesIn(out,in), - pm_cesdata(t,regi,in,"xi") - * ( - pm_cesdata(t,regi,in,"eff") - * vm_effGr(t,regi,in) - * vm_cesIOdelta(t,regi,in) - ) - ** pm_cesdata(t,regi,out,"rho") - ) - ** (1 / pm_cesdata(t,regi,out,"rho")) -; - -*' Putty-Clay constraints for perfect complements in the CES tree: -q01_prodCompl_putty(t,regi,in,in2) $ (complements_ref(in,in2) - AND ( in_putty(in2) AND ( NOT ppfIO_putty(in2)))) .. - vm_cesIOdelta(t,regi,in) =e= - pm_cesdata(t,regi,in2,"compl_coef") - * vm_cesIOdelta(t,regi,in2); - -*' Correspondance between vm_cesIO and vm_cesIOdelta: -q01_puttyclay(ttot,regi,in_putty(in))$(ord(ttot) lt card(ttot) AND (pm_ttot_val(ttot+1) ge max(2010, cm_startyear))).. - vm_cesIO(ttot+1,regi,in) - =e= - vm_cesIO(ttot,regi,in)*(1- pm_delta_kap(regi,in))**(pm_ttot_val(ttot+1)-pm_ttot_val(ttot)) - + pm_cumDeprecFactor_old(ttot+1,regi,in)* vm_cesIOdelta(ttot,regi,in) - + pm_cumDeprecFactor_new(ttot+1,regi,in)* vm_cesIOdelta(ttot+1,regi,in) -; - -*' Capital motion equation for putty clay capital: -q01_kapMo_putty(ttot,regi,in_putty(in))$(ppfKap(in) AND (ord(ttot) le card(ttot)) AND (pm_ttot_val(ttot) ge max(2005, cm_startyear)) AND (pm_cesdata("2005",regi,in,"quantity") gt 0)).. - vm_cesIOdelta(ttot,regi,in) - =e= - vm_invMacro(ttot,regi,in) -; -***--------------------------------------------------------------------------- -*** End of Putty-Clay equations -***--------------------------------------------------------------------------- *** EOF ./modules/01_macro/singleSectorGr/equations.gms diff --git a/modules/01_macro/singleSectorGr/preloop.gms b/modules/01_macro/singleSectorGr/preloop.gms index 50c044a6b..f790aea26 100644 --- a/modules/01_macro/singleSectorGr/preloop.gms +++ b/modules/01_macro/singleSectorGr/preloop.gms @@ -9,13 +9,13 @@ *** Calculate cummulative depreciation factors loop ((t,counter), if ( pm_dt(t) eq 2 * counter.val, -pm_cumDeprecFactor_old(t,regi,in)$(ppfKap(in) OR in_putty(in)) +p01_cumDeprecFactor_old(t,regi,in)$(ppfKap(in)) = ((1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2 ) - (1 - pm_delta_kap(regi,in)) ** (pm_dt(t) )) / pm_delta_kap(regi,in) ; -pm_cumDeprecFactor_new(t,regi,in)$(ppfKap(in) OR in_putty(in)) +p01_cumDeprecFactor_new(t,regi,in)$(ppfKap(in) ) = ( 1 - (1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2) ) @@ -24,14 +24,14 @@ pm_cumDeprecFactor_new(t,regi,in)$(ppfKap(in) OR in_putty(in)) ); if ( pm_dt(t) eq (2 * counter.val -1), -pm_cumDeprecFactor_old(t,regi,in)$(ppfKap(in) OR in_putty(in)) +p01_cumDeprecFactor_old(t,regi,in)$(ppfKap(in)) = ((1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2 - 0.5) - (1 - pm_delta_kap(regi,in)) ** (pm_dt(t))) / pm_delta_kap(regi,in) - 1/2 * (1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2 - 0.5 ) ; -pm_cumDeprecFactor_new(t,regi,in)$(ppfKap(in) OR in_putty(in)) +p01_cumDeprecFactor_new(t,regi,in)$(ppfKap(in)) = ( 1 - (1 - pm_delta_kap(regi,in)) ** (pm_dt(t)/2 - 0.5 + 1) ) @@ -41,6 +41,6 @@ pm_cumDeprecFactor_new(t,regi,in)$(ppfKap(in) OR in_putty(in)) ); ); -display "test Deprec", pm_cumDeprecFactor_new,pm_cumDeprecFactor_old; +display "test Deprec", p01_cumDeprecFactor_new,p01_cumDeprecFactor_old; *** EOF ./modules/01_macro/singleSectorGr/preloop.gms diff --git a/modules/01_macro/singleSectorGr/sets.gms b/modules/01_macro/singleSectorGr/sets.gms index ce15b5e85..f61927d52 100644 --- a/modules/01_macro/singleSectorGr/sets.gms +++ b/modules/01_macro/singleSectorGr/sets.gms @@ -16,7 +16,6 @@ cesOut2cesIn(all_in,all_in) "CES tree structure" cesLevel2cesIO(counter,all_in) "CES tree structure by level" cesRev2cesIO(counter,all_in) "CES tree structure by level - descending order" cesOut2cesIn_below(all_in,all_in) "All elements of the CES below located below the first item given" -in_below_putty(all_in) "All elements of the CES below ppf_putty, excluding ppf_putty. Only meaningful in case putty structures are not intertwined" in(all_in) "All inputs and outputs of the CES function" @@ -31,23 +30,9 @@ ipf(all_in) "All intermediate production factors" ppfKap(all_in) "Primary production factors capital" / kap / ppfEn(all_in) "Primary production factors energy" -in_putty(all_in) "Production factors subject to putty-clay dynamics" -ppf_putty(all_in) "All putty-clay primary production factors" -ipf_putty(all_in) "All putty-clay intermediate production factors" -ppfIO_putty(all_in) "Factors treated in the normal CES as ppf and in putty-clay as output" -nests_putty(all_in,all_in) "Defines factors which are in the same putty subnest. The first all_in gives the higher factors of the subnest" in_enerSerAdj(all_in) "Energy services factors which should be constrained by adjustment costs" // -in_complements(all_in) "Factors which are perfect complements" // -complements_ref(all_in,all_in) "Correspondence between complementary factors. Necessary to have a reference factor for the constraints equations" ; - - -in_putty(all_in) = NO; -ppf_putty(all_in) = NO; -ipf_putty(all_in) = NO; -ppfIO_putty(all_in) = NO; - alias(cesOut2cesIn,cesOut2cesIn2,cesOut2cesIn3); alias(in,out); alias(in,in2,in3); diff --git a/modules/21_tax/off/not_used.txt b/modules/21_tax/off/not_used.txt index 96049eebe..d156ee411 100644 --- a/modules/21_tax/off/not_used.txt +++ b/modules/21_tax/off/not_used.txt @@ -14,8 +14,8 @@ vm_prodSe, variable, ??? vm_prodPe, variable, ??? vm_Xport, variable, ??? pm_taxCO2eq, parameter, ??? -pm_tau_fe_sub, parameter, ??? -pm_tau_fe_tax, parameter, ??? +p21_tau_fe_sub, parameter, ??? +p21_tau_fe_tax, parameter, ??? pm_ts, parameter, ??? cm_bioenergy_SustTax,input,questionnaire cm_bioenergy_EF_for_tax,input,questionnaire diff --git a/modules/21_tax/on/datainput.gms b/modules/21_tax/on/datainput.gms index 18908d109..5a900b7df 100644 --- a/modules/21_tax/on/datainput.gms +++ b/modules/21_tax/on/datainput.gms @@ -82,16 +82,16 @@ $endIf.vehiclesSubsidies *** transfer data to parameters and rescaling of FE parameters from $/GJ to trillion $ / TWa (subsidies also get adjusted in preloop.gms to avoid neg. prices) - pm_tau_fe_tax(ttot,all_regi,emi_sectors,entyFe)$f21_tau_fe_tax(ttot,all_regi,emi_sectors,entyFe) = f21_tau_fe_tax(ttot,all_regi,emi_sectors,entyFe)*0.001/sm_EJ_2_TWa; - pm_tau_fe_sub(ttot,all_regi,emi_sectors,entyFe)$f21_tau_fe_sub(ttot,all_regi,emi_sectors,entyFe) = f21_tau_fe_sub(ttot,all_regi,emi_sectors,entyFe)*0.001/sm_EJ_2_TWa; + p21_tau_fe_tax(ttot,all_regi,emi_sectors,entyFe)$f21_tau_fe_tax(ttot,all_regi,emi_sectors,entyFe) = f21_tau_fe_tax(ttot,all_regi,emi_sectors,entyFe)*0.001/sm_EJ_2_TWa; + p21_tau_fe_sub(ttot,all_regi,emi_sectors,entyFe)$f21_tau_fe_sub(ttot,all_regi,emi_sectors,entyFe) = f21_tau_fe_sub(ttot,all_regi,emi_sectors,entyFe)*0.001/sm_EJ_2_TWa; p21_tau_fuEx_sub(ttot,regi,entyPE)$f21_tau_fuEx_sub(ttot,regi,entyPE) = f21_tau_fuEx_sub(ttot,regi,entyPE)*0.001/sm_EJ_2_TWa; p21_max_fe_sub(ttot,all_regi,entyFe)$f21_max_fe_sub(ttot,all_regi,entyFe) = f21_max_fe_sub(ttot,all_regi,entyFe)*0.001/sm_EJ_2_TWa; p21_prop_fe_sub(ttot,all_regi,entyFe)$f21_prop_fe_sub(ttot,all_regi,entyFe) = f21_prop_fe_sub(ttot,all_regi,entyFe); if(cm_fetaxscen eq 0, - pm_tau_fe_tax(ttot,all_regi,emi_sectors,entyFe) = 0; - pm_tau_fe_sub(ttot,all_regi,emi_sectors,entyFe) = 0; + p21_tau_fe_tax(ttot,all_regi,emi_sectors,entyFe) = 0; + p21_tau_fe_sub(ttot,all_regi,emi_sectors,entyFe) = 0; p21_tau_fuEx_sub(ttot,regi,all_enty) = 0; ); diff --git a/modules/21_tax/on/declarations.gms b/modules/21_tax/on/declarations.gms index 3f837cf06..fd4c1d9eb 100644 --- a/modules/21_tax/on/declarations.gms +++ b/modules/21_tax/on/declarations.gms @@ -20,6 +20,8 @@ p21_bio_EF(ttot,all_regi) "bioenergy emission factor, which p21_tau_Import(ttot,all_regi,all_enty,tax_import_type_21) "tax on energy imports, only works on energy carriers traded on nash markets, tax defined as share of world market price pm_pvp [Unit: share]" pm_tau_pe_tax(ttot,all_regi,all_enty) "pe tax path" pm_tau_ces_tax(ttot,all_regi,all_in) "ces production tax to implement CES mark-up cost in a budget-neutral way" +p21_tau_fe_tax(ttot,all_regi,emi_sectors,all_enty) "tax path for final energy" +p21_tau_fe_sub(ttot,all_regi,emi_sectors,all_enty) "subsidy path for final energy" pm_taxrevGHG0(ttot,all_regi) "reference level value of GHG emission tax" pm_taxrevCO2Sector0(ttot,all_regi,emi_sectors) "reference level value of CO2 sector markup tax" diff --git a/modules/21_tax/on/equations.gms b/modules/21_tax/on/equations.gms index e4accf87e..0a6eae16a 100644 --- a/modules/21_tax/on/equations.gms +++ b/modules/21_tax/on/equations.gms @@ -131,7 +131,7 @@ q21_taxrevFE(t,regi)$(t.val ge max(2010,cm_startyear)).. v21_taxrevFE(t,regi) =e= sum((entyFe,sector)$entyFe2Sector(entyFe,sector), - ( pm_tau_fe_tax(t,regi,sector,entyFe) + pm_tau_fe_sub(t,regi,sector,entyFe) ) + ( p21_tau_fe_tax(t,regi,sector,entyFe) + p21_tau_fe_sub(t,regi,sector,entyFe) ) * sum(emiMkt$sector2emiMkt(sector,emiMkt), sum(se2fe(entySe,entyFe,te), diff --git a/modules/21_tax/on/postsolve.gms b/modules/21_tax/on/postsolve.gms index 1694e056c..97da53fc6 100644 --- a/modules/21_tax/on/postsolve.gms +++ b/modules/21_tax/on/postsolve.gms @@ -29,7 +29,7 @@ p21_taxrevCCS0(ttot,regi) = cm_frac_CCS * pm_data(regi,"omf","ccsinje") * pm_inc * (1/pm_ccsinjecrate(regi)) * sum(teCCS2rlf(te,rlf), sum(ccs2te(ccsCO2(enty),enty2,te), vm_co2CCS.l(ttot,regi,enty,enty2,te,rlf) ) ) / pm_dataccs(regi,"quan","1"); pm_taxrevNetNegEmi0(ttot,regi) = cm_frac_NetNegEmi * pm_taxCO2eqSum(ttot,regi) * v21_emiALLco2neg.l(ttot,regi); p21_taxrevFE0(ttot,regi) = sum((entyFe,sector)$entyFe2Sector(entyFe,sector), - ( pm_tau_fe_tax(ttot,regi,sector,entyFe) + pm_tau_fe_sub(ttot,regi,sector,entyFe) ) + ( p21_tau_fe_tax(ttot,regi,sector,entyFe) + p21_tau_fe_sub(ttot,regi,sector,entyFe) ) * sum(emiMkt$sector2emiMkt(sector,emiMkt), sum(se2fe(entySe,entyFe,te), diff --git a/modules/21_tax/on/preloop.gms b/modules/21_tax/on/preloop.gms index 6c9481400..a0cc8d6f9 100644 --- a/modules/21_tax/on/preloop.gms +++ b/modules/21_tax/on/preloop.gms @@ -39,45 +39,45 @@ display pm_taxCO2eq; *** Adjustment of final energy subsidies to avoid neg. implicit 2005 prices that result in huge demand increases in 2010 and 2015 *** Maximum final energy subsidy levels (in $/Gj) from REMIND version prior to rev. 5429 -pm_tau_fe_sub(ttot,regi,sector,entyFe)$p21_max_fe_sub(ttot,regi,entyFe) = max(pm_tau_fe_sub(ttot,regi,sector,entyFe),-p21_max_fe_sub(ttot,regi,entyFe)); +p21_tau_fe_sub(ttot,regi,sector,entyFe)$p21_max_fe_sub(ttot,regi,entyFe) = max(p21_tau_fe_sub(ttot,regi,sector,entyFe),-p21_max_fe_sub(ttot,regi,entyFe)); *** Subsidy proportional cap to avoid liquids increasing dramatically -pm_tau_fe_sub(ttot,regi,sector,entyFe)$p21_prop_fe_sub(ttot,regi,entyFe) = pm_tau_fe_sub(ttot,regi,sector,entyFe) * p21_prop_fe_sub(ttot,regi,entyFe); +p21_tau_fe_sub(ttot,regi,sector,entyFe)$p21_prop_fe_sub(ttot,regi,entyFe) = p21_tau_fe_sub(ttot,regi,sector,entyFe) * p21_prop_fe_sub(ttot,regi,entyFe); *** Maximum primary energy subsidy levels (in $/Gj) to provide plausible upper bound: 40$/barrel ~ 8 $/GJ" p21_tau_fuEx_sub(ttot,regi,enty)$f21_max_pe_sub(ttot,regi,enty) = max(p21_tau_fuEx_sub(ttot,regi,enty),-f21_max_pe_sub(ttot,regi,enty)*0.001/sm_EJ_2_TWa); *** ------------------------- Temporal development of final energy TAXES and SUBSIDIES, depending on cm_fetaxscen *** Set time path for: -*** - final energy taxes (pm_tau_fe_tax) +*** - final energy taxes (p21_tau_fe_tax) *** - subsidies (p21_tau_fe_sub) if(cm_fetaxscen ne 0, *----- TAXES ---------------------------------- ***CASE 1: constant TAXES if((cm_fetaxscen eq 1) or (cm_fetaxscen eq 3) or (cm_fetaxscen eq 4), - loop(ttot$(ttot.val ge 2005), pm_tau_fe_tax(ttot,regi,sector,entyFe) = pm_tau_fe_tax("2005",regi,sector,entyFe)); + loop(ttot$(ttot.val ge 2005), p21_tau_fe_tax(ttot,regi,sector,entyFe) = p21_tau_fe_tax("2005",regi,sector,entyFe)); ); ***CASE 2: constant TAXES except for the final energies and regions defined at the f21_tax_convergence.cs4r file if(cm_fetaxscen eq 2, - loop(ttot$(ttot.val ge 2005), pm_tau_fe_tax(ttot,regi,sector,entyFe) = pm_tau_fe_tax("2005",regi,sector,entyFe)); + loop(ttot$(ttot.val ge 2005), p21_tau_fe_tax(ttot,regi,sector,entyFe) = p21_tau_fe_tax("2005",regi,sector,entyFe)); s21_tax_time = 2050; - pm_tau_fe_tax(ttot,regi,sector,entyFe)$(f21_tax_convergence("2050",regi,entyFe) AND ttot.val > 2015 AND ttot.val<(s21_tax_time + 1)) + p21_tau_fe_tax(ttot,regi,sector,entyFe)$(f21_tax_convergence("2050",regi,entyFe) AND ttot.val > 2015 AND ttot.val<(s21_tax_time + 1)) = - pm_tau_fe_tax("2005",regi,sector,entyFe)+((f21_tax_convergence("2050",regi,entyFe)*0.001/sm_EJ_2_TWa-pm_tau_fe_tax("2005",regi,sector,entyFe))*((ttot.val-2015)/(s21_tax_time-2015))); - pm_tau_fe_tax(ttot,regi,sector,entyFe)$(f21_tax_convergence("2050",regi,entyFe) AND ttot.val >(s21_tax_time)) = f21_tax_convergence("2050",regi,entyFe)*0.001/sm_EJ_2_TWa; + p21_tau_fe_tax("2005",regi,sector,entyFe)+((f21_tax_convergence("2050",regi,entyFe)*0.001/sm_EJ_2_TWa-p21_tau_fe_tax("2005",regi,sector,entyFe))*((ttot.val-2015)/(s21_tax_time-2015))); + p21_tau_fe_tax(ttot,regi,sector,entyFe)$(f21_tax_convergence("2050",regi,entyFe) AND ttot.val >(s21_tax_time)) = f21_tax_convergence("2050",regi,entyFe)*0.001/sm_EJ_2_TWa; ); ***----- SUBSIDIES ---------------------------------- ***global subsidies phase-out until 2030 for SSP1 (CASE 2) & SDP (CASE 4), until 2050 for SSP2 (CASE 3), no phaseout for SSP5 (CASE 1) *** CASE 1: Constant subsidy (SSP5) if(cm_fetaxscen eq 1, - loop(ttot$(ttot.val ge 2005), pm_tau_fe_sub(ttot,regi,sector,entyFe)=pm_tau_fe_sub("2005",regi,sector,entyFe)); + loop(ttot$(ttot.val ge 2005), p21_tau_fe_sub(ttot,regi,sector,entyFe)=p21_tau_fe_sub("2005",regi,sector,entyFe)); loop(ttot$(ttot.val ge 2005), p21_tau_pe2se_sub(ttot,regi,te)=p21_tau_pe2se_sub("2005",regi,te)); loop(ttot$(ttot.val ge 2005), p21_tau_fuEx_sub(ttot,regi,entyPE)=p21_tau_fuEx_sub("2005",regi,entyPE)); ); *** CASE 2 and 3 and 4: Global subsidies phase-out by 2030 (SSP1, SDP) and 2050 (SSP2) respectively if(cm_fetaxscen eq 2 OR cm_fetaxscen eq 3 OR cm_fetaxscen eq 4, - pm_tau_fe_sub(ttot,regi,sector,entyFe)$(ttot.val eq 2010 OR ttot.val eq 2015)=pm_tau_fe_sub("2005",regi,sector,entyFe); + p21_tau_fe_sub(ttot,regi,sector,entyFe)$(ttot.val eq 2010 OR ttot.val eq 2015)=p21_tau_fe_sub("2005",regi,sector,entyFe); p21_tau_pe2se_sub(ttot,regi,te)$(ttot.val eq 2010 OR ttot.val eq 2015)=p21_tau_pe2se_sub("2005",regi,te); p21_tau_fuEx_sub(ttot,regi,entyPE)$(ttot.val eq 2010 OR ttot.val eq 2015)=p21_tau_fuEx_sub("2005",regi,entyPE); if(cm_fetaxscen eq 2 OR cm_fetaxscen eq 4, s21_tax_time = 2030); @@ -85,10 +85,10 @@ if(cm_fetaxscen ne 0, s21_tax_value = 0; *** Calculate phase-out loop(ttot, - pm_tau_fe_sub(ttot,regi,sector,entyFe)$(ttot.val > 2015 AND ttot.val<(s21_tax_time + 1)) + p21_tau_fe_sub(ttot,regi,sector,entyFe)$(ttot.val > 2015 AND ttot.val<(s21_tax_time + 1)) = - pm_tau_fe_sub("2015",regi,sector,entyFe)+((s21_tax_value-pm_tau_fe_sub("2015",regi,sector,entyFe))*(ttot.val-2015)/(s21_tax_time-2015)); - pm_tau_fe_sub(ttot,regi,sector,entyFe)$(ttot.val>(s21_tax_time)) = s21_tax_value; + p21_tau_fe_sub("2015",regi,sector,entyFe)+((s21_tax_value-p21_tau_fe_sub("2015",regi,sector,entyFe))*(ttot.val-2015)/(s21_tax_time-2015)); + p21_tau_fe_sub(ttot,regi,sector,entyFe)$(ttot.val>(s21_tax_time)) = s21_tax_value; p21_tau_pe2se_sub(ttot,regi,te)$(ttot.val > 2015 AND ttot.val<(s21_tax_time + 1)) = @@ -111,11 +111,11 @@ $ifthen.fetax not "%cm_FEtax_trajectory_abs%" == "off" loop((ttot,sector,entyFe)$p21_FEtax_trajectory_abs(ttot,sector,entyFe), *** set FE tax to cm_FEtax_trajectory_abs to year given in cm_FEtax_trajectory_abs and after loop(ttot2$(ttot2.val ge ttot.val), - pm_tau_fe_tax(ttot2,regi,sector,entyFe) = p21_FEtax_trajectory_abs(ttot,sector,entyFe) * sm_TWa_2_MWh * 1e-12; + p21_tau_fe_tax(ttot2,regi,sector,entyFe) = p21_FEtax_trajectory_abs(ttot,sector,entyFe) * sm_TWa_2_MWh * 1e-12; ); *** phase-in(out) FE tax linearly before from startyear to year given in cm_FEtax_trajectory_abs loop(ttot2$(ttot2.val eq cm_startyear), - pm_tau_fe_tax(t,regi,sector,entyFe)$(t.val lt ttot.val and t.val ge cm_startyear) = (pm_tau_fe_tax(ttot,regi,sector,entyFe) - pm_tau_fe_tax(ttot2,regi,sector,entyFe))/(ttot.val - ttot2.val) * (t.val - ttot2.val) + pm_tau_fe_tax(ttot2,regi,sector,entyFe); + p21_tau_fe_tax(t,regi,sector,entyFe)$(t.val lt ttot.val and t.val ge cm_startyear) = (p21_tau_fe_tax(ttot,regi,sector,entyFe) - p21_tau_fe_tax(ttot2,regi,sector,entyFe))/(ttot.val - ttot2.val) * (t.val - ttot2.val) + p21_tau_fe_tax(ttot2,regi,sector,entyFe); ); ); $endif.fetax @@ -127,16 +127,16 @@ $ifthen.fetaxRel not "%cm_FEtax_trajectory_rel%" == "off" loop(ttot2$(ttot2.val eq cm_startyear), *** set FE tax to cm_FEtax_trajectory_rel * FE tax level of cm_startyear in year given in cm_FEtax_trajectory_rel and after loop(ttot3$(ttot3.val ge ttot.val), - pm_tau_fe_tax(ttot3,regi,sector,entyFe) = p21_FEtax_trajectory_rel(ttot,sector,entyFe) * pm_tau_fe_tax(ttot2,regi,sector,entyFe); + p21_tau_fe_tax(ttot3,regi,sector,entyFe) = p21_FEtax_trajectory_rel(ttot,sector,entyFe) * p21_tau_fe_tax(ttot2,regi,sector,entyFe); ); *** increase or decrease FE tax level linearily before - pm_tau_fe_tax(t,regi,sector,entyFe)$(t.val lt ttot.val and t.val ge cm_startyear) = (pm_tau_fe_tax(ttot,regi,sector,entyFe) - pm_tau_fe_tax(ttot2,regi,sector,entyFe))/(ttot.val - ttot2.val) * (t.val - ttot2.val) + pm_tau_fe_tax(ttot2,regi,sector,entyFe); + p21_tau_fe_tax(t,regi,sector,entyFe)$(t.val lt ttot.val and t.val ge cm_startyear) = (p21_tau_fe_tax(ttot,regi,sector,entyFe) - p21_tau_fe_tax(ttot2,regi,sector,entyFe))/(ttot.val - ttot2.val) * (t.val - ttot2.val) + p21_tau_fe_tax(ttot2,regi,sector,entyFe); ); ); $endif.fetaxRel -display pm_tau_fe_sub; -display pm_tau_fe_tax; +display p21_tau_fe_sub; +display p21_tau_fe_tax; display p21_tau_pe2se_sub, p21_tau_fuEx_sub; *LB* initialization of vm_emiMac diff --git a/modules/21_tax/on/presolve.gms b/modules/21_tax/on/presolve.gms index 100a2b875..fda488e61 100644 --- a/modules/21_tax/on/presolve.gms +++ b/modules/21_tax/on/presolve.gms @@ -28,7 +28,7 @@ p21_taxrevCCS0(ttot,regi) = cm_frac_CCS * pm_data(regi,"omf","ccsinje") * pm_inc pm_taxrevNetNegEmi0(ttot,regi) = cm_frac_NetNegEmi * pm_taxCO2eqSum(ttot,regi) * v21_emiALLco2neg.l(ttot,regi); p21_emiALLco2neg0(ttot,regi) = v21_emiALLco2neg.l(ttot,regi); p21_taxrevFE0(ttot,regi) = sum((entyFe,sector)$entyFe2Sector(entyFe,sector), - ( pm_tau_fe_tax(ttot,regi,sector,entyFe) + pm_tau_fe_sub(ttot,regi,sector,entyFe) ) + ( p21_tau_fe_tax(ttot,regi,sector,entyFe) + p21_tau_fe_sub(ttot,regi,sector,entyFe) ) * sum(emiMkt$sector2emiMkt(sector,emiMkt), sum(se2fe(entySe,entyFe,te), diff --git a/modules/29_CES_parameters/calibrate/datainput.gms b/modules/29_CES_parameters/calibrate/datainput.gms index 9d80aaf33..35a814c81 100644 --- a/modules/29_CES_parameters/calibrate/datainput.gms +++ b/modules/29_CES_parameters/calibrate/datainput.gms @@ -141,11 +141,6 @@ loop (cesOut2cesIn(out,in)$(in_beyond_calib_29(in) AND ppf(in)), ipf_beyond_last(out) = YES; ); -putty_compute_in(in)$((in_29(in) AND ppf_putty(in)) - OR (ppf_29(in) and in_putty(in)) - ) - = YES; - *** End of Sets calculation Parameter @@ -178,15 +173,6 @@ $offdelim ; p29_efficiency_growth(t,regi,in) = f29_efficiency_growth(t,regi,"%cm_demScen%",in); -Parameter -f29_capitalUnitProjections "Capital cost per unit of consumed energy and final energy per unit of useful energy (or UE per unit of ES) used to calibrate some elasticities of substitution" -/ -$ondelim -$include "./modules/29_CES_parameters/calibrate/input/f29_capitalUnitProjections.cs4r" -$offdelim -/ -; - parameter f29_capitalQuantity(tall,all_regi,all_demScen,all_in) "capital quantities" / @@ -256,28 +242,11 @@ $endif.indst_H2_penetration display pm_fedemand; -*** Attribute technological data to p29_capitalUnitProjections according to putty-clay - p29_capitalUnitProjections(all_regi,all_in,index_Nr) = f29_capitalUnitProjections(all_regi,all_in,index_Nr,"cap") $ ( NOT in_putty(all_in)) - + f29_capitalUnitProjections(all_regi,all_in,index_Nr,"inv") $ ( in_putty(all_in)); -loop (cesOut2cesIn(out,in)$ppfKap(in), -loop (cesOut2cesIn2(out,in2), -p29_capitalUnitProjections(all_regi,all_in,index_Nr)$(p29_capitalUnitProjections(all_regi,all_in,index_Nr) - AND (sameAs(all_in,out) OR sameAs(all_in,in2)) - ) - = p29_capitalUnitProjections(all_regi,all_in,index_Nr)$(p29_capitalUnitProjections(all_regi,in,index_Nr) ge p29_capitalUnitProjections(all_regi,in,"0") - ); -); -); - *** Change PPP for MER. p29_capitalQuantity(tall,all_regi,all_in) = p29_capitalQuantity(tall,all_regi,all_in) * pm_shPPPMER(all_regi); -p29_capitalUnitProjections(all_regi,all_in,index_Nr)$ppfKap(all_in) - = p29_capitalUnitProjections(all_regi,all_in,index_Nr) - * pm_shPPPMER(all_regi); - *** Subtract "special" capital stocks from gross economy capital stock p29_capitalQuantity(tall,all_regi,"kap") = p29_capitalQuantity(tall,all_regi,"kap") @@ -287,10 +256,6 @@ p29_capitalQuantity(tall,all_regi,"kap") *** Substract the end-use capital quantities from the aggregate capital -*** Change $/kWh to Trillion$/TWa; -p29_capitalUnitProjections(all_regi,all_in,index_Nr)$ppfKap(all_in) = p29_capitalUnitProjections(all_regi,all_in,index_Nr) * sm_TWa_2_kWh / sm_trillion_2_non; - - *** Load CES parameters from the last run Execute_Load 'input' p29_cesdata_load = pm_cesdata; $ifthen.testOneRegi "%optimization%" == "testOneRegi" !! optimization @@ -305,12 +270,6 @@ p29_cesdata_load(t,regi,in,"rho")$( p29_cesdata_load(t,regi,in,"rho") eq 0) = 0. *** Load quantities and efficiency growth from the last run Execute_Loadpoint 'input' p29_cesIO_load = vm_cesIO.l, p29_effGr = vm_effGr.l; -*** Load putty-clay quantities if relevant (initialise to 0 in case it is not) -p29_cesIOdelta_load(t,regi,in) = 0; -if ( (sm_CES_calibration_iteration gt 1 OR s29_CES_calibration_new_structure eq 0) AND (card(in_putty) gt 0), -Execute_Loadpoint 'input' p29_cesIOdelta_load = vm_cesIOdelta.l; -); - *** DEBUG: Load vm_deltacap Execute_Loadpoint 'input' vm_deltacap; @@ -385,7 +344,7 @@ $ifthen.indst_H2_offset "%industry%" == "fixed_shares" *** Assuming feh2i minimun levels as 1% of fegai to avoid CES numerical calibration issues and allow more aligned efficiencies between gas and h2 loop ((t,regi)$(pm_cesdata(t,regi,"feh2i","quantity") lt (0.01 * pm_cesdata(t,regi,"fegai","quantity"))), - pm_cesdata(t,regi,"feh2i","offset_quantity") = - (0.01 * pm_cesdata(t,regi,"fegai","quantity") - pm_cesdata(t,regi,"feh2i","quantity")); + pm_cesdata(t,regi,"feh2i","offset_quantity") = - (0.01 * pm_cesdata(t,regi,"fegai","quantity") - pm_cesdata(t,regi,"feh2i","quantity")); pm_cesdata(t,regi,"feh2i","quantity") = 0.01 * pm_cesdata(t,regi,"fegai","quantity"); ); @@ -410,7 +369,7 @@ loop ((t,regi), = - (0.05 + 0.45 * min(1, max(0, (t.val - 2025) / (2050 - 2025)))) * pm_cesdata(t,regi,"fegab","quantity") - pm_cesdata(t,regi,"feh2b","quantity"); - pm_cesdata(t,regi,"feh2b","quantity") + pm_cesdata(t,regi,"feh2b","quantity") = (0.05 + 0.45 * min(1, max(0, (t.val - 2025) / (2050 - 2025)))) * pm_cesdata(t,regi,"fegab","quantity"); ); @@ -442,13 +401,6 @@ loop (ue_fe_kap_29(out), ); ); -*** -loop ( (t0(t),regi, ppfIO_putty(in)), - if (pm_cesdata(t,regi,in,"quantity") eq 0, - abort "ppfIO_putty must have an exogenous value for the first period"; - ); -); - p29_esubGrowth = 0.3; *** EOF ./modules/29_CES_parameters/calibrate/datainput.gms diff --git a/modules/29_CES_parameters/calibrate/declarations.gms b/modules/29_CES_parameters/calibrate/declarations.gms index 4adcdc310..d430266b3 100644 --- a/modules/29_CES_parameters/calibrate/declarations.gms +++ b/modules/29_CES_parameters/calibrate/declarations.gms @@ -17,7 +17,6 @@ Parameters p29_beta(all_regi,all_in) "XXX" p29_cesdata_load(tall,all_regi,all_in,cesParameter) "pm_cesdata from the gdx file" p29_cesIO_load(tall,all_regi,all_in) "production factor vm_cesIO from input.gdx" - p29_cesIOdelta_load(tall,all_regi,all_in) "production factor vm_cesIOdelta from input.gdx" p29_effGr(tall,all_regi,all_in) "growth of factor efficiency from input.gdx" $ifthen.transpmodule "%transport%" == "edge_esm" p29_trpdemand(tall,all_regi,all_GDPscen,all_demScen,EDGE_scenario_all,all_in) "transport demand for the edge_esm transport module, unit: trillion passenger/ton km" @@ -27,12 +26,7 @@ $endif.transpmodule p29_capitalQuantity(tall,all_regi,all_in) "capital quantities" p29_capitalPrice(tall,all_regi) "capital prices" - p29_test_CES_recursive(tall,all_regi,all_in) "test the technological consistency of pm_cesdata" - p29_test_CES_putty_recursive(tall,all_regi,all_in) "test the technological consistency of pm_cesdata_putty" - - f29_capitalUnitProjections(all_regi,all_in,index_Nr,capUnitType) "Capital cost per unit of consumed energy and FE per unit of UE (or UE per unit of ES) used to calibrate some Esubs. kap is in $/kWh; UE and FE in kWh. Data for new investments and for standing capital" - p29_capitalUnitProjections(all_regi,all_in,index_Nr) "Capital cost per unit of consumed energy and final energy per unit of useful energy (or UE per unit of ES) used to calibrate some elasticities of substitution. kap is in $/kWh; UE and FE in kWh" - p29_output_estimation(all_regi,all_in) "scaling of the target quantity for comparability with technological data" + p29_test_CES_recursive(tall,all_regi,all_in) "test the technological consistency of pm_cesdata" p29_esubGrowth "long term growth of the elasticity of substitution" @@ -41,34 +35,6 @@ $endif.transpmodule p29_share_H2HTH_traj_indst(ttot,all_regi,all_in) "H2 and electricity HTH baseline trajectories as share of gas (for H2) and low-temperature electricity (for HTH electricity) trajectories in industry" ; -*** in case of a putty formulation, the model putty_paths will try to -*** find a pathway of variations which fits approximately the exogenous trajectories -*** the underlying variables (e.g. the consumption of useful energy in the whole buildings stock) -*** may vary but this is very costly in the objective function (we allow for these variations -*** because EDGE does not have a vintage structure and the projections might not fit the putty formulation -Variables -v29_cesdata(tall,all_regi,all_in) "underlying variables to the putty variations" -v29_cesdata_putty(tall,all_regi,all_in) "variation in the underlying variable" -v29_puttyTechDiff(tall,all_regi,all_in) "Difference to be minimised between the K/E ratio of putty and the K/E ratio from the technological data" -v29_putty_obj "index of the step by step variation of v29_cesdata_putty" -v29_ratioTotalPutty(tall,all_regi,all_in,all_in,all_in) "Ratio of the ratio between input quantities for total and putty quantities" - -v29_esub_err "sum of errors to be minimized" -v29_outputtech(all_regi,all_in,index_Nr) "CES output from the technological data" -v29_rho(all_regi,all_in) "parameter to be calibrated, related to the esub through: rho = 1 - 1/esub" -; - -Equations -q29_pathConstraint(tall,all_regi,all_in) "equation describing the relation between a variable and its variation" -q29_esubsConstraint(tall,all_regi,all_in,all_in,all_in) "constraint ensuring that the ratio between capital and energy in putty for the last historical region will be close to the technological data used for the ESUB estimation" -q29_ratioTotalPutty (tall,all_regi,all_in,all_in,all_in) "Computation of the ratio between the two putty inputs of a same CES nestand the the ratio of pm_cesdata" -q29_putty_obj "objective function" - -q29_esub_obj "objective function of esub estimation" -q29_outputtech(all_regi,all_in,index_Nr) "CES equation for technological data" - -; - *** Load calibration iteration number from environment variable *** cm_CES_calibration_iteration put_utility "shell" / "exit $cm_CES_calibration_iteration"; diff --git a/modules/29_CES_parameters/calibrate/equations.gms b/modules/29_CES_parameters/calibrate/equations.gms deleted file mode 100644 index 08f0c2f5b..000000000 --- a/modules/29_CES_parameters/calibrate/equations.gms +++ /dev/null @@ -1,129 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/29_CES_parameters/calibrate/equations.gms -$offOrder -q29_pathConstraint (t_29,regi_dyn29(regi),in) $(putty_compute_in(in) - AND (ord(t_29) lt card(t_29))) .. -v29_cesdata(t_29 + 1,regi,in) =e= - (1- pm_delta_kap(regi,in))**pm_dt(t_29+1) * v29_cesdata(t_29,regi,in) - + (pm_cumDeprecFactor_old(t_29+1,regi,in) * v29_cesdata_putty(t_29,regi,in)) - + (pm_cumDeprecFactor_new(t_29+1,regi,in) * v29_cesdata_putty(t_29+1,regi,in)) - ; -q29_ratioTotalPutty (t_29,regi_dyn29(regi),out,in,in2) $ (putty_compute_in(in) - AND putty_compute_in(in2) - AND cesOut2cesIn(out,in) - AND cesOut2cesIn2(out,in2) - AND ( NOT sameAs(in,in2)) - ) .. - - v29_ratioTotalPutty(t_29,regi,out,in,in2) - =e= - (v29_cesdata_putty(t_29,regi,in) - )/v29_cesdata_putty(t_29,regi,in2) - / - (pm_cesdata(t_29,regi,in,"quantity") - /pm_cesdata(t_29,regi,in2,"quantity") - ) - ; - - -q29_esubsConstraint(t,regi_dyn29(regi),out,in,in2) $ ( ipf_putty(out) - AND putty_compute_in(in) - AND putty_compute_in(in2) - AND t_29hist_last(t) - AND pm_cesdata_sigma(t,out) eq -1 - AND cesOut2cesIn(out,in) - AND cesOut2cesIn2(out,in2) - AND ppfKap(in) - AND ( NOT ppfKap(in2))) .. - v29_puttyTechDiff(t,regi,out) =e= p29_capitalUnitProjections(regi,in2,"0") - / p29_capitalUnitProjections(regi,in,"0") - - - v29_cesdata_putty(t,regi,in2) - /v29_cesdata_putty(t,regi,in) - ; - - - -q29_putty_obj.. -v29_putty_obj =e= 5e-1 * sum ((t_29,regi_dyn29(regi),in)$(putty_compute_in(in) - AND (ord(t_29) lt card(t_29))) - , power( v29_cesdata_putty(t_29+1,regi,in) !! Limit the variations from one period to another - - v29_cesdata_putty(t_29,regi,in) - - ,2) - ) - + - sum((t_29,regi_dyn29(regi),in)$putty_compute_in(in) - ,power( v29_cesdata(t_29,regi,in) !! Be as close as possible as the aggregate trajectory - - pm_cesdata(t_29,regi,in,"quantity") - ,6) - ) - + sum ((t_29hist_last(t),regi_dyn29(regi), out), - power ( v29_puttyTechDiff(t,regi,out), - 2) - ) - + 1e-6 * sum ((t_29, regi_dyn29(regi),out, in,in2) $(putty_compute_in(in) - AND putty_compute_in(in2) - AND cesOut2cesIn(out,in) - AND cesOut2cesIn2(out,in2) - AND ( NOT sameAs(in,in2)) - ), !! penalise the large differences in ratios between inputs for Total quantities (pm_cesdata) and putty quantities (pm_cesdata_putty) - power ( v29_ratioTotalPutty(t_29,regi,out,in,in2), - 2) - ) - ; - -$onOrder - - - -q29_outputtech(regi_dyn29(regi),ipf(out),index_Nr)$( (pm_cesdata_sigma("2015",out) eq -1) AND p29_capitalUnitProjections(regi,out,index_Nr)).. - - v29_outputtech(regi,out,index_Nr) - =e= - sum ((cesOut2cesIn(out,in), t_29hist_last(t)), - pm_cesdata(t,regi,in,"xi") - * ( - pm_cesdata(t,regi,in,"eff") - * p29_capitalUnitProjections(regi,in,index_Nr) - ) - ** v29_rho(regi,out) - ) - ** (1 / v29_rho(regi,out)) -; - -q29_esub_obj.. - - v29_esub_err - =e= - sum ((out,regi_dyn29(regi),index_Nr, t_29hist_last(t))$((pm_cesdata_sigma("2015",out) eq -1) AND p29_capitalUnitProjections(regi,out,index_Nr)), - (1 + pm_cesdata(t,regi,out,"quantity")) **2 !! weight by regional size of the service demand - * - ( - power ( - ( p29_output_estimation(regi,out) - / v29_outputtech(regi,out,index_Nr) - ) - - 1 - , 2 - ) - + - power ( - ( v29_outputtech(regi,out,index_Nr) - / p29_output_estimation(regi,out) - ) - -1 - ,2 - ) - ) - ); - - - -*** EOF ./modules/29_CES_parameters/calibrate/equations.gms - diff --git a/modules/29_CES_parameters/calibrate/input/files b/modules/29_CES_parameters/calibrate/input/files index 1e33aca7d..08cac811b 100644 --- a/modules/29_CES_parameters/calibrate/input/files +++ b/modules/29_CES_parameters/calibrate/input/files @@ -1,4 +1,3 @@ -f29_capitalUnitProjections.cs4r f29_capitalQuantity.cs4r f29_efficiency_growth.cs4r f29_esdemand.cs4r diff --git a/modules/29_CES_parameters/calibrate/not_used.txt b/modules/29_CES_parameters/calibrate/not_used.txt index 83165a436..ad14a32d8 100644 --- a/modules/29_CES_parameters/calibrate/not_used.txt +++ b/modules/29_CES_parameters/calibrate/not_used.txt @@ -5,5 +5,3 @@ # | REMIND License Exception, version 1.0 (see LICENSE file). # | Contact: remind@pik-potsdam.de name,type,reason - - diff --git a/modules/29_CES_parameters/calibrate/output.gms b/modules/29_CES_parameters/calibrate/output.gms index 96175f996..ed948fe59 100644 --- a/modules/29_CES_parameters/calibrate/output.gms +++ b/modules/29_CES_parameters/calibrate/output.gms @@ -11,15 +11,13 @@ p29_CESderivative(t,regi_dyn29(regi),cesOut2cesIn(out,in))$( vm_cesIO.l(t,regi,i * pm_cesdata(t,regi,in,"eff") * vm_effGr.l(t,regi,in) - * (vm_cesIO.l(t,regi,out)$( NOT ipf_putty(out)) - + vm_cesIOdelta.l(t,regi,out)$( ipf_putty(out)) + * (vm_cesIO.l(t,regi,out) ) ** (1 - pm_cesdata(t,regi,out,"rho")) * ( pm_cesdata(t,regi,in,"eff") * vm_effGr.l(t,regi,in) - * (vm_cesIO.l(t,regi,in)$( NOT ipf_putty(out)) - + vm_cesIOdelta.l(t,regi,in)$( ipf_putty(out)) + * (vm_cesIO.l(t,regi,in) ) ) ** (pm_cesdata(t,regi,out,"rho") - 1); @@ -44,8 +42,7 @@ put file_CES_calibration; loop ((t,regi_dyn29(regi),in)$( ppf_29(in) OR ppf_beyondcalib_29(in) - OR sameas(in,"inco") - OR ppf_putty(in) ), + OR sameas(in,"inco")), put "%c_expname%", sm_CES_calibration_iteration:0:0, t.tl, regi.tl; put "efficiency", in.tl; put (pm_cesdata("2005",regi,in,"eff") * vm_effGr.l(t,regi,in)) /; @@ -57,8 +54,7 @@ loop ((t,regi_dyn29(regi),in)$( ppf_29(in) put in.tl, pm_cesdata(t,regi,in,"xi") /; ); -loop ((t,regi_dyn29(regi),in)$( NOT in_putty(in) - AND ( ppf_29(in) +loop ((t,regi_dyn29(regi),in)$( ( ppf_29(in) OR ppf_beyondcalib_29(in) OR sameas(in,"inco")) ), put "%c_expname%", sm_CES_calibration_iteration:0:0, t.tl, regi.tl; @@ -78,28 +74,6 @@ loop ((t,regi_dyn29(regi),in)$( NOT in_putty(in) ) /; ); -loop ((t,regi_dyn29(regi),in)$( in_putty(in) - AND ( ppf_29(in) - OR ppf_beyondcalib_29(in) - OR sameas(in,"inco")) - OR ppf_putty(in) ), - put "%c_expname%", sm_CES_calibration_iteration:0:0, t.tl, regi.tl; - put "quantity_putty", in.tl, vm_cesIOdelta.l(t,regi,in) /; - - put "%c_expname%", sm_CES_calibration_iteration:0:0, t.tl, regi.tl, "price_putty"; - put in.tl, pm_cesdata(t,regi,in,"price") /; - - put "%c_expname%", sm_CES_calibration_iteration:0:0, t.tl, regi.tl; - put "total efficiency putty", in.tl; - put sum(cesOut2cesIn(out,in), - pm_cesdata(t,regi,in,"xi") - ** (1 / pm_cesdata(t,regi,out,"rho")) - * ( pm_cesdata("2005",regi,in,"eff") - * vm_effGr.l(t,regi,in) - ) - ) /; -); - loop ((ttot,regi_dyn29(regi),te_29_report), put "%c_expname%", sm_CES_calibration_iteration:0:0, ttot.tl, regi.tl; put "vm_deltaCap", te_29_report.tl; diff --git a/modules/29_CES_parameters/calibrate/preloop.gms b/modules/29_CES_parameters/calibrate/preloop.gms index dcdd0419f..98aa3fb41 100644 --- a/modules/29_CES_parameters/calibrate/preloop.gms +++ b/modules/29_CES_parameters/calibrate/preloop.gms @@ -46,8 +46,8 @@ if (sm_tmp, $endif.old_structure -***_____________________________ START OF: GET PRICES _____________________________ -*** In the first iteration with a changed CES structure, ppf prices can't be loaded from file, so they have to be set to an initial default. +***_____________________________START OF: 1 - CALCULATE PRICES _____________________________ +*** In the first iteration with a changed CES structure, ppf prices are set to an initial default. if( sm_CES_calibration_iteration eq 1 and s29_CES_calibration_new_structure eq 1, !! Set CES prices to the value specified by cm_CES_calibration_default_prices !! and abort if cm_CES_calibration_default_prices == 0 @@ -57,36 +57,32 @@ $endif.default_prices pm_cesdata(t,regi,all_in,"price") = %cm_CES_calibration_default_prices%; pm_cesdata(t,regi,ipf_29,"price") = 1; - pm_cesdata(t,regi,in_complements(in),"price") = 1; pm_cesdata(t,regi,industry_ue_calibration_target_dyn37(in),"price")$( pm_cesdata(t,regi,in,"price") eq 1 ) = %cm_CES_calibration_default_prices%; else - !! If not first iteration or known CES structure, compute ppf prices from CES derivatives load from file + !! If not first iteration with unknown CES structure, compute ppf prices from CES derivatives loaded from file !! Compute prices of each node from CES derivatives of previous run: !! d(V_o)/d(V_i) = pi_i = xi_i * eff_i * effGr_i * V_o**(1-rho_o) * (eff_i * effGr_i * V_i)**(rho_o-1) - p29_CESderivative(t,regi_dyn29(regi),ces_29(out,in))$( - p29_cesIO_load(t,regi,in)) + p29_CESderivative(t,regi_dyn29(regi),ces_29(out,in))$(p29_cesIO_load(t,regi,in)) = p29_cesdata_load(t,regi,in,"xi") * p29_cesdata_load(t,regi,in,"eff") * p29_effGr(t,regi,in) + * p29_cesIO_load(t,regi,out) - * ( p29_cesIO_load(t,regi,out)$( NOT ipf_putty(out)) - + p29_cesIOdelta_load(t,regi,out)$( ipf_putty(out)) - ) ** (1 - p29_cesdata_load(t,regi,out,"rho")) * exp( - log( - p29_cesdata_load(t,regi,in,"eff") - * p29_effGr(t,regi,in) - * ( p29_cesIO_load(t,regi,in)$( NOT ipf_putty(out)) - + p29_cesIOdelta_load(t,regi,in)$( ipf_putty(out))) - ) - * (p29_cesdata_load(t,regi,out,"rho") - 1)); + log( + p29_cesdata_load(t,regi,in,"eff") + * p29_effGr(t,regi,in) + * p29_cesIO_load(t,regi,in) + ) + * (p29_cesdata_load(t,regi,out,"rho") - 1) + ); !! Propagate price down the CES tree to get prices in terms of inco, !! i.e. calc d(inco)/d(in) by applying the chain rule (product of node derivatives) @@ -103,21 +99,12 @@ else !! Prices of intermediate production factors are all set to 1, !! To account for the chain rule multiplication above. - !! except on the level above the perfect substitutes if they are ppf_29. - !! Here, the level above gets the price, while the perfect substitutes below get 1. - loop ( cesOut2cesIn(in2,in) $ ( - NOT ( ppf_29(in) AND in_complements(in)) - ), + loop ( cesOut2cesIn(in2,in), p29_CESderivative(t,regi_dyn29(regi),out,ipf_29(in2))$( p29_CESderivative(t,regi,out,in2) ) = 1; ); - - !! Prices of perfect substitutes factors are all 1 - p29_CESderivative(t,regi_dyn29(regi),out,ppf_29(in2))$( - p29_CESderivative(t,regi,out,in2) AND in_complements(in2) ) - = 1; - !! Price of inco is 1, too + !! Price of inco is 1 p29_cesdata_load(t,regi_dyn29(regi),"inco","price") = 1; !! unit price !! Transfer prices @@ -165,7 +152,6 @@ $ifthen.write_prices %c_CES_calibration_write_prices% == "1" $endif.write_prices ) - *** Abort if any ppf prices are <= 0 if (smin((t,regi_dyn29(regi),ppf_29(in)), pm_cesdata(t,regi,in,"price")) le 0, put logfile; @@ -176,7 +162,6 @@ if (smin((t,regi_dyn29(regi),ppf_29(in)), pm_cesdata(t,regi,in,"price")) le 0, abort "Some ppf prices are <= 0. Check ./modules/29_CES_parameters/calibrate/input/pm_cesdata_price_XXX.inc!"; ); - *** Write prices to file if (sm_CES_calibration_iteration eq 1, !! first CES calibration iteration put file_CES_calibration; @@ -186,7 +171,7 @@ if (sm_CES_calibration_iteration eq 1, !! first CES calibration iteration OR ppf_beyondcalib_29(in) OR sameas(in,"enhb") OR sameas(in,"enhgab") ), - if (NOT in_putty(in) AND (ppf_29(in) OR sameas(in,"inco")), + if ((ppf_29(in) OR sameas(in,"inco")), put "%c_expname%", "origin", t.tl, regi.tl, "quantity", in.tl; put p29_cesIO_load(t,regi,in) /; @@ -206,27 +191,6 @@ if (sm_CES_calibration_iteration eq 1, !! first CES calibration iteration ); ); - if (in_putty(in) AND ppf_29(in), - put "%c_expname%", "origin", t.tl, regi.tl, "quantity_putty", in.tl; - put p29_cesIOdelta_load(t,regi,in) /; - - put "%c_expname%", "origin", t.tl, regi.tl, "price_putty", in.tl; - put pm_cesdata(t,regi,in,"price") /; - - if (p29_cesdata_load("2005",regi,in,"eff") AND p29_effGr(t,regi,in), - put "%c_expname%", "origin", t.tl, regi.tl, "total efficiency putty"; - put in.tl; - put ( sum(cesOut2cesIn(out,in), - p29_cesdata_load(t,regi,in,"xi") - ** (1 / p29_cesdata_load(t,regi,out,"rho")) - * ( p29_cesdata_load("2005",regi,in,"eff") - * p29_effGr(t,regi,in) - ) - ) - ) /; - ); - ); - put "%c_expname%", "origin", t.tl, regi.tl, "efficiency", in.tl; put (p29_cesdata_load("2005",regi,in,"eff") * p29_effGr(t,regi,in)) /; @@ -263,7 +227,6 @@ if (sm_tmp eq 1, abort "some prices are negative. See log file"; ); - display "before price smoothing", cesOut2cesIn_below, pm_cesdata; *** Smooth 2005 prices pm_cesdata("2005",regi_dyn29(regi),in_29,"price")$( ppf_29(in_29) ) @@ -371,29 +334,11 @@ loop (ttot$( ttot.val ge 2005), display "after all but entrp_frgt_lo smoothening", pm_cesdata; -*** Smooth prices for the whole period for elements in or below the putty-clay -*** structure. Problem if there are several ppfIO_putty below each other, -*** prices are then smoothed twice. -loop ((t_29,cesOut2cesIn_below(out,in))$( ppfIO_putty(out) ), - pm_cesdata(t_29,regi_dyn29(regi),in,"price") - = sum(t2_29$( t2_29.val ge t_29.val ), - (1 - pm_delta_kap(regi,out)) - ** (t2_29.val - t_29.val) - * pm_cesdata(t2_29,regi,in,"price") - ) - / sum(t2_29$( t2_29.val ge t_29.val ), - (1 - pm_delta_kap(regi,out)) - ** (t2_29.val - t_29.val) - ); -); +display "after price smoothing", cesOut2cesIn_below; -display "after price smoothing", cesOut2cesIn_below, pm_cesdata; +***_____________________________ END OF: 1 - CALCULATE PRICES _____________________________ -***_____________________________ END OF: GET PRICES _____________________________ - -***_____________________________ START OF: CALCULATE IPF _____________________________ - -display "start consistency", pm_cesdata; +***_____________________________ START OF: 2 - CALCULATE QUANTITIES_____________________________ *** All effGr, are set to one, so that we can focus on efficiencies *** we will split xi and eff evolutions later and pass it on to effGr @@ -401,86 +346,7 @@ pm_cesdata(t,regi_dyn29,in_29,"effGr") = 1; *** First, using the prices and quantities of the ppfEn, the prices of ipf *** we compute thanks to the Euler equation the quantities of the ipf. - -***This is done in two steps:first (A) for everything below ppf_putty, so that we can compute -***the first pm_cesdata_putty by taking into account the growth of pm_cesdata -***second (B) we compute quantities for everything up to the last CES level inco.(lab,kap,en) - -***(A) -loop (cesRev2cesIO(counter,ipf_29(out))$( in_below_putty(out) - OR ppf_putty(out) ), - pm_cesdata(t_29,regi_dyn29,out,"quantity") - = sum(cesOut2cesIn(out,in), - pm_cesdata(t_29,regi_dyn29,in,"price") - * pm_cesdata(t_29,regi_dyn29,in,"quantity") - ); -); -display "compute putty" , pm_cesdata; - -v29_cesdata_putty.lo(t_29,regi_dyn29(regi),in) $ putty_compute_in(in) - = 1e-6; -v29_cesdata_putty.L(t_29,regi_dyn29(regi),in) $ putty_compute_in(in) - = pm_cesdata(t_29,regi,in,"quantity") - / 30; -v29_cesdata.l(t_29,regi_dyn29(regi),in) $ putty_compute_in(in) - = pm_cesdata(t_29,regi,in,"quantity"); -v29_cesdata.lo(t_29,regi_dyn29(regi),in) - = 0.90 - * v29_cesdata.l(t_29,regi,in); -v29_cesdata.up(t_29,regi_dyn29(regi),in) - = 1.10 - * v29_cesdata.l(t_29,regi,in); -v29_cesdata.fx(t_29,regi_dyn29(regi),in) $ (putty_compute_in(in) - AND (sameAs(t_29,"2010") - OR sameAs(t_29,"2005") - ) - ) - = pm_cesdata(t_29,regi,in,"quantity"); - -loop ((regi_dyn29(regi),cesOut2cesIn(out,in),cesOut2cesIn2(out,in2)) $ ( - putty_compute_in(in) AND putty_compute_in(in2) ), - v29_ratioTotalPutty.l(t_29,regi,out,in,in2) = 1; - v29_ratioTotalPutty.up(t_29,regi,out,in,in2) = 100; -); - -model putty_paths / -q29_pathConstraint -q29_ratioTotalPutty -q29_putty_obj -q29_esubsConstraint -/; - -if (execError > 0, - execute_unload "abort.gdx"; - abort "at least one execution error occured, abort.gdx written"; -); - -solve putty_paths minimizing v29_putty_obj using nlp; - -if ( NOT (( putty_paths.solvestat eq 1 - AND (putty_paths.modelstat eq 1 OR putty_paths.modelstat eq 2)) - OR (putty_paths.solvestat eq 4 - AND putty_paths.modelstat eq 7) - ), - execute_unload "abort.gdx"; - abort "model putty_paths is infeasible"; -); - -pm_cesdata_putty(t_29,regi_dyn29(regi),in,"quantity") $ v29_cesdata_putty.L(t_29,regi,in) - = v29_cesdata_putty.L(t_29,regi,in); - - -loop ( cesOut2cesIn_below(out,in)$putty_compute_in(out), - pm_cesdata(t_29,regi_dyn29(regi),in,"quantity") - = v29_cesdata.L(t_29,regi,out) - / pm_cesdata(t_29,regi,out,"quantity") - * pm_cesdata(t_29,regi,in,"quantity") - ; -); - -pm_cesdata(t_29,regi_dyn29(regi),in,"quantity") $ putty_compute_in(in) - = v29_cesdata.L(t_29,regi,in); - +*** we compute quantities for everything up to the last CES level inco.(lab,kap,en) !! Write to file if (sm_CES_calibration_iteration eq 1, !! first CES calibration iteration @@ -491,15 +357,10 @@ if (sm_CES_calibration_iteration eq 1, !! first CES calibration iteration OR ppf_beyondcalib_29(in) OR sameas(in,"enhb") OR sameas(in,"enhgab") ), - if (NOT in_putty(in) AND (ppf_29(in) OR sameas(in,"inco")), + if ((ppf_29(in) OR sameas(in,"inco")), put "%c_expname%", "target", t.tl, regi.tl, "quantity", in.tl; put pm_cesdata(t,regi,in,"quantity") /; ); - - if (in_putty(in) AND ppf_29(in), - put "%c_expname%", "target", t.tl, regi.tl, "quantity_putty", in.tl; - put pm_cesdata_putty(t,regi,in,"quantity") /; - ); ); loop ((t_29hist(t),regi_dyn29(regi),ppf_beyondcalib_29(in)), @@ -520,44 +381,13 @@ $endif.subsectors putclose file_CES_calibration; ); - -***(B) -loop ((t,cesRev2cesIO(counter,ipf_29(out)))$( NOT ( sameas(out,"inco") - OR in_below_putty(out) - OR ppf_putty(out)) ), - pm_cesdata(t,regi_dyn29,out,"quantity")$( NOT ipf_putty(out) ) +loop ((t,cesRev2cesIO(counter,ipf_29(out)))$( NOT ( sameas(out,"inco")) ), + pm_cesdata(t,regi_dyn29,out,"quantity") = sum(cesOut2cesIn(out,in), pm_cesdata(t,regi_dyn29,in,"price") * pm_cesdata(t,regi_dyn29,in,"quantity") ); - - pm_cesdata_putty(t,regi_dyn29,out,"quantity")$( ipf_putty(out) ) - = sum(cesOut2cesIn(out,in), - pm_cesdata(t,regi_dyn29,in,"price") - * pm_cesdata_putty(t,regi_dyn29,in,"quantity") - ); - - !! compute the total for factors that are ppf in the CES and ipf in the - !! putty. For the first period, we assume that pm_cesdata stays constant - pm_cesdata(t,regi_dyn29,out,"quantity")$( t0(t) AND ppfIO_putty(out) ) - = pm_cesdata_putty(t,regi_dyn29,out,"quantity") - / pm_delta_kap(regi_dyn29,out); - - !! compute the total for factors that are ppf in the CES and ipf in the putty - pm_cesdata(t,regi_dyn29,out,"quantity")$( - NOT t0(t) AND ppfIO_putty(out) ) - = ( pm_cesdata(t-1,regi_dyn29,out,"quantity") - * (1 - pm_delta_kap(regi_dyn29,out)) ** pm_dt(t) - ) - + ( pm_cumDeprecFactor_old(t,regi_dyn29,out) - * pm_cesdata_putty(t-1,regi_dyn29,out,"quantity") - ) - + ( pm_cumDeprecFactor_new(t,regi_dyn29,out) - * pm_cesdata_putty(t,regi_dyn29,out,"quantity") - ); ); - - *** Ensure that the labour share in GDP is at least 20 % for historical periods *** and 0.5 % for others. sm_tmp = 0; @@ -577,126 +407,38 @@ loop ((t_29hist(t),regi_dyn29(regi)), put t.tl, " ", regi.tl, " labour share in GDP: ", (1 - sm_tmp); - pm_cesdata(t,regi,ppf_29(in),"price") $ ( NOT ( sameAs(in, "lab") - OR in_complements(in)) ) + pm_cesdata(t,regi,ppf_29(in),"price") $ ( NOT sameAs(in, "lab")) = pm_cesdata(t,regi,in,"price") * (0.8$( t_29hist(t) ) + 0.995$( NOT t_29hist(t) )) / sm_tmp; - loop (cesOut2cesIn(in2,in)$( ppf_29(in) AND in_complements(in) ), - pm_cesdata(t,regi,in2,"price") - = pm_cesdata(t,regi,in2,"price") - * (0.8$( t_29hist(t) ) + 0.995$( NOT t_29hist(t) )) - / sm_tmp; - ); - put " -> ", (1 - (0.8$( t_29hist(t) ) + 0.995$( NOT t_29hist(t) ))) /; sm_tmp2 = sm_tmp2 + 1; ); ); putclose logfile; - !! If there has been a rescaling for historical steps, repeat previous steps with new prices if ( sm_tmp2 gt 0, !! If there has been a rescaling - loop (cesRev2cesIO(counter,ipf_29(out))$( in_below_putty(out) - OR ppf_putty(out) ), - pm_cesdata(t_29,regi_dyn29,out,"quantity") - = sum(cesOut2cesIn(out,in), - pm_cesdata(t_29,regi_dyn29,in,"price") - * pm_cesdata(t_29,regi_dyn29,in,"quantity") - ); - ); - - if (execError > 0, - execute_unload "abort.gdx"; - abort "at least one execution error occured, abort.gdx written"; - ); - - solve putty_paths minimizing v29_putty_obj using nlp; - - - if ( NOT (( putty_paths.solvestat eq 1 - AND (putty_paths.modelstat eq 1 OR putty_paths.modelstat eq 2)) - OR (putty_paths.solvestat eq 4 - AND putty_paths.modelstat eq 7) - ), - execute_unload "abort.gdx"; - abort "model putty_paths is infeasible"; - ); + loop ((t,cesRev2cesIO(counter,ipf_29(out)))$( NOT ( sameas(out,"inco"))), - pm_cesdata_putty(t_29,regi_dyn29(regi),in,"quantity") $ v29_cesdata_putty.L(t_29,regi,in) - = v29_cesdata_putty.L(t_29,regi,in); - - - loop ( cesOut2cesIn_below(out,in)$putty_compute_in(out), - pm_cesdata(t_29,regi_dyn29(regi),in,"quantity") - = v29_cesdata.L(t_29,regi,out) - / pm_cesdata(t_29,regi,out,"quantity") - * pm_cesdata(t_29,regi,in,"quantity") - ; - ); - - pm_cesdata(t_29,regi_dyn29(regi),in,"quantity") $ putty_compute_in(in) - = v29_cesdata.L(t_29,regi,in); - - - loop ((t,cesRev2cesIO(counter,ipf_29(out)))$( NOT ( sameas(out,"inco") - OR in_below_putty(out) - OR ppf_putty(out)) ), - pm_cesdata(t,regi_dyn29,out,"quantity")$( NOT ipf_putty(out) ) + pm_cesdata(t,regi_dyn29,out,"quantity") = sum(cesOut2cesIn(out,in), pm_cesdata(t,regi_dyn29,in,"price") * pm_cesdata(t,regi_dyn29,in,"quantity") ); - - pm_cesdata_putty(t,regi_dyn29,out,"quantity")$( ipf_putty(out) ) - = sum(cesOut2cesIn(out,in), - pm_cesdata(t,regi_dyn29,in,"price") - * pm_cesdata_putty(t,regi_dyn29,in,"quantity") - ); - - !! compute the total for factors that are ppf in the CES and ipf in the - !! putty. For the first period, we assume that pm_cesdata stays constant - pm_cesdata(t,regi_dyn29,out,"quantity")$( t0(t) AND ppfIO_putty(out) ) - = pm_cesdata_putty(t,regi_dyn29,out,"quantity") - / pm_delta_kap(regi_dyn29,out); - - !! compute the total for factors that are ppf in the CES and ipf in the putty - pm_cesdata(t,regi_dyn29,out,"quantity")$( - NOT t0(t) AND ppfIO_putty(out) ) - = ( pm_cesdata(t-1,regi_dyn29,out,"quantity") - * (1 - pm_delta_kap(regi_dyn29,out)) ** pm_dt(t) - ) - + ( pm_cumDeprecFactor_old(t,regi_dyn29,out) - * pm_cesdata_putty(t-1,regi_dyn29,out,"quantity") - ) - + ( pm_cumDeprecFactor_new(t,regi_dyn29,out) - * pm_cesdata_putty(t,regi_dyn29,out,"quantity") - ); - ); + ); ); -*** Abort if any quantities in pm_cesdata_putty are negative. -if (smin((t_29,regi_dyn29(regi),in)$(in_putty(in)), pm_cesdata_putty(t_29,regi,in,"quantity")) lt 0, - put logfile; - loop ((t_29,regi_dyn29(regi),in)$(in_putty(in) AND pm_cesdata_putty(t_29,regi,in,"quantity") lt 0 ), - put pm_cesdata_putty.tn(t_29,regi,in,"quantity"), " = ", pm_cesdata_putty(t_29,regi,in,"quantity") /; - ); - execute_unload "abort.gdx"; - abort "Some pm_cesdata_putty are <= 0. Check logfile!"; -); +***_____________________________ END OF: 2 - CALCULATE QUANTITIES_____________________________ -***_____________________________ END OF: CALCULATE IPF _____________________________ - -***_____________________________ START OF: CHANGE EFFICIENCIES TO FULFILL ECONOMIC CONSTRAINT _____________________________ +***_____________________________ START OF: 3 - CALCULATE EFFICIENCIES _____________________________ *** We ensure that the prices correspond to the derivatives, because *** the Euler equation holds for derivatives. Using prices makes only sense if *** prices equal derivatives. loop ((cesRev2cesIO(counter,ipf_29(out)),ces_29(out,in))$( NOT sameas(out,"inco") ), - if (NOT ipf_putty(out), pm_cesdata(t,regi_dyn29, in,"xi") = pm_cesdata(t,regi_dyn29,in,"price") * pm_cesdata(t,regi_dyn29,in,"quantity") @@ -705,29 +447,17 @@ loop ((cesRev2cesIO(counter,ipf_29(out)),ces_29(out,in))$( pm_cesdata(t,regi_dyn29,in,"eff") = pm_cesdata(t,regi_dyn29,out, "quantity") / pm_cesdata(t,regi_dyn29,in, "quantity"); - ); - - if (ipf_putty(out), - pm_cesdata(t_29,regi_dyn29, in,"xi") - = pm_cesdata(t_29,regi_dyn29,in,"price") - * pm_cesdata_putty(t_29,regi_dyn29,in,"quantity") - / pm_cesdata_putty(t_29,regi_dyn29,out,"quantity"); - - pm_cesdata(t_29,regi_dyn29,in,"eff") - = pm_cesdata_putty(t_29,regi_dyn29,out, "quantity") - / pm_cesdata_putty(t_29,regi_dyn29,in, "quantity"); - ); ); display "after change up to en consistency", pm_cesdata; -***_____________________________ END OF: CHANGE EFFICIENCIES TO FULFILL ECONOMIC CONSTRAINT _____________________________ +***_____________________________ END OF: 3 - CALCULATE EFFICIENCIES _____________________________ -***_____________________________ START OF: ENSURE GDP CONSISTENCY VIA LABOUR PRICE _____________________________ +***_____________________________ START OF: 4 - ADJUST LABOUR PRICE to GDP _____________________________ -* Then, we consider the bottom level of the CES tree, where capital and labor -* have specific restrictions. Capital works as for the other ppfen, Labour -* will be the adjustment variable to meet inco. xi will not be equal to the -* income share of capital (from equation price = derivative) +*** Then, we consider the top level of the CES tree, where capital and labor +*** have specific restrictions. Capital works as for the other ppfen, Labour +*** will be the adjustment variable to meet inco. xi will not be equal to the +*** income share of capital (from equation price = derivative) pm_cesdata(t,regi_dyn29,"kap","xi") = pm_cesdata(t,regi_dyn29,"kap","price") * pm_cesdata(t,regi_dyn29,"kap","quantity") @@ -737,7 +467,7 @@ pm_cesdata(t,regi_dyn29,"kap","eff") = pm_cesdata(t,regi_dyn29,"inco", "quantity") / pm_cesdata(t,regi_dyn29,"kap", "quantity"); -display "after change cap eff consistency", pm_cesdata, pm_cesdata_putty; +display "after change cap eff consistency", pm_cesdata; *** If the value (quantity x price) of either en or kap, or the sum of both, *** exceed the quantity of inco (all of which would result in negative labour @@ -753,35 +483,35 @@ if (smax((t,regi_dyn29(regi)), "value exceeds inco <<<" /; loop ((t,regi_dyn29(regi)), sm_tmp !! by how much does en + kap exceed inco? - = ( ( pm_cesdata(t,regi,"en","quantity") - * pm_cesdata(t,regi,"en","price") - ) - + ( pm_cesdata(t,regi,"kap","quantity") - * pm_cesdata(t,regi,"kap","price") - ) + = ( ( pm_cesdata(t,regi,"en","quantity") + * pm_cesdata(t,regi,"en","price") + ) + + ( pm_cesdata(t,regi,"kap","quantity") + * pm_cesdata(t,regi,"kap","price") + ) ) - / pm_cesdata(t,regi,"inco","quantity"); + / pm_cesdata(t,regi,"inco","quantity"); if (sm_tmp > 1, put " ", t.tl, " ", regi.tl, " ", pm_cesdata(t,regi,"en","quantity"), " x ", - pm_cesdata(t,regi,"en","price"), " + ", - pm_cesdata(t,regi,"kap","quantity"), " x ", - pm_cesdata(t,regi,"kap","price"), " > ", - pm_cesdata(t,regi,"inco","quantity"), " -> "; + pm_cesdata(t,regi,"en","price"), " + ", + pm_cesdata(t,regi,"kap","quantity"), " x ", + pm_cesdata(t,regi,"kap","price"), " > ", + pm_cesdata(t,regi,"inco","quantity"), " -> "; sm_tmp2 = ( pm_cesdata(t,regi,"inco","quantity") - ( pm_cesdata(t,regi,"lab","quantity") * pm_cesdata(t,regi,"lab","price") - ) + ) ) / ( ( pm_cesdata(t,regi,"en","quantity") * pm_cesdata(t,regi,"en","price") - ) + ) + ( pm_cesdata(t,regi,"kap","quantity") * pm_cesdata(t,regi,"kap","price") - ) + ) ); pm_cesdata(t,regi,"en","price") @@ -809,28 +539,28 @@ loop (cesOut2cesIn("inco",in)$( NOT sameas(in,"lab") ), put logfile, ">>> Warning: Rescaling ", in.tl, " prices as its value ", "exceedes inco <<<" /; loop ((t,regi_dyn29(regi)), - sm_tmp - = pm_cesdata(t,regi,in,"quantity") - * pm_cesdata(t,regi,in,"price") - / pm_cesdata(t,regi,"inco","quantity"); - - if (sm_tmp gt 1, - put " ", t.tl, " ", regi.tl, in.tl:>4, " ", - pm_cesdata(t,regi,in,"quantity"), " x ", - pm_cesdata(t,regi,in,"price"), " > ", - pm_cesdata(t,regi,"inco","quantity"), " -> "; + sm_tmp + = pm_cesdata(t,regi,in,"quantity") + * pm_cesdata(t,regi,in,"price") + / pm_cesdata(t,regi,"inco","quantity"); + + if (sm_tmp gt 1, + put " ", t.tl, " ", regi.tl, in.tl:>4, " ", + pm_cesdata(t,regi,in,"quantity"), " x ", + pm_cesdata(t,regi,in,"price"), " > ", + pm_cesdata(t,regi,"inco","quantity"), " -> "; + + pm_cesdata(t,regi,in,"price") + = ( pm_cesdata(t,regi,"inco","quantity") + - sum(cesOut2cesIn2("inco",in2)$( NOT sameas(in,in2) ), + pm_cesdata(t,regi,in2,"quantity") + * pm_cesdata(t,regi,in2,"price") + ) + ) + / pm_cesdata(t,regi,in,"quantity"); - pm_cesdata(t,regi,in,"price") - = ( pm_cesdata(t,regi,"inco","quantity") - - sum(cesOut2cesIn2("inco",in2)$( NOT sameas(in,in2) ), - pm_cesdata(t,regi,in2,"quantity") - * pm_cesdata(t,regi,in2,"price") - ) - ) - / pm_cesdata(t,regi,in,"quantity"); - - put pm_cesdata(t,regi,in,"price") /; - ); + put pm_cesdata(t,regi,in,"price") /; + ); ); putclose logfile, " " /; ); @@ -896,13 +626,13 @@ if (sm_tmp, abort "assertion xi gt 0 failed, see .log file for details"; ); -***_____________________________ END OF: ENSURE GDP CONSISTENCY VIA LABOUR PRICE _____________________________ - display " end consistency", pm_cesdata; *** End of the part ensuring consistency given the ppfEn prices and quantities, the ipf prices, *** the labor quantities, and the capital efficiency growth. -***_____________________________ START OF: BEYOND CALIB _________________________________________________ +***_____________________________ END OF: 4 - ADJUST LABOUR PRICE to GDP _____________________________ + +***_____________________________ START OF: BEYOND CALIBRATION PART I _________________________________________________ *** Beyond calib allows for calibration of intermediate levels. *** At the time of documentation, this was mainly used for the industry module subsectors realization. @@ -925,21 +655,18 @@ if (card(ppf_beyondcalib_29) >= 1, !! if there are any nodes in beyond calib = p29_cesdata_load(t,regi,in,"xi") * p29_cesdata_load(t,regi,in,"eff") * p29_effGr(t,regi,in) + * p29_cesIO_load(t,regi,out) - * ( p29_cesIO_load(t,regi,out)$( NOT ipf_putty(out) ) - + p29_cesIOdelta_load(t,regi,out)$( ipf_putty(out) ) - ) ** (1 - p29_cesdata_load(t,regi,out,"rho")) * exp( - log( - p29_cesdata_load(t,regi,in,"eff") - * p29_effGr(t,regi,in) - * ( p29_cesIO_load(t,regi,in)$( NOT ipf_putty(out)) - + p29_cesIOdelta_load(t,regi,in)$( ipf_putty(out)) - ) - ) - * (p29_cesdata_load(t,regi,out,"rho") - 1)); + log( + p29_cesdata_load(t,regi,in,"eff") + * p29_effGr(t,regi,in) + * p29_cesIO_load(t,regi,in) + ) + * (p29_cesdata_load(t,regi,out,"rho") - 1) + ); !! Propagate price down the CES tree loop ((cesLevel2cesIO(counter,in),cesOut2cesIn(in,in2),cesOut2cesIn2(in2,in3)), @@ -949,20 +676,13 @@ if (card(ppf_beyondcalib_29) >= 1, !! if there are any nodes in beyond calib ); - !! Prices of intermediate production factors are all 1, except on the level - !! above the perfect substitutes if they are ppf_29 - loop (cesOut2cesIn(in2,in)$( - NOT (ppf_beyondcalib_29(in) AND in_complements(in)) ), + !! Prices of intermediate production factors are all 1 + loop (cesOut2cesIn(in2,in), p29_CESderivative(t,regi_dyn29(regi),out,ipf_beyond_29_excludeRoot(in2))$( p29_CESderivative(t,regi,out,in2) ) = 1; ); - !! Prices of perfect substitutes factors are all 1 - p29_CESderivative(t,regi_dyn29(regi),out,ppf_beyondcalib_29(in2))$( - p29_CESderivative(t,regi,out,in2) AND in_complements(in2) ) - = 1; - display "check p29_CESderivative", p29_CESderivative; loop ((regi_dyn29(regi), @@ -989,10 +709,8 @@ $endif.subsectors ); else - !! complements are not treated in the first iteration pm_cesdata(t,regi,ipf_beyond_29(in),"price")$( NOT ue_industry_dyn37(in) ) = 1; - ); !! The calibration of elasticities of substitution takes much longer to @@ -1031,8 +749,7 @@ $endif.subsectors !! First, we compute the quantity for the root deriving from the ppf !! quantities and prices and we adjust the ppf prices so that it matches the - !! root quantity. The current formulation does not support putty in beyond - !! and complements. + !! root quantity. loop ((t_29hist(t),regi_dyn29(regi),root_beyond_calib_29(out)), sm_tmp @@ -1056,15 +773,8 @@ $endif.subsectors put " " /; loop (cesOut2cesIn(out,in), - if ( NOT ipf_putty(out), - put pm_cesdata.tn(t,regi,in,"quantity"), " = "; - put pm_cesdata(t,regi,in,"quantity") /; - ); - if ( ipf_putty(out), - put pm_cesdata_putty.tn(t,regi,in,"quantity"), " = "; - put pm_cesdata_putty(t,regi,in,"quantity") /; - ); - + put pm_cesdata.tn(t,regi,in,"quantity"), " = "; + put pm_cesdata(t,regi,in,"quantity") /; put pm_cesdata.tn(t,regi,in,"price"), " = "; put pm_cesdata(t,regi,in,"price") /; ); @@ -1089,59 +799,14 @@ $endif.subsectors loop ((t_29,cesRev2cesIO(counter,ipf_beyond_29_excludeRoot(out)))$( NOT sameas(out,"inco") ), - pm_cesdata(t_29,regi_dyn29,out,"quantity")$( NOT ipf_putty(out) ) + pm_cesdata(t_29,regi_dyn29,out,"quantity") = sum(cesOut2cesIn(out,in), pm_cesdata(t_29,regi_dyn29,in,"price") * pm_cesdata(t_29,regi_dyn29,in,"quantity") ); - - pm_cesdata_putty(t_29,regi_dyn29,out,"quantity")$( ipf_putty(out) ) - = sum(cesOut2cesIn(out,in), - pm_cesdata(t_29,regi_dyn29,in,"price") - * pm_cesdata_putty(t_29,regi_dyn29,in, "quantity") - ); - - !! compute the total for factors that are ppf in the CES and ipf in the putty - pm_cesdata(t0(t_29),regi_dyn29,ppfIO_putty(out),"quantity") - = pm_cesdata_putty(t_29,regi_dyn29,out,"quantity") - / pm_delta_kap(regi_dyn29,out); - - !! compute the delta for factors that are ipf in the CES and ppf in the putty - pm_cesdata_putty(t0(t_29),regi_dyn29,ppf_putty(out),"quantity") - = pm_cesdata(t_29,regi_dyn29,out,"quantity") - - ( pm_cesdata(t_29,regi_dyn29,out,"quantity") - * (1 - pm_delta_kap(regi_dyn29,out)) - ); - - !! compute the total for factors that are ppf in the CES and ipf in the putty - pm_cesdata(t_29,regi_dyn29,ppfIO_putty(out),"quantity")$( NOT t0(t_29) ) - = ( pm_cesdata(t_29-1,regi_dyn29,out,"quantity") - * (1 - pm_delta_kap(regi_dyn29,out)) - ** pm_dt(t_29) - ) - + ( pm_cumDeprecFactor_old(t_29,regi_dyn29,out) - * pm_cesdata_putty(t_29-1,regi_dyn29,out,"quantity") - ) - + ( pm_cumDeprecFactor_new(t_29,regi_dyn29,out) - * pm_cesdata_putty(t_29,regi_dyn29,out,"quantity") - ); - - !! compute the delta for factors that are ipf in the CES and ppf in the putty - pm_cesdata_putty(t_29,regi_dyn29,ppf_putty(out),"quantity")$( NOT t0(t_29) ) - = 1 /pm_cumDeprecFactor_new(t_29,regi_dyn29,out) - * ( pm_cesdata(t_29,regi_dyn29,out,"quantity") - - ( pm_cesdata(t_29-1,regi_dyn29,out,"quantity") - * (1 - pm_delta_kap(regi_dyn29,out)) - ** pm_dt(t_29) - ) - - ( pm_cumDeprecFactor_old(t_29,regi_dyn29,out) - * pm_cesdata_putty(t_29-1,regi_dyn29,out,"quantity") - ) - ); ); loop ((t_29hist(t_29),cesOut2cesIn(out,in_beyond_calib_29_excludeRoot(in))), - if (NOT ipf_putty(out), pm_cesdata(t_29,regi_dyn29,in,"xi") = pm_cesdata(t_29,regi_dyn29,in,"price") * pm_cesdata(t_29,regi_dyn29,in,"quantity") @@ -1150,29 +815,13 @@ $endif.subsectors pm_cesdata(t_29,regi_dyn29,in,"eff") = pm_cesdata(t_29,regi_dyn29,out,"quantity") / pm_cesdata(t_29,regi_dyn29,in,"quantity"); - ); - - if (ipf_putty(out), - pm_cesdata(t_29,regi_dyn29,in,"xi") - = pm_cesdata(t_29,regi_dyn29,in,"price") - * pm_cesdata_putty(t_29,regi_dyn29,in,"quantity") - / pm_cesdata_putty(t_29,regi_dyn29,out,"quantity"); - - pm_cesdata(t_29,regi_dyn29,in,"eff") - = pm_cesdata_putty(t_29,regi_dyn29,out,"quantity") - / pm_cesdata_putty(t_29,regi_dyn29,in,"quantity"); - ); ); ); -***_____________________________ END OF: BEYOND CALIB ________________________________________ +***_____________________________ END OF: BEYOND CALIBRATION PART I ________________________________________ -***_____________________________ START OF: COMPUTE ELASTICITIES OF SUBSTITUTION ________________________________________ +***_____________________________ START OF: 5 - COMPUTE ELASTICITIES OF SUBSTITUTION ________________________________________ -*** Elasticities of substitution are normally prescribed manually. -*** However, they can also be estimated from technological data. This is done here. -*** At the time of documentation, the nodes for which this is done are in the services_with_capital realization of the -*** buildings module. *** Compute the rho parameter from the elasticity of substitution pm_cesdata(ttot,regi,ipf(out),"rho")$( ttot.val ge 2005 @@ -1180,80 +829,9 @@ pm_cesdata(ttot,regi,ipf(out),"rho")$( ttot.val ge 2005 AND pm_cesdata_sigma(ttot,out) ne -1 ) !! Do not compute it if sigma = 0, because these should be estimated = 1 - (1 / pm_cesdata_sigma(ttot,out)); - -*** Check whether all sigma = INF correspond to complementary factors -*** while it seems contradictory, the model currently only supports -*** complementary factors which add up to yield their output (therefore the perfect substituability). -*** OUT = IN1 + IN2 + IN3 +... -*** The complementarity is ensured by the production constraints on the relations between IN1, IN2, etc - -loop (cesOut2cesIn(out,in) $ (pm_cesdata_sigma("2015",out) eq INF ), - if ( NOT in_complements(in), - execute_unload "abort.gdx"; - abort "the model only supports perfect substituability for complementary factors. Please read the comments in calibration/preloop.gms" - ); - ); - - -*** For the estimation of Esubs: set the CES out to 1 if the CES inputs are in the data -loop (cesOut2cesIn(out,in) $ (pm_cesdata_sigma("2015",out) eq -1), - p29_capitalUnitProjections(all_regi,out,index_Nr) $p29_capitalUnitProjections(all_regi,in,index_Nr) = 1; -); - - model esubs / -q29_outputtech, -q29_esub_obj, -/; - -v29_outputtech.L(regi_dyn29,ipf(out),index_Nr) = 1; -v29_outputtech.lo(regi_dyn29,ipf(out),index_Nr) = 0; -v29_rho.L(regi,out)$( pm_cesdata_sigma("2015",out) eq -1) = 0.5; -v29_rho.up(regi,out) = 0.8; !! corresponds to sigma = 5 -v29_rho.lo(regi,out) = -9; !! corresponds to sigma = 0.1 - -loop ((cesOut2cesIn(out,in), t_29hist_last(t))$((pm_cesdata_sigma(t,out) eq -1) AND ppfKap(in)), - - p29_output_estimation(regi_dyn29(regi),out) = ( pm_cesdata(t,regi,out,"quantity") $ ( NOT ipf_putty(out)) - + pm_cesdata_putty(t,regi,out,"quantity") $ ( ipf_putty(out)) - ) - / ( pm_cesdata(t,regi,in,"quantity") $ ( NOT ipf_putty(out)) - + pm_cesdata_putty(t,regi,in,"quantity") $ ( ipf_putty(out)) - ) - * p29_capitalUnitProjections(regi,in,"0") !! index = 0, is the typical technology - -); -if (execError > 0, - execute_unload "abort.gdx"; - abort "at least one execution error occured, abort.gdx written"; -); - -solve esubs minimizing v29_esub_err using nlp; - -if ( NOT ( esubs.solvestat eq 1 AND (esubs.modelstat eq 1 OR esubs.modelstat eq 2)), - execute_unload "abort.gdx"; - abort "model esubs is infeasible"; -); - -display "esubs results", p29_capitalUnitProjections; - -pm_cesdata(t,regi_dyn29(regi),in,"rho")$( pm_cesdata_sigma(t,in) eq -1) = v29_rho.L(regi,in); - -pm_cesdata(t,regi_dyn29(regi),in,"rho")$( pm_cesdata_sigma(t,in) eq -1) = - 1 - (1 - pm_cesdata(t,regi,in,"rho")) - / ( 1 + min(max((pm_ttot_val(t) - 2015)/(2050 -2015),0),1) - * p29_esubGrowth - ) -; - -pm_cesdata(t,regi_dyn29(regi),in,"rho")$( pm_cesdata_sigma(t,in) eq -1 AND pm_cesdata(t,regi,in,"rho") lt 0) = min(pm_cesdata(t,regi,in,"rho"), 1 - 1/0.8); !! If complementary factors, sigma should be below 0.8 -pm_cesdata(t,regi_dyn29(regi),in,"rho")$( pm_cesdata_sigma(t,in) eq -1 AND pm_cesdata(t,regi,in,"rho") ge 0) = max(pm_cesdata(t,regi,in,"rho"), 1 - 1/1.2); !! If substitution factors, sigma should be above 1.2 -pm_cesdata(t,regi_dyn29(regi),in,"rho")$( pm_cesdata_sigma(t,in) eq -1 ) = max ( v29_rho.lo(regi,in), pm_cesdata(t,regi,in,"rho")); -pm_cesdata(t,regi_dyn29(regi),in,"rho")$( pm_cesdata_sigma(t,in) eq -1 ) = min ( v29_rho.up(regi,in), pm_cesdata(t,regi,in,"rho")); - ***_____________________________ END OF: COMPUTE ELASTICITIES OF SUBSTITUTION ________________________________________ - -***_____________________________ START OF: PASS EFF TIME EVOLUTION TO EFFGR ________________________________________ +***_____________________________ START OF: 5 - PASS EFF TIME EVOLUTION TO EFFGR ________________________________________ *** Finally, we take the evolution of xi and eff, and pass it on to effGr. *** (a) for items in ces_29 @@ -1309,7 +887,7 @@ loop ((t_29hist_last(t2),cesOut2cesIn(out,in))$( ue_fe_kap_29(out) ), / p29_efficiency_growth(t2,regi,in); ); -***_____________________________ END OF: PASS EFF TIME EVOLUTION TO EFFGR ________________________________________ +***_____________________________ END OF: 5 - PASS EFF TIME EVOLUTION TO EFFGR ________________________________________ ***_____________________________ START OF: BEYOND CALIBRATION PART II ________________________________________ @@ -1322,12 +900,13 @@ $ifthen.industry_FE_target "%c_CES_calibration_industry_FE_target%" == "1" *** Abort if any industry EEK value is lower than subsector output quantity sm_tmp = smin((t,regi_dyn29(regi), - cesOut2cesIn(ue_industry_dyn37(out),ppfKap(in))), - pm_cesdata(t,regi,out,"quantity") - - ( pm_cesdata(t,regi,in,"quantity") - * pm_cesdata(t,regi,in,"price") - ) - ); + cesOut2cesIn(ue_industry_dyn37(out),ppfKap(in)) + ), + pm_cesdata(t,regi,out,"quantity") + - ( pm_cesdata(t,regi,in,"quantity") + * pm_cesdata(t,regi,in,"price") + ) + ); if (0 gt sm_tmp, put logfile, "Error in industry FE price rescaling: ", "EEK value exceeds subsector output quantity" /; @@ -1336,13 +915,13 @@ if (0 gt sm_tmp, cesOut2cesIn(ue_industry_dyn37(out),ppfKap(in))), sm_tmp = pm_cesdata(t,regi,out,"quantity") - ( pm_cesdata(t,regi,in,"quantity") - * pm_cesdata(t,regi,in,"price") - ); + * pm_cesdata(t,regi,in,"price") + ); if (0 gt sm_tmp, put t.tl, ".", regi.tl, " ", out.tl:>20, pm_cesdata(t,regi,out,"quantity"):>10:4, " < ", - pm_cesdata(t,regi,in,"quantity"):>8:4, " x ", - pm_cesdata(t,regi,in,"price"):<8:4, " ", + pm_cesdata(t,regi,in,"quantity"):>8:4, " x ", + pm_cesdata(t,regi,in,"price"):<8:4, " ", in.tl:<0 /; ); ); @@ -1497,24 +1076,6 @@ $endif.subsectors option p29_efficiency_growth:8; display "after long term efficiencies", pm_cesdata, p29_efficiency_growth; -***_______________________ COMPLEMENTARY CONSTRAINTS _____________________________ -*** Compute the coefficients for the complementarity constraints -*** FIXME: In case in_complements are in beyond, quantity data is needed for -*** the assignment below -loop (complements_ref(in, in2), - pm_cesdata(t,regi_dyn29(regi),in2,"compl_coef")$( - ( NOT in_putty(in2)) OR ppfIO_putty(in2) ) - = pm_cesdata(t,regi,in,"quantity") - / pm_cesdata(t,regi,in2,"quantity"); - - pm_cesdata(t,regi_dyn29(regi),in2,"compl_coef")$( - in_putty(in2) AND (NOT ppfIO_putty(in2)) ) - = pm_cesdata_putty(t,regi,in,"quantity") - / pm_cesdata_putty(t,regi,in2,"quantity"); -); -***_______________________ END COMPLEMENTARY CONSTRAINTS _____________________________ - - *** All efficiences after t_29_last are set to their t_29_last values. This is *** done in order to avoid xi negative in the latest periods. Should not be *** necessary to split pre and post-t_29_last with reasonable FE pathways @@ -1541,13 +1102,9 @@ loop ((out,in,in2,t)$((pm_cesdata_sigma(t,out) eq -1) AND ( ppfKap(in) AND ( NOT ppfKap(in2))) AND (sameAs(t, "2015") OR sameAs(t, "2050") OR sameAs(t, "2100"))) , - if ( sameAs(t,"2015"), - put sm_CES_calibration_iteration:0:0, "remind" ,"2015", out.tl , "output_scale", regi.tl, p29_output_estimation(regi,out) /; - ); - - put sm_CES_calibration_iteration:0:0, "remind" , t.tl, out.tl , "quantity", regi.tl, ( pm_cesdata(t,regi,out,"quantity") $ ( NOT ipf_putty(out)) + pm_cesdata_putty(t,regi,out,"quantity") $ ( ipf_putty(out))) /; - put sm_CES_calibration_iteration:0:0, "remind" , t.tl, in.tl , "quantity", regi.tl, ( pm_cesdata(t,regi,in,"quantity") $ ( NOT ipf_putty(out)) + pm_cesdata_putty(t,regi,in,"quantity") $ ( ipf_putty(out))) /; - put sm_CES_calibration_iteration:0:0, "remind" , t.tl, in2.tl , "quantity", regi.tl, ( pm_cesdata(t,regi,in2,"quantity") $ ( NOT ipf_putty(out)) + pm_cesdata_putty(t,regi,in2,"quantity") $ ( ipf_putty(out))) /; + put sm_CES_calibration_iteration:0:0, "remind" , t.tl, out.tl , "quantity", regi.tl, pm_cesdata(t,regi,out,"quantity") /; + put sm_CES_calibration_iteration:0:0, "remind" , t.tl, in.tl , "quantity", regi.tl, pm_cesdata(t,regi,in,"quantity") /; + put sm_CES_calibration_iteration:0:0, "remind" , t.tl, in2.tl , "quantity", regi.tl, pm_cesdata(t,regi,in2,"quantity") /; put sm_CES_calibration_iteration:0:0,"remind" , t.tl, in.tl , "eff", regi.tl, pm_cesdata(t,regi,in,"eff") /; put sm_CES_calibration_iteration:0:0,"remind" , t.tl, in2.tl , "eff", regi.tl, pm_cesdata(t,regi,in2,"eff") /; @@ -1563,10 +1120,6 @@ loop ((out,in,in2,t)$((pm_cesdata_sigma(t,out) eq -1) put sm_CES_calibration_iteration:0:0,"remind" , t.tl,out.tl , "rho", regi.tl, pm_cesdata(t,regi,out,"rho") /; ); - - loop ((index_Nr,in)$p29_capitalUnitProjections(regi, in, index_Nr), - put sm_CES_calibration_iteration:0:0,index_Nr.tl, "2015", in.tl , "quantity", regi.tl, p29_capitalUnitProjections(regi,in,index_Nr) /; - ); ); putclose; @@ -1579,33 +1132,15 @@ p29_test_CES_recursive(t_29,regi,in) = 0; p29_test_CES_recursive(t_29hist,regi_dyn29,ppf(in)) = pm_cesdata(t_29hist,regi_dyn29,in,"quantity"); -p29_test_CES_recursive(t_29,regi_dyn29,ppf_29(in))$( NOT ppf_putty(in) ) +p29_test_CES_recursive(t_29,regi_dyn29,ppf_29(in)) = pm_cesdata(t_29,regi_dyn29,in,"quantity"); -p29_test_CES_putty_recursive(t_29,regi_dyn29,ppf_29(in))$( ppf_putty(in) ) -= pm_cesdata_putty(t_29,regi_dyn29,in,"quantity"); - -p29_test_CES_putty_recursive(t_29hist,regi_dyn29,ppf_putty(in))$( - NOT ppf_29(in) ) -= pm_cesdata_putty(t_29hist,regi_dyn29,in,"quantity"); - -display "consistency beyond 1", p29_test_CES_recursive, - p29_test_CES_putty_recursive; +display "consistency beyond 1", p29_test_CES_recursive; *** test for the historical periods, where beyond_calib is also taken into account loop ((t_29hist(t),regi_dyn29(regi),cesRev2cesIO(counter,ipf(out))), - p29_test_CES_putty_recursive(t,regi,out)$( ipf_putty(out) ) - = sum(cesOut2cesIn(out,in), - pm_cesdata(t,regi,in,"xi") - * ( pm_cesdata(t,regi,in,"eff") - * pm_cesdata(t,regi,in,"effGr") - * p29_test_CES_putty_recursive(t,regi,in) - ) - ** pm_cesdata(t,regi,out,"rho") - ) - ** (1 / pm_cesdata(t,regi,out,"rho")); - p29_test_CES_recursive(t,regi,out)$( NOT ipf_putty(out) ) + p29_test_CES_recursive(t,regi,out) = sum(cesOut2cesIn(out,in), pm_cesdata(t,regi,in,"xi") * ( pm_cesdata(t,regi,in,"eff") @@ -1616,57 +1151,16 @@ loop ((t_29hist(t),regi_dyn29(regi),cesRev2cesIO(counter,ipf(out))), ) ** (1 / pm_cesdata(t,regi,out,"rho")); -!! compute the total for factors that are ppf in the CES and ipf in the putty -p29_test_CES_recursive(t0(t),regi,ppfIO_putty(out)) - = p29_test_CES_putty_recursive(t,regi,out) - / pm_delta_kap(regi,out); - -!! compute the total for factors that are ppf in the CES and ipf in the putty -p29_test_CES_recursive(t,regi_dyn29,ppfIO_putty(out))$( NOT t0(t) ) - = ( p29_test_CES_recursive(t-1,regi_dyn29,out) - * (1- pm_delta_kap(regi_dyn29,out)) - ** pm_dt(t) - ) - + ( pm_cumDeprecFactor_old(t,regi_dyn29,out) - * p29_test_CES_putty_recursive(t-1,regi_dyn29,out) - ) - + ( pm_cumDeprecFactor_new(t,regi_dyn29,out) - * p29_test_CES_putty_recursive(t,regi_dyn29,out) - ); - -!! compute the delta for factors that are ipf in the CES and ppf in the putty -p29_test_CES_putty_recursive(t,regi_dyn29,ppf_putty(out))$( NOT t0(t) ) - = 1 / pm_cumDeprecFactor_new(t,regi_dyn29,out) - * ( p29_test_CES_recursive(t,regi_dyn29,out) - - ( p29_test_CES_recursive(t-1,regi_dyn29,out) - * (1 - pm_delta_kap(regi_dyn29,out)) - ** pm_dt(t) - ) - - ( pm_cumDeprecFactor_old(t,regi_dyn29,out) - * p29_test_CES_putty_recursive(t-1,regi_dyn29,out) - ) - ); ); putclose logfile; -display "consistency beyond 2", p29_test_CES_recursive, - p29_test_CES_putty_recursive; +display "consistency beyond 2", p29_test_CES_recursive; *** test for the other periods, and restrict to in_29 loop ((t_29(t),regi_dyn29(regi),cesRev2cesIO(counter,ipf_29(out)))$( NOT t_29hist(t) ), - p29_test_CES_putty_recursive(t,regi,out)$( ipf_putty(out) ) - = sum(cesOut2cesIn(out,in), - pm_cesdata(t,regi,in,"xi") - * ( pm_cesdata(t,regi,in,"eff") - * pm_cesdata(t,regi,in,"effGr") - * p29_test_CES_putty_recursive(t,regi,in) - ) - ** pm_cesdata(t,regi,out,"rho") - ) - ** (1 / pm_cesdata(t,regi,out,"rho")); - p29_test_CES_recursive(t,regi,out)$( NOT ipf_putty(out) ) + p29_test_CES_recursive(t,regi,out) !! use exp(log(a) * b) = a ** b because the latter is not accurate in GAMS = exp( log( @@ -1685,81 +1179,14 @@ loop ((t_29(t),regi_dyn29(regi),cesRev2cesIO(counter,ipf_29(out)))$( ) * (1 / pm_cesdata(t,regi,out,"rho")) ); - - !! compute the total for factors that are ppf in the CES and ipf in the putty - p29_test_CES_recursive(t,regi_dyn29,out)$( ppfIO_putty(out) ) - = ( p29_test_CES_recursive(t-1,regi_dyn29,out) - * (1 - pm_delta_kap(regi_dyn29,out)) - ** pm_dt(t) - ) - + ( pm_cumDeprecFactor_old(t,regi_dyn29,out) - * p29_test_CES_putty_recursive(t-1,regi_dyn29,out) - ) - + ( pm_cumDeprecFactor_new(t,regi_dyn29,out) - * p29_test_CES_putty_recursive(t,regi_dyn29,out) - ); - - !! compute the delta for factors that are ipf in the CES and ppf in the putty - p29_test_CES_putty_recursive(t,regi_dyn29,out)$( ppf_putty(out) ) - = 1 / pm_cumDeprecFactor_new(t,regi_dyn29,out) - * ( p29_test_CES_recursive(t,regi_dyn29,out) - - ( p29_test_CES_recursive(t-1,regi_dyn29,out) - * (1 - pm_delta_kap(regi_dyn29,out)) - ** pm_dt(t) - ) - - ( pm_cumDeprecFactor_old(t,regi_dyn29,out) - * p29_test_CES_putty_recursive(t-1,regi_dyn29,out) - ) - ); ); -display "consistency beyond 3", p29_test_CES_recursive, - p29_test_CES_putty_recursive; +display "consistency beyond 3", p29_test_CES_recursive; option p29_test_CES_recursive:8; display "check technological consistency beyond calibration", pm_cesdata, p29_test_CES_recursive; -put logfile; -sm_tmp = 0; -loop ((t_29(t),regi_dyn29(Regi)), - if ( ( card(putty_compute_in) eq 0 - AND abs( p29_test_CES_recursive(t,regi,"inco") - - pm_cesdata(t,regi,"inco","quantity")) gt 1e-6) - OR ( card(putty_compute_in) gt 0 - AND abs( p29_test_CES_recursive(t,regi,"inco") - - pm_cesdata(t,regi,"inco","quantity")) gt 1e-2), - - put "consistency check failed for ", t.tl, ", ", regi.tl /; - sm_tmp = 0; - loop (cesLevel2cesIO(counter,ipf)$( pm_cesdata(t,regi,ipf,"quantity") - ne p29_test_CES_recursive(t,regi,ipf) ), - sm_tmp = max(sm_tmp, card(ipf.tl) + counter.val); - ); - put "ipf", @(sm_tmp + 2) "pm_cesdata"; - put @(sm_tmp + 15) "p29_test_CES_recursive" /; - loop (cesLevel2cesIO(counter,ipf)$( - ( pm_cesdata(t,regi,ipf,"quantity") - ne p29_test_CES_recursive(t,regi,ipf)) - AND p29_test_CES_recursive(t,regi,ipf) ne 0 ), - put @(counter.val - 1) ipf.tl; - put @(sm_tmp + 3) pm_cesdata(t,regi,ipf,"quantity"); - put @(sm_tmp + 16) p29_test_CES_recursive(t,regi,ipf); - put @(sm_tmp + 41) "[", ( p29_test_CES_recursive(t,regi,ipf) - - pm_cesdata(t,regi,ipf,"quantity")), "]" /; - ); - put " " /; - - sm_tmp = 1; - ); -); -putclose logfile; - -if (sm_tmp, - execute_unload "abort.gdx"; - abort "something is wrong with the consistency of pm_cesdata, see logfile"; -); - sm_tmp = 0; loop ((t_29(t),regi_dyn29(regi),cesOut2cesIn(out,in))$( NOT sameas(in,"inco") ), if ( pm_cesdata(t,regi,in,"effGr") lt 1e-10 @@ -1802,23 +1229,9 @@ putclose logfile; ***_____________________________ END OF: CONSISTENCY CHECKS ________________________________________ -*** Add information on ppf_putty quantities which are not in ppf_29 -if (sm_CES_calibration_iteration eq 1, - put file_CES_calibration; - - loop ((t,regi_dyn29(regi),in)$(( NOT ppf_29(in)) AND ppf_putty(in)), - - put "%c_expname%", "target", t.tl, regi.tl, "quantity_putty", in.tl; - put pm_cesdata_putty(t,regi,in,"quantity") /; - - - ); - putclose file_CES_calibration; - ); - $ONorder -* Assert that q37_energy_limits is feasible for calibration runs +*** Assert that q37_energy_limits is feasible for calibration runs sm_tmp = 0; loop ((ttot(t),regi_dyn29(regi),industry_ue_calibration_target_dyn37(out))$( t.val gt 2015 AND pm_energy_limit(out) ), @@ -1842,7 +1255,7 @@ if (sm_tmp eq 1, put " > ", sm_tmp /; loop (ces_eff_target_dyn37(out,in)$( pm_cesdata(t,regi,in,"quantity") ), put @3 pm_cesdata.tn(t,regi,in,"quantity"), @73 " = "; - put pm_cesdata(t,regi,in,"quantity") /; + put pm_cesdata(t,regi,in,"quantity") /; ); put " " /; ); diff --git a/modules/29_CES_parameters/calibrate/realization.gms b/modules/29_CES_parameters/calibrate/realization.gms index 1518e6d82..dfe63ccd3 100644 --- a/modules/29_CES_parameters/calibrate/realization.gms +++ b/modules/29_CES_parameters/calibrate/realization.gms @@ -241,52 +241,12 @@ *' approach is taken: All ppfen (not ppfkap) input prices are mutliplied with the same factor (the ratio of prescribed *' to computed UE quantity, minus the ppfkap share), such that the quantity trajectories are met for UE. *' -*' ##### Putty-Clay -*' -*' Putty-Clay is currently mainly used in the buildings module. -*' -*' It is possible to introduce segments of the CES tree which are subject to putty-clay dynamics, _i.e._ the model at -*' time `t` will substitute between _increments_ of the variables. The _aggregate_ level of the variable will be the -*' sum of the _increment_ from the CES and the depreciated past _aggregate_ level. This mechanism limits the extent -*' to which the energy demand can be reduced in response to higher energy prices. -*' -*' To treat some CES sections as putty-clay, the set items should be included to `in_putty` and `ppf_putty` for the lowest -*' level of the putty-clay section. In addition, depreciation rates should be defined for the putty variables. For -*' consistency, it is advisable to use identical depreciation rates for inputs and outputs in the same CES function. -*' -*' Currently, the calibration script has not been tested for a putty-clay structure that is in the `beyond_calib` part. -*' -*' The Powerpoint file attached gives some more explanations. -*' -*' ##### Perfectly complementary factors -*' -*' To implement perfectly complementary factors, you should include the factors in the set `in_complements`. In addition, -*' the elasticity of substitution between these factors should be set to `INF` (which is counter-intuitive). Prices of -*' complementary inputs are set to 1, so that the output is equal to the sum of inputs (reason why the substitution -*' elasticity should be INF), which makes sense for energetic entities. It would however be possible to change this -*' (by choosing another elasticity of substitution) without harming the calibration. -*' -*' In the model, the complementary factors are subject to a constraint (`q01_prodCompl` or `q01_prodCompl_putty`), so that -*' each variable is computed by multiplying a key variable of the CES function by a given factor. The calibration computes -*' this factor for each period. -*' -*' ##### Compute elasticities of substitution -*' -*' Normally, the elasticities of substitution are prescribed as an ad-hoc guess in the according modules. -*' -*' However, for some CES nodes (currently only in the `services_with_capital` realization of the buildings module), it is -*' estimated with technological data instead. -*' -*' To this end, equations are defined in the file `equations.gms`, and a corresponding model minimizing an error is solved -*' in `preloop.gms` to best fit the data. The according section is labeled "compute elasticities of substitution" in the -*' source code. -*' + *####################### R SECTION START (PHASES) ############################## $Ifi "%phase%" == "sets" $include "./modules/29_CES_parameters/calibrate/sets.gms" $Ifi "%phase%" == "declarations" $include "./modules/29_CES_parameters/calibrate/declarations.gms" $Ifi "%phase%" == "datainput" $include "./modules/29_CES_parameters/calibrate/datainput.gms" -$Ifi "%phase%" == "equations" $include "./modules/29_CES_parameters/calibrate/equations.gms" $Ifi "%phase%" == "preloop" $include "./modules/29_CES_parameters/calibrate/preloop.gms" $Ifi "%phase%" == "bounds" $include "./modules/29_CES_parameters/calibrate/bounds.gms" $Ifi "%phase%" == "output" $include "./modules/29_CES_parameters/calibrate/output.gms" diff --git a/modules/29_CES_parameters/calibrate/sets.gms b/modules/29_CES_parameters/calibrate/sets.gms index a4329589b..7990f1e34 100644 --- a/modules/29_CES_parameters/calibrate/sets.gms +++ b/modules/29_CES_parameters/calibrate/sets.gms @@ -30,7 +30,6 @@ ppf_29(all_in) "primary production factors to calibrate for" in_29(all_in) "calibration production factors" ue_29(all_in) "useful energy variables" ue_fe_kap_29(all_in) "useful energy items which are the direct output of one FE and one Kap, and which is calibrated to. The CES efficiencies need specific treatment" -putty_compute_in(all_in) "factors inside putty which should be computed from non-putty values" in_beyond_calib_29(all_in) "all factors which are outside of the calibration, including the ones which are ppf_29" in_beyond_calib_29_excludeRoot(all_in) "all factors which are outside of the calibration, excluding the ones which are ppf_29" root_beyond_calib_29(all_in) "all factors which operate the junction between the calibrated CES and the CES which is not calibrated" diff --git a/modules/29_CES_parameters/load/not_used.txt b/modules/29_CES_parameters/load/not_used.txt index 6018f1fd7..04ecdcca1 100644 --- a/modules/29_CES_parameters/load/not_used.txt +++ b/modules/29_CES_parameters/load/not_used.txt @@ -14,11 +14,6 @@ pm_gdp,parameter,??? pm_lab,parameter,??? sm_EJ_2_TWa,input,questionnaire pm_cesdata_sigma,input,questionnaire -vm_cesIOdelta,input,questionnaire -pm_cesdata_putty,input,questionnaire -pm_dt,input,questionnaire -pm_cumDeprecFactor_old,input,questionnaire -pm_cumDeprecFactor_new,input,questionnaire sm_mega_2_non,input,questionnaire pm_delta_kap,input,questionnaire sm_tmp2,input,questionnaire @@ -28,5 +23,5 @@ sm_TWa_2_kWh,input,questionnaire pm_ue_eff_target,parameter,not needed pm_calibrate_eff_scale,parameter,not needed pm_fedemand,parameter,not needed -pm_energy_limit +pm_energy_limit,, sm_CES_calibration_iteration,scalar,only applicable during calibration diff --git a/modules/32_power/DTcoup/datainput.gms b/modules/32_power/DTcoup/datainput.gms index 6c2c2ddb7..b0012b590 100644 --- a/modules/32_power/DTcoup/datainput.gms +++ b/modules/32_power/DTcoup/datainput.gms @@ -81,7 +81,7 @@ $offdelim / ; *** convert from USD2015/MWh to trUSD2005/TWa -p32_flex_maxdiscount(regi,te) = p32_flex_maxdiscount(regi,te) * sm_TWa_2_MWh * sm_D2015_2_D2005 * 1e-12; +p32_flex_maxdiscount(regi,te) = p32_flex_maxdiscount(regi,te) * sm_TWa_2_MWh * s_D2015_2_D2005 * 1e-12; display p32_flex_maxdiscount; $offtext diff --git a/modules/32_power/IntC/datainput.gms b/modules/32_power/IntC/datainput.gms index 61fbbb44f..b443ec499 100644 --- a/modules/32_power/IntC/datainput.gms +++ b/modules/32_power/IntC/datainput.gms @@ -92,7 +92,7 @@ $offdelim / ; *** convert from USD2015/MWh to trUSD2005/TWa -p32_flex_maxdiscount(regi,te) = p32_flex_maxdiscount(regi,te) * sm_TWa_2_MWh * sm_D2015_2_D2005 * 1e-12; +p32_flex_maxdiscount(regi,te) = p32_flex_maxdiscount(regi,te) * sm_TWa_2_MWh * s_D2015_2_D2005 * 1e-12; display p32_flex_maxdiscount; $offtext diff --git a/modules/36_buildings/module.gms b/modules/36_buildings/module.gms index a1d8aa54e..731398851 100644 --- a/modules/36_buildings/module.gms +++ b/modules/36_buildings/module.gms @@ -14,8 +14,6 @@ *' @authors Antoine Levesque, Robin Hasse *###################### R SECTION START (MODULETYPES) ########################## -$Ifi "%buildings%" == "services_putty" $include "./modules/36_buildings/services_putty/realization.gms" -$Ifi "%buildings%" == "services_with_capital" $include "./modules/36_buildings/services_with_capital/realization.gms" $Ifi "%buildings%" == "simple" $include "./modules/36_buildings/simple/realization.gms" *###################### R SECTION END (MODULETYPES) ############################ *** EOF ./modules/36_buildings/module.gms diff --git a/modules/36_buildings/services_putty/bounds.gms b/modules/36_buildings/services_putty/bounds.gms deleted file mode 100644 index 92776b9bf..000000000 --- a/modules/36_buildings/services_putty/bounds.gms +++ /dev/null @@ -1,49 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_putty/bounds.gms -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") ) - = 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); -); - -loop (t36_hist_last(ttot2) , - v36_deltaProdEs.lo(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $ ( - ttot.val le ttot2.val) - = max ( 0, - p36_deltaProdEs(ttot,regi,enty,esty,teEs) - -1e-6 - ) - ; - v36_deltaProdEs.up(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $ ( - ttot.val le ttot2.val) - = p36_deltaProdEs(ttot,regi,enty,esty,teEs) - +1e-6 - ; - ); -v36_deltaProdEs.lo(t36_scen(ttot),regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) = 1e-9; - -v36_vintageInfes.fx(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $( - v36_vintageInfes.L(ttot,regi,enty,esty,teEs)) - = v36_vintageInfes.L(ttot,regi,enty,esty,teEs); - -v36_vintageInfes.fx(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $( - NOT v36_vintageInfes.L(ttot,regi,enty,esty,teEs)) - = 0; - -v36_logitInfes.up(t,regi_dyn36(regi),inViaEs_dyn36(in)) = + INF ; - -*** EOF ./modules/36_buildings/services_putty/bounds.gms diff --git a/modules/36_buildings/services_putty/datainput.gms b/modules/36_buildings/services_putty/datainput.gms deleted file mode 100644 index 410584636..000000000 --- a/modules/36_buildings/services_putty/datainput.gms +++ /dev/null @@ -1,327 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_putty/datainput.gms -*** substitution elasticities -Parameter - p36_cesdata_sigma(all_in) "substitution elasticities" - / - enb 0.3 - esswb -1 !! The Esub is estimated with technological data - ueswb INF !! all sigma equal to INF will be treated as a sum with coefficients equal to unity ie OUT = IN1+ IN2. - uescb -1 !! The Esub is estimated with technological data - uealb -1 !! The Esub is estimated with technological data - / - -; -pm_cesdata_sigma(ttot,in)$p36_cesdata_sigma(in) = p36_cesdata_sigma(in); - -pm_capital_lifetime_exp(all_regi,"kapsc") = 20; -pm_capital_lifetime_exp(all_regi,"kapal") = 12; - -pm_capital_lifetime_exp(all_regi,"esswb") = log ( 0.25) / log ( 1 -0.02 ); - -pm_delta_kap(regi,in)$((ppfKap_dyn36(in) AND NOT in_putty(in)) OR nests_putty_dyn36(in,in)) = - log (0.25) / pm_capital_lifetime_exp(regi,in); - -loop (out, -pm_delta_kap(regi,in)$nests_putty_dyn36(out,in) = pm_delta_kap(regi,out); -); - -parameter - -p36_floorspace_scen(tall,all_regi,all_demScen) "floorspace" -/ -$ondelim -$include "./modules/36_buildings/services_putty/input/p36_floorspace_scen.cs4r" -$offdelim -/ -; -p36_floorspace(ttot,regi) = p36_floorspace_scen(ttot,regi,"%cm_demScen%") * 1e-3; !! from million to billion m2 - -parameter -p36_demFeForEs_scen "final energy demand projections for FE-UE technologies" -/ -$ondelim -$include "./modules/36_buildings/services_with_capital/input/p36_serviceInputs.cs4r" -$offdelim -/ - -p36_prodEs_scen "useful energy demand projections for FE-UE technologies" -/ -$ondelim -$include "./modules/36_buildings/services_with_capital/input/p36_serviceOutputs.cs4r" -$offdelim -/ -; - -table f36_datafecostsglob(char,all_teEs) "end-use (final energy) technologies characteristics" -$include "./modules/36_buildings/services_putty/input/generisdata_feCapCosts.prn" -; - - f36_datafecostsglob("inco0",teEs) = sm_D2015_2_D2005 * f36_datafecostsglob("inco0",teEs); - f36_datafecostsglob("inco0",teEs) = sm_DpKW_2_TDpTW * f36_datafecostsglob("inco0",teEs); - f36_datafecostsglob("omf",teEs) = sm_D2015_2_D2005 * f36_datafecostsglob("omf",teEs); - f36_datafecostsglob("omf",teEs) = sm_DpKW_2_TDpTW * f36_datafecostsglob("omf",teEs); - -table f36_dataeff(char,all_teEs) "end-use (final energy) long term efficiency assumptions" -$include "./modules/36_buildings/services_with_capital/input/generisdata_Eff.prn" -; - -p36_demFeForEs(ttot,regi,entyFe,esty,teEs)$fe2es_dyn36(entyFe,esty,teEs) = p36_demFeForEs_scen(ttot,regi,"%cm_GDPscen%",entyFe,esty,teEs) * sm_EJ_2_TWa; !! from EJ to TWa; -p36_prodEs(ttot,regi,entyFe,esty,teEs)$fe2es_dyn36(entyFe,esty,teEs) = p36_prodEs_scen(ttot,regi,"%cm_GDPscen%",entyFe,esty,teEs) * sm_EJ_2_TWa; !! from EJ to TWa; - - -***_____________________________Information for the ES layer and the multinomial logit function _____________________________ -*** Price sensitivity of the logit function -p36_logitLambda(regi,in)$inViaEs_dyn36(in) = cm_priceSensiBuild; - -*** Compute efficiencies of technologies producing ES(UE) from FE -loop ( fe2es_dyn36(entyFe,esty,teEs), -p36_fe2es(ttot,regi,teEs)$p36_demFeForEs(ttot,regi,entyFe,esty,teEs) = p36_prodEs(ttot,regi,entyFe,esty,teEs) / p36_demFeForEs(ttot,regi,entyFe,esty,teEs); -); - -p36_fe2es(ttot,regi,teEs)$(teEs_dyn36(teEs) AND ( NOT p36_fe2es(ttot,regi,teEs))) = 0.5; -p36_fe2es(ttot,regi,teEs)$(sameAs(teEs, "te_ueshhpb") OR sameAs(teEs,"te_uecwhpb")) = 3; - -*** Compute share of heat pumps based on the efficiency of electricity -loop (mapElHp(teEs,teEs2), !!teEs= electric resistance. teEs2= heat pump -loop (fe2es_dyn36(entyFe,esty,teEs), -loop (fe2es_dyn36_2(entyFe,esty2,teEs2), -sm_tmp = 0.9; !! maximum assumed efficiency of electric resistance -p36_demFeForEs(ttot,regi,entyFe,esty2,teEs2)$(p36_fe2es(ttot,regi,teEs) gt sm_tmp) - = p36_demFeForEs(ttot,regi,entyFe,esty,teEs) - * (p36_fe2es(ttot,regi,teEs) - sm_tmp) - / (p36_fe2es(ttot,regi,teEs2) -sm_tmp) - ; -p36_demFeForEs(ttot,regi,entyFe,esty,teEs) = p36_demFeForEs(ttot,regi,entyFe,esty,teEs) - - p36_demFeForEs(ttot,regi,entyFe,esty2,teEs2); - -p36_fe2es(ttot,regi,teEs)$(p36_fe2es(ttot,regi,teEs) gt sm_tmp) = sm_tmp; -); -); -); - -*** Correct the UE quantities of heat pumps and electricity in accordance -p36_prodEs(ttot,regi,entyFe,esty,teEs) = p36_demFeForEs(ttot,regi,entyFe,esty,teEs) * p36_fe2es(ttot,regi,teEs); - -if (cm_startyear gt 2005, -Execute_Loadpoint 'input_ref' p36_logitCalibration_load = p36_logitCalibration, p36_logitLambda_load = p36_logitLambda; -p36_logitCalibration(ttot,regi,enty,esty,teEs) = p36_logitCalibration_load(ttot,regi,enty,esty,teEs); -p36_logitLambda(regi,in) = p36_logitLambda_load(regi,in); -); - -*** Introduce long term assumption concerning efficiencies -loop (t36_hist_last(ttot2), - -p36_fe2es(ttot,regi,teEs)$( pm_ttot_val(ttot) gt pm_ttot_val(ttot2)) = p36_fe2es(ttot2,regi,teEs); - -p36_fe2es(ttot,regi,teEs)$f36_dataeff("eta",teEs) -= -min(max((2100 - pm_ttot_val(ttot))/(2100 -ttot2.val),0),1) !! lambda = 1 in 2015 and 0 in 2100 - * ( p36_fe2es(ttot,regi,teEs) - - f36_dataeff("eta",teEs) - ) - + f36_dataeff("eta",teEs) -; -); - -*** Compute FE shares of technologies producing ES(UE) from FE -p36_shFeCes(ttot,regi,entyFe,in,teEs)$(feViaEs2ppfen(entyFe,in,teEs) - AND teEs_dyn36(teEs) - AND sum(fe2es(entyFe2,esty,teEs2)$es2ppfen(esty,in), p36_demFeForEs(ttot,regi,entyFe2,esty,teEs2))) - = - sum(fe2es(entyFe,esty,teEs)$es2ppfen(esty,in), p36_demFeForEs(ttot,regi,entyFe,esty,teEs)) - / sum(fe2es(entyFe2,esty,teEs2)$es2ppfen(esty,in), p36_demFeForEs(ttot,regi,entyFe2,esty,teEs2)) -; - -*** Compute UE shares of technologies producing ES(UE) from FE -p36_shUeCes(ttot,regi,entyFe,in,teEs)$(feViaEs2ppfen(entyFe,in,teEs) - AND teEs_dyn36(teEs) - AND sum(fe2es(entyFe2,esty,teEs2)$es2ppfen(esty,in), p36_prodEs(ttot,regi,entyFe2,esty,teEs2))) -= -sum(fe2es(entyFe,esty,teEs)$es2ppfen(esty,in), p36_prodEs(ttot,regi,entyFe,esty,teEs)) -/ sum(fe2es(entyFe2,esty,teEs2)$es2ppfen(esty,in), p36_prodEs(ttot,regi,entyFe2,esty,teEs2)) -; -display p36_shFeCes, p36_fe2es, p36_demFeForEs, p36_prodEs, p36_shUeCes; - -p36_demUEtotal(ttot,regi,in) = sum (fe2ces_dyn36(entyFe,esty,teEs,in), p36_prodEs(ttot,regi,entyFe,esty,teEs)); - -loop (t0(ttot), -p36_prodUEintern(ttot,regi,entyFe,esty,teEs) = p36_prodEs(ttot,regi,entyFe,esty,teEs); -); - -if (cm_startyear gt 2005, -Execute_Loadpoint 'input_ref' p36_prodUEintern_load = vm_prodEs.L; -p36_prodUEintern(ttot,regi,enty,esty,teEs)$(ttot.val gt 2005 and ttot.val lt cm_startyear) = p36_prodUEintern_load(ttot,regi,enty,esty,teEs); -); - -*** Compute FE prices from input.gdx -if ( execError = 0, -Execute_Loadpoint 'input' p36_marginalUtility = qm_budget.m; - if (execError gt 0, - execError = 0; - p36_marginalUtility(ttot,regi) = 1; - ); -); -if ( execError = 0, -Execute_Loadpoint 'input' p36_fePrice_load = qm_balFe.m; -loop (se2fe(entySe,entyFe,te), - p36_fePrice(ttot,regi,entyFe) = p36_fePrice_load(ttot,regi,entySe,entyFe,te); - ); -if (execError gt 0, - execError = 0; - p36_fePrice(ttot,regi,entyFe) = 1; - ); -); - -p36_marginalUtility(ttot,regi)$( abs (p36_marginalUtility(ttot,regi)) lt sm_eps) = 1; - -p36_fePrice(ttot,regi,entyFe) = abs (p36_fePrice(ttot,regi,entyFe)) / abs (p36_marginalUtility(ttot,regi)); -p36_fePrice(ttot,regi,entyFe)$ ( NOT p36_fePrice(ttot,regi,entyFe)) = 0.01; !! give a default value in case the relevant information is not available in the input.gdx - -p36_fePrice_iter(iteration,ttot,regi,entyFe) = 0; - -if ((cm_noReboundEffect eq 1 ), -Execute_Load 'input_ref' p36_cesIONoRebound = vm_cesIO.L; -Execute_Load 'input_ref' p36_cesIONoRebound_putty = vm_cesIOdelta.L; -); - -*** Implicit discount rates mark-ups over the normal discount rate -if ((cm_DiscRateScen eq 0), -p36_implicitDiscRateMarg(ttot,regi,all_in) = 0; - elseif (cm_DiscRateScen eq 1), - p36_implicitDiscRateMarg(ttot,regi,"ueshb") = 0.05; !! 5% for the choice of space heating technology - p36_implicitDiscRateMarg(ttot,regi,"uecwb") = 0.05; !! 5% for the choice of cooking and water heating technology - elseif (cm_DiscRateScen eq 2), - p36_implicitDiscRateMarg(ttot,regi,all_in) = 0; - p36_implicitDiscRateMarg(ttot,regi,"ueshb")$(ttot.val ge 2005 AND ttot.val lt cm_startyear) = 0.05; !! 5% for the choice of space heating technology - p36_implicitDiscRateMarg(ttot,regi,"uecwb")$(ttot.val ge 2005 AND ttot.val lt cm_startyear) = 0.05; !! 5% for the choice of cooking and water heating technology - - elseif (cm_DiscRateScen eq 3), - p36_implicitDiscRateMarg(ttot,regi,all_in) = 0; - - p36_implicitDiscRateMarg(ttot,regi,"ueshb") = 0.05; !! 5% for the choice of space heating technology - p36_implicitDiscRateMarg(ttot,regi,"uecwb") = 0.05; !! 5% for the choice of cooking and water heating technology - - p36_implicitDiscRateMarg(ttot,regi,in)$( pm_ttot_val(ttot) ge cm_startyear - AND (sameAs(in,"ueshb") - OR sameAs(in,"uecwb") - ) - ) - = 0.25 * p36_implicitDiscRateMarg(ttot,regi,in) ; - - elseif (cm_DiscRateScen eq 4), - p36_implicitDiscRateMarg(ttot,regi,all_in) = 0; - - p36_implicitDiscRateMarg(ttot,regi,"ueshb") = 0.05; !! 5% for the choice of space heating technology - p36_implicitDiscRateMarg(ttot,regi,"uecwb") = 0.05; !! 5% for the choice of cooking and water heating technology - - p36_implicitDiscRateMarg(ttot,regi,"ueshb") = min(max((2030 - pm_ttot_val(ttot))/(2030 -2020),0),1) !! lambda = 1 in 2020 and 0 in 2030; - * 0.75 * p36_implicitDiscRateMarg(ttot,regi,"ueshb") - + 0.25 * p36_implicitDiscRateMarg(ttot,regi,"ueshb"); !! Reduction of 75% of the Efficiency gap - p36_implicitDiscRateMarg(ttot,regi,"uecwb") = min(max((2030 - pm_ttot_val(ttot))/(2030 -2020),0),1) !! lambda = 1 in 2020 and 0 in 2030; - * 0.75 * p36_implicitDiscRateMarg(ttot,regi,"uecwb") - + 0.25 * p36_implicitDiscRateMarg(ttot,regi,"uecwb"); !! Reduction of 75% of the Efficiency gap - ); - -p36_kapPrice(ttot,regi) = pm_cesdata(ttot,regi,"kap","price") - pm_delta_kap(regi,"kap"); -loop (fe2ces_dyn36(entyFe,esty,teEs,in), -p36_kapPriceImplicit(ttot,regi,teEs) = p36_kapPrice(ttot,regi) + p36_implicitDiscRateMarg(ttot,regi,in); -); - -*** Inconvenience mark-up -f36_inconvpen(teEs)$(sameAs(teEs,"te_ueshstb") OR sameAs(teEs,"te_uecwstb")) = 42; !! In dollar per GJ 42$/GJ is app. eq to 0.15$/kWh -f36_inconvpen(teEs)$(sameAs(teEs,"te_ueshhob") OR sameAs(teEs,"te_uecwhob")) = 14; !! In dollar per GJ 14$/GJ is app. eq to 0.05$/kWh -f36_inconvpen(teEs)$(sameAs(teEs,"te_ueshsob") OR sameAs(teEs,"te_uecwsob")) = 14; !! In dollar per GJ 14$/GJ is app. eq to 0.05$/kWh -f36_inconvpen(teEs) = f36_inconvpen(teEs) * sm_DpGJ_2_TDpTWa; !! conversion $/GJ -> T$/TWa - -*** Compute depreciation rates for technologies -p36_depreciationRate(teEs)$f36_datafecostsglob("lifetime",teEs) = - log (0.33) / f36_datafecostsglob("lifetime",teEs); - -*** Define which technologies will have a faster reduction of their calibration parameter -p36_pushCalib(ttot,teEs_dyn36) = 0; - -$ifthen "%cm_pushCalib%" == "none" -$elseif "%cm_pushCalib%" == "hydrogen" -teEs_pushCalib_dyn36("te_ueshh2b") = YES; -teEs_pushCalib_dyn36("te_uecwh2b") = YES; -p36_pushCalib(ttot,"te_ueshh2b") = 0; -p36_pushCalib(ttot,"te_ueshh2b") = 0.5; - -p36_pushCalib(ttot,teEs_pushCalib_dyn36(teEs)) = - min(max((2050 -ttot.val)/(2050 - cm_startyear),0),1) !! lambda = 1 in startyear and 0 in 2050 - * ( 1 - p36_pushCalib(ttot,teEs)) - + p36_pushCalib(ttot,teEs) ; -$endif - - -*** Define for which technologies the investment costs will evolve -p36_costReduc(ttot,teEs_dyn36) = 1; - -$ifthen "%cm_reducCostB%" == "none" -$elseif "%cm_reducCostB%" == "hydrogen" - -p36_costReduc(ttot,"te_ueshh2b") = 0.2; -p36_costReduc(ttot,"te_ueshh2b") = 0.5; - -p36_costReduc(ttot,teEs_pushCalib_dyn36(teEs)) = - min(max((2050 -ttot.val)/(2050 - cm_startyear),0),1) !! lambda = 1 in startyear and 0 in 2050 - * ( 1 - p36_costReduc(ttot,teEs)) - + p36_costReduc(ttot,teEs) ; -$elseif "%cm_reducCostB%" == "heatpumps" -p36_costReduc(ttot,"te_ueshhpb") = 0.8; -p36_costReduc(ttot,"te_uecwhpb") = 0.8; - -p36_costReduc(ttot,teEs_pushCalib_dyn36(teEs)) = - min(max((2050 -ttot.val)/(2050 - cm_startyear),0),1) !! lambda = 1 in startyear and 0 in 2050 - * ( 1 - p36_costReduc(ttot,teEs)) - + p36_costReduc(ttot,teEs) ; -$endif - -*** Computation of omegs and opTimeYr2teEs for technology vintages -p36_omegEs(regi,opTimeYr,teEs_dyn36(teEs)) = 0; - -loop(regi, - p36_aux_lifetime(teEs_dyn36(teEs)) = 5/4 * f36_datafecostsglob("lifetime",teEs); - loop(teEs_dyn36(teEs), - - loop(opTimeYr, - p36_omegEs(regi,opTimeYr,teEs) = 1 - ((opTimeYr.val-0.5) / p36_aux_lifetime(teEs))**4 ; - opTimeYr2teEs(teEs,opTimeYr)$(p36_omegEs(regi,opTimeYr,teEs) > 0 ) = yes; - if( p36_omegEs(regi,opTimeYr,teEs) <= 0, - p36_omegEs(regi,opTimeYr,teEs) = 0; - opTimeYr2teEs(teEs,opTimeYr) = no; - ); - ) - ); -); -display p36_omegEs , opTimeYr2teEs ; -***_____________________________END OF Information for the ES layer and the multinomial logit function _____________________________ - - -*** Adjustement cost factor -p36_adjFactor(ttot,regi) = 1; - -*** Set regions with high cooling demand, on which we impose a constraint on efficiency development -loop(regi $ (pm_cesdata("2100",regi,"fescelb","quantity") gt 0.01), - -regi_dyn36_cooling(regi) = YES; -); - -*** Set dynamic regional set depending on testOneRegi -$ifthen "%optimization%" == "testOneRegi" -regi_dyn36(all_regi) = regi_dyn80(all_regi); -$else -regi_dyn36(all_regi) = regi(all_regi); -$endif - -***------------------------------------------------------------------------- -*** pass on module specific parameter values to core parameters -***------------------------------------------------------------------------- - -pm_fe2es(ttot,regi,teEs_dyn36) = p36_fe2es(ttot,regi,teEs_dyn36); -pm_shFeCes(ttot,regi,entyFe,in,teEs)$p36_shFeCes(ttot,regi,entyFe,in,teEs) = p36_shFeCes(ttot,regi,entyFe,in,teEs); -*** EOF ./modules/36_buildings/services_putty/datainput.gms diff --git a/modules/36_buildings/services_putty/declarations.gms b/modules/36_buildings/services_putty/declarations.gms deleted file mode 100644 index 21316c668..000000000 --- a/modules/36_buildings/services_putty/declarations.gms +++ /dev/null @@ -1,117 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_putty/declarations.gms -Scalar -s36_switch_floor "switch for the inclusion of the floorspace equations. It should exclude the equations from hybrid" /0/, -s36_vintage_calib "switch for the inclusion of vintage equations and restricting ttot to historical. It should exclude the equations from hybrid" /0/, -s36_logit "switch for the inclusion of vintage equations. It should exclude the equations from hybrid" /0/ -; - -Parameter -p36_floorspace(tall,all_regi) "buildings floorspace, billion m2" -p36_floorspace_delta(tall,all_regi) "increase in floorspace, billion m2" -p36_adjFactor(tall,all_regi) "factor applied for the adjustment costs" -p36_floorspace_delta_gdx(tall,all_regi) "parameter storing fixings from input_ref for v36_floorspace_delta" - -p36_cesIONoRebound(tall,all_regi,all_in) "loads the vm_cesIO values from the input_ref and sets the upper bound to vm_cesIO to forbid a rebound effect" -p36_cesIONoRebound_putty(tall,all_regi,all_in) "loads the vm_cesIO_putty values from the input_ref and sets the upper bound to vm_cesIO to forbid a rebound effect" - -p36_demFeForEs_scen(tall,all_regi,all_GDPscen,all_enty,all_esty,all_teEs) "Final energy demand for technologies producing energy services (useful energy in the case of buildings)" -p36_demFeForEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Final energy demand for technologies producing energy services (useful energy in the case of buildings)" - -p36_prodEs_scen(tall,all_regi,all_GDPscen,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) for technologies producing energy services and using FE" -p36_prodEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) for technologies producing energy services and using FE" -p36_prodEs_iter(iteration,ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) for technologies producing energy services and using FE over iterations" -p36_deltaProdEs_iter(iteration,ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) addition for a year. For technologies producing energy services and using FE over iterations" -p36_deltaProdEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) addition for a year. Result of vintage_36" - -p36_shFeCes(ttot,all_regi,all_enty,all_in,all_teEs) "share of Final energy of technology teEs in the final energy producing all_in" -p36_shFeCes_iter(iteration,ttot,all_regi,all_enty,all_in,all_teEs) "share of Final energy of technology teEs in the final energy producing all_in" -p36_shUeCes(ttot,all_regi,all_enty,all_in,all_teEs) "share of Useful energy of technology teEs in the final energy producing all_in" -p36_shUeCes_iter(iteration,ttot,all_regi,all_enty,all_in,all_teEs) "share of Useful energy of technology teEs in the final energy producing all_in" -p36_fe2es(ttot,all_regi,all_teEs) "FE to ES(UE) efficiency of technology teES" - -p36_logitLambda(all_regi,all_in) "logit parameter for homogeneity" -p36_logitLambda_load (all_regi,all_in) "logit parameter for homogeneity, loaded from GDX_ref" -p36_fePrice_load(tall,all_regi,all_enty,all_enty,all_te) "Final energy price from GDX" -p36_fePrice(tall,all_regi,all_enty) "Final energy price" -p36_fePrice_iter(iteration,tall,all_regi,all_enty) "Final energy price over iterations" -p36_marginalUtility(tall,all_regi) "Marginal utility of income: used to compute the final energy price from the marginal of balance equation" -p36_techCosts(tall,all_regi,all_enty,all_esty,all_teEs) "Relevant costs of each ES technology for the computation of the share in the multinomial logit" -p36_techCosts_iter(iteration,tall,all_regi,all_enty,all_esty,all_teEs) "Relevant costs of each ES technology for the computation of the share in the multinomial logit over iterations" -p36_logitCalibration(tall,all_regi,all_enty,all_esty,all_teEs) "calibration parameter for the multinomial logit function" -p36_logitCalibration_load(tall,all_regi,all_enty,all_esty,all_teEs) "calibration parameter for the multinomial logit function from input_ref.gdx" -p36_logitNorm(iteration,tall,all_regi,all_in) "Norm of the share vector difference between iterations" - -p36_prodUEintern(tall,all_regi,all_enty,all_esty,all_teEs) "UE production from depreciated technologies of the previous period" -p36_prodUEintern_load(tall,all_regi,all_enty,all_esty,all_teEs) "UE production from depreciated technologies of the previous period -- From GDX" -p36_demUEtotal(tall,all_regi,all_in) "Demand for UE, independent of the technology" -p36_demUEdelta(tall,all_regi,all_in) "Demand for UE, independent of the technology, and which is not covered by the depreciated technologies" -p36_shUeCesDelta(ttot,all_regi,all_enty,all_in,all_teEs) "Technological shares in UE which is not covered by former depreciated technologies" -p36_depreciationRate(all_teEs) "Depreciation rates for the indivudal conversion technologies, rouhgly derived from their lifetime parameter" - -p36_esCapCost(tall,all_regi,all_teEs) "Capital costs for each technology transforming FE into UE. Cost per unit of FE" -p36_esCapCostImplicit(tall,all_regi,all_teEs) "Capital costs for each technology transforming FE into UE, taking the implicit discount rate into account. Cost per unit of FE" -p36_kapPrice(tall,all_regi) "Macroeconomic capital price, net of depreciation" -p36_kapPriceImplicit(tall,all_regi,all_teEs) "Macroeconomic capital price, net of depreciation, to which the implicit discount rate is added" -p36_implicitDiscRateMarg(tall,all_regi,all_in) "Implicit discount rate for the choice of conversion technologies from UE to FE in buildings" - -p36_pushCalib(tall,all_teEs) "degree to which the calibration parameter should be reduced/increased for these technologies" -p36_costReduc(tall,all_teEs) "Reduction of costs for some technologies" - -f36_inconvpen(all_teEs) "maximum inconvenience penalty for traditional conversion technologies. Unit: T$/TWa" -p36_inconvpen(ttot,all_regi,all_teEs) "parameter for inconvenience penalty depending on income level. Unit: T$/TWa" - -p36_aux_lifetime(all_teEs) "auxiliary parameter for calculating life times" -p36_omegEs(all_regi,opTimeYr,all_teEs) "technical depreciation parameter, gives the share of a capacity that is still usable after tlt. [none/share, value between 0 and 1]" -; - - -Variables -v36_floorspace_delta(tall,all_regi) "increase in floorspace, million m2" -v36_putty_obj "index of the step by step variation of v36_floorspace_delta" - -v36_prodEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) for technologies producing energy services and using FE" -v36_deltaProdEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) addition for a year. For technologies producing energy services and using FE" -v36_vintageInfes(ttot,all_regi,all_enty,all_esty,all_teEs) "slack variable to avoid infeasibilities in the initialisation of vintages" -v36_logitInfes(tall,all_regi,all_in) "slack variable to avoid infeasibilities in case historical demand cannot be declined fast enough" -v36_costs(ttot,all_regi) "technological costs" -v36_vintage_obj "objective variable for vintage model" -v36_shares_obj "objective variable for heterogeneity preferences" -; - -Equations -q36_enerSerAdj(tall,all_regi,all_in) "adjustment costs for energy services" -q36_enerCoolAdj(tall,all_regi,all_in) "adjustment costs for energy cooling services" -q36_pathConstraint(tall,all_regi) "equation describing the relation between a variable and its variation" -q36_putty_obj "objective function" - -q36_demFeBuild(ttot,all_regi,all_enty,all_emiMkt) "buildings final energy demand" - -q36_ueTech2Total(tall,all_regi,all_in) "definition of total UE buildings demand, based on the sum of demand by technology" -q36_cap(tall,all_regi,all_enty,all_esty,all_teEs) "definition of available capacities" -q36_budget(tall,all_regi) "budget equation" -q36_vintage_obj "objective function for vintage model" - -q36_shares_obj "objective function for logit shares: heterogeneity preferences" -; - - -file testfile /""/; - -testfile.nd = 10; - - -file file_logit_buildings / "Logit_buildings.csv" /; - -file_logit_buildings.ap = 0; !! append to file is negative to overwrite former file if existing -file_logit_buildings.pc = 5; !! csv file -file_logit_buildings.lw = 0; -file_logit_buildings.nw = 20; -file_logit_buildings.nd = 15; - -*** EOF ./modules/36_buildings/services_putty/declarations.gms diff --git a/modules/36_buildings/services_putty/equations.gms b/modules/36_buildings/services_putty/equations.gms deleted file mode 100644 index 2e59fd164..000000000 --- a/modules/36_buildings/services_putty/equations.gms +++ /dev/null @@ -1,191 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_putty/equations.gms - -*** Can you please structure which equations belongs to which model? - -*** Buildings Final Energy Balance -q36_demFeBuild(ttot,regi,entyFe,emiMkt)$((ttot.val ge cm_startyear) AND (entyFe2Sector(entyFe,"build"))) .. - sum((entySe,te)$se2fe(entySe,entyFe,te), vm_demFeSector_afterTax(ttot,regi,entySe,entyFe,"build",emiMkt)) - =e= - ( - sum(fe2ppfEn36(entyFe,in), - vm_cesIO(ttot,regi,in) - + pm_cesdata(ttot,regi,in,"offset_quantity") - ) - + - sum(fe2es_dyn36(entyFe,esty,teEs), vm_demFeForEs(ttot,regi,entyFe,esty,teEs) ) - )$(sameas(emiMkt,"ES")) -; - -*** Couldn't we also formulate an ES to ppfen handover function instead of pushing this to the postsolve.gms? It would be easier to follow. - -*AL* Start of Model solved in preloop for determining the floorspace delta projections -q36_pathConstraint (ttot,regi) $((s36_switch_floor eq 1) AND (ord(ttot) lt card(ttot)) AND (ttot.val ge cm_startyear)) .. -p36_floorspace(ttot + 1,regi) =e= - (1- pm_delta_kap(regi,"esswb"))**pm_dt(ttot+1) * p36_floorspace(ttot,regi) - + (pm_cumDeprecFactor_old(ttot+1,regi,"esswb") * v36_floorspace_delta(ttot,regi)) - + (pm_cumDeprecFactor_new(ttot+1,regi,"esswb") * v36_floorspace_delta(ttot+1,regi)) - ; - - - -q36_putty_obj$(s36_switch_floor eq 1).. -v36_putty_obj =e= sum((ttot,regi,in)$((ord(ttot) lt card(ttot))) - , power( v36_floorspace_delta(ttot+1,regi) - - v36_floorspace_delta(ttot,regi) - - ,2) - - ); -*AL* End of Model solved in preloop - -q36_enerSerAdj(ttot,regi,in)$(sameas(in,"esswb") - AND ttot.val ge max(2010, cm_startyear) - AND cm_build_AdjCostActive eq 1).. - vm_enerSerAdj(ttot,regi,in) - =e= - p36_adjFactor(ttot,regi) - * sqr( - (vm_cesIOdelta(ttot,regi,in) / p36_floorspace_delta(ttot,regi) - - vm_cesIOdelta(ttot-1,regi,in) / p36_floorspace_delta(ttot-1,regi)) - / (pm_ttot_val(ttot)-pm_ttot_val(ttot-1)) - / (vm_cesIOdelta(ttot,regi,in) / p36_floorspace_delta(ttot,regi) +0.0001) - ) - * vm_cesIOdelta(ttot,regi,in) / 11 - ; - - -q36_enerCoolAdj(ttot,regi,in)$(sameas (in, "fescelb") - AND ttot.val ge max(2015, cm_startyear) - AND regi_dyn36_cooling(regi) - AND cm_build_AdjCostActive eq 1).. - vm_enerSerAdj(ttot,regi,in) - =e= - p36_adjFactor(ttot,regi) - * sum (cesOut2cesIn(out,in), - sqr ( - (vm_cesIO(ttot,regi,out) / vm_cesIO(ttot,regi,in) !! Efficiency in ttot - - vm_cesIO(ttot - 1,regi,out) / vm_cesIO(ttot - 1,regi,in) !! Efficiency in ttot -1 - ) / (pm_ttot_val(ttot) - pm_ttot_val(ttot - 1)) - - - (vm_cesIO(ttot - 1,regi,out) / vm_cesIO(ttot - 1,regi,in) !! Efficiency in ttot -1 - - vm_cesIO(ttot - 2,regi,out) / vm_cesIO(ttot - 2,regi,in) !! Efficiency in ttot -2 - ) / (pm_ttot_val(ttot - 1) - pm_ttot_val(ttot - 2)) - ) - ) -; - -******************************************* -*** Equations of the logit model ********** -******************************************* - - - -*** total UE buildings demand, based on the sum of demand by technology -q36_ueTech2Total(ttot,regi_dyn36(regi),inViaEs_dyn36(in)) $ - ( (s36_vintage_calib eq 1 AND t36_hist(ttot) ) - OR ((s36_logit eq 1) AND (ttot.val ge cm_startyear)) ) .. - p36_demUEtotal(ttot,regi,in) - + v36_logitInfes(ttot,regi,in) - =e= - sum (fe2ces_dyn36(enty,esty,teEs,in), - v36_prodEs(ttot,regi,enty,esty,teEs) - ); - -*** In what sense is this calculating capacities? Are you referring to useful energy as capacities? That should be in energy units. -*** What is the difference between v36_prodEs and v36_deltaProdEs? - -q36_cap(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $ - ( ((s36_vintage_calib eq 1) AND (t36_hist(ttot) )) - OR ((s36_logit eq 1) AND (ttot.val ge cm_startyear)) ) .. - - v36_prodEs(ttot,regi,enty,esty,teEs) - =e= - sum(opTimeYr2teEs(teEs,opTimeYr)$(tsu2opTimeYr(ttot,opTimeYr) AND (opTimeYr.val ge 1) ), - pm_ts(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)-1)) - * p36_omegEs(regi,opTimeYr+1,teEs) - * (v36_deltaProdEs(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)-1),regi,enty,esty,teEs) - - v36_vintageInfes(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)-1),regi,enty,esty,teEs) - ) - ) - ; - -q36_budget(t36_scen(ttot),regi_dyn36(regi)).. - v36_costs(ttot,regi) - =e= - sum ( fe2ces_dyn36(enty,esty,teEs,in), - p36_techCosts(ttot,regi,enty,esty,teEs) - * v36_deltaProdEs(ttot,regi,enty,esty,teEs) - ) - ; - -*** What is the purpose of the objetve function of the vintage model? -q36_vintage_obj $ (s36_vintage_calib eq 1 ) .. - v36_vintage_obj - =e= - sum((ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs))$( - t36_hist(ttot) - ), - - sum(opTimeYr2teEs(teEs,opTimeYr)$( - tsu2opTimeYr(ttot,opTimeYr) - ), - power ( - v36_deltaProdEs(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)),regi,enty,esty,teEs) - - v36_deltaProdEs(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)-1),regi,enty,esty,teEs) - ,2 - ) - - + - 1000 - * v36_vintageInfes(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)),regi,enty,esty,teEs) - ) - + 1000 - * v36_vintageInfes(ttot,regi,enty,esty,teEs) - ) - - ; - -*** Can you explain what this objective function is? -*** Why does its maximization give the output of the logit function -*** which should (I guess) be the UE shares based on the cost of the fe2ue technology output. -*** Also I do not recognize the logit formulation from before. -q36_shares_obj $ (s36_logit eq 1).. - v36_shares_obj - =e= - sum ((t36_scen(ttot),regi_dyn36(regi),inViaEs_dyn36(in)), - sum ( fe2ces_dyn36(enty,esty,teEs,in), - - p36_logitCalibration(ttot,regi,enty,esty,teEs) - * v36_deltaProdEs(ttot,regi,enty,esty,teEs) - ) - + 1 / p36_logitLambda(regi,in) - * sum ( fe2ces_dyn36(enty,esty,teEs,in), - v36_deltaProdEs(ttot,regi,enty,esty,teEs) - * log ( v36_deltaProdEs(ttot,regi,enty,esty,teEs) - / sum (fe2ces_dyn36_2(enty2,esty2,teEs2,in), - v36_deltaProdEs(ttot,regi,enty2,esty2,teEs2)) - ) - ) - ) - - - sum ( (t36_scen(ttot),regi_dyn36(regi)), - v36_costs(ttot,regi) - ) - - - sum ((ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)), - 1000 - * v36_vintageInfes(ttot,regi,enty,esty,teEs) - ) - - sum ((ttot,regi_dyn36(regi),inViaEs_dyn36(in)), - 1000 - * v36_logitInfes(ttot,regi,in) - ) - ; - - -*** EOF ./modules/36_buildings/services_putty/equations.gms diff --git a/modules/36_buildings/services_putty/input/files b/modules/36_buildings/services_putty/input/files deleted file mode 100644 index e5b324c14..000000000 --- a/modules/36_buildings/services_putty/input/files +++ /dev/null @@ -1,4 +0,0 @@ -p36_floorspace_scen.cs4r -p36_serviceInputs.cs4r -p36_serviceOutputs.cs4r - diff --git a/modules/36_buildings/services_putty/input/generisdata_Eff.prn b/modules/36_buildings/services_putty/input/generisdata_Eff.prn deleted file mode 100644 index dbe469464..000000000 --- a/modules/36_buildings/services_putty/input/generisdata_Eff.prn +++ /dev/null @@ -1,23 +0,0 @@ -*** SOF ./modules/36_buildings/services_putty/input/generisdata_Eff.prn -$ontext -Data adapted from EIA - Technology Forecast Updates – Residential and Commercial Building Technologies – Reference Case -Documentation of the NEMS model: https://www.eia.gov/analysis/studies/buildings/equipcosts/ -Data adapted from https://ec.europa.eu/energy/sites/ener/files/documents/2018_06_27_technology_pathways_-_finalreportmain2.pdf -IMPORTANT: all costs are now given in $2015! As long as the model runs in $2005, the values need to be converted in datainput.gms -inco0 Initial investment costs given in $(2015)/kW Useful energy power -omf Fixed operation and maintenance costs in $(2015)/kW Useful energy power -eta Conversion efficiency: UE/FE -usehr number of hours in a year when the technology is used -lifetime given in years -$offtext - - te_ueshhpb te_ueshgab te_ueshhob te_ueshelb te_ueshh2b te_ueshsob te_ueshheb te_ueshstb -eta %cm_INNOPATHS_effHP% 0.9 0.9 1 0.8 0.8 1 0.25 - - -+ te_uecwhpb te_uecwgab te_uecwhob te_uecwelb te_uecwh2b te_uecwsob te_uecwheb te_uecwstb -eta %cm_INNOPATHS_effHP% 0.9 0.9 1 0.8 0.8 1 0.25 - - - -*** EOF ./modules/36_buildings/services_putty/input/generisdata_Eff.prn diff --git a/modules/36_buildings/services_putty/input/generisdata_feCapCosts.prn b/modules/36_buildings/services_putty/input/generisdata_feCapCosts.prn deleted file mode 100644 index 1a54c1050..000000000 --- a/modules/36_buildings/services_putty/input/generisdata_feCapCosts.prn +++ /dev/null @@ -1,29 +0,0 @@ -*** SOF ./modules/36_buildings/services_putty/input/generisdata_feCapCosts.prn -$ontext -Data adapted from EIA - Technology Forecast Updates – Residential and Commercial Building Technologies – Reference Case -Documentation of the NEMS model: https://www.eia.gov/analysis/studies/buildings/equipcosts/ -Data adapted from https://ec.europa.eu/energy/sites/ener/files/documents/2018_06_27_technology_pathways_-_finalreportmain2.pdf -IMPORTANT: all costs are now given in $2015! As long as the model runs in $2005, the values need to be converted in datainput.gms -inco0 Initial investment costs given in $(2015)/kW Useful energy power -omf Fixed operation and maintenance costs in $(2015)/kW Useful energy power -eta Conversion efficiency: UE/FE -usehr number of hours in a year when the technology is used -lifetime given in years -$offtext - - te_ueshhpb te_ueshgab te_ueshhob te_ueshelb te_ueshh2b te_ueshsob te_ueshheb te_ueshstb -inco0 1000 180 180 60 180 470 110 10 -omf 7 3 3 2 13 17 2 1 -eta 3 0.9 0.8 1 0.7 0.8 0.7 0.25 -usehr 1440 1440 1440 1440 1440 1440 1440 1440 !! 60 days a year -lifetime 20 20 20 20 20 20 20 5 - -+ te_uecwhpb te_uecwgab te_uecwhob te_uecwelb te_uecwh2b te_uecwsob te_uecwheb te_uecwstb -inco0 500 190 200 110 190 250 100 10 -omf 1 2 6 0 13 17 2 1 -eta 3 1 0.8 1 0.7 0.8 0.7 0.25 -usehr 730 730 730 730 730 730 730 730 -lifetime 20 20 20 20 20 20 20 5 - - -*** EOF ./modules/36_buildings/services_putty/input/generisdata_feCapCosts.prn diff --git a/modules/36_buildings/services_putty/not_used.txt b/modules/36_buildings/services_putty/not_used.txt deleted file mode 100644 index d6f828aa8..000000000 --- a/modules/36_buildings/services_putty/not_used.txt +++ /dev/null @@ -1,23 +0,0 @@ -# | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -# | authors, and contributors see CITATION.cff file. This file is part -# | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -# | AGPL-3.0, you are granted additional permissions described in the -# | REMIND License Exception, version 1.0 (see LICENSE file). -# | Contact: remind@pik-potsdam.de -name,type,reason -vm_costAddTeInv,input,questionnaire -cm_build_H2costAddH2Inv,input,questionnaire -cm_build_H2costDecayStart,input,questionnaire -cm_build_H2costDecayEnd,input,questionnaire -pm_shGasLiq_fe_up,parameter,not needed -pm_shGasLiq_fe_lo,parameter,not needed -pm_shfe_up,parameter,not needed -pm_shfe_lo,parameter,not needed -pm_tau_fe_tax,input,questionnaire -pm_tau_fe_sub,input,questionnaire -sm_TWa_2_MWh,input,questionnaire -vm_costCESMkup,input,questionnaire -sm_trillion_2_non,input,questionnaire -sm_TWa_2_kWh,input,questionnaire -pm_tau_ces_tax,input,questionnaire -vm_prodSe,input,questionnaire diff --git a/modules/36_buildings/services_putty/postsolve.gms b/modules/36_buildings/services_putty/postsolve.gms deleted file mode 100644 index dee74e1d9..000000000 --- a/modules/36_buildings/services_putty/postsolve.gms +++ /dev/null @@ -1,54 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_putty/postsolve.gms - - -*** calculation of FE Buildings Prices (useful for internal use and reporting purposes) -pm_FEPrice(ttot,regi,entyFE,"build",emiMkt)$(abs (qm_budget.m(ttot,regi)) gt sm_eps) = - q36_demFeBuild.m(ttot,regi,entyFE,emiMkt) / qm_budget.m(ttot,regi); - -p36_fePrice(t,regi_dyn36(regi),entyFe)=pm_FEPrice(t,regi,entyFE,"build","ES"); - -loop (se2fe(entySe,entyFe,te), -p36_fePrice(t,regi_dyn36(regi),entyFe)$(abs (qm_budget.m(t,regi)) gt sm_eps) = abs ( qm_balFe.m(t,regi,entySe,entyFe,te)) / abs (qm_budget.m(t,regi)); -); -p36_fePrice_iter(iteration,t,regi_dyn36(regi),entyFe)$p36_fePrice(t,regi,entyFe) = - p36_fePrice(t,regi,entyFe); - -*** To compute the capital price, take the CES derivative and substract the depreciation rate -loop(cesOut2cesIn(out,in) $ (sameAs(out,"inco") - AND sameAs(in,"kap")), -p36_kapPrice(t,regi_dyn36(regi)) = - pm_cesdata(t,regi,in,"xi") - * pm_cesdata(t,regi,in,"eff") - * vm_effGr.l(t,regi,in) - - * (vm_cesIO.l(t,regi,out) - + vm_cesIOdelta.l(t,regi,out)$( ipf_putty(out)) - ) - ** (1 - pm_cesdata(t,regi,out,"rho")) - - * ( pm_cesdata(t,regi,in,"eff") - * vm_effGr.l(t,regi,in) - * (vm_cesIO.l(t,regi,in)$( NOT ipf_putty(out)) - + vm_cesIOdelta.l(t,regi,in)$( ipf_putty(out)) - ) - ) - ** (pm_cesdata(t,regi,out,"rho") - 1) - - - pm_delta_kap(regi,"kap"); -); - - -p36_demUEtotal(t,regi_dyn36(regi),in)$(p36_demUEtotal(t,regi,in) AND ( NOT t36_hist(t))) = vm_cesIO.L(t,regi,in) + pm_cesdata(t,regi,in,"offset_quantity") ; - -p36_prodEs_iter(iteration,t,regi,enty,esty,teEs) = - v36_prodEs.l(t,regi,enty,esty,teEs); -p36_deltaProdEs_iter(iteration,t,regi,enty,esty,teEs) = - v36_deltaProdEs.l(t,regi,enty,esty,teEs); - -*** EOF ./modules/36_buildings/services_putty/postsolve.gms diff --git a/modules/36_buildings/services_putty/preloop.gms b/modules/36_buildings/services_putty/preloop.gms deleted file mode 100644 index ebf291866..000000000 --- a/modules/36_buildings/services_putty/preloop.gms +++ /dev/null @@ -1,93 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_putty/preloop.gms - -v36_floorspace_delta.lo(tall,all_regi) = 1e-6; - -if( (cm_startyear gt 2005), - Execute_Loadpoint 'input_ref' p36_floorspace_delta_gdx = v36_floorspace_delta.L; - v36_floorspace_delta.fx(ttot,regi)$( (ttot.val ge 2005) and (ttot.val lt cm_startyear)) = p36_floorspace_delta_gdx(ttot,regi); -); - -s36_switch_floor = 1; - -model putty_paths_floor / -q36_pathConstraint -q36_putty_obj -/; - - - -if (execError > 0, - execute_unload "abort.gdx"; - abort "at least one execution error occured, abort.gdx written"; -); - -solve putty_paths_floor minimizing v36_putty_obj using nlp; - -if ( NOT ( putty_paths_floor.solvestat eq 1 AND (putty_paths_floor.modelstat eq 1 OR putty_paths_floor.modelstat eq 2)), - execute_unload "abort.gdx"; - abort "model putty_paths_floor is infeasible"; -); - -p36_floorspace_delta(ttot,regi_dyn36(regi)) $ v36_floorspace_delta.L(ttot,regi) = v36_floorspace_delta.L(ttot,regi); - -s36_switch_floor = 0; - - -*** Vintage initialisation -v36_prodEs.lo(ttot,regi,fe2es_dyn36(enty,esty,teEs)) = 0; -v36_deltaProdEs.lo(ttot,regi,fe2es_dyn36(enty,esty,teEs)) = 0; -v36_vintageInfes.lo(ttot,regi,fe2es_dyn36(enty,esty,teEs)) = 0; - - -s36_vintage_calib = 1; -v36_logitInfes.fx(ttot,regi_dyn36(regi),inViaEs_dyn36(in)) = 0; -v36_prodEs.fx(t36_hist(ttot),regi_dyn36(regi), fe2es_dyn36(entyFe,esty,teEs)) - = p36_prodEs(ttot,regi,entyFe,esty,teEs); - -model vintage_36 / -q36_ueTech2Total -q36_cap -q36_vintage_obj -/; - -if (execError > 0, - execute_unload "abort.gdx"; - abort "at least one execution error occured, abort.gdx written"; -); - -solve vintage_36 minimizing v36_vintage_obj using nlp; - -if ( NOT ( vintage_36.solvestat eq 1 AND (vintage_36.modelstat eq 1 OR vintage_36.modelstat eq 2)), -abort "model vintage_36 is infeasible"; -); - -p36_prodUEintern(t36_hist(ttot),regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) - = v36_deltaProdEs.L(ttot,regi,enty,esty,teEs); - -p36_deltaProdEs(ttot,regi,enty,esty,teEs) = v36_deltaProdEs.L(ttot,regi,enty,esty,teEs); - -s36_vintage_calib = 0; - - -*** Define model for logit shares -model logit_36 / -q36_ueTech2Total -q36_cap -q36_shares_obj -q36_budget -/ -; -*** The value of the capital price cannot be set in datainput as in calibration runs, pm_cesdata is computed in preloop.gms of module 29 -p36_kapPrice(t,regi_dyn36(regi)) = pm_cesdata(t,regi,"kap","price") - pm_delta_kap(regi,"kap"); -loop (fe2ces_dyn36(entyFe,esty,teEs,in), -p36_kapPriceImplicit(t,regi_dyn36(regi),teEs) = p36_kapPrice(t,regi) + p36_implicitDiscRateMarg(t,regi,in); -); - -*** EOF ./modules/36_buildings/services_putty/preloop.gms - diff --git a/modules/36_buildings/services_putty/presolve.gms b/modules/36_buildings/services_putty/presolve.gms deleted file mode 100644 index 4096c7378..000000000 --- a/modules/36_buildings/services_putty/presolve.gms +++ /dev/null @@ -1,358 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_putty/presolve.gms - -*** For the first iterations, avoid very high prices because of numerical reasons -if (ord(iteration) le 8, - - loop ((t,regi_dyn36(regi)), - sm_tmp = smax(fe2ces_dyn36(entyFe,esty,teEs,in), p36_fePrice(t,regi,entyFe)); - if (sm_tmp gt 3, - p36_fePrice(t,regi,entyFe) = max(0.01, - p36_fePrice(t,regi,entyFe) / sm_tmp * 3 - ); - - - ); - ); -); - - -*** Take average price over previous iterations -if (ord(iteration) ge 5, -p36_fePrice(t,regi_dyn36(regi),entyFe) $ p36_fePrice(t,regi,entyFe)= - ( p36_fePrice_iter(iteration - 1,t,regi,entyFe) - + p36_fePrice_iter(iteration - 2,t,regi,entyFe) - + p36_fePrice_iter(iteration - 3,t,regi,entyFe) - + p36_fePrice_iter(iteration - 4,t,regi,entyFe) - ) - / 4; -); -*** Beyond the 70th iteration, the prices are averaged over the prices since the 66th iteration -if (ord(iteration) ge 70, - -p36_fePrice(t,regi_dyn36(regi),entyFe) = - sum(iteration2 $ (ord(iteration2) ge 66 - AND ord(iteration2) lt ord(iteration)), - p36_fePrice_iter(iteration2,t,regi,entyFe) - ) - / - sum(iteration2 $ (ord(iteration2) ge 66 - AND ord(iteration2) lt ord(iteration)), - 1 - ) - ; - -); -*** smooth the costs - -*** Smooth 2005 prices -$offOrder -p36_kapPrice(t,regi_dyn36(regi))$(ord(t) eq 1) - = ( p36_kapPrice(t+1,regi) * 2 - + p36_kapPrice(t+2,regi) - ) - / 3; - -p36_fePrice(t,regi_dyn36(regi),entyFe)$(ord(t) eq 1) - = ( p36_fePrice(t+1,regi,entyFe) * 2 - + p36_fePrice(t+2,regi,entyFe) - ) - / 3; -$onOrder -*** Smooth non 2005 prices with moving average -$OFForder -loop (t$ ( not ((ord(t) le 1) or (ord(t) eq card(t)))), -p36_kapPrice(t,regi_dyn36(regi)) = - ( p36_kapPrice(t-1,regi) - + p36_kapPrice(t,regi) - + p36_kapPrice(t+1,regi) - ) / 3 ; - -p36_fePrice(t,regi_dyn36(regi),entyFe) = - (p36_fePrice(t-1,regi,entyFe) - + p36_fePrice(t,regi,entyFe) - + p36_fePrice(t+1,regi,entyFe) - ) / 3; - -); -$ONorder - -*** Can you explain again the purpose of adding an implicit discount rate to the capital cost of fe2ue techs? -*** Is p36_costReduc(t,teEs) assuming some exogenous learning? -loop (fe2ces_dyn36(entyFe,esty,teEs,in), -p36_kapPriceImplicit(t,regi_dyn36(regi),teEs) = p36_kapPrice(t,regi) + p36_implicitDiscRateMarg(t,regi,in); -); - - p36_esCapCost(t,regi_dyn36(regi),teEs_dyn36(teEs)) = - (f36_datafecostsglob("inco0",teEs) - * p36_costReduc(t,teEs) - * p36_kapPrice(t,regi) / (1 - (1 + p36_kapPrice(t,regi))** (-f36_datafecostsglob("lifetime",teEs))) !! annualised initial capital costs - + f36_datafecostsglob("omf",teEs) - ) - / f36_datafecostsglob("usehr",teEs) !! from T$/TW to T$/TWh - * sm_day_2_hour * sm_year_2_day !! from T$/TWh to T$/TWa - ; - - p36_esCapCostImplicit(t,regi_dyn36(regi),teEs_dyn36(teEs)) = - (f36_datafecostsglob("inco0",teEs) - * p36_costReduc(t,teEs) - * p36_kapPriceImplicit(t,regi,teEs) / (1 - (1 + p36_kapPriceImplicit(t,regi,teEs))** (-f36_datafecostsglob("lifetime",teEs))) !! annualised initial capital costs - + f36_datafecostsglob("omf",teEs) - ) - / f36_datafecostsglob("usehr",teEs) !! from T$/TW to T$/TWh - * sm_day_2_hour * sm_year_2_day !! from T$/TWh to T$/TWa - ; - -p36_inconvpen(t,regi_dyn36(regi),teEs)$f36_inconvpen(teEs) = - (1 - - min(max((20 - (vm_cesIO.L(t,regi,"inco")$( NOT sameAs(iteration,"1")) - +pm_gdp(t,regi)$ sameAs(iteration,"1")) / pm_shPPPMER(regi) - / pm_pop(t,regi)) - /(20 - 3),0),1) !! (1-lambda) = 0 if gdppop < 3000, 1 if gdppop >= 20000 - ) - * f36_inconvpen(teEs) ; - -loop ( (fe2es_dyn36(entyFe,esty,teEs)), -p36_techCosts(t,regi_dyn36(regi),entyFe,esty,teEs) = - p36_esCapCostImplicit(t,regi,teEs) - + - (p36_fePrice(t,regi,entyFe) - + p36_inconvpen(t,regi,teEs)) - / pm_fe2es(t,regi,teEs) - !! add taxes, subsidies, and later on costs - ; -); - -p36_techCosts_iter(iteration,t,regi,entyFe,esty,teEs) = - p36_techCosts(t,regi,entyFe,esty,teEs); - -*** Compute the share of UE for each technology that is needed to get the aggregate technological distribution observed -loop ((t36_hist(ttot),fe2ces_dyn36(entyFe,esty,teEs,in)), -p36_shUeCesDelta(ttot,regi_dyn36(regi),entyFe,in,teEs) - = p36_prodUEintern(ttot,regi,entyFe,esty,teEs) - / sum ( fe2ces_dyn36_2(entyFe2,esty2,teEs2,in), - p36_prodUEintern(ttot,regi,entyFe2,esty2,teEs2) - ) - ; - - loop (regi_dyn36(regi), - if ( p36_shUeCesDelta(ttot,regi,entyFe,in,teEs) lt 0, - put testfile; - put p36_shUeCesDelta.tn(ttot,regi,entyFe,in,teEs) , " = ", p36_shUeCesDelta(ttot,regi,entyFe,in,teEs) /; - put p36_demUEtotal.tn(ttot,regi,in) , " = ", p36_demUEtotal(ttot,regi,in) /; - put p36_prodEs.tn(ttot,regi,entyFe,esty,teEs) , " = ", p36_prodEs(ttot,regi,entyFe,esty,teEs) /; - put p36_prodUEintern.tn(ttot,regi,entyFe,esty,teEs), " = ", p36_prodUEintern(ttot,regi,entyFe,esty,teEs) /; - putclose; - execute_unload "abort.gdx"; - abort "some share was decreasing faster than planned. Look at the logfile for more information"; - ); - ); -); - -*** Compute the calibration factors for the historical periods -loop ((t36_hist(ttot),fe2ces_dyn36(entyFe,esty,teEs,in)), -p36_logitCalibration(ttot,regi_dyn36(regi),entyFe,esty,teEs) $ p36_shUeCesDelta(ttot,regi,entyFe,in,teEs) !! exclude shares which are zero - = - (1 / (p36_logitLambda(regi,in)) - * log ( p36_shUeCesDelta(ttot,regi,entyFe,in,teEs)) - - p36_techCosts(ttot,regi,entyFe,esty,teEs) - ) - - - (1 - / sum (fe2ces_dyn36_2(entyFe2,esty2,teEs2,in)$ p36_shUeCesDelta(ttot,regi,entyFe2,in,teEs2), - 1) - ) - * sum (fe2ces_dyn36_2(entyFe2,esty2,teEs2,in)$ p36_shUeCesDelta(ttot,regi,entyFe2,in,teEs2), !! exclude shares which are zero - 1 / ( p36_logitLambda(regi,in)) - * log ( p36_shUeCesDelta(ttot,regi,entyFe2,in,teEs2)) - - p36_techCosts(ttot,regi,entyFe2,esty2,teEs2) - ); - -); - -*** For the last historical period, attribute the last historical value of the calibration parameter to the scenario periods -*** The calibration factors are reduced towards 80% in the long term to represent the enhanced flexibility of the system -*** Long lasting non-price barriers should preferably be represented through price mark-ups -loop ( t36_hist_last(ttot), - p36_logitCalibration(ttot,regi_dyn36(regi),entyFe,esty,teEs) $ ( fe2es_dyn36(entyFe,esty,teEs) - AND NOT p36_logitCalibration(ttot,regi,entyFe,esty,teEs)) - = 5; - - loop ( t36_scen(t2), - - p36_logitCalibration(t2,regi_dyn36(regi),entyFe,esty,teEs) $ fe2es_dyn36(entyFe,esty,teEs) - = min(max((2040 - pm_ttot_val(t2))/(2040 -ttot.val),0),1) !! lambda = 1 in 2015 and 0 in 2040 - * (p36_logitCalibration(ttot,regi,entyFe,esty,teEs) - - cm_logitCal_markup_conv_b * p36_logitCalibration(ttot,regi,entyFe,esty,teEs)) - + cm_logitCal_markup_conv_b * p36_logitCalibration(ttot,regi,entyFe,esty,teEs) - ; - - !! give a high parameter value to the technologies that do not have some - p36_logitCalibration(t2,regi_dyn36(regi),entyFe,esty,teEs) $ (fe2es_dyn36(entyFe,esty,teEs) - AND NOT p36_logitCalibration(t2,regi,entyFe,esty,teEs)) - = min(max((2040 - pm_ttot_val(t2))/(2040 -ttot.val),0),1) !! lambda = 1 in 2015 and 0 in 2040 - * (3 - - cm_logitCal_markup_newtech_conv_b * 3) - + cm_logitCal_markup_newtech_conv_b * 3; - - !! Decrease the calibration factor for some technologies, based on the difference between the 2015 (ttot) Income per capita and scenario (t2) income per capita. - !! the calibration factor decreases by 90% when income reaches 30 k$ if income per capita was equal or below 5 k$ in 2015. - !! the decrease is lower if the starting income was above 10k$ and is 0 if income was above 30k$ - p36_logitCalibration(t2,regi_dyn36(regi),entyFe,esty,teEs) $ richTechs(teEs) = !! calib = calib * (1 - 0.90 * X) - p36_logitCalibration(ttot,regi,entyFe,esty,teEs) - * (1 - 0.90 - * (( max ( 5, min (30, (vm_cesIO.L(t2,regi,"inco")$( NOT sameAs(iteration,"1")) + pm_gdp(t2,regi)$ sameAs(iteration,"1")) / pm_shPPPMER(regi) / pm_pop(t2,regi) )) - - min (30, max (5, (vm_cesIO.L(ttot,regi,"inco")$( NOT sameAs(iteration,"1")) + pm_gdp(ttot,regi)$ sameAs(iteration,"1")) / pm_shPPPMER(regi) / pm_pop(ttot,regi) )) - ) - / (30 -5)) - ) - ; - - p36_logitCalibration(t2,regi_dyn36(regi),entyFe,esty,teEs) $ (fe2es_dyn36(entyFe,esty,teEs) AND teEs_pushCalib_dyn36(teEs)) = - p36_pushCalib(t2,teEs) - * p36_logitCalibration(t2,regi,entyFe,esty,teEs) - ; -); -); - -option - limrow = 10000000 - limcol = 10000000 - solprint = on -; - -s36_logit = 1; -if (execError > 0, - execute_unload "abort.gdx"; - abort "at least one execution error occured, abort.gdx written"; -); - -solve logit_36 maximizing v36_shares_obj using nlp; -s36_logit = 0; - -option - limrow = 0 - limcol = 0 - solprint = off -; - -if ( NOT ( logit_36.solvestat eq 1 AND (logit_36.modelstat eq 1 OR logit_36.modelstat eq 2)), -abort "model logit_36 is infeasible"; -); - -*** Compute the aggregate UE shares -loop (fe2ces_dyn36(entyFe,esty,teEs,in), - p36_shUeCes(t,regi_dyn36(regi),entyFe,in,teEs) - = v36_prodEs.L(t,regi,entyFe,esty,teEs) - / p36_demUEtotal(t,regi,in); -); - - -*** Set 1e-3 as a lower bound for shares -p36_shUeCes(ttot,regi_dyn36(regi),entyFe,in,teEs) $ ( t36_scen(ttot) - AND p36_shUeCes(ttot,regi,entyFe,in,teEs) lt 1e-3) - = 0 - ; -p36_shUeCes(ttot,regi_dyn36(regi),entyFe,in,teEs) $ ( t36_scen(ttot) - AND feteces_dyn36(entyFe,teEs,in) - ) - = p36_shUeCes(ttot,regi,entyFe,in,teEs) - / sum( feteces_dyn36_2(entyFe2,teEs2,in), - p36_shUeCes(ttot,regi,entyFe2,in,teEs2)) - ; - -*** Compute FE shares -p36_shFeCes(t,regi_dyn36(regi),entyFe,in,teEs)$feteces_dyn36(entyFe,teEs,in) - = (1 / p36_fe2es(t,regi,teEs)) - / sum ( (fe2ces_dyn36(entyFe2,esty2,teEs2,in)), - (1 / p36_fe2es(t,regi,teEs2)) - * p36_shUeCes(t,regi,entyFe2,in,teEs2) - ) - * p36_shUeCes(t,regi,entyFe,in,teEs) - ; - -p36_shFeCes_iter(iteration,t,regi,entyFe,in,teEs) = - p36_shFeCes(t,regi,entyFe,in,teEs); - -*** Pass on to core parameters -loop (fe2ces_dyn36(entyFe,esty,teEs,in), -pm_shFeCes(t,regi_dyn36(regi),entyFe,in,teEs)$( NOT t0(t)) - = p36_shFeCes(t,regi,entyFe,in,teEs); -); -pm_esCapCost(t,regi_dyn36(regi),teEs_dyn36(teEs)) - = p36_esCapCost(t,regi,teEs); - - -*** Diagnostics -*** Compute the norm of the difference between the share vectors of two iterations -p36_shUeCes_iter(iteration,t,regi,entyFe,in,teEs) - = p36_shUeCes(t,regi,entyFe,in,teEs) ; -if ( ord(iteration) gt 1, -loop ((t,regi_dyn36(regi),inViaEs_dyn36(in)), -p36_logitNorm(iteration,t,regi,in) = sqrt ( - sum (fe2ces_dyn36(entyFe,esty,teEs,in) , - power ( p36_shUeCes_iter(iteration,t,regi,entyFe,in,teEs) - - p36_shUeCes_iter(iteration - 1,t,regi,entyFe,in,teEs), - 2) - ) - ) -; -) -); - -*** Reporting -put file_logit_buildings; -put "scenario", "iteration", "period", "region", "variable", "tech", "ces_out", "value" /; - -*** Report on the historical shares - - loop (t36_hist(ttot), - loop (regi_dyn36(regi), - loop (fe2ces_dyn36(entyFe,esty,teEs,in), - - put "%c_expname%", "target", ttot.tl, regi.tl, "shareFE", teEs.tl, in.tl, p36_shFeCes(ttot,regi,entyFe,in,teEs) /; - - ); - ); - ); - -loop ((t,regi_dyn36(regi),fe2ces_dyn36(entyFe,esty,teEs,in)), -put "%c_expname%", iteration.tl, t.tl,regi.tl, "shareFE", teEs.tl, in.tl, p36_shFeCes(t,regi,entyFe,in,teEs) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "shareUE", teEs.tl, in.tl, p36_shUeCes(t,regi,entyFe,in,teEs) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "cost", teEs.tl, in.tl, (p36_techCosts(t,regi,entyFe,esty,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "calibfactor", teEs.tl, in.tl, (p36_logitCalibration(t,regi,entyFe,esty,teEs)* 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "FEpriceWoTax", teEs.tl, in.tl, (p36_fePrice(t,regi,entyFe) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "OM", teEs.tl, in.tl, ((p36_fePrice(t,regi,entyFe) - + p36_inconvpen(t,regi,teEs) - ) - / pm_fe2es(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "OM_FEpriceWtax", teEs.tl, in.tl, ( - (p36_fePrice(t,regi,entyFe) - ) - / pm_fe2es(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "OM_inconvenience", teEs.tl, in.tl, (( - p36_inconvpen(t,regi,teEs) - ) - / pm_fe2es(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "FEpriceTax", teEs.tl, in.tl, ((p36_fePrice(t,regi,entyFe) - ) - * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "CapCosts", teEs.tl, in.tl, (p36_esCapCost(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "CapCostsImplicit", teEs.tl, in.tl, (p36_esCapCostImplicit(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -); - -if ( ord(iteration) gt 1, -loop ((t,regi_dyn36(regi),inViaEs_dyn36(in)), -put "%c_expname%", iteration.tl, t.tl,regi.tl, "norm_diff", "NA" ,in.tl, p36_logitNorm(iteration,t,regi,in) /; -); -); - -putclose; - -*** EOF ./modules/36_buildings/services_putty/presolve.gms - diff --git a/modules/36_buildings/services_putty/realization.gms b/modules/36_buildings/services_putty/realization.gms deleted file mode 100644 index 1e7feb29d..000000000 --- a/modules/36_buildings/services_putty/realization.gms +++ /dev/null @@ -1,36 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_putty/realization.gms - -*' @description -*' -*'The `services_putty` realization splits the representation of buildings energy demand between the CES structure -*' and a multinomial logit structure which distributes the demand across technologies. -*' Importantly, the realization distinguishes across four end-use categories (`appliances and lighting`, `water heating and cooking`, -*' `space cooling` and `space cooling` ). -*' Not only the demand for final energy is represented, but also the demand for useful energy, which is necessary to display the level of efficiency achieved. -*' In total, six energy carrier categories are included (electricity, solids, liquids, gas, district heating, hydrogen), spread across the various end-uses. -*' -*' The model can decide to invest in end-use capital (insulation, appliances, space cooling) to reduce the energy demand, -*' or it can switch to more efficient technologies to produce heat. -*' The conversion efficiencies of the individual heat technologies is prescribed exogenously however. -*' -*' In addition, inertia dynamics are integrated through a putty-clay representation. -*' In each time step, the model can only improve the efficiency of a portion of the building stock. - - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/36_buildings/services_putty/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/36_buildings/services_putty/declarations.gms" -$Ifi "%phase%" == "datainput" $include "./modules/36_buildings/services_putty/datainput.gms" -$Ifi "%phase%" == "equations" $include "./modules/36_buildings/services_putty/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/36_buildings/services_putty/preloop.gms" -$Ifi "%phase%" == "bounds" $include "./modules/36_buildings/services_putty/bounds.gms" -$Ifi "%phase%" == "presolve" $include "./modules/36_buildings/services_putty/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/36_buildings/services_putty/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### -*** EOF ./modules/36_buildings/services_putty/realization.gms diff --git a/modules/36_buildings/services_putty/sets.gms b/modules/36_buildings/services_putty/sets.gms deleted file mode 100644 index df45f6e7b..000000000 --- a/modules/36_buildings/services_putty/sets.gms +++ /dev/null @@ -1,277 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_putty/sets.gms -Sets - regi_dyn36(all_regi) "dynamic region set for compatibility with testOneRegi" - regi_dyn36_cooling(all_regi) "regions with high cooling on which we impose efficiency constraint" - teEs_dyn36(all_teEs) "technologies - buildings module additions" - / - te_ueshheb "buildings space heating district heat" - te_ueshhob "buildings space heating liquids" - te_ueshsob "buildings space heating solids" - te_ueshstb "buildings space heating traditional solids (trad biomass + coal)" - te_ueshgab "buildings space heating district heat" - te_ueshh2b "buildings space heating hydrogen" - te_ueshelb "buildings space heating electricity resistance" - te_ueshhpb "buildings space heating electricity heat pump" - - te_uecwhob "buildings cooking and water heating liquids" - te_uecwsob "buildings cooking and water heating solids" - te_uecwstb "buildings cooking and water heating traditional solids" - te_uecwgab "buildings cooking and water heating gas" - te_uecwheb "buildings cooking and water heating district heat" - te_uecwh2b "buildings cooking and water heating hydrogen" - te_uecwelb "buildings cooking and water heating electricity" - te_uecwhpb "buildings cooking and water heating heat pump" - - / - - esty_dyn36(all_esty) "Energy service types" - / - ueshheb "buildings space heating district heat" - ueshhob "buildings space heating liquids" - ueshsob "buildings space heating solids" - ueshstb "buildings space heating traditional solids" - ueshgab "buildings space heating district heat" - ueshh2b "buildings space heating hydrogen" - ueshelb "buildings space heating electricity resistance" - ueshhpb "buildings space heating electricity heat pump" - - uecwhob "buildings cooking and water heating liquids" - uecwsob "buildings cooking and water heating solids" - uecwstb "buildings cooking and water heating traditional solids" - uecwgab "buildings cooking and water heating gas" - uecwheb "buildings cooking and water heating district heat" - uecwh2b "buildings cooking and water heating hydrogen" - uecwelb "buildings cooking and water heating electricity" - uecwhpb "buildings cooking and water heating heat pump" - / - - - in_buildings_dyn36(all_in) "all inputs and outputs of the CES function - buildings" - / - enb "buildings energy use" - - esswb "buildings weatherization energy service" - - uealb "buildings appliances and light" - uecwb "buildings cooking and water heating" - ueswb "buildings weatherization" - uescb "buildings cooling" - ueshb "buildings heating" - - fescelb "buildings space cooling electricity" - - fealelb "buildings appliances and light electricity" - - kaphc "buildings capital stock insulation" - kapsc "buildings capital stock space cooling" - kapal "buildings capital stock appliances and light" - - / - - es2ppfen_dyn36(all_esty,all_in) "matching FE to ppfEn in MACRO" -/ - ueshheb.ueshb - ueshhob.ueshb - ueshsob.ueshb - ueshstb.ueshb - ueshgab.ueshb - ueshh2b.ueshb - ueshelb.ueshb - ueshhpb.ueshb - - uecwhob.uecwb - uecwsob.uecwb - uecwstb.uecwb - uecwgab.uecwb - uecwheb.uecwb - uecwh2b.uecwb - uecwelb.uecwb - uecwhpb.uecwb -/ - -fe2es_dyn36(all_enty,all_esty,all_teEs) "map FE carriers to ES via appliances" -/ - fehes.ueshheb.te_ueshheb - fehos.ueshhob.te_ueshhob - fesos.ueshsob.te_ueshsob - fesos.ueshstb.te_ueshstb - fegas.ueshgab.te_ueshgab - feh2s.ueshh2b.te_ueshh2b - feels.ueshelb.te_ueshelb - feels.ueshhpb.te_ueshhpb - - fehos.uecwhob.te_uecwhob - fesos.uecwsob.te_uecwsob - fesos.uecwstb.te_uecwstb - fegas.uecwgab.te_uecwgab - fehes.uecwheb.te_uecwheb - feh2s.uecwh2b.te_uecwh2b - feels.uecwelb.te_uecwelb - feels.uecwhpb.te_uecwhpb -/ - -buildMoBio36 (all_esty) "modern biomass in buildings" -/ -ueshsob -uecwsob -/ - - fe2ces_dyn36(all_enty,all_esty,all_teEs,all_in) "map FE carriers to CES via appliances" -// -feteces_dyn36(all_enty,all_teEs,all_in) "map FE carriers to CES without esty" -// - - -inViaEs_dyn36(all_in) "CES inputs which are provided throught the ES pathway" - - in_putty_dyn36(all_in) "putty in for buildings" - / - esswb - kaphc - ueswb - / - - ppf_putty_dyn36(all_in) "putty ppf for buildigs" - / - kaphc - ueswb - / - - in_complements_dyn36(all_in) "in complements" - / - uescb - ueshb - / - - nests_putty_dyn36(all_in,all_in) "putty nests" - / - esswb.( esswb,kaphc,ueswb) - / - - - ppfKap_dyn36(all_in) "Capital primary production factors" - / - kaphc - kapsc - kapal - / - - ppfen_buildings_dyn36(all_in) "primary production factors energy - buildings" - / - ueshb - uecwb - fescelb - fealelb - / - - cal_ppf_buildings_dyn36(all_in) "primary production factors - buildings - used for the calibration" - / uescb, ueshb, uealb, uecwb, kaphc/ - - ue_dyn36(all_in) "useful energy items" - /uescb, ueshb, uealb, uecwb/ - - ces_buildings_dyn36(all_in,all_in) "CES tree structure - buildings" - / - en . enb - enb . (esswb, uealb, uecwb) - esswb . (ueswb,kaphc) - ueswb . (uescb,ueshb) - uescb . (fescelb,kapsc) - - uealb . (fealelb,kapal) - - / - - fe2ppfEn36(all_enty,all_in) "match ESM entyFe to ppfEn" - / - feels . (fescelb,fealelb) - / - - fe_tax_sub36(all_in,all_in) "correspondence between tax and subsidy input data resolution and model sectoral resolution" - / - feelb . (fealelb,fescelb) - / - - in_enerSerAdj_dyn36(all_in) "Energy services input to be adjusted" - / - esswb - fescelb - / - - mapElHp(all_teEs,all_teEs) "correspondence between electric resistance technology and heat pump technology" - / - te_uecwelb. te_uecwhpb - te_ueshelb. te_ueshhpb - / - - richTechs(all_teEs) "technologies whose calibration decreases with income " - / - te_ueshgab - te_uecwgab - / - - t36_hist(ttot) "historic time steps" - t36_hist_last(ttot) "last historic time step" - t36_scen(ttot) "non historical scenario time step" - - teEs_pushCalib_dyn36(all_teEs) "technologies for which the Logit parameter should be modified" - - opTimeYr2teEs(all_teEs,opTimeYr) "mapping for technologies to yearly lifetime - is filled automatically from the lifetime values of technologies" -; - -loop ( fe2es_dyn36(all_enty,all_esty,all_teEs), - loop ( es2ppfen_dyn36(all_esty,all_in), - fe2ces_dyn36(all_enty,all_esty,all_teEs,all_in) = YES; - inViaEs_dyn36(all_in) = YES; - feteces_dyn36(all_enty,all_teEs,all_in) = YES; - ) - ); - - - alias (fe2ces_dyn36,fe2ces_dyn36_2); - alias (fe2es_dyn36, fe2es_dyn36_2); - alias (feteces_dyn36, feteces_dyn36_2); - - -t36_hist(ttot) = NO; -t36_hist(ttot)$(sameAs(ttot,"2005") OR sameAs(ttot,"2010") OR sameAs(ttot,"2015")) = YES; - -t36_scen(ttot) = NO; -t36_scen(ttot)$t(ttot) = YES; -t36_scen(ttot)$t36_hist(ttot) = NO; - -$offOrder - t36_hist_last(ttot) = NO; - t36_hist_last(t36_hist)$(ord(t36_hist) eq card(t36_hist)) = YES; -$offOrder - -teEs_pushCalib_dyn36(all_teEs) = NO; -regi_dyn36_cooling(all_regi) = NO; -***------------------------------------------------------------------------- -*** add module specific sets and mappings to the global sets and mappings -***------------------------------------------------------------------------- -ppfKap(ppfKap_dyn36) = YES; -in(in_buildings_dyn36) = YES; -ppfEn(ppfen_buildings_dyn36) = YES; -cesOut2cesIn(ces_buildings_dyn36) = YES; -fe2ppfEn(fe2ppfEn36) = YES; -in_putty(in_putty_dyn36) = YES; -ppf_putty(ppf_putty_dyn36) = YES; -in_complements(in_complements_dyn36) = YES; -in_enerSerAdj(in_enerSerAdj_dyn36) = YES; -nests_putty(nests_putty_dyn36) = YES; -fe_tax_sub_sbi(fe_tax_sub36) = YES; - -buildMoBio(buildMoBio36) = YES; - -teEs(teEs_dyn36) = YES; -esty(esty_dyn36) = YES; -fe2es(fe2es_dyn36) = YES; -es2ppfen(es2ppfen_dyn36) = YES; -*** EOF ./modules/36_buildings/services_putty/sets.gms diff --git a/modules/36_buildings/services_with_capital/bounds.gms b/modules/36_buildings/services_with_capital/bounds.gms deleted file mode 100644 index b82c2b603..000000000 --- a/modules/36_buildings/services_with_capital/bounds.gms +++ /dev/null @@ -1,46 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** 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") ) - = max( - (1 - 1e-14) * p36_cesIONoRebound(t,regi,in), - abs(pm_cesdata(t,regi,in,"offset_quantity")) - ); -); - - -loop (t36_hist_last(ttot2) , - v36_deltaProdEs.lo(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $ ( - ttot.val le ttot2.val) - = max ( 0, - p36_deltaProdEs(ttot,regi,enty,esty,teEs) - -1e-6 - ) - ; - v36_deltaProdEs.up(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $ ( - ttot.val le ttot2.val) - = p36_deltaProdEs(ttot,regi,enty,esty,teEs) - +1e-6 - ; - ); -v36_deltaProdEs.lo(t36_scen(ttot),regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) = 1e-9; - -v36_vintageInfes.fx(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $( - v36_vintageInfes.L(ttot,regi,enty,esty,teEs)) - = v36_vintageInfes.L(ttot,regi,enty,esty,teEs); - -v36_vintageInfes.fx(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $( - NOT v36_vintageInfes.L(ttot,regi,enty,esty,teEs)) - = 0; - -v36_logitInfes.up(t,regi_dyn36(regi),inViaEs_dyn36(in)) = + INF ; - -*** EOF ./modules/36_buildings/services_with_capital/bounds.gms diff --git a/modules/36_buildings/services_with_capital/datainput.gms b/modules/36_buildings/services_with_capital/datainput.gms deleted file mode 100644 index b9c1d5434..000000000 --- a/modules/36_buildings/services_with_capital/datainput.gms +++ /dev/null @@ -1,323 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_with_capital/datainput.gms -*** substitution elasticities -Parameter - p36_cesdata_sigma(all_in) "substitution elasticities" - / - enb 0.3 - esswb -1 !! The Esub is estimated with technological data - ueswb INF !! all sigma equal to INF will be treated as a sum with coefficients equal to unity ie OUT = IN1+ IN2. - uescb -1 !! The Esub is estimated with technological data - uealb -1 !! The Esub is estimated with technological data - / - -; -pm_cesdata_sigma(ttot,in)$p36_cesdata_sigma(in) = p36_cesdata_sigma(in); - -pm_capital_lifetime_exp(all_regi,"kapsc") = 20; -pm_capital_lifetime_exp(all_regi,"kapal") = 12; -*** FS: ad-hoc assume the same lifetime for insulation capital than for space cooling capital to avoid division by zero -pm_capital_lifetime_exp(all_regi,"kaphc") = 20; - -pm_capital_lifetime_exp(all_regi,"esswb") = log ( 0.25) / log ( 1 -0.02 ); - -pm_delta_kap(regi,in)$((ppfKap_dyn36(in) AND NOT in_putty(in)) OR nests_putty_dyn36(in,in)) = - log (0.25) / pm_capital_lifetime_exp(regi,in); - -loop (out, -pm_delta_kap(regi,in)$nests_putty_dyn36(out,in) = pm_delta_kap(regi,out); -); - -parameter - -p36_floorspace_scen(tall,all_regi,all_demScen) "floorspace" -/ -$ondelim -$include "./modules/36_buildings/services_with_capital/input/p36_floorspace_scen.cs4r" -$offdelim -/ -; -p36_floorspace(ttot,regi) = p36_floorspace_scen(ttot,regi,"%cm_demScen%") * 1e-3; !! from million to billion m2 - -parameter -p36_demFeForEs_scen "final energy demand projections for FE-UE technologies" -/ -$ondelim -$include "./modules/36_buildings/services_with_capital/input/p36_serviceInputs.cs4r" -$offdelim -/ - -p36_prodEs_scen "useful energy demand projections for FE-UE technologies" -/ -$ondelim -$include "./modules/36_buildings/services_with_capital/input/p36_serviceOutputs.cs4r" -$offdelim -/ -; - -table f36_datafecostsglob(char,all_teEs) "end-use (final energy) technologies characteristics" -$include "./modules/36_buildings/services_with_capital/input/generisdata_feCapCosts.prn" -; - - f36_datafecostsglob("inco0",teEs) = sm_D2015_2_D2005 * f36_datafecostsglob("inco0",teEs); - f36_datafecostsglob("inco0",teEs) = sm_DpKW_2_TDpTW * f36_datafecostsglob("inco0",teEs); - f36_datafecostsglob("omf",teEs) = sm_D2015_2_D2005 * f36_datafecostsglob("omf",teEs); - f36_datafecostsglob("omf",teEs) = sm_DpKW_2_TDpTW * f36_datafecostsglob("omf",teEs); - -table f36_dataeff(char,all_teEs) "end-use (final energy) long term efficiency assumptions" -$include "./modules/36_buildings/services_with_capital/input/generisdata_Eff.prn" -; - -p36_demFeForEs(ttot,regi,entyFe,esty,teEs)$fe2es_dyn36(entyFe,esty,teEs) = p36_demFeForEs_scen(ttot,regi,"%cm_GDPscen%",entyFe,esty,teEs) * sm_EJ_2_TWa; !! from EJ to TWa; -p36_prodEs(ttot,regi,entyFe,esty,teEs)$fe2es_dyn36(entyFe,esty,teEs) = p36_prodEs_scen(ttot,regi,"%cm_GDPscen%",entyFe,esty,teEs) * sm_EJ_2_TWa; !! from EJ to TWa; - - -***_____________________________Information for the ES layer and the multinomial logit function _____________________________ -*** Price sensitivity of the logit function -p36_logitLambda(regi,in)$inViaEs_dyn36(in) = cm_priceSensiBuild; - -*** Compute efficiencies of technologies producing ES(UE) from FE -loop ( fe2es_dyn36(entyFe,esty,teEs), -p36_fe2es(ttot,regi,teEs)$p36_demFeForEs(ttot,regi,entyFe,esty,teEs) = p36_prodEs(ttot,regi,entyFe,esty,teEs) / p36_demFeForEs(ttot,regi,entyFe,esty,teEs); -); - -p36_fe2es(ttot,regi,teEs)$(teEs_dyn36(teEs) AND ( NOT p36_fe2es(ttot,regi,teEs))) = 0.5; -p36_fe2es(ttot,regi,teEs)$(sameAs(teEs, "te_ueshhpb") OR sameAs(teEs,"te_uecwhpb")) = 3; - -*** Compute share of heat pumps based on the efficiency of electricity -loop (mapElHp(teEs,teEs2), !!teEs= electric resistance. teEs2= heat pump -loop (fe2es_dyn36(entyFe,esty,teEs), -loop (fe2es_dyn36_2(entyFe,esty2,teEs2), -sm_tmp = 0.9; !! maximum assumed efficiency of electric resistance -p36_demFeForEs(ttot,regi,entyFe,esty2,teEs2)$(p36_fe2es(ttot,regi,teEs) gt sm_tmp) - = p36_demFeForEs(ttot,regi,entyFe,esty,teEs) - * (p36_fe2es(ttot,regi,teEs) - sm_tmp) - / (p36_fe2es(ttot,regi,teEs2) -sm_tmp) - ; -p36_demFeForEs(ttot,regi,entyFe,esty,teEs) = p36_demFeForEs(ttot,regi,entyFe,esty,teEs) - - p36_demFeForEs(ttot,regi,entyFe,esty2,teEs2); - -p36_fe2es(ttot,regi,teEs)$(p36_fe2es(ttot,regi,teEs) gt sm_tmp) = sm_tmp; -); -); -); - -*** Correct the UE quantities of heat pumps and electricity in accordance -p36_prodEs(ttot,regi,entyFe,esty,teEs) = p36_demFeForEs(ttot,regi,entyFe,esty,teEs) * p36_fe2es(ttot,regi,teEs); - -if (cm_startyear gt 2005, -Execute_Loadpoint 'input_ref' p36_logitCalibration_load = p36_logitCalibration, p36_logitLambda_load = p36_logitLambda; -p36_logitCalibration(ttot,regi,enty,esty,teEs) = p36_logitCalibration_load(ttot,regi,enty,esty,teEs); -p36_logitLambda(regi,in) = p36_logitLambda_load(regi,in); -); - -*** Introduce long term assumption concerning efficiencies -loop (t36_hist_last(ttot2), - -p36_fe2es(ttot,regi,teEs)$( pm_ttot_val(ttot) gt pm_ttot_val(ttot2)) = p36_fe2es(ttot2,regi,teEs); - -p36_fe2es(ttot,regi,teEs)$f36_dataeff("eta",teEs) -= -min(max((2100 - pm_ttot_val(ttot))/(2100 -ttot2.val),0),1) !! lambda = 1 in 2015 and 0 in 2100 - * ( p36_fe2es(ttot,regi,teEs) - - f36_dataeff("eta",teEs) - ) - + f36_dataeff("eta",teEs) -; -); - -*** Compute FE shares of technologies producing ES(UE) from FE -p36_shFeCes(ttot,regi,entyFe,in,teEs)$(feViaEs2ppfen(entyFe,in,teEs) - AND teEs_dyn36(teEs) - AND sum(fe2es(entyFe2,esty,teEs2)$es2ppfen(esty,in), p36_demFeForEs(ttot,regi,entyFe2,esty,teEs2))) - = - sum(fe2es(entyFe,esty,teEs)$es2ppfen(esty,in), p36_demFeForEs(ttot,regi,entyFe,esty,teEs)) - / sum(fe2es(entyFe2,esty,teEs2)$es2ppfen(esty,in), p36_demFeForEs(ttot,regi,entyFe2,esty,teEs2)) -; - -*** Compute UE shares of technologies producing ES(UE) from FE -p36_shUeCes(ttot,regi,entyFe,in,teEs)$(feViaEs2ppfen(entyFe,in,teEs) - AND teEs_dyn36(teEs) - AND sum(fe2es(entyFe2,esty,teEs2)$es2ppfen(esty,in), p36_prodEs(ttot,regi,entyFe2,esty,teEs2))) -= -sum(fe2es(entyFe,esty,teEs)$es2ppfen(esty,in), p36_prodEs(ttot,regi,entyFe,esty,teEs)) -/ sum(fe2es(entyFe2,esty,teEs2)$es2ppfen(esty,in), p36_prodEs(ttot,regi,entyFe2,esty,teEs2)) -; -display p36_shFeCes, p36_fe2es, p36_demFeForEs, p36_prodEs, p36_shUeCes; - -p36_demUEtotal(ttot,regi,in) = sum (fe2ces_dyn36(entyFe,esty,teEs,in), p36_prodEs(ttot,regi,entyFe,esty,teEs)); - -loop (t0(ttot), -p36_prodUEintern(ttot,regi,entyFe,esty,teEs) = p36_prodEs(ttot,regi,entyFe,esty,teEs); -); - -if (cm_startyear gt 2005, -Execute_Loadpoint 'input_ref' p36_prodUEintern_load = vm_prodEs.L; -p36_prodUEintern(ttot,regi,enty,esty,teEs)$(ttot.val gt 2005 and ttot.val lt cm_startyear) = p36_prodUEintern_load(ttot,regi,enty,esty,teEs); -); - -*** Compute FE prices from input.gdx -if ( execError = 0, -Execute_Loadpoint 'input' p36_marginalUtility = qm_budget.m; - if (execError gt 0, - execError = 0; - p36_marginalUtility(ttot,regi) = 1; - ); -); -if ( execError = 0, -Execute_Loadpoint 'input' p36_fePrice_load = qm_balFe.m; -loop (se2fe(entySe,entyFe,te), - p36_fePrice(ttot,regi,entyFe) = p36_fePrice_load(ttot,regi,entySe,entyFe,te); - ); -if (execError gt 0, - execError = 0; - p36_fePrice(ttot,regi,entyFe) = 1; - ); -); - -p36_marginalUtility(ttot,regi)$( abs (p36_marginalUtility(ttot,regi)) lt sm_eps) = 1; - -p36_fePrice(ttot,regi,entyFe) = abs (p36_fePrice(ttot,regi,entyFe)) / abs (p36_marginalUtility(ttot,regi)); -p36_fePrice(ttot,regi,entyFe)$ ( NOT p36_fePrice(ttot,regi,entyFe)) = 0.01; !! give a default value in case the relevant information is not available in the input.gdx - -p36_fePrice_iter(iteration,ttot,regi,entyFe) = 0; - -if ((cm_noReboundEffect eq 1 ), -Execute_Load 'input_ref' p36_cesIONoRebound = vm_cesIO.L; -); - -*** Implicit discount rates mark-ups over the normal discount rate -if ((cm_DiscRateScen eq 0), -p36_implicitDiscRateMarg(ttot,regi,all_in) = 0; - elseif (cm_DiscRateScen eq 1), - p36_implicitDiscRateMarg(ttot,regi,"ueshb") = 0.05; !! 5% for the choice of space heating technology - p36_implicitDiscRateMarg(ttot,regi,"uecwb") = 0.05; !! 5% for the choice of cooking and water heating technology - elseif (cm_DiscRateScen eq 2), - p36_implicitDiscRateMarg(ttot,regi,all_in) = 0; - p36_implicitDiscRateMarg(ttot,regi,"ueshb")$(ttot.val ge 2005 AND ttot.val lt cm_startyear) = 0.05; !! 5% for the choice of space heating technology - p36_implicitDiscRateMarg(ttot,regi,"uecwb")$(ttot.val ge 2005 AND ttot.val lt cm_startyear) = 0.05; !! 5% for the choice of cooking and water heating technology - - elseif (cm_DiscRateScen eq 3), - p36_implicitDiscRateMarg(ttot,regi,all_in) = 0; - - p36_implicitDiscRateMarg(ttot,regi,"ueshb") = 0.05; !! 5% for the choice of space heating technology - p36_implicitDiscRateMarg(ttot,regi,"uecwb") = 0.05; !! 5% for the choice of cooking and water heating technology - - p36_implicitDiscRateMarg(ttot,regi,in)$( pm_ttot_val(ttot) ge cm_startyear - AND (sameAs(in,"ueshb") - OR sameAs(in,"uecwb") - ) - ) - = 0.25 * p36_implicitDiscRateMarg(ttot,regi,in) ; - - elseif (cm_DiscRateScen eq 4), - p36_implicitDiscRateMarg(ttot,regi,all_in) = 0; - - p36_implicitDiscRateMarg(ttot,regi,"ueshb") = 0.05; !! 5% for the choice of space heating technology - p36_implicitDiscRateMarg(ttot,regi,"uecwb") = 0.05; !! 5% for the choice of cooking and water heating technology - - p36_implicitDiscRateMarg(ttot,regi,"ueshb") = min(max((2030 - pm_ttot_val(ttot))/(2030 -2020),0),1) !! lambda = 1 in 2020 and 0 in 2030; - * 0.75 * p36_implicitDiscRateMarg(ttot,regi,"ueshb") - + 0.25 * p36_implicitDiscRateMarg(ttot,regi,"ueshb"); !! Reduction of 75% of the Efficiency gap - p36_implicitDiscRateMarg(ttot,regi,"uecwb") = min(max((2030 - pm_ttot_val(ttot))/(2030 -2020),0),1) !! lambda = 1 in 2020 and 0 in 2030; - * 0.75 * p36_implicitDiscRateMarg(ttot,regi,"uecwb") - + 0.25 * p36_implicitDiscRateMarg(ttot,regi,"uecwb"); !! Reduction of 75% of the Efficiency gap - ); - -p36_kapPrice(ttot,regi) = pm_cesdata(ttot,regi,"kap","price") - pm_delta_kap(regi,"kap"); -loop (fe2ces_dyn36(entyFe,esty,teEs,in), -p36_kapPriceImplicit(ttot,regi,teEs) = p36_kapPrice(ttot,regi) + p36_implicitDiscRateMarg(ttot,regi,in); -); - -*** Inconvenience mark-up -f36_inconvpen(teEs)$(sameAs(teEs,"te_ueshstb") OR sameAs(teEs,"te_uecwstb")) = 42; !! In dollar per GJ 42$/GJ is app. eq to 0.15$/kWh -f36_inconvpen(teEs)$(sameAs(teEs,"te_ueshhob") OR sameAs(teEs,"te_uecwhob")) = 14; !! In dollar per GJ 14$/GJ is app. eq to 0.05$/kWh -f36_inconvpen(teEs)$(sameAs(teEs,"te_ueshsob") OR sameAs(teEs,"te_uecwsob")) = 14; !! In dollar per GJ 14$/GJ is app. eq to 0.05$/kWh -f36_inconvpen(teEs) = f36_inconvpen(teEs) * sm_DpGJ_2_TDpTWa; !! conversion $/GJ -> T$/TWa - -*** Compute depreciation rates for technologies -p36_depreciationRate(teEs)$f36_datafecostsglob("lifetime",teEs) = - log (0.33) / f36_datafecostsglob("lifetime",teEs); - -*** Define which technologies will have a faster reduction of their calibration parameter -p36_pushCalib(ttot,teEs_dyn36) = 0; - -$ifthen "%cm_pushCalib%" == "none" -$elseif "%cm_pushCalib%" == "hydrogen" -teEs_pushCalib_dyn36("te_ueshh2b") = YES; -teEs_pushCalib_dyn36("te_uecwh2b") = YES; -p36_pushCalib(ttot,"te_ueshh2b") = 0; -p36_pushCalib(ttot,"te_uecwh2b") = 0.5; - -p36_pushCalib(ttot,teEs_pushCalib_dyn36(teEs)) = - min(max((2050 -ttot.val)/(2050 - cm_startyear),0),1) !! lambda = 1 in startyear and 0 in 2050 - * ( 1 - p36_pushCalib(ttot,teEs)) - + p36_pushCalib(ttot,teEs) ; -$endif - - -*** Define for which technologies the investment costs will evolve -p36_costReduc(ttot,teEs_dyn36) = 1; - -$ifthen "%cm_reducCostB%" == "none" -$elseif "%cm_reducCostB%" == "hydrogen" - -p36_costReduc(ttot,"te_ueshh2b") = 0.2; -p36_costReduc(ttot,"te_uecwh2b") = 0.5; - -p36_costReduc(ttot,teEs_pushCalib_dyn36(teEs)) = - min(max((2050 -ttot.val)/(2050 - cm_startyear),0),1) !! lambda = 1 in startyear and 0 in 2050 - * ( 1 - p36_costReduc(ttot,teEs)) - + p36_costReduc(ttot,teEs) ; -$elseif "%cm_reducCostB%" == "heatpumps" -p36_costReduc(ttot,"te_ueshhpb") = 0.8; -p36_costReduc(ttot,"te_uecwhpb") = 0.8; - -p36_costReduc(ttot,teEs_pushCalib_dyn36(teEs)) = - min(max((2050 -ttot.val)/(2050 - cm_startyear),0),1) !! lambda = 1 in startyear and 0 in 2050 - * ( 1 - p36_costReduc(ttot,teEs)) - + p36_costReduc(ttot,teEs) ; -$endif - -*** Computation of omegs and opTimeYr2teEs for technology vintages -p36_omegEs(regi,opTimeYr,teEs_dyn36(teEs)) = 0; - -loop(regi, - p36_aux_lifetime(teEs_dyn36(teEs)) = 5/4 * f36_datafecostsglob("lifetime",teEs); - loop(teEs_dyn36(teEs), - - loop(opTimeYr, - p36_omegEs(regi,opTimeYr,teEs) = 1 - ((opTimeYr.val-0.5) / p36_aux_lifetime(teEs))**4 ; - opTimeYr2teEs(teEs,opTimeYr)$(p36_omegEs(regi,opTimeYr,teEs) > 0 ) = yes; - if( p36_omegEs(regi,opTimeYr,teEs) <= 0, - p36_omegEs(regi,opTimeYr,teEs) = 0; - opTimeYr2teEs(teEs,opTimeYr) = no; - ); - ) - ); -); -display p36_omegEs , opTimeYr2teEs ; -***_____________________________END OF Information for the ES layer and the multinomial logit function _____________________________ - - -*** Adjustement cost factor -p36_adjFactor(ttot,regi) = 1; - - -*** Set dynamic regional set depending on testOneRegi -$ifthen "%optimization%" == "testOneRegi" -regi_dyn36(all_regi) = regi_dyn80(all_regi); -$else -regi_dyn36(all_regi) = regi(all_regi); -$endif - -***------------------------------------------------------------------------- -*** pass on module specific parameter values to core parameters -***------------------------------------------------------------------------- - -pm_fe2es(ttot,regi,teEs_dyn36) = p36_fe2es(ttot,regi,teEs_dyn36); -pm_shFeCes(ttot,regi,entyFe,in,teEs)$p36_shFeCes(ttot,regi,entyFe,in,teEs) = p36_shFeCes(ttot,regi,entyFe,in,teEs); -*** EOF ./modules/36_buildings/services_with_capital/datainput.gms diff --git a/modules/36_buildings/services_with_capital/declarations.gms b/modules/36_buildings/services_with_capital/declarations.gms deleted file mode 100644 index da96a8796..000000000 --- a/modules/36_buildings/services_with_capital/declarations.gms +++ /dev/null @@ -1,100 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_with_capital/declarations.gms -Scalar -s36_vintage_calib "switch for the inclusion of vintage equations and restricting ttot to historical. It should exclude the equations from hybrid" /0/, -s36_logit "switch for the inclusion of vintage equations. It should exclude the equations from hybrid" /0/ -; - -Parameter -p36_floorspace(tall,all_regi) "buildings floorspace, billion m2" -p36_adjFactor(tall,all_regi) "factor applied for the adjustment costs" - -p36_cesIONoRebound(tall,all_regi,all_in) "loads the vm_cesIO values from the input_ref and sets the upper bound to vm_cesIO to forbid a rebound effect" -p36_demFeForEs_scen(tall,all_regi,all_GDPscen,all_enty,all_esty,all_teEs) "Final energy demand for technologies producing energy services (useful energy in the case of buildings)" -p36_demFeForEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Final energy demand for technologies producing energy services (useful energy in the case of buildings)" - -p36_prodEs_scen(tall,all_regi,all_GDPscen,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) for technologies producing energy services and using FE" -p36_prodEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) for technologies producing energy services and using FE" -p36_prodEs_iter(iteration,ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) for technologies producing energy services and using FE over iterations" -p36_deltaProdEs_iter(iteration,ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) addition for a year. For technologies producing energy services and using FE over iterations" -p36_deltaProdEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) addition for a year. Result of vintage_36" - -p36_shFeCes(ttot,all_regi,all_enty,all_in,all_teEs) "share of Final energy of technology teEs in the final energy producing all_in" -p36_shFeCes_iter(iteration,ttot,all_regi,all_enty,all_in,all_teEs) "share of Final energy of technology teEs in the final energy producing all_in" -p36_shUeCes(ttot,all_regi,all_enty,all_in,all_teEs) "share of Useful energy of technology teEs in the final energy producing all_in" -p36_shUeCes_iter(iteration,ttot,all_regi,all_enty,all_in,all_teEs) "share of Useful energy of technology teEs in the final energy producing all_in" -p36_fe2es(ttot,all_regi,all_teEs) "FE to ES(UE) efficiency of technology teES" - -p36_logitLambda(all_regi,all_in) "logit parameter for homogeneity" -p36_logitLambda_load (all_regi,all_in) "logit parameter for homogeneity, loaded from GDX_ref" -p36_fePrice_load(tall,all_regi,all_enty,all_enty,all_te) "Final energy price from GDX" -p36_fePrice(tall,all_regi,all_enty) "Final energy price" -p36_fePrice_iter(iteration,tall,all_regi,all_enty) "Final energy price over iterations" -p36_marginalUtility(tall,all_regi) "Marginal utility of income: used to compute the final energy price from the marginal of balance equation" -p36_techCosts(tall,all_regi,all_enty,all_esty,all_teEs) "Relevant costs of each ES technology for the computation of the share in the multinomial logit" -p36_techCosts_iter(iteration,tall,all_regi,all_enty,all_esty,all_teEs) "Relevant costs of each ES technology for the computation of the share in the multinomial logit over iterations" -p36_logitCalibration(tall,all_regi,all_enty,all_esty,all_teEs) "calibration parameter for the multinomial logit function" -p36_logitCalibration_load(tall,all_regi,all_enty,all_esty,all_teEs) "calibration parameter for the multinomial logit function from input_ref.gdx" -p36_logitNorm(iteration,tall,all_regi,all_in) "Norm of the share vector difference between iterations" - -p36_prodUEintern(tall,all_regi,all_enty,all_esty,all_teEs) "UE production from depreciated technologies of the previous period" -p36_prodUEintern_load(tall,all_regi,all_enty,all_esty,all_teEs) "UE production from depreciated technologies of the previous period -- From GDX" -p36_demUEtotal(tall,all_regi,all_in) "Demand for UE, independent of the technology" -p36_demUEdelta(tall,all_regi,all_in) "Demand for UE, independent of the technology, and which is not covered by the depreciated technologies" -p36_shUeCesDelta(ttot,all_regi,all_enty,all_in,all_teEs) "Technological shares in UE which is not covered by former depreciated technologies" -p36_depreciationRate(all_teEs) "Depreciation rates for the indivudal conversion technologies, rouhgly derived from their lifetime parameter" - -p36_esCapCost(tall,all_regi,all_teEs) "Capital costs for each technology transforming FE into UE. Cost per unit of FE" -p36_esCapCostImplicit(tall,all_regi,all_teEs) "Capital costs for each technology transforming FE into UE, taking the implicit discount rate into account. Cost per unit of FE" -p36_kapPrice(tall,all_regi) "Macroeconomic capital price, net of depreciation" -p36_kapPriceImplicit(tall,all_regi,all_teEs) "Macroeconomic capital price, net of depreciation, to which the implicit discount rate is added" -p36_implicitDiscRateMarg(tall,all_regi,all_in) "Implicit discount rate for the choice of conversion technologies from UE to FE in buildings" -p36_depreciationRate(all_teEs) "Depreciation rates for the indivudal conversion technologies, rouhgly derived from their lifetime parameter" -p36_pushCalib(tall,all_teEs) "degree to which the calibration parameter should be reduced/increased for these technologies" -p36_costReduc(tall,all_teEs) "Reduction of costs for some technologies" -f36_inconvpen(all_teEs) "maximum inconvenience penalty for traditional conversion technologies. Unit: T$/TWa" -p36_inconvpen(ttot,all_regi,all_teEs) "parameter for inconvenience penalty depending on income level. Unit: T$/TWa" - -p36_aux_lifetime(all_teEs) "auxiliary parameter for calculating life times" -p36_omegEs(all_regi,opTimeYr,all_teEs) "technical depreciation parameter, gives the share of a capacity that is still usable after tlt. [none/share, value between 0 and 1]" -; - -Variables -v36_prodEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) for technologies producing energy services and using FE" -v36_deltaProdEs(ttot,all_regi,all_enty,all_esty,all_teEs) "Energy service demand (UE in the case of buildings) addition for a year. For technologies producing energy services and using FE" -v36_vintageInfes(ttot,all_regi,all_enty,all_esty,all_teEs) "slack variable to avoid infeasibilities in the initialisation of vintages" -v36_logitInfes(tall,all_regi,all_in) "slack variable to avoid infeasibilities in case historical demand cannot be declined fast enough" -v36_costs(ttot,all_regi) "technological costs" -v36_vintage_obj "objective variable for vintage model" -v36_shares_obj "objective variable for heterogeneity preferences" -; - -Equations -q36_demFeBuild(ttot,all_regi,all_enty,all_emiMkt) "buildings final energy demand" -q36_ueTech2Total(tall,all_regi,all_in) "definition of total UE buildings demand, based on the sum of demand by technology" -q36_cap(tall,all_regi,all_enty,all_esty,all_teEs) "definition of available capacities" -q36_budget(tall,all_regi) "budget equation" -q36_vintage_obj "objective function for vintage model" -q36_shares_obj "objective function for logit shares: heterogeneity preferences" -; - - -file testfile /""/; - -testfile.nd = 10; - - -file file_logit_buildings / "Logit_buildings.csv" /; - -file_logit_buildings.ap = 0; !! append to file is negative to overwrite former file if existing -file_logit_buildings.pc = 5; !! csv file -file_logit_buildings.lw = 0; -file_logit_buildings.nw = 20; -file_logit_buildings.nd = 15; - -*** EOF ./modules/36_buildings/services_with_capital/declarations.gms diff --git a/modules/36_buildings/services_with_capital/equations.gms b/modules/36_buildings/services_with_capital/equations.gms deleted file mode 100644 index f78725554..000000000 --- a/modules/36_buildings/services_with_capital/equations.gms +++ /dev/null @@ -1,116 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_with_capital/equations.gms - -*** Buildings Final Energy Balance -q36_demFeBuild(ttot,regi,entyFe,emiMkt)$((ttot.val ge cm_startyear) AND (entyFe2Sector(entyFe,"build"))) .. - sum((entySe,te)$se2fe(entySe,entyFe,te), vm_demFeSector_afterTax(ttot,regi,entySe,entyFe,"build",emiMkt)) - =e= - ( - sum(fe2ppfEn36(entyFe,in), - vm_cesIO(ttot,regi,in) - + pm_cesdata(ttot,regi,in,"offset_quantity") - ) - + - sum(fe2es_dyn36(entyFe,esty,teEs), vm_demFeForEs(ttot,regi,entyFe,esty,teEs) ) - )$(sameas(emiMkt,"ES")) -; -q36_ueTech2Total(ttot,regi_dyn36(regi),inViaEs_dyn36(in)) $ - ( (s36_vintage_calib eq 1 AND t36_hist(ttot) ) - OR ((s36_logit eq 1) AND (ttot.val ge cm_startyear)) ) .. - p36_demUEtotal(ttot,regi,in) - + v36_logitInfes(ttot,regi,in) - =e= - sum (fe2ces_dyn36(enty,esty,teEs,in), - v36_prodEs(ttot,regi,enty,esty,teEs) - ); - - -q36_cap(ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) $ - ( ((s36_vintage_calib eq 1) AND (t36_hist(ttot) )) - OR ((s36_logit eq 1) AND (ttot.val ge cm_startyear)) ) .. - - v36_prodEs(ttot,regi,enty,esty,teEs) - =e= - sum(opTimeYr2teEs(teEs,opTimeYr)$(tsu2opTimeYr(ttot,opTimeYr) AND (opTimeYr.val ge 1) ), - pm_ts(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)-1)) - * p36_omegEs(regi,opTimeYr+1,teEs) - * (v36_deltaProdEs(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)-1),regi,enty,esty,teEs) - - v36_vintageInfes(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)-1),regi,enty,esty,teEs) - ) - ) - ; - -q36_budget(t36_scen(ttot),regi_dyn36(regi)).. - v36_costs(ttot,regi) - =e= - sum ( fe2ces_dyn36(enty,esty,teEs,in), - p36_techCosts(ttot,regi,enty,esty,teEs) - * v36_deltaProdEs(ttot,regi,enty,esty,teEs) - ) - ; - -q36_vintage_obj $ (s36_vintage_calib eq 1 ) .. - v36_vintage_obj - =e= - sum((ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs))$( - t36_hist(ttot) - ), - - sum(opTimeYr2teEs(teEs,opTimeYr)$( - tsu2opTimeYr(ttot,opTimeYr) - ), - power ( - v36_deltaProdEs(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)),regi,enty,esty,teEs) - - v36_deltaProdEs(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)-1),regi,enty,esty,teEs) - ,2 - ) - - + - 1000 - * v36_vintageInfes(ttot-(pm_tsu2opTimeYr(ttot,opTimeYr)),regi,enty,esty,teEs) - ) - + 1000 - * v36_vintageInfes(ttot,regi,enty,esty,teEs) - ) - - ; - -q36_shares_obj $ (s36_logit eq 1).. - v36_shares_obj - =e= - sum ((t36_scen(ttot),regi_dyn36(regi),inViaEs_dyn36(in)), - sum ( fe2ces_dyn36(enty,esty,teEs,in), - - p36_logitCalibration(ttot,regi,enty,esty,teEs) - * v36_deltaProdEs(ttot,regi,enty,esty,teEs) - ) - + 1 / p36_logitLambda(regi,in) - * sum ( fe2ces_dyn36(enty,esty,teEs,in), - v36_deltaProdEs(ttot,regi,enty,esty,teEs) - * log ( v36_deltaProdEs(ttot,regi,enty,esty,teEs) - / sum (fe2ces_dyn36_2(enty2,esty2,teEs2,in), - v36_deltaProdEs(ttot,regi,enty2,esty2,teEs2)) - ) - ) - ) - - - sum ( (t36_scen(ttot),regi_dyn36(regi)), - v36_costs(ttot,regi) - ) - - - sum ((ttot,regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)), - 1000 - * v36_vintageInfes(ttot,regi,enty,esty,teEs) - ) - - sum ((ttot,regi_dyn36(regi),inViaEs_dyn36(in)), - 1000 - * v36_logitInfes(ttot,regi,in) - ) - ; - - -*** EOF ./modules/36_buildings/services_with_capital/equations.gms diff --git a/modules/36_buildings/services_with_capital/input/files b/modules/36_buildings/services_with_capital/input/files deleted file mode 100644 index e5b324c14..000000000 --- a/modules/36_buildings/services_with_capital/input/files +++ /dev/null @@ -1,4 +0,0 @@ -p36_floorspace_scen.cs4r -p36_serviceInputs.cs4r -p36_serviceOutputs.cs4r - diff --git a/modules/36_buildings/services_with_capital/input/generisdata_Eff.prn b/modules/36_buildings/services_with_capital/input/generisdata_Eff.prn deleted file mode 100644 index cdda91535..000000000 --- a/modules/36_buildings/services_with_capital/input/generisdata_Eff.prn +++ /dev/null @@ -1,23 +0,0 @@ -*** SOF ./modules/36_buildings/services_with_capital/input/generisdata_Eff.prn -$ontext -Data adapted from EIA - Technology Forecast Updates – Residential and Commercial Building Technologies – Reference Case -Documentation of the NEMS model: https://www.eia.gov/analysis/studies/buildings/equipcosts/ -Data adapted from https://ec.europa.eu/energy/sites/ener/files/documents/2018_06_27_technology_pathways_-_finalreportmain2.pdf -IMPORTANT: all costs are now given in $2015! As long as the model runs in $2005, the values need to be converted in datainput.gms -inco0 Initial investment costs given in $(2015)/kW Useful energy power -omf Fixed operation and maintenance costs in $(2015)/kW Useful energy power -eta Conversion efficiency: UE/FE -usehr number of hours in a year when the technology is used -lifetime given in years -$offtext - - te_ueshhpb te_ueshgab te_ueshhob te_ueshelb te_ueshh2b te_ueshsob te_ueshheb te_ueshstb -eta %cm_INNOPATHS_effHP% 0.9 0.9 1 0.8 0.8 1 0.25 - - -+ te_uecwhpb te_uecwgab te_uecwhob te_uecwelb te_uecwh2b te_uecwsob te_uecwheb te_uecwstb -eta %cm_INNOPATHS_effHP% 0.9 0.9 1 0.8 0.8 1 0.25 - - - -*** EOF ./modules/36_buildings/services_with_capital/input/generisdata_Eff.prn diff --git a/modules/36_buildings/services_with_capital/input/generisdata_feCapCosts.prn b/modules/36_buildings/services_with_capital/input/generisdata_feCapCosts.prn deleted file mode 100644 index 247c11fcb..000000000 --- a/modules/36_buildings/services_with_capital/input/generisdata_feCapCosts.prn +++ /dev/null @@ -1,29 +0,0 @@ -*** SOF ./modules/36_buildings/services_with_capital/input/generisdata_feCapCosts.prn -$ontext -Data adapted from EIA - Technology Forecast Updates – Residential and Commercial Building Technologies – Reference Case -Documentation of the NEMS model: https://www.eia.gov/analysis/studies/buildings/equipcosts/ -Data adapted from https://ec.europa.eu/energy/sites/ener/files/documents/2018_06_27_technology_pathways_-_finalreportmain2.pdf -IMPORTANT: all costs are now given in $2015! As long as the model runs in $2005, the values need to be converted in datainput.gms -inco0 Initial investment costs given in $(2015)/kW Useful energy power -omf Fixed operation and maintenance costs in $(2015)/kW Useful energy power -eta Conversion efficiency: UE/FE -usehr number of hours in a year when the technology is used -lifetime given in years -$offtext - - te_ueshhpb te_ueshgab te_ueshhob te_ueshelb te_ueshh2b te_ueshsob te_ueshheb te_ueshstb -inco0 1000 180 180 60 10000 470 110 10 -omf 7 3 3 2 13 17 2 1 -eta 3 0.9 0.8 1 0.7 0.8 0.7 0.25 -usehr 1440 1440 1440 1440 1440 1440 1440 1440 !! 60 days a year -lifetime 20 20 20 20 20 20 20 5 - -+ te_uecwhpb te_uecwgab te_uecwhob te_uecwelb te_uecwh2b te_uecwsob te_uecwheb te_uecwstb -inco0 500 190 200 110 10000 250 100 10 -omf 1 2 6 0 13 17 2 1 -eta 3 1 0.8 1 0.7 0.8 0.7 0.25 -usehr 730 730 730 730 730 730 730 730 -lifetime 20 20 20 20 20 20 20 5 - - -*** EOF ./modules/36_buildings/services_with_capital/input/generisdata_feCapCosts.prn diff --git a/modules/36_buildings/services_with_capital/not_used.txt b/modules/36_buildings/services_with_capital/not_used.txt deleted file mode 100644 index 9c96497ff..000000000 --- a/modules/36_buildings/services_with_capital/not_used.txt +++ /dev/null @@ -1,29 +0,0 @@ -# | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -# | authors, and contributors see CITATION.cff file. This file is part -# | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -# | AGPL-3.0, you are granted additional permissions described in the -# | REMIND License Exception, version 1.0 (see LICENSE file). -# | Contact: remind@pik-potsdam.de -name,type,reason -vm_enerSerAdj,input,questionnaire -pm_cumDeprecFactor_old,input,questionnaire -pm_cumDeprecFactor_new,input,questionnaire -vm_costAddTeInv,input,questionnaire -cm_build_H2costAddH2Inv,input,questionnaire -cm_build_H2costDecayStart,input,questionnaire -cm_build_H2costDecayEnd,input,questionnaire -cm_logitCal_markup_conv_b,input,questionnaire -cm_logitCal_markup_newtech_conv_b,input,questionnaire -cm_build_AdjCostActive,input,questionnaire -pm_shGasLiq_fe_up,parameter,not needed -pm_shGasLiq_fe_lo,parameter,not needed -pm_shfe_up,parameter,not needed -pm_shfe_lo,parameter,not needed -qm_balFe,input,questionnaire -sm_TWa_2_MWh,input,questionnaire -vm_costCESMkup,input,questionnaire -sm_trillion_2_non,input,questionnaire -sm_TWa_2_kWh,input,questionnaire -pm_tau_ces_tax,input,questionnaire -pm_dt,parameter,??? -vm_prodSe,input,questionnaire diff --git a/modules/36_buildings/services_with_capital/postsolve.gms b/modules/36_buildings/services_with_capital/postsolve.gms deleted file mode 100644 index 6cbf3eb77..000000000 --- a/modules/36_buildings/services_with_capital/postsolve.gms +++ /dev/null @@ -1,50 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_with_capital/postsolve.gms - -*** calculation of FE Buildings Prices (useful for internal use and reporting purposes) -pm_FEPrice(ttot,regi,entyFE,"build",emiMkt)$(abs (qm_budget.m(ttot,regi)) gt sm_eps) = - q36_demFeBuild.m(ttot,regi,entyFE,emiMkt) / qm_budget.m(ttot,regi); - -p36_fePrice(t,regi_dyn36(regi),entyFe)=pm_FEPrice(t,regi,entyFE,"build","ES"); - -p36_fePrice_iter(iteration,t,regi_dyn36(regi),entyFe)$p36_fePrice(t,regi,entyFe) = - p36_fePrice(t,regi,entyFe); - -*** To compute the capital price, take the CES derivative and substract the depreciation rate -loop(cesOut2cesIn(out,in) $ (sameAs(out,"inco") - AND sameAs(in,"kap")), -p36_kapPrice(t,regi_dyn36(regi)) = - pm_cesdata(t,regi,in,"xi") - * pm_cesdata(t,regi,in,"eff") - * vm_effGr.l(t,regi,in) - - * (vm_cesIO.l(t,regi,out) - + vm_cesIOdelta.l(t,regi,out)$( ipf_putty(out)) - ) - ** (1 - pm_cesdata(t,regi,out,"rho")) - - * ( pm_cesdata(t,regi,in,"eff") - * vm_effGr.l(t,regi,in) - * (vm_cesIO.l(t,regi,in)$( NOT ipf_putty(out)) - + vm_cesIOdelta.l(t,regi,in)$( ipf_putty(out)) - ) - ) - ** (pm_cesdata(t,regi,out,"rho") - 1) - - - pm_delta_kap(regi,"kap"); -); - - -p36_demUEtotal(t,regi_dyn36(regi),in)$(p36_demUEtotal(t,regi,in) AND ( NOT t36_hist(t))) = vm_cesIO.L(t,regi,in) + pm_cesdata(t,regi,in,"offset_quantity") ; - -p36_prodEs_iter(iteration,t,regi,enty,esty,teEs) = - v36_prodEs.l(t,regi,enty,esty,teEs); -p36_deltaProdEs_iter(iteration,t,regi,enty,esty,teEs) = - v36_deltaProdEs.l(t,regi,enty,esty,teEs); - -*** EOF ./modules/36_buildings/services_with_capital/postsolve.gms diff --git a/modules/36_buildings/services_with_capital/preloop.gms b/modules/36_buildings/services_with_capital/preloop.gms deleted file mode 100644 index 1206d4cf7..000000000 --- a/modules/36_buildings/services_with_capital/preloop.gms +++ /dev/null @@ -1,61 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_with_capital/preloop.gms - -*** Vintage initialisation -v36_prodEs.lo(ttot,regi,fe2es_dyn36(enty,esty,teEs)) = 0; -v36_deltaProdEs.lo(ttot,regi,fe2es_dyn36(enty,esty,teEs)) = 0; -v36_vintageInfes.lo(ttot,regi,fe2es_dyn36(enty,esty,teEs)) = 0; - - -s36_vintage_calib = 1; -v36_logitInfes.fx(ttot,regi_dyn36(regi),inViaEs_dyn36(in)) = 0; -v36_prodEs.fx(t36_hist(ttot),regi_dyn36(regi), fe2es_dyn36(entyFe,esty,teEs)) - = p36_prodEs(ttot,regi,entyFe,esty,teEs); - -model vintage_36 / -q36_ueTech2Total -q36_cap -q36_vintage_obj -/; - -if (execError > 0, - execute_unload "abort.gdx"; - abort "at least one execution error occured, abort.gdx written"; -); - -solve vintage_36 minimizing v36_vintage_obj using nlp; - -if ( NOT ( vintage_36.solvestat eq 1 AND (vintage_36.modelstat eq 1 OR vintage_36.modelstat eq 2)), -abort "model vintage_36 is infeasible"; -); - -p36_prodUEintern(t36_hist(ttot),regi_dyn36(regi),fe2es_dyn36(enty,esty,teEs)) - = v36_deltaProdEs.L(ttot,regi,enty,esty,teEs); - -*** Save result from vintage_36 for later bound setting -p36_deltaProdEs(ttot,regi,enty,esty,teEs) = v36_deltaProdEs.L(ttot,regi,enty,esty,teEs); - -s36_vintage_calib = 0; - - -*** Define model for logit shares -model logit_36 / -q36_ueTech2Total -q36_cap -q36_shares_obj -q36_budget -/ -; -*** The value of the capital price cannot be set in datainput as in calibration runs, pm_cesdata is computed in preloop.gms of module 29 -p36_kapPrice(t,regi_dyn36(regi)) = pm_cesdata(t,regi,"kap","price") - pm_delta_kap(regi,"kap"); -loop (fe2ces_dyn36(entyFe,esty,teEs,in), -p36_kapPriceImplicit(t,regi_dyn36(regi),teEs) = p36_kapPrice(t,regi) + p36_implicitDiscRateMarg(t,regi,in); -); - -*** EOF ./modules/36_buildings/services_with_capital/preloop.gms - diff --git a/modules/36_buildings/services_with_capital/presolve.gms b/modules/36_buildings/services_with_capital/presolve.gms deleted file mode 100644 index 4cc77b9bd..000000000 --- a/modules/36_buildings/services_with_capital/presolve.gms +++ /dev/null @@ -1,365 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_with_capital/presolve.gms - -*** For the first iterations, avoid very high prices because of numerical reasons -if (ord(iteration) le 8, - - loop ((t,regi_dyn36(regi)), - sm_tmp = smax(fe2ces_dyn36(entyFe,esty,teEs,in), p36_fePrice(t,regi,entyFe)); - if (sm_tmp gt 3, - p36_fePrice(t,regi,entyFe) = max(0.01, - p36_fePrice(t,regi,entyFe) / sm_tmp * 3 - ); - - - ); - ); -); - - -*** Take average price over previous iterations -if (ord(iteration) ge 5, -p36_fePrice(t,regi_dyn36(regi),entyFe) $ p36_fePrice(t,regi,entyFe)= - ( p36_fePrice_iter(iteration - 1,t,regi,entyFe) - + p36_fePrice_iter(iteration - 2,t,regi,entyFe) - + p36_fePrice_iter(iteration - 3,t,regi,entyFe) - + p36_fePrice_iter(iteration - 4,t,regi,entyFe) - ) - / 4; -); -*** Beyond the 70th iteration, the prices are averaged over the prices since the 66th iteration -if (ord(iteration) ge 70, - -p36_fePrice(t,regi_dyn36(regi),entyFe) = - sum(iteration2 $ (ord(iteration2) ge 66 - AND ord(iteration2) lt ord(iteration)), - p36_fePrice_iter(iteration2,t,regi,entyFe) - ) - / - sum(iteration2 $ (ord(iteration2) ge 66 - AND ord(iteration2) lt ord(iteration)), - 1 - ) - ; - -); -*** smooth the costs - -*** Smooth 2005 prices -$offOrder -p36_kapPrice(t,regi_dyn36(regi))$(ord(t) eq 1) - = ( p36_kapPrice(t+1,regi) * 2 - + p36_kapPrice(t+2,regi) - ) - / 3; - -p36_fePrice(t,regi_dyn36(regi),entyFe)$(ord(t) eq 1) - = ( p36_fePrice(t+1,regi,entyFe) * 2 - + p36_fePrice(t+2,regi,entyFe) - ) - / 3; -$onOrder -*** Smooth non 2005 prices with moving average -$OFForder -loop (t$ ( not ((ord(t) le 1) or (ord(t) eq card(t)))), -p36_kapPrice(t,regi_dyn36(regi)) = - ( p36_kapPrice(t-1,regi) - + p36_kapPrice(t,regi) - + p36_kapPrice(t+1,regi) - ) / 3 ; - -p36_fePrice(t,regi_dyn36(regi),entyFe) = - (p36_fePrice(t-1,regi,entyFe) - + p36_fePrice(t,regi,entyFe) - + p36_fePrice(t+1,regi,entyFe) - ) / 3; - -); -$ONorder - -loop (fe2ces_dyn36(entyFe,esty,teEs,in), -p36_kapPriceImplicit(t,regi_dyn36(regi),teEs) = p36_kapPrice(t,regi) + p36_implicitDiscRateMarg(t,regi,in); -); - - p36_esCapCost(t,regi_dyn36(regi),teEs_dyn36(teEs)) = - (f36_datafecostsglob("inco0",teEs) - * p36_costReduc(t,teEs) - * p36_kapPrice(t,regi) / (1 - (1 + p36_kapPrice(t,regi))** (-f36_datafecostsglob("lifetime",teEs))) !! annualised initial capital costs - + f36_datafecostsglob("omf",teEs) - ) - / f36_datafecostsglob("usehr",teEs) !! from T$/TW to T$/TWh - * sm_day_2_hour * sm_year_2_day !! from T$/TWh to T$/TWa - ; - - p36_esCapCostImplicit(t,regi_dyn36(regi),teEs_dyn36(teEs)) = - (f36_datafecostsglob("inco0",teEs) - * p36_costReduc(t,teEs) - * p36_kapPriceImplicit(t,regi,teEs) / (1 - (1 + p36_kapPriceImplicit(t,regi,teEs))** (-f36_datafecostsglob("lifetime",teEs))) !! annualised initial capital costs - + f36_datafecostsglob("omf",teEs) - ) - / f36_datafecostsglob("usehr",teEs) !! from T$/TW to T$/TWh - * sm_day_2_hour * sm_year_2_day !! from T$/TWh to T$/TWa - ; - -p36_inconvpen(t,regi_dyn36(regi),teEs)$f36_inconvpen(teEs) = - (1 - - min(max((20 - (vm_cesIO.L(t,regi,"inco")$( NOT sameAs(iteration,"1")) - +pm_gdp(t,regi)$ sameAs(iteration,"1")) / pm_shPPPMER(regi) - / pm_pop(t,regi)) - /(20 - 3),0),1) !! (1-lambda) = 0 if gdppop < 3000, 1 if gdppop >= 20000 - ) - * f36_inconvpen(teEs) ; - -loop ( (fe2es_dyn36(entyFe,esty,teEs)), -p36_techCosts(t,regi_dyn36(regi),entyFe,esty,teEs) = - p36_esCapCostImplicit(t,regi,teEs) - + - (p36_fePrice(t,regi,entyFe) - + p36_inconvpen(t,regi,teEs) - + pm_tau_fe_tax(t,regi,"build",entyFe) - + pm_tau_fe_sub(t,regi,"build",entyFe) - ) - / pm_fe2es(t,regi,teEs) - !! add taxes, subsidies, and later on costs - ; -); - -p36_techCosts_iter(iteration,t,regi,entyFe,esty,teEs) = - p36_techCosts(t,regi,entyFe,esty,teEs); - -*** Compute the share of UE for each technology that is needed to get the aggregate technological distribution observed -loop ((t36_hist(ttot),fe2ces_dyn36(entyFe,esty,teEs,in)), -p36_shUeCesDelta(ttot,regi_dyn36(regi),entyFe,in,teEs) - = p36_prodUEintern(ttot,regi,entyFe,esty,teEs) - / sum ( fe2ces_dyn36_2(entyFe2,esty2,teEs2,in), - p36_prodUEintern(ttot,regi,entyFe2,esty2,teEs2) - ) - ; - - loop (regi_dyn36(regi), - if ( p36_shUeCesDelta(ttot,regi,entyFe,in,teEs) lt 0, - put testfile; - put p36_shUeCesDelta.tn(ttot,regi,entyFe,in,teEs) , " = ", p36_shUeCesDelta(ttot,regi,entyFe,in,teEs) /; - put p36_demUEtotal.tn(ttot,regi,in) , " = ", p36_demUEtotal(ttot,regi,in) /; - put p36_prodEs.tn(ttot,regi,entyFe,esty,teEs) , " = ", p36_prodEs(ttot,regi,entyFe,esty,teEs) /; - put p36_prodUEintern.tn(ttot,regi,entyFe,esty,teEs), " = ", p36_prodUEintern(ttot,regi,entyFe,esty,teEs) /; - putclose; - execute_unload "abort.gdx"; - abort "some share was decreasing faster than planned. Look at the logfile for more information"; - ); - ); -); - -*** Compute the calibration factors for the historical periods -loop ((t36_hist(ttot),fe2ces_dyn36(entyFe,esty,teEs,in)), -p36_logitCalibration(ttot,regi_dyn36(regi),entyFe,esty,teEs) $ p36_shUeCesDelta(ttot,regi,entyFe,in,teEs) !! exclude shares which are zero - = - (1 / (p36_logitLambda(regi,in)) - * log ( p36_shUeCesDelta(ttot,regi,entyFe,in,teEs)) - - p36_techCosts(ttot,regi,entyFe,esty,teEs) - ) - - - (1 - / sum (fe2ces_dyn36_2(entyFe2,esty2,teEs2,in)$ p36_shUeCesDelta(ttot,regi,entyFe2,in,teEs2), - 1) - ) - * sum (fe2ces_dyn36_2(entyFe2,esty2,teEs2,in)$ p36_shUeCesDelta(ttot,regi,entyFe2,in,teEs2), !! exclude shares which are zero - 1 / ( p36_logitLambda(regi,in)) - * log ( p36_shUeCesDelta(ttot,regi,entyFe2,in,teEs2)) - - p36_techCosts(ttot,regi,entyFe2,esty2,teEs2) - ); - -); - -*** For the last historical period, attribute the last historical value of the calibration parameter to the scenario periods -*** The calibration factors are reduced towards 80% in the long term to represent the enhanced flexibility of the system -*** Long lasting non-price barriers should preferably be represented through price mark-ups -loop ( t36_hist_last(ttot), - p36_logitCalibration(ttot,regi_dyn36(regi),entyFe,esty,teEs) $ ( fe2es_dyn36(entyFe,esty,teEs) - AND NOT p36_logitCalibration(ttot,regi,entyFe,esty,teEs)) - = 5; - - loop ( t36_scen(t2), - - p36_logitCalibration(t2,regi_dyn36(regi),entyFe,esty,teEs) $ fe2es_dyn36(entyFe,esty,teEs) - = min(max((2100 - pm_ttot_val(t2))/(2100 -ttot.val),0),1) !! lambda = 1 in 2015 and 0 in 2100 - * (p36_logitCalibration(ttot,regi,entyFe,esty,teEs) - - 0.80 * p36_logitCalibration(ttot,regi,entyFe,esty,teEs)) - + 0.80 * p36_logitCalibration(ttot,regi,entyFe,esty,teEs) - ; - - !! give a high parameter value to the technologies that do not have some - p36_logitCalibration(t2,regi_dyn36(regi),entyFe,esty,teEs) $ (fe2es_dyn36(entyFe,esty,teEs) - AND NOT p36_logitCalibration(t2,regi,entyFe,esty,teEs)) - = min(max((2100 - pm_ttot_val(t2))/(2100 -ttot.val),0),1) !! lambda = 1 in 2015 and 0 in 2100 - * (5 - - 0.3 * 5) - + 0.3 * 5; - - !! Decrease the calibration factor for some technologies, based on the difference between the 2015 (ttot) Income per capita and scenario (t2) income per capita. - !! the calibration factor decreases by 90% when income reaches 30 k$ if income per capita was equal or below 5 k$ in 2015. - !! the decrease is lower if the starting income was above 10k$ and is 0 if income was above 30k$ - p36_logitCalibration(t2,regi_dyn36(regi),entyFe,esty,teEs) $ richTechs(teEs) = !! calib = calib * (1 - 0.90 * X) - p36_logitCalibration(ttot,regi,entyFe,esty,teEs) - * (1 - 0.90 - * (( max ( 5, min (30, (vm_cesIO.L(t2,regi,"inco")$( NOT sameAs(iteration,"1")) + pm_gdp(t2,regi)$ sameAs(iteration,"1")) / pm_shPPPMER(regi) / pm_pop(t2,regi) )) - - min (30, max (5, (vm_cesIO.L(ttot,regi,"inco")$( NOT sameAs(iteration,"1")) + pm_gdp(ttot,regi)$ sameAs(iteration,"1")) / pm_shPPPMER(regi) / pm_pop(ttot,regi) )) - ) - / (30 -5)) - ) - ; - - p36_logitCalibration(t2,regi_dyn36(regi),entyFe,esty,teEs) $ (fe2es_dyn36(entyFe,esty,teEs) AND teEs_pushCalib_dyn36(teEs)) = - p36_pushCalib(t2,teEs) - * p36_logitCalibration(t2,regi,entyFe,esty,teEs) - ; -); -); - -option - limrow = 10000000 - limcol = 10000000 - solprint = on -; - -s36_logit = 1; -if (execError > 0, - execute_unload "abort.gdx"; - abort "at least one execution error occured, abort.gdx written"; -); - -solve logit_36 maximizing v36_shares_obj using nlp; -s36_logit = 0; - -option - limrow = 0 - limcol = 0 - solprint = off -; - -if ( NOT ( logit_36.solvestat eq 1 AND (logit_36.modelstat eq 1 OR logit_36.modelstat eq 2)), -abort "model logit_36 is infeasible"; -); - -*** Compute the aggregate UE shares -loop (fe2ces_dyn36(entyFe,esty,teEs,in), - p36_shUeCes(t,regi_dyn36(regi),entyFe,in,teEs) - = v36_prodEs.L(t,regi,entyFe,esty,teEs) - / p36_demUEtotal(t,regi,in); -); - - -*** Set 1e-3 as a lower bound for shares -p36_shUeCes(ttot,regi_dyn36(regi),entyFe,in,teEs) $ ( t36_scen(ttot) - AND p36_shUeCes(ttot,regi,entyFe,in,teEs) lt 1e-3) - = 0 - ; -p36_shUeCes(ttot,regi_dyn36(regi),entyFe,in,teEs) $ ( t36_scen(ttot) - AND feteces_dyn36(entyFe,teEs,in) - ) - = p36_shUeCes(ttot,regi,entyFe,in,teEs) - / sum( feteces_dyn36_2(entyFe2,teEs2,in), - p36_shUeCes(ttot,regi,entyFe2,in,teEs2)) - ; - -*** Compute FE shares -p36_shFeCes(t,regi_dyn36(regi),entyFe,in,teEs)$feteces_dyn36(entyFe,teEs,in) - = (1 / p36_fe2es(t,regi,teEs)) - / sum ( (fe2ces_dyn36(entyFe2,esty2,teEs2,in)), - (1 / p36_fe2es(t,regi,teEs2)) - * p36_shUeCes(t,regi,entyFe2,in,teEs2) - ) - * p36_shUeCes(t,regi,entyFe,in,teEs) - ; - -p36_shFeCes_iter(iteration,t,regi,entyFe,in,teEs) = - p36_shFeCes(t,regi,entyFe,in,teEs); - -*** Pass on to core parameters -loop (fe2ces_dyn36(entyFe,esty,teEs,in), -pm_shFeCes(t,regi_dyn36(regi),entyFe,in,teEs)$( NOT t0(t)) - = p36_shFeCes(t,regi,entyFe,in,teEs); -); -pm_esCapCost(t,regi_dyn36(regi),teEs_dyn36(teEs)) - = p36_esCapCost(t,regi,teEs); - - -*** Diagnostics -*** Compute the norm of the difference between the share vectors of two iterations -p36_shUeCes_iter(iteration,t,regi,entyFe,in,teEs) - = p36_shUeCes(t,regi,entyFe,in,teEs) ; -if ( ord(iteration) gt 1, -loop ((t,regi_dyn36(regi),inViaEs_dyn36(in)), -p36_logitNorm(iteration,t,regi,in) = sqrt ( - sum (fe2ces_dyn36(entyFe,esty,teEs,in) , - power ( p36_shUeCes_iter(iteration,t,regi,entyFe,in,teEs) - - p36_shUeCes_iter(iteration - 1,t,regi,entyFe,in,teEs), - 2) - ) - ) -; -) -); - -*** Reporting -put file_logit_buildings; -put "scenario", "iteration", "period", "region", "variable", "tech", "ces_out", "value" /; - -*** Report on the historical shares - - loop (t36_hist(ttot), - loop (regi_dyn36(regi), - loop (fe2ces_dyn36(entyFe,esty,teEs,in), - - put "%c_expname%", "target", ttot.tl, regi.tl, "shareFE", teEs.tl, in.tl, p36_shFeCes(ttot,regi,entyFe,in,teEs) /; - - ); - ); - ); - -loop ((t,regi_dyn36(regi),fe2ces_dyn36(entyFe,esty,teEs,in)), -put "%c_expname%", iteration.tl, t.tl,regi.tl, "shareFE", teEs.tl, in.tl, p36_shFeCes(t,regi,entyFe,in,teEs) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "shareUE", teEs.tl, in.tl, p36_shUeCes(t,regi,entyFe,in,teEs) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "cost", teEs.tl, in.tl, (p36_techCosts(t,regi,entyFe,esty,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "calibfactor", teEs.tl, in.tl, (p36_logitCalibration(t,regi,entyFe,esty,teEs)* 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "FEpriceWoTax", teEs.tl, in.tl, (p36_fePrice(t,regi,entyFe) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "OM", teEs.tl, in.tl, ((p36_fePrice(t,regi,entyFe) - + p36_inconvpen(t,regi,teEs) - + pm_tau_fe_tax(t,regi,"build",entyFe) - + pm_tau_fe_sub(t,regi,"build",entyFe) - ) - / pm_fe2es(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "OM_FEpriceWtax", teEs.tl, in.tl, ( - (p36_fePrice(t,regi,entyFe) - + pm_tau_fe_tax(t,regi,"build",entyFe) - + pm_tau_fe_sub(t,regi,"build",entyFe) - ) - / pm_fe2es(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "OM_inconvenience", teEs.tl, in.tl, (( - p36_inconvpen(t,regi,teEs) - ) - / pm_fe2es(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "FEpriceTax", teEs.tl, in.tl, ((p36_fePrice(t,regi,entyFe) - + pm_tau_fe_tax(t,regi,"build",entyFe) - + pm_tau_fe_sub(t,regi,"build",entyFe) - ) - * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "CapCosts", teEs.tl, in.tl, (p36_esCapCost(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -put "%c_expname%", iteration.tl, t.tl,regi.tl, "CapCostsImplicit", teEs.tl, in.tl, (p36_esCapCostImplicit(t,regi,teEs) * 1000 / (sm_day_2_hour * sm_year_2_day)) /; -); - -if ( ord(iteration) gt 1, -loop ((t,regi_dyn36(regi),inViaEs_dyn36(in)), -put "%c_expname%", iteration.tl, t.tl,regi.tl, "norm_diff", "NA" ,in.tl, p36_logitNorm(iteration,t,regi,in) /; -); -); - -putclose; - -*** EOF ./modules/36_buildings/services_with_capital/presolve.gms - diff --git a/modules/36_buildings/services_with_capital/realization.gms b/modules/36_buildings/services_with_capital/realization.gms deleted file mode 100644 index 83f506039..000000000 --- a/modules/36_buildings/services_with_capital/realization.gms +++ /dev/null @@ -1,35 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_with_capital/realization.gms - -*' @description -*' -*'The `services_with_capital` realization splits the representation of buildings energy demand between the CES structure -*' and a multinomial logit structure which distributes the demand across technologies. -*' Importantly, the realization distinguishes across four end-use categories (`appliances and lighting`, `water heating and cooking`, -*' `space cooling` and `space cooling` ). -*' Not only the demand for final energy is represented, but also the demand for useful energy, which is necessary to display the level of efficiency achieved. -*' In total, six energy carrier categories are included (electricity, solids, liquids, gas, district heating, hydrogen), spread across the various end-uses. -*' -*' The model can decide to invest in end-use capital (insulation, appliances, space cooling) to reduce the energy demand, -*' or it can switch to more efficient technologies to produce heat. -*' The conversion efficiencies of the individual heat technologies is prescribed exogenously however. -*' -*' @limitations This realization does not represent inertia dynamics in the renovation of buildings. -* - -*####################### R SECTION START (PHASES) ############################## -$Ifi "%phase%" == "sets" $include "./modules/36_buildings/services_with_capital/sets.gms" -$Ifi "%phase%" == "declarations" $include "./modules/36_buildings/services_with_capital/declarations.gms" -$Ifi "%phase%" == "datainput" $include "./modules/36_buildings/services_with_capital/datainput.gms" -$Ifi "%phase%" == "equations" $include "./modules/36_buildings/services_with_capital/equations.gms" -$Ifi "%phase%" == "preloop" $include "./modules/36_buildings/services_with_capital/preloop.gms" -$Ifi "%phase%" == "bounds" $include "./modules/36_buildings/services_with_capital/bounds.gms" -$Ifi "%phase%" == "presolve" $include "./modules/36_buildings/services_with_capital/presolve.gms" -$Ifi "%phase%" == "postsolve" $include "./modules/36_buildings/services_with_capital/postsolve.gms" -*######################## R SECTION END (PHASES) ############################### -*** EOF ./modules/36_buildings/services_with_capital/realization.gms diff --git a/modules/36_buildings/services_with_capital/sets.gms b/modules/36_buildings/services_with_capital/sets.gms deleted file mode 100644 index caf2a30f0..000000000 --- a/modules/36_buildings/services_with_capital/sets.gms +++ /dev/null @@ -1,259 +0,0 @@ -*** | (C) 2006-2023 Potsdam Institute for Climate Impact Research (PIK) -*** | authors, and contributors see CITATION.cff file. This file is part -*** | of REMIND and licensed under AGPL-3.0-or-later. Under Section 7 of -*** | AGPL-3.0, you are granted additional permissions described in the -*** | REMIND License Exception, version 1.0 (see LICENSE file). -*** | Contact: remind@pik-potsdam.de -*** SOF ./modules/36_buildings/services_with_capital/sets.gms -Sets - regi_dyn36(all_regi) "dynamic region set for compatibility with testOneRegi" - teEs_dyn36(all_teEs) "technologies - buildings module additions" - / - te_ueshheb "buildings space heating district heat" - te_ueshhob "buildings space heating liquids" - te_ueshsob "buildings space heating solids" - te_ueshstb "buildings space heating traditional solids (trad biomass + coal)" - te_ueshgab "buildings space heating district heat" - te_ueshh2b "buildings space heating hydrogen" - te_ueshelb "buildings space heating electricity resistance" - te_ueshhpb "buildings space heating electricity heat pump" - - te_uecwhob "buildings cooking and water heating liquids" - te_uecwsob "buildings cooking and water heating solids" - te_uecwstb "buildings cooking and water heating traditional solids" - te_uecwgab "buildings cooking and water heating gas" - te_uecwheb "buildings cooking and water heating district heat" - te_uecwh2b "buildings cooking and water heating hydrogen" - te_uecwelb "buildings cooking and water heating electricity" - te_uecwhpb "buildings cooking and water heating heat pump" - - / - - esty_dyn36(all_esty) "Energy service types" - / - ueshheb "buildings space heating district heat" - ueshhob "buildings space heating liquids" - ueshsob "buildings space heating solids" - ueshstb "buildings space heating traditional solids" - ueshgab "buildings space heating district heat" - ueshh2b "buildings space heating hydrogen" - ueshelb "buildings space heating electricity resistance" - ueshhpb "buildings space heating electricity heat pump" - - uecwhob "buildings cooking and water heating liquids" - uecwsob "buildings cooking and water heating solids" - uecwstb "buildings cooking and water heating traditional solids" - uecwgab "buildings cooking and water heating gas" - uecwheb "buildings cooking and water heating district heat" - uecwh2b "buildings cooking and water heating hydrogen" - uecwelb "buildings cooking and water heating electricity" - uecwhpb "buildings cooking and water heating heat pump" - / - - in_buildings_dyn36(all_in) "all inputs and outputs of the CES function - buildings" - / - enb "buildings energy use" - - esswb "buildings weatherization energy service" - - uealb "buildings appliances and light" - uecwb "buildings cooking and water heating" - ueswb "buildings weatherization" - uescb "buildings cooling" - ueshb "buildings heating" - - fescelb "buildings space cooling electricity" - - fealelb "buildings appliances and light electricity" - - kaphc "buildings capital stock insulation" - kapsc "buildings capital stock space cooling" - kapal "buildings capital stock appliances and light" - - / - - - - es2ppfen_dyn36(all_esty,all_in) "matching FE to ppfEn in MACRO" -/ - ueshheb.ueshb - ueshhob.ueshb - ueshsob.ueshb - ueshstb.ueshb - ueshgab.ueshb - ueshh2b.ueshb - ueshelb.ueshb - ueshhpb.ueshb - - uecwhob.uecwb - uecwsob.uecwb - uecwstb.uecwb - uecwgab.uecwb - uecwheb.uecwb - uecwh2b.uecwb - uecwelb.uecwb - uecwhpb.uecwb -/ - -fe2es_dyn36(all_enty,all_esty,all_teEs) "map FE carriers to ES via appliances" -/ - fehes.ueshheb.te_ueshheb - fehos.ueshhob.te_ueshhob - fesos.ueshsob.te_ueshsob - fesos.ueshstb.te_ueshstb - fegas.ueshgab.te_ueshgab - feh2s.ueshh2b.te_ueshh2b - feels.ueshelb.te_ueshelb - feels.ueshhpb.te_ueshhpb - - fehos.uecwhob.te_uecwhob - fesos.uecwsob.te_uecwsob - fesos.uecwstb.te_uecwstb - fegas.uecwgab.te_uecwgab - fehes.uecwheb.te_uecwheb - feh2s.uecwh2b.te_uecwh2b - feels.uecwelb.te_uecwelb - feels.uecwhpb.te_uecwhpb -/ - -buildMoBio36 (all_esty) "modern biomass in buildings" -/ -ueshsob -uecwsob -/ - - fe2ces_dyn36(all_enty,all_esty,all_teEs,all_in) "map FE carriers to CES via appliances" -// -feteces_dyn36(all_enty,all_teEs,all_in) "map FE carriers to CES without esty" -// - - -inViaEs_dyn36(all_in) "CES inputs which are provided throught the ES pathway" - - in_putty_dyn36(all_in) "putty in for buildings" - / - / - ppf_putty_dyn36(all_in) "putty ppf for buildings" - // - - in_complements_dyn36(all_in) "in complements" - / - uescb - ueshb - / - - nests_putty_dyn36(all_in,all_in) "putty nests" - // - - ppfKap_dyn36(all_in) "Capital primary production factors" - / - kaphc - kapsc - kapal - - / - - ppfen_buildings_dyn36(all_in) "primary production factors energy - buildings" - / - ueshb - uecwb - fescelb - fealelb - / - - cal_ppf_buildings_dyn36(all_in) "primary production factors - buildings - used for the calibration" - / uescb, ueshb, uealb, uecwb, kaphc/ - - ue_dyn36(all_in) "useful energy items" - /uescb, ueshb, uealb, uecwb/ - - ces_buildings_dyn36(all_in,all_in) "CES tree structure - buildings" - / - en . enb - enb . (esswb, uealb, uecwb) - esswb . (ueswb,kaphc) - ueswb . (uescb,ueshb) - uescb . (fescelb,kapsc) - - uealb . (fealelb,kapal) - - / - - fe2ppfEn36(all_enty,all_in) "match ESM entyFe to ppfEn" - / - feels . (fescelb,fealelb) - / - - fe_tax_sub36(all_in,all_in) "correspondence between tax and subsidy input data resolution and model sectoral resolution" - / - feelb . (fealelb,fescelb) - / - - mapElHp(all_teEs,all_teEs) "correspondence between electric resistance technology and heat pump technology" - / - te_uecwelb. te_uecwhpb - te_ueshelb. te_ueshhpb - / - - richTechs(all_teEs) "technologies whose calibration decreases with income " - / - te_ueshgab - te_uecwgab - / - - t36_hist(ttot) "historic time steps" - t36_hist_last(ttot) "last historic time step" - t36_scen(ttot) "non historical scenario time step" - - teEs_pushCalib_dyn36(all_teEs) "technologies for which the Logit parameter should be modified" - - opTimeYr2teEs(all_teEs,opTimeYr) "mapping for technologies to yearly lifetime - is filled automatically from the lifetime values of technologies" -; - -loop ( fe2es_dyn36(all_enty,all_esty,all_teEs), - loop ( es2ppfen_dyn36(all_esty,all_in), - fe2ces_dyn36(all_enty,all_esty,all_teEs,all_in) = YES; - inViaEs_dyn36(all_in) = YES; - feteces_dyn36(all_enty,all_teEs,all_in) = YES; - ) - ); - - - alias (fe2ces_dyn36,fe2ces_dyn36_2); - alias (fe2es_dyn36, fe2es_dyn36_2); - alias (feteces_dyn36, feteces_dyn36_2); - - -t36_hist(ttot) = NO; -t36_hist(ttot)$(sameAs(ttot,"2005") OR sameAs(ttot,"2010") OR sameAs(ttot,"2015")) = YES; - -t36_scen(ttot) = NO; -t36_scen(ttot)$t(ttot) = YES; -t36_scen(ttot)$t36_hist(ttot) = NO; - -$offOrder - t36_hist_last(ttot) = NO; - t36_hist_last(t36_hist)$(ord(t36_hist) eq card(t36_hist)) = YES; -$offOrder - -teEs_pushCalib_dyn36(all_teEs) = NO; -***------------------------------------------------------------------------- -*** add module specific sets and mappings to the global sets and mappings -***------------------------------------------------------------------------- -ppfKap(ppfKap_dyn36) = YES; -in(in_buildings_dyn36) = YES; -ppfEn(ppfen_buildings_dyn36) = YES; -cesOut2cesIn(ces_buildings_dyn36) = YES; -fe2ppfEn(fe2ppfEn36) = YES; -in_putty(in_putty_dyn36) = YES; -ppf_putty(ppf_putty_dyn36) = YES; -in_complements(in_complements_dyn36) = YES; -fe_tax_sub_sbi(fe_tax_sub36) = YES; - -buildMoBio(buildMoBio36) = YES; - -teEs(teEs_dyn36) = YES; -esty(esty_dyn36) = YES; -fe2es(fe2es_dyn36) = YES; -es2ppfen(es2ppfen_dyn36) = YES; -*** EOF ./modules/36_buildings/services_with_capital/sets.gms diff --git a/modules/36_buildings/simple/not_used.txt b/modules/36_buildings/simple/not_used.txt index 7b30165da..ad14a32d8 100644 --- a/modules/36_buildings/simple/not_used.txt +++ b/modules/36_buildings/simple/not_used.txt @@ -5,33 +5,3 @@ # | REMIND License Exception, version 1.0 (see LICENSE file). # | Contact: remind@pik-potsdam.de name,type,reason -vm_cesIOdelta,input,questionnaire -vm_enerSerAdj,input,questionnaire -pm_capital_lifetime_exp,input,questionnaire -pm_dt,input,questionnaire -pm_ts,input,questionnaire -pm_cumDeprecFactor_old,input,questionnaire -pm_cumDeprecFactor_new,input,questionnaire -pm_delta_kap,input,questionnaire -sm_EJ_2_TWa,input,questionnaire -sm_DpKW_2_TDpTW,input,questionnaire -sm_DpGJ_2_TDpTWa,input,questionnaire -sm_D2015_2_D2005,input,questionnaire -sm_tmp,input,questionnaire -vm_effGr,input,questionnaire -pm_esCapCost,input,questionnaire -pm_fe2es,input,questionnaire -pm_shFeCes,input,questionnaire -cm_DiscRateScen,input,questionnaire -cm_noReboundEffect,input,questionnaire -sm_year_2_day,input,questionnaire -sm_day_2_hour,input,questionnaire -pm_tsu2opTimeYr,input,questionnaire -vm_demFeForEs,input,questionnaire -cm_priceSensiBuild,input,questionnaire -cm_logitCal_markup_conv_b,input,questionnaire -cm_logitCal_markup_newtech_conv_b,input,questionnaire -cm_build_AdjCostActive,input,questionnaire -qm_balFe,input,questionnaire -pm_tau_fe_tax,input,questionnaire -pm_tau_fe_sub,input,questionnaire diff --git a/scripts/output/single/plotIterations.R b/scripts/output/single/plotIterations.R index a87ee5378..ce541d5b1 100644 --- a/scripts/output/single/plotIterations.R +++ b/scripts/output/single/plotIterations.R @@ -11,14 +11,8 @@ plotMapping <- list() generateHtml <- "y" combineDims <- list() -if (!exists("source_include")) { - outputdir <- file.path("output", "B-putty_SSP2-NDC_restartWithAllIterationResults") - lucode2::readArgs("outputdir", "symbolNames", "generateHtml") -} - outputdir <- normalizePath(outputdir) - getLineCoerce <- function() { # gets characters (line) from the user and always returns a string s <- gms::getLine() diff --git a/scripts/output/single/reportCEScalib.R b/scripts/output/single/reportCEScalib.R index 236cba534..2dc6c8cf5 100644 --- a/scripts/output/single/reportCEScalib.R +++ b/scripts/output/single/reportCEScalib.R @@ -269,71 +269,9 @@ for (s in levels(CES.cal.report$scenario)) { ggtitle(paste("total efficiency (1 = iteration 1)", r, s)) -> p plot(p) - - # plot Putty quantities - if ( dim(CES.cal.report %>% filter(variable == "quantity_putty"))[1] > 0){ - CES.cal.report %>% - filter(scenario == s, - t <= 2100, - regi == r, - variable == "quantity_putty") %>% - order.levels(pf = getElement(.pf,"structure" )) %>% - ggplot(aes(x = t, y = value, colour = iteration, - linetype = iteration)) + - geom_line() + - facet_wrap(~ pf, scales = "free", as.table = FALSE) + - expand_limits(y = 0) + - scale_colour_manual(values = col) + - scale_linetype_manual(values = lns) + - ggtitle(paste("Putty quantities", r, s)) -> p - - plot(p) - - # plot prices putty - CES.cal.report %>% - filter(scenario == s, - t <= 2100, - regi == r, - variable == "price_putty") %>% - order.levels(pf = getElement(.pf,"structure" )) %>% - ggplot(aes(x = t, y = value, colour = iteration, - linetype = iteration)) + - geom_line() + - facet_wrap(~ pf, scales = "free", as.table = FALSE) + - expand_limits(y = 0) + - scale_colour_manual(values = col) + - scale_linetype_manual(values = lns) + - ggtitle(paste("prices", r, s)) -> p - plot(p) - - # plot efficiencies - CES.cal.report %>% - filter(scenario == s, - t <= 2100, - regi == r, - variable == "total efficiency putty", - iteration != "origin") %>% - group_by(scenario,t,regi,pf,variable) %>% - mutate(value = value / value[as.character(iteration) == "1"]) %>% - ungroup() %>% - order.levels(pf = getElement(.pf,"structure" )) %>% - ggplot(aes(x = t, y = value, colour = iteration, - linetype = iteration)) + - geom_line() + - facet_wrap(~ pf, scales = "free", as.table = FALSE) + - expand_limits(y = 0) + - scale_colour_manual(values = col) + - scale_linetype_manual(values = lns) + - ggtitle(paste("total efficiency (1 = iteration 1)", r, s)) -> p - plot(p) - } - - - - # plot delta_cap if ('vm_deltaCap' %in% unique(CES.cal.report$variable)) { CES.cal.report %>% diff --git a/scripts/start/run.R b/scripts/start/run.R index 4ea61f915..c493a3d96 100644 --- a/scripts/start/run.R +++ b/scripts/start/run.R @@ -78,21 +78,7 @@ run <- function() { sub("'([^']*)'.'([^']*)'.'([^']*)'.'([^']*)' (.*)[ ,][ /];?", "pm_cesdata(\"\\1\",\"\\2\",\"\\3\",\"\\4\") = \\5;", x = .) %>% write(file_name) - - - pm_cesdata_putty = system("gdxdump fulldata.gdx symb=pm_cesdata_putty", intern = TRUE) - if (length(pm_cesdata_putty) == 2){ - tmp_putty = gsub("^Parameter *([A-z_(,)])+cesParameters\\).*$",'\\1"quantity") = 0;', pm_cesdata_putty[2]) - } else { - tmp_putty = pm_cesdata_putty[-(1:2)] %>% - grep("quantity", x = ., value = TRUE) %>% - grep(expr_ces_in,x = ., value = T) - } - tmp_putty %>% - sub("'([^']*)'.'([^']*)'.'([^']*)'.'([^']*)' (.*)[ ,][ /];?", - "pm_cesdata_putty(\"\\1\",\"\\2\",\"\\3\",\"\\4\") = \\5;", x = .)%>% write(file_name,append =T) - } - + } getLoadFile() # Store all the interesting output diff --git a/scripts/utils/gdx_rename.sh b/scripts/utils/gdx_rename.sh index a3ae162c1..d08bf586d 100644 --- a/scripts/utils/gdx_rename.sh +++ b/scripts/utils/gdx_rename.sh @@ -91,7 +91,7 @@ if (length(args) == 1) { q_co2eq = 'q_co2eq', pm_costsPEtradeMp = 'pm_costsPEtradeMp', vm_welfare = 'v_welfare', - pm_tau_fe_sub = 'p21_tau_fe_sub', + p21_tau_fe_sub = 'p21_tau_fe_sub', pm_datapop = 'pm_pop', p_datalab = 'pm_lab', p80_pvp = 'pm_pvp', diff --git a/standalone/MOFEX/MOFEX.gms b/standalone/MOFEX/MOFEX.gms index 9f29424fa..c5af248ab 100644 --- a/standalone/MOFEX/MOFEX.gms +++ b/standalone/MOFEX/MOFEX.gms @@ -187,8 +187,6 @@ cm_frac_CCS "tax on carbon transport & storage (ccsinje) to reflect ris cm_frac_NetNegEmi "tax on net negative emissions to reflect risk of overshooting, formulated as fraction of carbon price" cm_DiscRateScen "Scenario for the implicit discount rate applied to the energy efficiency capital" -cm_noReboundEffect "Switch for allowing a rebound effect when closing the efficiency gap (cm_DiscRateScen)" -cm_priceSensiBuild "Price sensitivity of energy carrier choice in buildings" c_peakBudgYr "date of net-zero CO2 emissions for peak budget runs without overshoot" c_taxCO2inc_after_peakBudgYr "annual increase of CO2 price after the Peak Budget Year in $ per tCO2" cm_CO2priceRegConvEndYr "Year at which regional CO2 prices converge in module 45 realization diffCurvPhaseIn2Lin" @@ -207,15 +205,12 @@ cm_VRE_supply_assumptions "default (0), optimistic (1), sombre (2), or bl cm_build_H2costAddH2Inv "additional h2 distribution costs for low diffusion levels (default value: 6.5$/ 100 /Kwh)" cm_build_H2costDecayStart "simplified logistic function end of full value (ex. 5% -> between 0 and 5% the function will have the value 1). [%]" cm_build_H2costDecayEnd "simplified logistic function start of null value (ex. 10% -> after 10% the function will have the value 0). [%]" -cm_build_AdjCostActive "Activate adjustment cost to penalise inter-temporal variation of area-specific weatherisation demand and space cooling efficiency slope (only in putty)" cm_indst_H2costAddH2Inv "additional h2 distribution costs for low diffusion levels. [3.25$/ 0.1 /kWh]" cm_indst_costDecayStart "simplified logistic function end of full value (ex. 5% -> between 0 and 5% the simplified logistic function will have the value 1). [%]" cm_indst_H2costDecayEnd "simplified logistic function start of null value (ex. 10% -> between 10% and 100% the simplified logistic function will have the value 0). [%]" cm_BioSupply_Adjust_EU "factor for scaling sub-EU bioenergy supply curves" cm_BioImportTax_EU "factor for EU bioenergy import tax" cm_import_EU "EU switch for different scenarios of EU SE import assumptions" -cm_logitCal_markup_conv_b "value to which logit calibration markup of standard fe2ue technologies in detailed buildings module converges to" -cm_logitCal_markup_newtech_conv_b "value to which logit calibration markup of new fe2ue technologies in detailed buildings module converges to" cm_noPeFosCCDeu "switch to suppress Pe2Se Fossil Carbon Capture in Germany" cm_HeatLim_b "switch to set maximum share of district heating in FE buildings" cm_ElLim_b "switch to set maximum share of electricity in FE buildings" @@ -343,8 +338,6 @@ cm_carbonprice_temperatureLimit = 1.8; !! def = 1.8 cm_DiscRateScen = 0;!! def = 0 -cm_noReboundEffect = 0; -cm_priceSensiBuild = -3; $setGlobal c_scaleEmiHistorical on !! def = on $setGlobal cm_pushCalib none !! def = none $setGlobal cm_reducCostB none !! def = none @@ -368,11 +361,6 @@ cm_H2targets = 0; !! def 0 *** EU import switches $setGlobal cm_import_EU off !! def off -*** buildings services_putty switches -cm_logitCal_markup_conv_b = 0.8; !! def 0.8 -cm_logitCal_markup_newtech_conv_b = 0.3; !! def 0.3 -cm_build_AdjCostActive = 0; !! def 0 = Adjustment cost deactivated (set to 1 to activate) - *** flex tax switches cm_flex_tax = 0; !! def 0 cm_PriceDurSlope_elh2 = 20; !! def 10 diff --git a/standalone/template.gms b/standalone/template.gms index 607286e94..e05ad4fe9 100644 --- a/standalone/template.gms +++ b/standalone/template.gms @@ -181,7 +181,6 @@ cm_frac_CCS "tax on carbon transport & storage (ccsinje) to reflect ris cm_frac_NetNegEmi "tax on net negative emissions to reflect risk of overshooting, formulated as fraction of carbon price" cm_DiscRateScen "Scenario for the implicit discount rate applied to the energy efficiency capital" -cm_noReboundEffect "Switch for allowing a rebound effect when closing the efficiency gap (cm_DiscRateScen)" ; *** -------------------------------------------------------------------------------------------------------------------------------------------------------------------- @@ -275,7 +274,6 @@ cm_carbonprice_temperatureLimit = 1.8; !! def = 1.8 cm_DiscRateScen = 0;!! def = 0 -cm_noReboundEffect = 0; *** -------------------------------------------------------------------------------------------------------------------------------------------------------------------- *** YOU ARE IN THE WARNING ZONE (DON'T DO CHANGES HERE) *** -------------------------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/standalone/trade/trade.gms b/standalone/trade/trade.gms index 16b6618d1..ea74b52a7 100644 --- a/standalone/trade/trade.gms +++ b/standalone/trade/trade.gms @@ -191,8 +191,6 @@ cm_frac_CCS "tax on carbon transport & storage (ccsinje) to reflect ris cm_frac_NetNegEmi "tax on net negative emissions to reflect risk of overshooting, formulated as fraction of carbon price" cm_DiscRateScen "Scenario for the implicit discount rate applied to the energy efficiency capital" -cm_noReboundEffect "Switch for allowing a rebound effect when closing the efficiency gap (cm_DiscRateScen)" -cm_priceSensiBuild "Price sensitivity of energy carrier choice in buildings" c_peakBudgYr "date of net-zero CO2 emissions for peak budget runs without overshoot" c_taxCO2inc_after_peakBudgYr "annual increase of CO2 price after the Peak Budget Year in $ per tCO2" cm_CO2priceRegConvEndYr "Year at which regional CO2 prices converge in module 45 realization diffCurvPhaseIn2Lin" @@ -217,8 +215,6 @@ cm_indst_H2costDecayEnd "simplified logistic function start of null value (e cm_BioSupply_Adjust_EU "factor for scaling sub-EU bioenergy supply curves" cm_BioImportTax_EU "factor for EU bioenergy import tax" cm_import_EU "EU switch for different scenarios of EU SE import assumptions" -cm_logitCal_markup_conv_b "value to which logit calibration markup of standard fe2ue technologies in detailed buildings module converges to" -cm_logitCal_markup_newtech_conv_b "value to which logit calibration markup of new fe2ue technologies in detailed buildings module converges to" cm_demTcomplex "switch used to select the source of demand trends for the complex transport realization. By default, temporary handmade trajectories; if set to fromEDGET, EDGE-T based mrremind results." cm_noPeFosCCDeu "switch to suppress Pe2Se Fossil Carbon Capture in Germany" cm_HeatLim_b "switch to set maximum share of district heating in FE buildings" @@ -349,8 +345,6 @@ cm_carbonprice_temperatureLimit = 1.8; !! def = 1.8 cm_DiscRateScen = 0;!! def = 0 -cm_noReboundEffect = 0; -cm_priceSensiBuild = -3; $setGlobal c_scaleEmiHistorical on !! def = on $setGlobal cm_pushCalib none !! def = none $setGlobal cm_reducCostB none !! def = none @@ -374,9 +368,6 @@ cm_H2targets = 0; !! def 0 *** EU import switches $setGlobal cm_import_EU off !! def off -*** buildings services_putty switches -cm_logitCal_markup_conv_b = 0.8; !! def 0.8 -cm_logitCal_markup_newtech_conv_b = 0.3; !! def 0.3 *** flex tax switches cm_flex_tax = 0; !! def 0