Skip to content

Commit

Permalink
Update to v4.8.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Antti-L authored Sep 7, 2024
1 parent ca3c134 commit 3973eeb
Show file tree
Hide file tree
Showing 9 changed files with 51 additions and 27 deletions.
18 changes: 17 additions & 1 deletion Version.log
Original file line number Diff line number Diff line change
Expand Up @@ -2964,4 +2964,20 @@ bnd_ucw.mod : (2)
pp_qack.mod : (1)
coef_ext.vda : (2)
solsetv.v3 : (1)
prepret.dsc : (3)
prepret.dsc : (3)

-----------------------------------------------------------------------------------------
TIMES Version 4.8.3
-----------------------------------------------------------------------------------------
Date: 7-Sep-2024 [AL]: Maintenance release
1) Fixed bug in the ABS extension introduced in v469 related to EQ_BS24
2) Fixed bug in the ABS extension related to past capacities in EQ_BS09
3) Fixed issue with spaces in model folder names

initsys.mod : Increased version number to 4.8.3
initmty.mod : (3)
main_ext.mod : (3)
init_ext.abs : (2)
prep_ext.abs : (2)
coef_ext.abs : (2)
equ_ext.abs : (1),(2)
Binary file modified _times.g00
Binary file not shown.
6 changes: 4 additions & 2 deletions coef_ext.abs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright (C) 2000-2023 Energy Technology Systems Analysis Programme (ETSAP)
* Copyright (C) 2000-2024 Energy Technology Systems Analysis Programme (ETSAP)
* This file is part of the IEA-ETSAP TIMES model generator, licensed
* under the GNU General Public License v3.0 (see file NOTICE-GPLv3.txt).
*=============================================================================*
Expand Down Expand Up @@ -109,4 +109,6 @@ $ BATINCLUDE pp_qaput.mod PUTOUT PUTGRP 01 'BS_RMAX decreasing at slower reser
LOOP((BS_COMTS(R,C,S),BS_ABD(R,C,L)),BS_SBD(R,S,L)=YES);
OPTION CLEAR=PRC_YMAX,CLEAR=VDA_FLOP,CLEAR=NCAP_AFAC,CLEAR=RCS;
* Build UC map
BS_UCMAP(UC_MAP_FLO(UC_N,SIDE,R,P,C))$(BS_BSC(R,P,C)+BS_STGP(R,P)$BS_STIME(R,P,C,'UP'))$=BS_RTYPE(R,C);
BS_UCMAP(UC_MAP_FLO(UC_N,SIDE,R,P,C))$(BS_BSC(R,P,C)+BS_STGP(R,P)$BS_STIME(R,P,C,'UP'))$=BS_RTYPE(R,C);
* Ensure existence of AF
COEF_AF(RTP_VINTYR(R,T,T,P),S,'UP')$(NOT RTP_CPTYR(R,T,T,P)) $= NCAP_AF(R,T,P,S,'UP')$BS_PRS(R,P,S);
38 changes: 21 additions & 17 deletions equ_ext.abs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
*-----------------------------------------------------------------------------
* ABS Final pre-processing
*-----------------------------------------------------------------------------
$IFI NOT %OBMAC%==YES $EXIT
* Adjust equation controls
BS_UPL(RP_UPL(BS_SUPP,BDNEQ))=YES;
BS_UPC(PRC_TSL(BS_SUPP(R,P),TSL),BDNEQ)$SUM(BS_BSC(R,P,C)$(ABS(BS_RTYPE(R,C))>2),1)$=RP_UPS(R,P,TSL,'UP');
Expand All @@ -29,19 +28,21 @@ $IFI NOT %OBMAC%==YES $EXIT
LOOP((RTP(R,V,P),RPS_PRCTS(R,P,S))$((NOT PRC_TS(R,P,S))$BS_MAINT(RTP,S)),Z=BS_MAINT(RTP,S);
F=ABS(Z); IF((F>=TS_CYCLE(R,S)*24$(F>1))$(RPS_UPS(R,P,S) OR (STOAL(R,S)*SIGN(Z)<2)),UNCD7(RTP,S,RTP)=YES));
LOOP(UNCD7(RTP,S,R,T,P),RPS_UPS(R,P,TS)$(STOAL(R,TS)=1)=YES; BS_MAINT(RTP,TS)$RS_TREE(R,S,TS)=EPS$(BS_MAINT(RTP,TS)>=0)$BS_MAINT(RTP,TS));
BS_RVT(R,VNT(V,T)) $= SUM(RC(R,C)$BS_LAMBDA(R,T,C),1);

*-----------------------------------------------------------------------------
* Variable macros
$ macro var_bson(r,v,t,p,s) sum(ts_map(r,all_ts,s)$(rs_below1(r,all_ts,s)+annual(s)),var_gap(r,v,t,p,all_ts)+(%var%_ups(r,v,t,p,all_ts,'FX'%SOW%)-var_off(r,v,t,p,s))$rps_ups(r,p,s))
$ macro var_bsd(typ,rtc,s) %var%_comlv(typ,rtc,s%SOW%)
$ macro var_bsmup(r,v,t,p,s) %var%_bsprs(r,v,t,p,%PGPRIM%,s,'N'%SOW%)
$ macro var_bsfsp(r,v,t,p,c,s) %var%_bsprs(r,v,t,p,c,s,'N'%SOW%)
$ macro var_bsfnsp(r,v,t,p,c,s) %var%_bsprs(r,v,t,p,c,s,'FX'%SOW%)
$ macro var_bsupsr(r,v,t,p,s,bd) %var%_bsprs(r,v,t,p,%PGPRIM%,s,bd%SOW%)
$ macro var_bsfsp(r,v,t,p,c,s) %var%_bsprs(r,v,t,p,c,s,'N'%SOW%)$bs_rvt(r,v,t)
$ macro var_bsfnsp(r,v,t,p,c,s) %var%_bsprs(r,v,t,p,c,s,'FX'%SOW%)$bs_rvt(r,v,t)
$ macro var_bsupsr(r,v,t,p,s,bd) %var%_bsprs(r,v,t,p,%PGPRIM%,s,bd%SOW%)$bs_rvt(r,v,t)
$ macro var_bslack(r,t,p,c,s) %var%_bsprs(r,t,t,p,c,s,'UP'%SOW%)
* Capacity-CPT expression
$IF %STAGES%==YES $%SW_STVARS%
$SET TMP SUM(MODLYEAR(K)$(COEF_VNT(R,T,P,K)$(PRC_VINT(R,P)->DIAG(V,K))),COEF_VNT(R,T,P,K)*(%VARM%_NCAP(R,K,P%SWS%)$T(K)+NCAP_PASTI(R,K,P)%RCAPSBM%))
$SET R_W_T BS_RVT(%R_V_T%)

*-----------------------------------------------------------------------------
* ABS Equation Formulations - numbers refer to document (00=01)
Expand Down Expand Up @@ -133,22 +134,22 @@ $ BATINCLUDE %cal_red% C COM TS P T
PRC_CAPACT(R,P)*ACT_MINLD(R,V,P)*(VAR_BSON(R,V,T,P,S)-SUM(RPS_UPS(R,P,S),VAR_BSUPSR(R,V,T,P,S,'LO')$SUM(BS_COMTS(BS_ANEG(R,C),S),1)));
*-----------------------------------------------------------------------------
* ABSEQ11-17 : Limit reserve by type and sign according to BS_RMAX
EQ_BS11(RTP_VINTYR(%R_V_T%,P),C,RTS(S),BD%SWX%)$(%SWTX%BS_PRS(R,P,S)$BS_COMTS(R,C,S)$RPC_CONLY(R,V,P,C)$BS_ABD(R,C,BD))..
EQ_BS11(RTP_VINTYR(%R_W_T%,P),C,RTS(S),BD%SWX%)$(%SWTX%BS_PRS(R,P,S)$BS_COMTS(R,C,S)$RPC_CONLY(R,V,P,C)$BS_ABD(R,C,BD))..
SUM(BS_ABD(R,COM,BD)$(ABS(BS_RTYPE(R,COM))<=ABS(BS_RTYPE(R,C))),VAR_BSFSP(R,V,T,P,COM,S)$BS_BSC(R,P,COM)$BS_COMTS(R,COM,S))
=L= (VAR_BSON(R,V,T,P,S)-SUM(RPS_UPS(R,P,S)$BDLOX(BD),VAR_BSUPSR(R,V,T,P,S,BD))) * SUM(TS_ANN(S,TS),BS_RMAX(R,V,P,C,TS));
*-----------------------------------------------------------------------------
* ABSEQ18,20 : Limit the provision of TRT & RRR reserves according to quick start-up / shut-down capacity
EQ_BS18(RTP_VINTYR(%R_V_T%,P),RTS(S),BDNEQ(BD)%SWX%)$(%SWTX%BS_PRS(R,P,S)$RPS_UPS(R,P,S)$ACT_MINLD(R,V,P)$BS_SUPP(R,P))..
EQ_BS18(RTP_VINTYR(%R_W_T%,P),RTS(S),BDNEQ(BD)%SWX%)$(%SWTX%BS_PRS(R,P,S)$RPS_UPS(R,P,S)$ACT_MINLD(R,V,P)$BS_SUPP(R,P))..
VAR_BSUPSR(R,V,T,P,S,BD)*ACT_MINLD(R,V,P)$BS_SBD(R,S,BD)
=L= SUM(BS_ABD(R,C,BD)$(ABS(BS_RTYPE(R,C))>2),VAR_BSFNSP(R,V,T,P,C,S)$BS_BSC(R,P,C)$BS_COMTS(R,C,S));
*-----------------------------------------------------------------------------
* ABSEQ19,21 : Limit the provision of TRT & RRR reserves according to quick start-up / shut-down capacity
EQ_BS19(RTP_VINTYR(%R_V_T%,P),C,RTS(S),BD%SWX%)$(%SWTX%(ABS(BS_RTYPE(R,C))>2)$BS_PRS(R,P,S)$BS_SUPP(R,P)$BS_BSC(R,P,C)$BS_ABD(R,C,BD))..
EQ_BS19(RTP_VINTYR(%R_W_T%,P),C,RTS(S),BD%SWX%)$(%SWTX%(ABS(BS_RTYPE(R,C))>2)$BS_PRS(R,P,S)$BS_SUPP(R,P)$BS_BSC(R,P,C)$BS_ABD(R,C,BD))..
SUM(BS_ABD(R,COM,BD)$(MOD(ABS(BS_RTYPE(R,COM))-1,BS_RTYPE(R,C))>1),VAR_BSFNSP(R,V,T,P,COM,S)$BS_BSC(R,P,COM)$BS_COMTS(R,COM,S))
=L= VAR_BSUPSR(R,V,T,P,S,BD)$RPS_UPS(R,P,S) * SUM(TS_ANN(S,TS),BS_RMAX(R,V,P,C,TS))$BS_COMTS(R,C,S);
*-----------------------------------------------------------------------------
* ABSEQ22 : Ensure sufficient storage level when contracted to reserve
EQ_BS22(RTP_VINTYR(%R_V_T%,P),RTS(S)%SWX%)$(%SWTX%BS_STGP(R,P)$COEF_AFUPS(R,V,P,S)$RPS_STG(R,P,S))..
EQ_BS22(RTP_VINTYR(%R_W_T%,P),RTS(S)%SWX%)$(%SWTX%BS_STGP(R,P)$COEF_AFUPS(R,V,P,S)$RPS_STG(R,P,S))..
* storage: for single-day (true) activity divide by cycles under parent
SUM(PRC_TS(R,P,TS)$RS_FR(R,TS,S),%VAR%_ACT(R,V,T,P,TS%SOW%)*RS_FR(R,TS,S)/RS_STGPRD(R,TS))$BS_SBD(R,S,'UP')
=G=
Expand All @@ -166,18 +167,21 @@ $ BATINCLUDE %cal_red% C COM TS P T
VAR_BSFSP(R,V,T,P,C,S)*(BS_STIME(R,P,C,'LO')/2 +(BS_STIME(R,P,C,'UP')-BS_STIME(R,P,C,'LO'))*MAX(1,G_YRFR(R,S)/RS_STGPRD(R,S)*8760/(1+BS_STIME(R,P,C,'UP'))**0.5)));
*-----------------------------------------------------------------------------
* ABSEQ24 : End-use - negative
EQ_BS24(RTP_VINTYR(%R_V_T%,P),RTS(S)%SWX%)$(%SWTX%BS_PRS(R,P,S)$AFS(R,T,P,S,'UP')$BS_SBD(R,S,'LO')$BS_NEGP(R,P)$BS_ENDP(R,P))..
SUM(BS_COMTS(BS_ANEG(R,C),S)$BS_BSC(R,P,C),VAR_BSFSP(R,V,T,P,C,S)) =L=
EQ_BS24(RTP_VINTYR(%R_W_T%,P),RTS(S)%SWX%)$(%SWTX%BS_PRS(R,P,S)$AFS(R,T,P,S,'UP')$BS_SBD(R,S,'LO')$BS_NEGP(R,P)$BS_ENDP(R,P))..
SUM(BS_COMTS(BS_ANEG(R,C),S)$BS_BSC(R,P,C),VAR_BSFSP(R,V,T,P,C,S))
=L=
* available process capacity - activity level
(VAR_BSON(R,V,T,P,S)*COEF_AF%MX%(R,V,T,P,S,'UP') - %VAR%_ACT(R,V,T,P,S%SOW%)/PRC_CAPACT(R,P)/G_YRFR(R,S)) *
SUM((TOP(R,P,C,'IN'),RPC_PG(R,P,COM))$NRG_TMAP(R,'ELC',C),
PRC_ACTFLO(R,V,P,C)$RPC_PG(R,P,C) +
(SUM(RTPCS_VARF(R,T,P,C,TS)$RS_FR(R,TS,S),RS_FR(R,TS,S)*SUM(RPG_1ACE(R,P,CG,C)$COEF_PTRAN(R,V,P,CG,C,COM,TS),1/COEF_PTRAN(R,V,P,CG,C,COM,TS)))+
SUM(RP_PG(R,P,CG),COEF_PTRAN(R,V,P,CG,COM,C,S)))$(NOT RPC_PG(R,P,C)));
SUM(TOP(R,P,C,'IN')$NRG_TMAP(R,'ELC',C),PRC_ACTFLO(R,V,P,C)$RPC_PG(R,P,C) +
SUM(RTPCS_VARF(R,T,P,C,TS)$RS_FR(R,TS,S),RS_FR(R,TS,S) *
SUM(RPC_PG(R,P,COM),ACT_FLO(R,V,P,C,TS)$RPC_FFUNC(R,P,C) + PRC_ACTFLO(R,V,P,COM) *
(SUM(RPG_1ACE(R,P,CG,C)$COEF_PTRAN(R,V,P,CG,C,COM,TS),1/COEF_PTRAN(R,V,P,CG,C,COM,TS)) +
SUM((RPCC_FFUNC(RP_PG(R,P,CG),C),TS_MAP(R,SL,TS))$RPS_S1(R,P,SL),(ACT_FLO(R,V,P,C,SL)**1$RPC_AFLO(R,P,C))*COEF_PTRAN(R,V,P,CG,COM,C,S)))))$(NOT RPC_PG(R,P,C)));
*-----------------------------------------------------------------------------
* ABSEQ25 : End-use - positive
EQ_BS25(RTP_VINTYR(%R_V_T%,P),RTS(S)%SWX%)$(%SWTX%BS_PRS(R,P,S)$BS_SBD(R,S,'UP')$BS_ENDP(R,P))..
SUM(BS_COMTS(BS_APOS(R,C),S)$BS_BSC(R,P,C),VAR_BSFSP(R,V,T,P,C,S))*PRC_CAPACT(R,P)*G_YRFR(R,S) =L=
EQ_BS25(RTP_VINTYR(%R_W_T%,P),RTS(S)%SWX%)$(%SWTX%BS_PRS(R,P,S)$BS_SBD(R,S,'UP')$BS_ENDP(R,P))..
SUM(BS_COMTS(BS_APOS(R,C),S)$BS_BSC(R,P,C),VAR_BSFSP(R,V,T,P,C,S))*PRC_CAPACT(R,P)*G_YRFR(R,S)
=L=
SUM(TOP(R,P,C,'IN')$NRG_TMAP(R,'ELC',C),
SUM(RTPCS_VARF(R,T,P,C,TS)$TS_MAP(R,S,TS),
$ BATINCLUDE %cal_red% C COM TS P T
Expand All @@ -201,4 +205,4 @@ $ BATINCLUDE %cal_red% C COM TS P T
* ABSEQ28 : Maintenence 2 - continuous duration
EQ_BS28(RTP_VINTYR(%R_V_T%,P),RTS(S)%SWX%)$(%SWTX%PRC_TS(R,P,S)$BS_MAINT(R,V,P,S))..
SUM((RS_UP(R,S,JS),RJ_SL(R,JS,SL)),VAR_BSMUP(R,V,T,P,SL)$(RS_MODUS(R,S,JS,SL)<ABS(BS_MAINT(R,V,P,S))/8760))
=L= %TMP%*(1-COEF_AF%MX%(R,V,T,P,S,'UP'))-(%UPSCAPS%*COEF_AF%MX%(R,V,T,P,S,'UP'));
=L= %TMP%*(1-COEF_AF%MX%(R,V,T,P,S,'UP'))-(%UPSCAPS%*COEF_AF%MX%(R,V,T,P,S,'UP'));
3 changes: 2 additions & 1 deletion init_ext.abs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright (C) 2000-2023 Energy Technology Systems Analysis Programme (ETSAP)
* Copyright (C) 2000-2024 Energy Technology Systems Analysis Programme (ETSAP)
* This file is part of the IEA-ETSAP TIMES model generator, licensed
* under the GNU General Public License v3.0 (see file NOTICE-GPLv3.txt).
*=============================================================================*
* INIT_EXT.xtd oversees initial preprocessor activities
* %1 - mod or v# for the source code to be used
*=============================================================================*
SET BS_RVT(R,YEAR,T);
* Get processes allowed to participate in the reserve markets per region
OPTION BS_BSC<BS_RMAX, TRACKP<BS_BSC; Z=CARD(TRACKP);
BS_RTYPE(R,C)$BS_RTYPE(R,C) = SIGN(BS_RTYPE(R,C))*ROUND(MIN(5,ABS(BS_RTYPE(R,C))));
Expand Down
3 changes: 1 addition & 2 deletions initmty.mod
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,6 @@ $IF SET FIXBOH $SETGLOBAL STEPPED -
$IF SET TIMESTEP $SETGLOBAL STEPPED +
$IF SET STEPPED $SETGLOBAL VAR_UC YES
$IF %SYSTEM.LICENSELEVEL%==2 $SETGLOBAL VAR_UC YES

*------------------------------------------------------------------------------
* Other extensions to TIMES code
*------------------------------------------------------------------------------
Expand Down Expand Up @@ -488,7 +487,7 @@ $IF %MACRO%==YES $INCLUDE initmty.tm
* Load data from GDX if DATAGDX set and %RUN_NAME%~DATA exists
$ IF NOT SET DATAGDX $GOTO RUN
$ IF NOT %G2X6%==YES $GOTO RUN
$ IF NOT SET RUN_NAME $SETNAMES %SYSTEM.INCPARENT% . RUN_NAME .
$ IF NOT SET RUN_NAME $SETNAMES "%SYSTEM.INCPARENT%" . RUN_NAME .
$ IF NOT EXIST %RUN_NAME%~data.gdx $GOTO RUN
$ hiddencall gdxdump %RUN_NAME%~data.gdx NODATA > _dd_.dmp
$ hiddencall sed "/^\(Alias\|[^($]*(\*) Alias\|[^$].*empty *$\)/{N;d;}; /^\([^$].*$\|$\)/d; s/\$LOAD.. /\$LOAD /I" _dd_.dmp > _dd_.dd
Expand Down
2 changes: 1 addition & 1 deletion initsys.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$TITLE TIMES -- VERSION 4.8.2
$TITLE TIMES -- VERSION 4.8.3
*==========================================================================================*
* INITSYS.MOD has all the fixed system declarations for ETSAP TIMES *
*==========================================================================================*
Expand Down
4 changes: 2 additions & 2 deletions main_ext.mod
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright (C) 2000-2023 Energy Technology Systems Analysis Programme (ETSAP)
* Copyright (C) 2000-2024 Energy Technology Systems Analysis Programme (ETSAP)
* This file is part of the IEA-ETSAP TIMES model generator, licensed
* under the GNU General Public License v3.0 (see file NOTICE-GPLv3.txt).
*=============================================================================*
Expand All @@ -11,7 +11,7 @@
* This would include the reporting extensions for ETL and two custom
* reporting routines rpt_ext.RP1 and rpt_ext.RP2
*-----------------------------------------------------------------------------
$SETNAMES %SYSTEM.INCPARENT% . TMP .
$SETNAMES "%SYSTEM.INCPARENT%" . TMP .
$SETLOCAL WHCALL %1
$LABEL MORE
$SHIFT
Expand Down
4 changes: 3 additions & 1 deletion prep_ext.abs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
* Copyright (C) 2000-2023 Energy Technology Systems Analysis Programme (ETSAP)
* Copyright (C) 2000-2024 Energy Technology Systems Analysis Programme (ETSAP)
* This file is part of the IEA-ETSAP TIMES model generator, licensed
* under the GNU General Public License v3.0 (see file NOTICE-GPLv3.txt).
*=============================================================================*
Expand All @@ -26,8 +26,10 @@ $ BATINCLUDE fillparm BS_MAINT R 'P,S' ",'0','0','0','0'" V 'RTP(R,V,P)' >=0
$ BATINCLUDE fillparm BS_RMAX R 'P,C,S' ",'0','0','0'" V 'RTP(R,V,P)' >=0
$ BATINCLUDE prepparm BS_BNDPRS R 'P,C,S,BD' ",'0'" T 'RTP(R,T,P)' 1

* Intermediate QA clean-up
BS_RTCS(RSP('OMEGA'),R,T,C,S)$BS_RTCS(RSP,R,T,C,S) = ROUND(BS_RTCS(RSP,R,T,C,S));
BS_SIGMA(R,T,C,BS_K,S)$(BS_LAMBDA(R,T,C)=0)=0;
BS_RMAX(R,LL--ORD(LL),P,C,S+STOA(S)) $= (BS_RMAX(R,LL,P,C,S)>0);
BS_RMAX(R,LL,P,C,S)$(NOT BS_RMAX(R,'0',P,C,'ANNUAL'))=0;
BS_BNDPRS(R,T,P,C,S,BD)$((BS_LAMBDA(R,T,C)=0)$BS_BNDPRS(R,T,P,C,S,BD))=0;
OPTION BS_BSC < BS_RMAX, CLEAR=BS_OMEGA;

0 comments on commit 3973eeb

Please sign in to comment.