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 | def orig_cost_model(m_file, args):
"""Plot pie chart for the orginal 1990 cost model.
Two plots produced: (1) Breakdown of the direct costs and (2) Direct, indirect, etc.
"""
# Read Cost Values
c21 = m_file.data["c21"].get_scan(-1) # Site and Buildings
c221 = m_file.data["c221"].get_scan(-1) # Reactor Systems
c222 = m_file.data["c222"].get_scan(-1) # Magnets
c223 = m_file.data["c223"].get_scan(-1) # Power Injection
c224 = m_file.data["c224"].get_scan(-1) # Vacuum Systems
c225 = m_file.data["c225"].get_scan(-1) # Power Conditioning
c226 = m_file.data["c226"].get_scan(-1) # Heat Transport System
c227 = m_file.data["c227"].get_scan(-1) # Fuel Handling System
c228 = m_file.data["c228"].get_scan(-1) # Instrumentation and Control
c229 = m_file.data["c229"].get_scan(-1) # Maintenance Equipment
c23 = m_file.data["c23"].get_scan(-1) # Turbine Plant Equipment
c24 = m_file.data["c24"].get_scan(-1) # Electric Plant Equipment
c25 = m_file.data["c25"].get_scan(-1) # Miscellaneous Plant Equipment
c26 = m_file.data["c26"].get_scan(-1) # Heat Rejection System
cdirt = m_file.data["cdirt"].get_scan(-1) # Plant Direct Cost
c9 = m_file.data["c9"].get_scan(-1) # Indirect Cost
ccont = m_file.data["ccont"].get_scan(-1) # Total Contingency
# Interest during construction is linked to ireactor = 1
if "moneyint" in m_file.data:
moneyint = m_file.data["moneyint"].get_scan(-1) # Interest during Construction
labels2 = [
"Plant Direct Cost",
"Indirect Cost",
"Total Contingency",
"Interest during Construction",
]
sizes2 = [cdirt, c9, ccont, moneyint]
else:
labels2 = ["Plant Direct Cost", "Indirect Cost", "Total Contingency"]
sizes2 = [cdirt, c9, ccont]
# No turbines if ireactor = 0
if c23 > 1.0e-3:
labels = [
"Magnets and Power Conditioning",
"Site and Buildings",
"Maintenance Equipment",
"Power Injection",
"Reactor Systems",
"Fuel Handling System",
"Instrumentation and Control",
"Turbine Plant Equipment",
"Heat Transport System",
"Other",
]
sizes = [
c222 + c225,
c21,
c229,
c223,
c221,
c227,
c228,
c23,
c226,
c224 + c24 + c25 + c26,
]
else:
labels = [
"Magnets and Power Conditioning",
"Site and Buildings",
"Maintenance Equipment",
"Power Injection",
"Reactor Systems",
"Fuel Handling System",
"Instrumentation and Control",
"Heat Transport System",
"Other",
]
sizes = [
c222 + c225,
c21,
c229,
c223,
c221,
c227,
c228,
c226,
c224 + c24 + c25 + c26,
]
# Setup figures
# Plot direct cost items
fig1, ax1 = plt.subplots(figsize=(8, 5))
ax1.pie(sizes, labels=labels, autopct="%1.1f%%")
ax1.axis("equal") # Equal aspect ratio ensures that pie is drawn as a circle.
# Plot overall breakdown
fig2, ax2 = plt.subplots(figsize=(8, 5))
ax2.pie(sizes2, labels=labels2, autopct="%1.1f%%")
ax2.axis("equal") # Equal aspect ratio ensures that pie is drawn as a circle.
# Save figures if option selected
if args.save:
fig1.savefig("direct_cost_pie.pdf")
fig2.savefig("cost_pie.pdf")
else:
plt.show()
|