-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patheco_analysis.py
1860 lines (1284 loc) · 57.5 KB
/
eco_analysis.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# File : eco_analysis.py
# Author : tzhang
# Date : 26.11.2019
# Last Modified Date: 28.09.2020
# Last Modified By : tzhang
import sys
import numpy as np
import math
import importlib.util
# use a tool to calculation inflation, written by 'Los Angeles Times Data and Graphics Department', the project is on GitHub, details see: https://github.com/datadesk/cpi
# but this module is quite slow
# later a new model can be developed
import cpi
"""
economical analysis of the system
"""
from prepost_process import *
"""
economical analysis of SMR
REFERENCES:
- Geoffrey A. Black, Fatih Aydogan, Cassandra L. Koerner,Economic viability of light water small modular nuclear reactors: General methodology and vendor data,Renewable and Sustainable Energy Reviews,Volume 103,2019,Pages 248-258,ISSN 1364-0321, doi:10.1016/j.rser.2018.12.041.
- NEA/OEC, Current Status, Technical Feasibility and Economics of Small Nuclear Reactors, NEA/OECD, 2011.
- Boldon, Lauren M., and Sabharwall, Piyush. Small modular reactor: First-of-a-Kind (FOAK) and Nth-of-a-Kind (NOAK) Economic Analysis. United States: N. p., 2014. Web. doi:10.2172/1167545
- Locatelli, G , Pecoraro, M, Meroni, G et al. (1 more author) (2017) Appraisal of small modular nuclear reactors with ‘real options’ valuation. Proceedings of the Institution of Civil Engineers - Energy, 170 (2). 1600004. pp. 51-66. ISSN 1751-4223
- Piyush Sabharwall, Shannon Bragg-Sitton, Lauren Boldon, Seth Blumsack, Nuclear Renewable Energy Integration: An Economic Case Study, The Electricity Journal, Volume 28, Issue 8, 2015, Pages 85-95, ISSN 1040-6190, doi:10.1016/j.tej.2015.09.003.
"""
class nuclear_eco:
def __init__(self,P_unit,n_unit,year,lifetime,y_unit_construct,FOAK = True):
self.P_unit = P_unit # power of one SMR module
self.n_unit = n_unit # number of units in one nuclear power plant
self.year = year # use currency in which year
self.lifetime = lifetime # life time of a unit
self.y_unit_construct = y_unit_construct # years needed to construct a unit
y_construction = y_unit_construct * n_unit
self.y_construction = y_construction # years needed to construct a unit
self.P_pwr12 = 1147 #in MW, the electrical power output of PWR12
# whether the site include first of a kind (FOAK), default FALSE
if FOAK == 1:
self.FOAK = True
else:
self.FOAK = False
# unit cost data
self.unit_direct_cost = []
self.unit_direct_cost_tot = 0.0
self.unit_indirect_cost = []
self.unit_indirect_cost_tot = 0.0
self.unit_cost_tot = 0.0
self.unit_cost_kW = 0.0
# npp cost data
self.occ = 0.0
self.occ_kW = 0.0
# interest during construction
self.idc = 0.0
# O&M cost per unit per year
self.om_unit_year = 0.0
# fuel cost per unit per year
self.fuel_unit_year = 0.0
# decommissioning cost per unit per year
self.dcms_unit_year = 0.0
# smr cash flow
self.cashflow = []
# smr LCOE
self.LCOE = 0.0
# smr NPV
self.NPV = 0.0
# smr IRR
self.IRR = 0.0
# calculate the net cost of from 0 to nth year
def cal_cost(self):
cost = []
# calculate investment per year
occ_year = self.occ/self.y_construction
# calculate averaged interest per year
idc_year = self.idc/self.y_construction
# calculate hours per year, ignore leap year
hours = 365*24
for i in range(self.lifetime+int(self.y_construction/2)):
# the very beginning of the project
if i == 0:
cost.append(0.0)
elif i > 0 and i <= self.y_construction:
unit_done = int((i-1)/self.y_unit_construct)
cost_year = occ_year + (self.om_unit_year+self.fuel_unit_year+self.dcms_unit_year)*unit_done + idc_year
cost_year = cost_year/1e6 # convert to million dollar
cost.append(cost_year)
else:
cost_year = ((self.om_unit_year+self.fuel_unit_year+self.dcms_unit_year)*self.n_unit)#*(1+r_discount)**i
cost_year = cost_year/1e6 # convert to million dollar
cost.append(cost_year)
return cost
def cal_cost_year(self,unit_done,year):
# calculate investment per year
occ_year = self.occ/self.y_construction
# calculate averaged interest per year
idc_year = self.idc/self.y_construction
# calculate hours per year, ignore leap year
hours = 365*24
# the very beginning of the project
if year == 0:
cost_year = 0.0
elif year > 0 and year <= self.y_construction:
cost_year = occ_year + (self.om_unit_year+self.fuel_unit_year+self.dcms_unit_year)*unit_done + idc_year
cost_year = cost_year/1e6 # convert to million dollar
else:
cost_year = ((self.om_unit_year+self.fuel_unit_year+self.dcms_unit_year)*self.n_unit)#*(1+r_discount)**i
cost_year = cost_year/1e6 # convert to million dollar
return cost_year
# calculate the net cash flow of from 0 to nth year
def cal_NCF(self,price_e,f_utilization):
cashflow = []
# calculate investment per year
occ_year = self.occ/self.y_construction
# calculate averaged interest per year
idc_year = self.idc/self.y_construction
# calculate hours per year, ignore leap year
hours = 365*24
for i in range(self.lifetime+int(self.y_construction/2)):
# the very beginning of the project
if i == 0:
cashflow.append(0.0)
elif i > 0 and i <= self.y_construction:
unit_done = int((i-1)/self.y_unit_construct)
cost_year = occ_year + (self.om_unit_year+self.fuel_unit_year+self.dcms_unit_year)*unit_done + idc_year
production_year = ((self.P_unit*unit_done*hours*f_utilization) * price_e)
cashflow_year = (cashflow[-1]*1e6 + production_year - cost_year)/1e6 # convert to million dollar
cashflow.append(cashflow_year)
else:
cost_year = ((self.om_unit_year+self.fuel_unit_year+self.dcms_unit_year)*self.n_unit)#*(1+r_discount)**i
production_year = ((self.P_unit*self.n_unit*hours*f_utilization) * price_e)#*(1+r_discount)**i
cashflow_year = (cashflow[-1]*1e6 + production_year - cost_year)/1e6 # convert to million dollar
cashflow.append(cashflow_year)
self.cashflow = self.cashflow + cashflow
# calculate the levelized cost of electricity used
def cal_LCOE(self,r_discount,price_e,f_utilization):
# calculate investment per year
occ_year = self.occ/self.y_construction
# calculate hours per year, ignore leap year
hours = 365*24
for i in range(self.lifetime + int(self.y_construction/2)):
# the very beginning of the project
if i == 0:
cost = 0.0
production = 0.0
elif i > 0 and i <= self.y_construction:
unit_done = int((i-1)/self.y_unit_construct)
cost_year = (occ_year + (self.om_unit_year+self.fuel_unit_year+self.dcms_unit_year)*unit_done)/(1+r_discount)**i
production_year = (self.P_unit*unit_done*hours*f_utilization)/(1+r_discount)**i
cost = cost + cost_year
production = production + production_year
else:
cost_year = ((self.om_unit_year+self.fuel_unit_year+self.dcms_unit_year)*self.n_unit)/(1+r_discount)**i
production_year = (self.P_unit*self.n_unit*hours*f_utilization)/(1+r_discount)**i
cost = cost + cost_year
production = production + production_year
LCOE = cost/production # unit in $/MWh
#print ('smr levelized cost of electricity: ',LCOE, ' $/MWh')
self.LCOE = self.LCOE + LCOE
# calculate Net Present Value (NPV)
def cal_NPV(self,r_discount):
# calculate the real rate of interest
r_interest = r_discount
NPV = 0
for i in range(self.lifetime+int(self.y_construction/2)):
NPV_curr = self.cashflow[i]/(1+r_interest)**i
NPV = NPV + NPV_curr
self.NPV = self.NPV + NPV
# calculate Internal Rate of Return (IRR)
def cal_IRR(self,r_discount):
# initial guess of IRR
IRR = r_discount
NPV = self.NPV
epsi = 1e-6
step_size = 0.01
n_iter = 0
iter_max = 100
while abs(NPV) > epsi:
if NPV > 0:
IRR = IRR + step_size
else:
IRR = IRR - step_size
NPV_new = 0.0
for i in range(self.lifetime+int(self.y_construction/2)):
NPV_curr = self.cashflow[i]/(1+IRR)**i
NPV_new = NPV_new + NPV_curr
if NPV_new * NPV < 0:
step_size = step_size/2
NPV = NPV_new
n_iter = n_iter + 1
if n_iter > iter_max:
print ('not converge')
break
self.IRR = self.IRR + IRR
# calculate the overnight calpatical cost
def cal_OCC(self,ME_2_curr,ME_9_curr,eta_direct,eta_indirect,x,y,z,k,r_learning):
self.unit_direct_cost_coa(ME_2_curr,eta_direct)
self.unit_indirect_cost_coa(ME_9_curr,eta_indirect)
self.cal_unit_cost_tot()
# print ('total cost of a unit: ', self.unit_cost_tot)
self.cal_unit_cost_kW()
# cost_ratio = SMR_eco.cost_kW/cost_kW_pwr12
# print ('original cost ratio: ',cost_ratio)
f_cosite = self.cosite_factor()
# print ('co_site factor is: ', f_cosite)
f_modular = self.iPWR_factor()
# print ('modular factor: ', f_modular)
f_config_learning = self.config_learning_factor(x,y,z,k)
# print ('config learning rate: ', f_config_learning)
if self.FOAK and self.n_unit > 1:
f_tech_learning = 1.0
elif not self.FOAK and self.n_unit>1:
f_tech_learning = self.tech_learning_factor(x,r_learning)
else:
f_tech_learning = 1.0
# print ('technology learning rate: ', f_tech_learning)
occ = self.unit_cost_tot*self.n_unit * f_cosite * f_modular * f_config_learning * f_tech_learning
# print ('total cost of the NPP: ', occ)
occ_kW = occ/(self.P_unit*self.n_unit*1000)
# print ('SMR cost of the NPP per kW: ', occ_kW)
self.occ = self.occ + occ
self.occ_kW = self.occ_kW + occ_kW
# calculate interest during construction (IDC)
def cal_IDC(self,r_discount):
idc = []
idc = self.y_construction/2 * (self.occ/self.y_construction * (1+r_discount)**(self.y_construction-1) - self.occ/self.y_construction)
self.idc = self.idc + idc
# calculate operation and maintainence cost per unit per year
def cal_OM_unit(self,om_cost_MWh,f_utilization):
# calculate hours per year, ignore leap year
hours = 365*24
# elecectricity produced per unit per year
P_MWh = self.P_unit * hours * f_utilization
# calculate O&M cost per unit per year
om_unit_year = om_cost_MWh * P_MWh
self.om_unit_year = self.om_unit_year + om_unit_year
# calculate fuel cost per unit per year
def cal_fuel_unit(self,fuel_cost_MWh,f_utilization):
# calculate hours per year, ignore leap year
hours = 365*24
# elecectricity produced per unit per year
P_MWh = self.P_unit * hours * f_utilization
# calculate O&M cost per unit per year
fuel_unit_year = fuel_cost_MWh * P_MWh
self.fuel_unit_year = self.fuel_unit_year + fuel_unit_year
# calculate the decommissioning cost per unit per year
def cal_decommissioning_unit(self,dcms_cost_MWh,f_utilization):
# calculate hours per year, ignore leap year
hours = 365*24
# elecectricity produced per unit per year
P_MWh = self.P_unit * hours * f_utilization
# calculate O&M cost per unit per year
dcms_unit_year = dcms_cost_MWh * P_MWh
self.dcms_unit_year = self.dcms_unit_year + dcms_unit_year
# calculate co-site factor
def cosite_factor(self):
# calculat the ratio of direct cost and indirect cost in tot cost
f_ind = self.unit_indirect_cost_tot/self.unit_cost_tot
f_dir = self.unit_direct_cost_tot/self.unit_cost_tot
n_unit = float(self.n_unit)
f_cosite = (1 + (self.n_unit-1)*(1-f_ind))/self.n_unit
return f_cosite
# cacluate learning reduction factor by plant configuration
# - x: FOAK extra cost parameter, range 15%-55%
# - y: parameter related to the gain in building a pair of units, range 74%-85%
# - z: parameter related to the gain in building two pairs of units on the same site, 82%-95%
# - k: industrial productivity coefficient, 0%-2%
def config_learning_factor(self,x,y,z,k):
# the cost of 1st unit according to whether it is FOAK
if self.FOAK:
f_ini = 1.+x
else:
f_ini = 1.0
# total cost of the 1st unit
if self.n_unit == 1:
f_curr = f_ini
# total cost of more than one unit
elif self.n_unit > 1:
f_curr = f_ini
for i in range(2,self.n_unit+1):
if i%2 == 0:
f_curr = f_curr + y/(1+k)**(i-2)
else:
f_curr = f_curr + z/(1+k)**(i-2)
f_config_learning = f_curr/self.n_unit
return f_config_learning
# calculate the learning rate by technology improvement
# the learning rate is nomally a value between 1% to 6%
# according to historical data, between 3% to 4.5%
def tech_learning_factor(self,x,rate):
# calculate FOAK extra cost fact
f_cost_FOAK = (1+x)#*self.unit_cost_tot
# calculate the NPP power output
P_npp = self.P_unit * self.n_unit
# calculate the exponential term
b = -math.log10(1-rate)/math.log10(2)
f_tech_learning = f_cost_FOAK * P_npp**(-b)
return f_tech_learning
# define iPWR design simplification factor
def iPWR_factor(self):
if self.P_unit <= 35.:
f_modular = 0.6
elif self.P_unit > 35. and self.P_unit < 600.:
f_modular = 4e-10*(self.P_unit)**3 - 1e-6*(self.P_unit)**2 + 0.0012*self.P_unit + 0.581
else:
f_modular = 1.0
return f_modular
# estimate the direct cost by the method of coa with existing PWR-12 data, use two digits value to evaluate
def unit_direct_cost_coa(self,ME_2_curr,eta_direct):
unit_direct_cost = []
# total direct cost
unit_direct_cost_tot = 0
# calculate scale factor
f_scale = (self.P_unit/self.P_pwr12)**eta_direct
# calculate tow digits new cost
for i in range(len(ME_2_curr)):
data = []
data.append(ME_2_curr[i][0])
cost_new = float(ME_2_curr[i][1]) * f_scale
data.append('%.0f'%cost_new)
unit_direct_cost.append(data)
unit_direct_cost_tot = unit_direct_cost_tot + cost_new
# print (unit_direct_cost)
# print ('%.0f'%unit_direct_cost_tot)
self.unit_direct_cost = self.unit_direct_cost + unit_direct_cost
self.unit_direct_cost_tot = self.unit_direct_cost_tot + unit_direct_cost_tot
# estimate the indirect cost by the method of coa with existing PWR-12 data, use two digits value to evaluate
def unit_indirect_cost_coa(self,ME_9_curr,eta_indirect):
unit_indirect_cost = []
# total direct cost
unit_indirect_cost_tot = 0
# calculate scale factor
f_scale = (self.P_unit/self.P_pwr12)**eta_indirect
# calculate tow digits new cost
for i in range(len(ME_9_curr)):
data = []
data.append(ME_9_curr[i][0])
cost_new = float(ME_9_curr[i][1]) * f_scale
data.append('%.0f'%cost_new)
unit_indirect_cost.append(data)
unit_indirect_cost_tot = unit_indirect_cost_tot + cost_new
# print (unit_indirect_cost)
# print ('%.0f'%unit_indirect_cost_tot)
self.unit_indirect_cost = self.unit_indirect_cost + unit_indirect_cost
self.unit_indirect_cost_tot = self.unit_indirect_cost_tot + unit_indirect_cost_tot
# calculate SMR total cost
def cal_unit_cost_tot(self):
unit_cost_tot = self.unit_direct_cost_tot + self.unit_indirect_cost_tot
# print ('total cost',unit_cost_tot)
self.unit_cost_tot = self.unit_cost_tot + unit_cost_tot
# calculate SMR total cost per kW
def cal_unit_cost_kW(self):
self.unit_cost_kW = self.unit_cost_kW + self.unit_cost_tot/(self.P_unit*1000)
# import the coa data for PWR12
def import_coa(self):
coa = coa_pwr12()
direct_cost_dd = coa.aquire_2_dd()
direct_cost_dd_curr = coa.inflation(direct_cost_dd,self.year)
indirect_cost_dd = coa.aquire_9_dd()
indirect_cost_dd_curr = coa.inflation(indirect_cost_dd,self.year)
# convert direct and indirect cost madien experiences to current current currency
ME_2_curr = coa.aquire_code_ME(direct_cost_dd_curr)
ME_9_curr = coa.aquire_code_ME(indirect_cost_dd_curr)
return ME_2_curr,ME_9_curr
"""
the Code of Account (COA) of DOE Energy Economic Data Base (EEDB), the data of PWR 12, for Capitalized Direct Costs (2*), and Indirect Cost (9*)
REFERENCES:
- Generation IV International Forum, Economic Modeling Working Group; 2007. Holcomb D, Peretz F, Qualls A. Advanced High Temperature Reactor Systems and Economic Analysis, Rev 0.ORNL/TM-2011/364 September 2011. Oak Ridge National Laboratory; 2011.
"""
class coa_pwr12:
def __init__(self):
self.pwr12_data = [
['21','Structures and improvements subtotal',200744098,303499834,198110031],
['211','Yardwork',24992519,32518044,25641072],
['212','Reactor containment building',64836041,100710559,62341201],
['213','Turbine room and heater bay',23152330,37872452,24016964],
['214','Security building',1361955,1914689,1312224],
['215','Primary auxiliary building and tunnels',18472145,27163800,19114786],
['216','Waste processing building',14367318,22378826,13883581],
['217','Fuel storage building',9879103,13030890,9603975],
['218','Other structures',43682687,67910574,42196228],
['22','Reactor plant equipment',303048181,370640594,290413681],
['220A','Nuclear steam supply (NSSS)',179340000,179340000,173959800],
['221','Reactor equipment',10516879,11191741,10304492],
['222','Main heat transfer transport system',9898419,20509935,9526332],
['223','Safeguards system',12416260,24389226,11541651],
['224','Radwaste processing',20942407,30865919,19885175],
['225','Fuel handling and storage',3167160,4248375,3103137],
['226','Other reactor plant equipment',37759511,67363994,33544955],
['227','Reactor instrumentation and control',21555270,23607427,21329518],
['228','Reactor plant miscellaneous items',7452275,9123977,7218621],
['23','Turbine plant equipment',223778366,266443824,209610905],
['231','Turbine generator',133984273,137755009,131357864],
['233','Condensing systems',28981986,38244984,25749941],
['234','Feedwater heating system',23588801,32713168,19800879],
['235','Other turbine plant equipment',22323194,40286456,18690726],
['236','Instrumentation and control',6854212,7980222,6216009],
['237','Turbine plant miscellaneous items',8045900,9463985,7795486],
['24','Electric plant equipment',81322724,119236515,62241755],
['241','Switchgear',11946283,11946368,11225531],
['242','Station service equipment',20163388,20318526,19039791],
['243','Switchboards',2048898,2091797,1858720],
['244','Protective equipment',4261386,4975308,4308153],
['245','Electric structure and wiring contnr.',22301683,46674779,12419117],
['246','Power and control wiring',20601086,33229737,13390443],
['25','Miscellaneous plant equipment subtotal',46701898,70656254,44618307],
['251','Transportation and lifting equipment',5993830,6360616,6607780],
['252','Air, water and steam service systems',28725654,51096666,26656904],
['253','Communications equipment',6415046,7272235,6139079],
['254','Furnishings and fixtures',2735984,2901892,2637261],
['255','Waste water treatment equipment',2831384,3024845,2577283],
['26','Main condenser heat rejection system',48980965,56612488,47841279],
['261','Structures',4332720,5726470,4197560],
['262','Mechanical equipment',44648245,50886018,43643719],
['91','Construction services',226915000,411147000,185639000],
['92','Engineering and home office services',212742000,487254000,90716000],
['93','Field supervision and field office services',111400000,443845000,79262000],
]
self.data_year = 1987
# aquire two digits capitialize direct cost
def aquire_2_dd(self):
direct_cost_dd = []
for data in self.pwr12_data:
if len(data[0]) == 2 and data[0][0] == '2':
direct_cost_dd.append(data)
return direct_cost_dd
# aquire two digits capitialize indirect cost
def aquire_9_dd(self):
indirect_cost_dd = []
for data in self.pwr12_data:
if len(data[0]) == 2 and data[0][0] == '2':
indirect_cost_dd.append(data)
return indirect_cost_dd
# aquire three digits capitialize direct cost
def aquire_2_ddd(self):
direct_cost_ddd = []
for data in self.pwr12_data:
if len(data[0]) >= 3 and data[0][0] == '2':
direct_cost_ddd.append(data)
return direct_cost_ddd
# aquire three digits capitialize Structures and improvements subtotal (code 21)
def aquire_ddd_21(self):
ddd_21 = []
for data in self.pwr12_data:
if len(data[0]) == 3 and data[0][0] == '2' and data[0][1] == '1':
ddd_21.append(data)
return ddd_21
# aquire three digits capitialize Reactor plant equipment (code 22)
def aquire_ddd_22(self):
ddd_22 = []
for data in self.pwr12_data:
if len(data[0]) >= 3 and data[0][0] == '2' and data[0][1] == '2':
ddd_22.append(data)
return ddd_22
# aquire three digits capitialize Turbine plant equipment (code 23)
def aquire_ddd_23(self):
ddd_23 = []
for data in self.pwr12_data:
if len(data[0]) == 3 and data[0][0] == '2' and data[0][1] == '3':
ddd_23.append(data)
return ddd_23
# aquire three digits capitialize Electric plant equipment (code 24)
def aquire_ddd_24(self):
ddd_24 = []
for data in self.pwr12_data:
if len(data[0]) == 3 and data[0][0] == '2' and data[0][1] == '4':
ddd_24.append(data)
return ddd_24
# aquire three digits capitialize Miscellaneous plant equipment subtotal (code 25)
def aquire_ddd_25(self):
ddd_25 = []
for data in self.pwr12_data:
if len(data[0]) == 3 and data[0][0] == '2' and data[0][1] == '5':
ddd_25.append(data)
return ddd_25
# aquire three digits capitialize Main condenser heat rejection system (code 26)
def aquire_ddd_26(self):
ddd_26 = []
for data in self.pwr12_data:
if len(data[0]) == 3 and data[0][0] == '2' and data[0][1] == '6':
ddd_26.append(data)
return ddd_26
# aquire account code and account description
def aquire_code_description(self,array):
array = np.asarray(array)
code_and_description = array[:,:2]
return code_and_description
# aquire account code and account median experience (ME)
def aquire_code_ME(self,array):
array = np.asarray(array)
code_ME = array[:,[0,3]]
return code_ME
# aquire account code and account better experience (BE)
def aquire_code_BE(self,array):
array = np.asarray(array)
code_BE = array[:,[0,2]]
return code_BE
# aquire account code and account improved total cost
def aquire_code_improved(self,array):
array = np.asarray(array)
code_improved = array[:,[0,4]]
return code_improved
# update the inflation according to year, use the cpi module (one can use other methods to convert dollars)
def inflation(self,array,year): # year is the target year to convert to
array_new = []
for data in array:
data_new = []
data_new.append(data[0])
data_new.append(data[1])
BE_new = cpi.inflate(data[2],self.data_year,to = year)
ME_new = cpi.inflate(data[3],self.data_year,to = year)
improved_new = cpi.inflate(data[4],self.data_year,to = year)
data_new.append(BE_new)
data_new.append(ME_new)
data_new.append(improved_new)
array_new.append(data_new)
return array_new
# calculate PWR 12 cost per MW
def aquire_cost_kW(self,data_direct,data_indirect):
P_pwr12 = 1147 # electrical power of pwr 12, in MW
data_direct = np.asarray(data_direct)
data_indirect = np.asarray(data_indirect)
data_direct = data_direct[:,1]
data_indirect = data_indirect[:,1]
data_direct = np.asarray(data_direct,dtype = float)
data_indirect = np.asarray(data_indirect,dtype = float)
cost_direct_tot = sum(data_direct)
cost_indirect_tot = sum(data_indirect)
cost_tot = cost_direct_tot + cost_indirect_tot
cost_kW = cost_tot/(P_pwr12*1000) # dollar per kW
return cost_kW
"""
a test class for coa_pwr12
year_curr = 2018
coa = coa_pwr12()
direct_cost_dd = coa.aquire_2_dd()
ddd_21 = coa.aquire_ddd_21()
des_21 = coa.aquire_code_description(ddd_21)
print (des_21)
ME_21 = coa.aquire_code_ME(ddd_21)
ME_2 = coa.aquire_code_ME(direct_cost_dd)
print (ME_21)
print (ME_2)
indirect_cost_dd = coa.aquire_9_dd()
direct_cost_dd_2018 = coa.inflation(direct_cost_dd,year_curr)
indirect_cost_dd_2018 = coa.inflation(indirect_cost_dd,year_curr)
print (direct_cost_dd_2018)
ME_2_2018 = coa.aquire_code_ME(direct_cost_dd_2018)
print (ME_2_2018)
ME_9_2018 = coa.aquire_code_ME(indirect_cost_dd_2018)
cost_kW_pwr12 = coa.aquire_cost_kW(ME_2_2018,ME_9_2018)
print ('PWR12 cost per kW', cost_kW_pwr12)
"""
"""
a test class for SMR_eco
sub_sys1 = 'smr'
P_unit = 50 #electrical power in MW
n_unit = 4
year = 2018
FOAK = 1
lifetime = 60 # life time the npp
eta_direct = 0.51 # oecd nea value, large uncentainty
eta_indirect = 0.51 # oecd nea value, large uncentainty
# operation and maintainess cost, dollar per MWh
om_cost_MWh = 25.8
# fuel cost, dollar per MWh
fuel_cost_MWh = 8.26
# decommisioning cost per MWh
dcms_cost_MWh = 0.16
# construction time of a unit, in year
y_unit_construct = 2
# electricty price per MWh
price_e = 130
# the utilization factor
f_uti = 0.85
# discount rate
r_discount = 0.05
# inflation rate
#r_inflation = 0.03
# energy inflation rate
e_inflation = 0.05
# config learning factors
x = 0.15
y = 0.74
z = 0.82
k = 0.02
# technology learning rate
r_learning = 0.04
smr = nuclear_eco(P_unit,n_unit,year,lifetime,FOAK)
ME_2_curr,ME_9_curr = smr.import_coa()
coa = coa_pwr12()
cost_kW_pwr12 = coa.aquire_cost_kW(ME_2_curr,ME_9_curr)
print ('PWR12 cost per kW: ', cost_kW_pwr12)
smr.cal_OCC(ME_2_curr,ME_9_curr,eta_direct,eta_indirect,x,y,z,k,r_learning)
print ('total cost of the NPP: ', '%.9e'%smr.occ)
print ('total cost of the NPP per kW: ', smr.occ_kW)
smr.cal_IDC(r_discount,y_unit_construct)
print ('total interest to pay: ', smr.idc)
smr.cal_OM_unit(om_cost_MWh,f_uti)
print ('O&M cost per unit per year: ',smr.om_unit_year)
smr.cal_fuel_unit(fuel_cost_MWh,f_uti)
print ('fuel cost per unit per year: ',smr.fuel_unit_year)
smr.cal_decommissioning_unit(dcms_cost_MWh,f_uti)
print ('decommissioning cost per unit per year: ',smr.dcms_unit_year)
smr.cal_NCF(price_e,f_uti)
cashflow = smr.cashflow
smr.cal_LCOE(r_discount,price_e,f_uti)
print ('smr levelized cost of electricity: ',smr.LCOE, ' $/MWh')
y_tot = lifetime+int((y_unit_construct*n_unit)/2)
post_process.plt_cashflow(y_tot,cashflow,sub_sys1)
smr.cal_NPV(r_discount)
print ('SMR net present value: ', smr.NPV, 'million $')
smr.cal_IRR(r_discount)
print ('SMR internal rate of return: ', smr.IRR)
print ('\n')
"""
"""
economical analysis of the wind farm
REFERENCES:
- Stehly, Tyler J., Heimiller, Donna M., and Scott, George N. 2016 Cost of Wind Energy Review. United States: N. p., 2017. Web. doi:10.2172/1415731.
- Magdi Ragheb, Chapter 25 - Economics of Wind Power Generation, Editor(s): Trevor M. Letcher, Wind Energy Engineering, Academic Press,2017,Pages 537-555,ISBN 9780128094518,doi:10.1016/B978-0-12-809451-8.00025-4.
- María Isabel Blanco,The economics of wind energy,Renewable and Sustainable Energy Reviews,Volume 13, Issues 6–7,2009,Pages 1372-1382,ISSN 1364-0321,doi:10.1016/j.rser.2008.09.004.
"""
class wind_eco:
def __init__(self,P_lim,n_unit,lifetime,con_time):
self.P_lim = P_lim
self.n_unit = n_unit
self.lifetime = lifetime
self.con_time = con_time # construction time, in year
# overnight capital cost of the wind farm
self.occ = 0.0
self.occ_unit = 0.0
# O&M cost per unit per year
self.om_unit_year = 0.0
# decommissioning cost per unit per year
self.dcms_unit_year = 0.0
# wind farm cash flow
self.cashflow = []
# wind farm LCOE
self.LCOE = 0.0
# wind farm NPV
self.NPV = 0.0
# wind farm IRR
self.IRR = 0.0
# calculate year cost under different conditions
def cal_cost_year(self,unit_op,unit_con,unit_replace):
# calculate construction occ of this year
cost_con = self.occ_unit * unit_con
# calculate construction occ of this year
cost_replace = self.occ_unit * unit_replace
# calculate operation cost of this year
cost_op = (self.om_unit_year+self.dcms_unit_year) * unit_op
cost_year = (cost_con + cost_op + cost_replace)/1e6 # convert to million dollar
return cost_year
# calculate the cost of from 0 to nth year
def cal_cost(self):
cost = []
for i in range(self.lifetime+1):
# the very beginning of the project
if i == 0:
cost.append(0.0)
elif i == 1:
cost_year = self.occ/1e6 # convert to million dollar
cost.append(cost_year)
else:
cost_year = ((self.om_unit_year+self.dcms_unit_year)*self.n_unit)/1e6 # convert to million dollar
cost.append(cost_year)
return cost
# calculate the net cash flow of from 0 to nth year
def cal_NCF(self,price_e,f_inter):
cashflow = []
# calculate hours per year, ignore leap year
hours = 365*24
for i in range(self.lifetime+1):
# the very beginning of the project
if i == 0:
cashflow.append(0.0)
elif i == 1:
cost_year = self.occ
production_year = 0.0
cashflow_year = (cashflow[-1]*1e6 + production_year - cost_year)/1e6 # convert to million dollar
cashflow.append(cashflow_year)
else:
cost_year = ((self.om_unit_year+self.dcms_unit_year)*self.n_unit)
production_year = ((self.P_lim*self.n_unit*hours*f_inter[i]) * price_e)
cashflow_year = (cashflow[-1]*1e6 + production_year - cost_year)/1e6 # convert to million dollar
cashflow.append(cashflow_year)
self.cashflow = self.cashflow + cashflow
# calculate the levelized cost of electricity used
def cal_LCOE(self,r_discount,price_e,f_inter):
# calculate hours per year, ignore leap year
hours = 365*24