FI 20 MOUT-S.TXT
FI 21 MIN-S.TXT
FI 22 MTFP-S.TXT
FI 23 PPK-S.TXT
FI 24 PP1-S.TXT
SET NODOECHO
SET NOCOLOR
**************************************************************************
** THIS FILE CALCULATES ELECTRICITY DNSP MULTILATERAL TFP FOR 2006-2024 **
** BY STATE **************************************************************
**************************************************************************
** VARIABLES ARE IN ORDER: IDYEAR, TOTAL REVENUE, GWH, CONNECTION NO, ****
** MAXIMUM DEMAND, RATCHETED MAX DEMAND, CIRCUIT LENGTH, MINS OFF SUPPLY,* 
** PRICE MIN OFF-SUPPLY, OPEX, PRICE OF OPEX, OHSTLine, OHDNLine, ********
** UGSTCabl, UGDNCabl, MVA TRANSFORMERS EXCL FIRST STAGE, AUCOHST, *******
** AUCOHDN, AUCUGST, AUCUGDN, AUC TRANSFORMERS EXCL FIRST STAGE, *********
** Maximum Demand Index **************************************************
**************************************************************************
** WE USE LEONTIEF COST FUNCTION SHARES OF 0.11, 0.48, 0.15 AND 0.26 ON **
** OUTPUTS OF GWH, RATCHETED MAX DEMAND, CONNECTION NO, CIRCUIT LENGTH ***
** RELIABILITY IS INCLUDED AS 5th OUTPUT USING DNSP VCRs *****************
** INPUTS ARE OPEX, OH SUBTRANS MVAKMS, OH DIST MVAKMS, UG SUBTRANS MVAKMS, 
** UG DIST MVAKMS, MVA TRF CAP EXCL FIRST STAGE & OTHER ASSETS ***********
** WITH EXOGENOUS CAPITAL AUCs *******************************************
**************************************************************************
SMPL 1 114
read(STATEdata.csv) IDYear Revenue Energy RMDemand CustNum CircLen CustMOS PRCMOS Opex PrOpex &	
  OHSTLine OHDNLine UGSTCabl UGDNCabl SSTranf AUCOHST AUCOHDN AUCUGST AUCUGDN SSAUCTrn MaxD MDindex / skiplines=1
genr VI1=Opex
genr R1=PrOpex
genr Q1=Energy
genr Q2=RMDemand
genr Q3=CustNum
genr Q4=CircLen
genr Q5=CustMOS
genr X2=OHSTLine
genr X3=OHDNLine
genr X4=UGSTCabl
genr X5=UGDNCabl
genr X6=SSTranf
genr VI2=AUCOHST
genr VI3=AUCOHDN
genr VI4=AUCUGST
genr VI5=AUCUGDN
genr VI6=SSAUCTrn
GENR GR=Revenue+PRCMOS*Q5/1000
GENR V1=GR*0.0858
GENR V2=GR*0.3376
GENR V3=GR*0.1852
GENR V4=GR*0.3914
GENR V5=-1*PRCMOS*Q5/1000
GENR X1=VI1/R1
DO #=1,5
GENR P#=V#/Q#
GENR SO#=V#/Revenue
ENDO
GENR TC=VI1+VI2+VI3+VI4+VI5+VI6
DO #=2,6
GENR R#=VI#/X#
GENR SI#=VI#/TC
ENDO
GENR SI1=VI1/TC
**********************************************************************
** MULTILATERAL CCD OUTPUT INDEX *************************************
**********************************************************************
GENR CCDOI=0
GENR TV=0
DO #=1,5
GENR TV=TV+Q#*P#
ENDO
DO #=1,5
GENR V=Q#*P#/TV
GENR LQ=LOG(Q#)
?STAT V/MEAN=VM
?STAT LQ/MEAN=LQM
GENR CCDOI=CCDOI+0.5*(V+VM)*(LQ-LQM)
ENDO
GEN1 BASEO=CCDOI:1
GENR CCDOI=CCDOI-BASEO
GENR CCDOI=EXP(CCDOI)
**********************************************************************
** MULTILATERAL CCD INPUT INDEX **************************************
**********************************************************************
GENR CCDII=0
GENR TV=0
DO #=1,6
GENR TV=TV+X#*R#
ENDO
DO #=1,6
GENR W=X#*R#/TV
GENR W#=X#*R#/TV
GENR LX=LOG(X#)
?STAT W/MEAN=WM
?STAT LX/MEAN=LXM
GENR CCDII=CCDII+0.5*(W+WM)*(LX-LXM)
ENDO
GEN1 BASE=CCDII:1
GENR CCDII=CCDII-BASE
GENR CCDII=EXP(CCDII)
**********************************************************************
** MULTILATERAL CCD CAPITAL INDEX ************************************
**********************************************************************
GENR CCDKI=0
GENR TV=0
DO #=2,6
GENR TV=TV+X#*R#
ENDO
DO #=2,6
GENR WK=X#*R#/TV
GENR LXK=LOG(X#)
?STAT WK/MEAN=WKM
?STAT LXK/MEAN=LXKM
GENR CCDKI=CCDKI+0.5*(WK+WKM)*(LXK-LXKM)
ENDO
GEN1 BASE=CCDKI:1
GENR CCDKI=CCDKI-BASE
GENR CCDKI=EXP(CCDKI)
**********************************************************************
** MULTILATERAL CCD TFP INDEX ****************************************
**********************************************************************
GENR CCDTFP=CCDOI/CCDII
GENR PPK=CCDOI/CCDKI
DO #=1,5
GEN1 BASEO#=Q#(1)
GENR QB#=Q#/BASEO#
ENDO
DO #=1,6
GEN1 BASE#=X#(1)
GENR XB#=X#/BASE#
GENR PP#=CCDOI/XB#
ENDO
PRINT IDYEAR QB1-QB5 / wide
PRINT IDYEAR SO1-SO5 / wide
PRINT IDYEAR XB1-XB6 / wide
PRINT IDYEAR SI1-SI6 / wide
PRINT IDYEAR W1-W6 / wide
PRINT IDYEAR PPK PP1-PP6 / wide
PRINT IDYEAR CCDOI CCDII CCDTFP
**********************************************************************
** WRITE INDEXES TO FILES ********************************************
**********************************************************************
FORMAT(13F8.4)
SMPL 1 19
WRITE (20) CCDOI / FORMAT NOREWIND
SMPL 20 38
WRITE (20) CCDOI / FORMAT NOREWIND
SMPL 39 57
WRITE (20) CCDOI / FORMAT NOREWIND
SMPL 58 76
WRITE (20) CCDOI / FORMAT NOREWIND
SMPL 77 95
WRITE (20) CCDOI / FORMAT NOREWIND
SMPL 96 114
WRITE (20) CCDOI / FORMAT NOREWIND
SMPL 1 19
WRITE (21) CCDII / FORMAT NOREWIND
SMPL 20 38
WRITE (21) CCDII / FORMAT NOREWIND
SMPL 39 57
WRITE (21) CCDII / FORMAT NOREWIND
SMPL 58 76
WRITE (21) CCDII / FORMAT NOREWIND
SMPL 77 95
WRITE (21) CCDII / FORMAT NOREWIND
SMPL 96 114
WRITE (21) CCDII / FORMAT NOREWIND
SMPL 1 19
WRITE (22) CCDTFP / FORMAT NOREWIND
SMPL 20 38
WRITE (22) CCDTFP / FORMAT NOREWIND
SMPL 39 57
WRITE (22) CCDTFP / FORMAT NOREWIND
SMPL 58 76
WRITE (22) CCDTFP / FORMAT NOREWIND
SMPL 77 95
WRITE (22) CCDTFP / FORMAT NOREWIND
SMPL 96 114
WRITE (22) CCDTFP / FORMAT NOREWIND
SMPL 1 19
WRITE (23) PPK / FORMAT NOREWIND
SMPL 20 38
WRITE (23) PPK / FORMAT NOREWIND
SMPL 39 57
WRITE (23) PPK / FORMAT NOREWIND
SMPL 58 76
WRITE (23) PPK / FORMAT NOREWIND
SMPL 77 95
WRITE (23) PPK / FORMAT NOREWIND
SMPL 96 114
WRITE (23) PPK / FORMAT NOREWIND
SMPL 1 19
WRITE (24) PP1 / FORMAT NOREWIND
SMPL 20 38
WRITE (24) PP1 / FORMAT NOREWIND
SMPL 39 57
WRITE (24) PP1 / FORMAT NOREWIND
SMPL 58 76
WRITE (24) PP1 / FORMAT NOREWIND
SMPL 77 95
WRITE (24) PP1 / FORMAT NOREWIND
SMPL 96 114
WRITE (24) PP1 / FORMAT NOREWIND
STOP