Skip to content

Commit 982525d

Browse files
committed
Add calibration for PB,GU
1 parent bff82ff commit 982525d

File tree

9 files changed

+24
-20
lines changed

9 files changed

+24
-20
lines changed

core/declarations.gms

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ VmElecConsHeatPla(allCy,DSBS,YTIME) "Electricity consumed
7474
Positive Variables
7575
VmCarVal(allCy,NAP,YTIME) "Carbon prices for all countries (US$2015/tn CO2)"
7676
VmRenValue(YTIME) "Renewable value (US$2015/KWh)"
77-
common(allCy,YTIME)
77+
common(allCy,TRANSE,YTIME)
7878
;
7979

8080
Scalars

core/equations.gms

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ qDummyObj(allCy,YTIME)$(TIME(YTIME) and runCy(allCy))..
2020
t04SharePowPlaNewEq(allCy,PGALL,YTIME)
2121
)
2222
) +
23-
SUM(TTECH$SECTTECH("PC",TTECH),
23+
SUM((TRANSE,TTECH)$(SECTTECH("PC",TTECH) and (sameas("PC",TRANSE) or sameas("PB",TRANSE) or sameas("GU",TRANSE))),
2424
SQR(
2525
(
26-
V01ShareTechTr(allCy,"PC",TTECH,YTIME) -
27-
t01NewShareStockPC(allCy,TTECH,YTIME)
28-
)$(t01NewShareStockPC(allCy,TTECH,YTIME) >= 0) +
29-
0.01 * (imMatrFactor(allCy,"PC",TTECH,YTIME) - imMatrFactor(allCy,"PC",TTECH,YTIME-1))
26+
V01ShareTechTr(allCy,TRANSE,TTECH,YTIME) -
27+
t01NewShareStockPC(allCy,TRANSE,TTECH,YTIME)
28+
)$(t01NewShareStockPC(allCy,TRANSE,TTECH,YTIME) >= 0) +
29+
0.01 * (imMatrFactor(allCy,TRANSE,TTECH,YTIME) - imMatrFactor(allCy,TRANSE,TTECH,YTIME-1))
3030
)
3131
);
3232

33-
qRestrain(allCy,TTECH,YTIME)$(TIME(YTIME) and runCy(allCy) and (t01NewShareStockPC(allCy,TTECH,YTIME) < 0))..
34-
imMatrFactor(allCy,"PC",TTECH,YTIME)
33+
qRestrain(allCy,TRANSE,TTECH,YTIME)$(TIME(YTIME) and runCy(allCy) and (t01NewShareStockPC(allCy,TRANSE,TTECH,YTIME) < 0))..
34+
imMatrFactor(allCy,TRANSE,TTECH,YTIME)
3535
=e=
36-
common(allCy,YTIME);
36+
common(allCy,TRANSE,YTIME);
3737
$ELSE.calib qDummyObj.. vDummyObj =e= 1;
3838
$ENDIF.calib

core/input.gms

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -616,6 +616,7 @@ $IFTHEN.calib %Calibration% == off
616616
parameter imMatrFactor(allCy,DSBS,TECH,YTIME) "Maturity factor per technology and subsector for all countries (1)";
617617
imMatrFactor(runCy,DSBS,TECH,YTIME) = iMatrFactorData(runCy,DSBS,TECH,YTIME);
618618

619+
imMatrFactor(runCy,DSBS,"TBMSWAS",YTIME) = 0.01;
619620
$ontext
620621
imMatrFactor(runCy,DSBS,"TGDO",YTIME)$((ord(YTIME) > 11) and TRANSE(DSBS)) = 0.5;
621622
imMatrFactor(runCy,DSBS,"TGSL",YTIME)$((ord(YTIME) > 11) and TRANSE(DSBS)) = 0.5;
@@ -628,7 +629,7 @@ imMatrFactor(runCy,DSBS,"TELC",YTIME)$(ord(YTIME) > 50 and TRANSE(DSBS)) = 15;
628629
imMatrFactor(runCy,DSBS,"TELC",YTIME)$(ord(YTIME) > 50 and TRANSE(DSBS)) = 15;
629630
imMatrFactor(runCy,DSBS,"TELC",YTIME)$(ord(YTIME) > 40 and TRANSE(DSBS)) = 11;
630631
imMatrFactor(runCy,DSBS,"TELC",YTIME)$(ord(YTIME) > 40 and TRANSE(DSBS)) = 11;
631-
$offtext
632+
632633
imMatrFactor(runCy,DSBS,"TNGSCCS",YTIME)$((ord(YTIME) > 11) and INDSE(DSBS)) = 1;
633634
imMatrFactor(runCy,DSBS,"THCLCCS",YTIME)$((ord(YTIME) > 11) and INDSE(DSBS)) = 1;
634635
imMatrFactor(runCy,DSBS,"TELC",YTIME)$(ord(YTIME) > 11 and DOMSE(DSBS)) = 20;
@@ -646,13 +647,14 @@ imMatrFactor(runCy,DSBS,"TPHEVGSL",YTIME)$(ord(YTIME) > 40 and TRANSE(DSBS)) = 0
646647
imMatrFactor(runCy,DSBS,"TPHEVGDO",YTIME)$(ord(YTIME) > 40 and TRANSE(DSBS)) = 0.001;
647648
imMatrFactor(runCy,DSBS,"TCHEVGSL",YTIME)$(ord(YTIME) > 40 and TRANSE(DSBS)) = 0.001;
648649
imMatrFactor(runCy,DSBS,"TCHEVGDO",YTIME)$(ord(YTIME) > 40 and TRANSE(DSBS)) = 0.001;
650+
$offtext
649651

650652
$ELSE.calib
651653
variable imMatrFactor(allCy,DSBS,TECH,YTIME) "Maturity factor per technology and subsector for all countries (1)";
652654
imMatrFactor.LO(runCy,DSBS,TECH,YTIME) = 0;
653-
imMatrFactor.UP(runCy,DSBS,TECH,YTIME) = 10;
654-
imMatrFactor.L(runCy,DSBS,TECH,YTIME) = iMatrFactorData(runCy,DSBS,TECH,YTIME);
655-
imMatrFactor.FX(runCy,DSBS,TECH,YTIME)$(not sameas(DSBS,"PC") or not SECTTECH(DSBS,TECH)) = iMatrFactorData(runCy,DSBS,TECH,YTIME);
655+
imMatrFactor.UP(runCy,DSBS,TECH,YTIME) = 20;
656+
imMatrFactor.L(runCy,DSBS,TECH,YTIME) = 1;!!iMatrFactorData(runCy,DSBS,TECH,YTIME);
657+
imMatrFactor.FX(runCy,DSBS,TECH,YTIME)$(not (sameas(DSBS,"PC") or sameas(DSBS,"PB") or sameas(DSBS,"GU")) or not SECTTECH(DSBS,TECH)) = iMatrFactorData(runCy,DSBS,TECH,YTIME);
656658
$ENDIF.calib
657659
*---
658660
parameters

core/postsolve.gms

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,4 @@ $if %WriteGDX% == on execute_unload "blabla.gdx";
1515
$ifthen.calib %Calibration% == MatCalibration
1616
execute 'gdxdump outputCalib.gdx output=iMatFacPlaAvailCap.csv symb=i04MatFacPlaAvailCap cDim=y format=csv';
1717
execute 'gdxdump outputCalib.gdx output=iMatrFactorData.csv symb=imMatrFactor cDim=y format=csv';
18-
execute 'gdxdump outputCalib.gdx output=iPremScrpFac.csv symb=i01PremScrpFac cDim=y format=csv';
1918
$endif.calib

modules/01_Transport/simple/input.gms

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ i01ShareBlend("LAM",ROAD,"BGSL",YTIME) = i01ShareBlend("LAM",ROAD,"BGSL","%fBase
233233
i01ShareBlend("LAM",ROAD,"GSL",YTIME) = i01ShareBlend("LAM",ROAD,"GSL","%fBaseY%") - 0.001 * (ord(YTIME)-11);
234234
*---
235235
$IFTHEN.calib %Calibration% == MatCalibration
236-
table t01NewShareStockPC(allCy,TTECH,YTIME) "Targets for share of new passenger cars"
236+
table t01NewShareStockPC(allCy,TRANSE,TTECH,YTIME) "Targets for share of new passenger cars"
237237
$ondelim
238238
$include "../targets/tNewShareStockPC.csv"
239239
$offdelim

modules/01_Transport/simple/preloop.gms

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ V01RateScrPcTot.FX(runCy,TTECH,YTIME)$DATAY(YTIME) = V01RateScrPc.L(runCy,TTECH,
3030
*---
3131
V01StockPcYearlyTech.L(runCy,TTECH,YTIME) = i01StockPC(runCy,TTECH,"%fBaseY%");
3232
V01StockPcYearlyTech.FX(runCy,TTECH,YTIME)$DATAY(YTIME) = i01StockPC(runCy,TTECH,YTIME);
33+
V01StockPcYearlyTech.FX(runCy,TTECH,YTIME)$(not SECTTECH("PC",TTECH)) = 0;
3334
*---
3435
V01NumPcScrap.FX(runCy,YTIME)$sameas(YTIME,"%fBaseY%") = SUM(TTECH,V01RateScrPcTot.L(runCy,TTECH,YTIME) * V01StockPcYearlyTech.L(runCy,TTECH,YTIME));
3536
*---
@@ -39,7 +40,7 @@ V01ActivGoodsTransp.FX(runCy,TRANSE,YTIME)$(not TRANG(TRANSE)) = 0;
3940
*---
4041
V01PcOwnPcLevl.FX(runCy,YTIME)$(not An(YTIME)) = V01StockPcYearly.L(runCy,YTIME) / (i01Pop(YTIME,runCy) * 1000) ;
4142
*---
42-
i01Sigma(runCy,"S2") = 0.5;
43+
i01Sigma(runCy,"S2") = 0.4;
4344
i01Sigma(runCy,"S1") = -log(V01PcOwnPcLevl.L(runCy,"%fBaseY%") / i01PassCarsMarkSat(runCy)) * EXP(i01Sigma(runCy,"S2") * i01GDPperCapita("%fBaseY%",runCy) / 10000);
4445
*---
4546
V01GapTranspActiv.LO(runCy,TRANSE,YTIME) = 0;

modules/11_Economy/economy/equations.gms

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Q11SubsiDemTech(allCy,DSBS,TECH,YTIME)$(TIME(YTIME)$(runCy(allCy))$SECTTECH(DSBS
8080
VmSubsiDemTechAvail(allCy,DSBS,TECH,YTIME) * 1e3 / (V01NewRegPcTechYearly(allCy,TTECH,YTIME-1) * 1e6)
8181
- (1 - imCapCostTechMin(allCy,DSBS,TECH,YTIME)) * imCapCostTech(allCy,DSBS,TECH,YTIME)))
8282
) / 2
83-
)$((ord(YTIME) > 12 and TRANSE(DSBS) and sameas(DSBS,"PC")))
83+
)$(ord(YTIME) > 12 and TRANSE(DSBS) and sameas(DSBS,"PC") and sameas(TECH,"TELC"))
8484
+
8585
sum(ITECH$(sameas(TECH,ITECH)), !! Industry
8686
VmSubsiDemITech(allCy,DSBS,ITECH,YTIME)

modules/11_Economy/economy/preloop.gms

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ VmSubsiDemITech.FX(runCy,DSBS,ITECH,YTIME)$(DATAY(YTIME) or TFIRST(YTIME) or not
1212
*---
1313
VmSubsiCapCostTech.FX(runCy,DSBS,TECH,YTIME)$(not SECTTECH(DSBS,TECH)) = 0;
1414
*---
15-
VmNetSubsiTax.FX(runCy,YTIME)$(DATAY(YTIME)) = 0;
15+
VmNetSubsiTax.FX(runCy,YTIME)$(DATAY(YTIME)) = 0;
16+
*---
17+
VmSubsiDemTech.LO(runCy,DSBS,TECH,YTIME) = 0;

start.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ if (task == 0) {
286286
}
287287

288288
# Verify calibration output files exist
289-
CalibratedParams <- c("iMatFacPlaAvailCap.csv", "iMatrFactorData.csv", "iPremScrpFac.csv")
289+
CalibratedParams <- c("iMatFacPlaAvailCap.csv", "iMatrFactorData.csv")
290290
missing_files <- CalibratedParams[!file.exists(CalibratedParams)]
291291
if (length(missing_files) > 0) {
292292
cat("ERROR: Calibrated parameter files missing:", paste(missing_files, collapse = ", "), "\n")
@@ -349,7 +349,7 @@ if (task == 0) {
349349

350350
if (withRunFolder && withSync) syncRun()
351351

352-
CalibratedParams <- c("iMatFacPlaAvailCap.csv", "iMatrFactorData.csv", "iPremScrpFac.csv")
352+
CalibratedParams <- c("iMatFacPlaAvailCap.csv", "iMatrFactorData.csv")
353353
CalibratedParamsPath <- file.path(getwd(), CalibratedParams)
354354
newPath <- file.path(dirname(dirname(getwd())), "data", CalibratedParams)
355355
file.rename(CalibratedParamsPath, newPath)

0 commit comments

Comments
 (0)