-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCoutNuke.cpp
536 lines (448 loc) · 21.7 KB
/
CoutNuke.cpp
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
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <TFile.h>
#include <TTree.h>
#include <TH1.h>
#include <THStack.h>
#include <TApplication.h>
#include <TLegend.h>
#include <TCanvas.h>
#include <TPaveText.h>
#include <TPie.h>
using namespace std;
// ###################################################################################
// ###################################################################################
// Functions
// ###################################################################################
// ###################################################################################
// --------------------------------
// Levelization function
// --------------------------------
double Lev(double Val, double DiscountRate, double T0, double T1)
{
return Val / pow(1 + DiscountRate, T1 - T0);
}
// --------------------------------
// Constant Payment for a loan
// --------------------------------
double PMT(double rate, double nper, double principle)
{
double to_pay = principle * rate / (1 - pow(1 + rate, -nper));
return to_pay;
}
// --------------------------------
// Build Cost Profile
// --------------------------------
vector <double> CapexProfile_Gaus(double occ, int nt, double constr_period)
{
// Investment gaussian profile
double sigma = constr_period / 3.;
double T0 = - constr_period / 2.;
double tot = 0;
vector <double> CapexProfile (nt, 0);
for (int t(0); t < constr_period; t++)
{
double x = -constr_period + 0.5 + t;
CapexProfile[t] = exp(-(x - T0) * (x - T0) / (2.* sigma * sigma));
tot += CapexProfile[t];
}
// Normalization to unity in fabrication duration
// [3] in Haeseleer
// Overnight Construction Cost profile [year ref]
// [4] in Haeseleer
for (int t(0); t < constr_period; t++) CapexProfile[t] = CapexProfile[t] / tot * occ;
return CapexProfile;
}
// ###################################################################################
// ###################################################################################
// Main program
// ###################################################################################
// ###################################################################################
int main(int argc, char* argv[])
{
TApplication TApp ("app", &argc, argv);
// #################################################################################
// INPUT DATA
// #################################################################################
// --------------------------------
// Time steps
// --------------------------------
int NTimeSteps = 100;
// --------------------------------
// Financing Data
// --------------------------------
// Actualisation
double DiscountRate_Operation = atof(argv[1]); //0.04; => Sensitivity
double DiscountRate_LongTerm = 0.02;
// Interest for IDC (interets intercalaires)
double InterestRate_IDC = 0.08;
// --------------------------------
// Time Frame
// --------------------------------
// Investment
int ConstructionPeriod = atof(argv[2]);//9; => Sensitivity
// Operation
int ProductionStart = ConstructionPeriod;
int ProductionPeriod = 60;
int ProductionStop = ProductionStart + ProductionPeriod;
// Time at which an important maintenance is done
int ProductionPeriodBeforeMaintenance = 40;
// --------------------------------
// Project size
// --------------------------------
// Nominal Energy
double ElectricPower = 1.650e9; //[W]
// Load Factor
double LoadFactor = 0.90;
// --------------------------------
// Costs
// --------------------------------
// Reactor Overnight Cost - 3600 € / kW
//double OCC = 3600 * ElectricPower / 1.e3;
double OCC = atof(argv[3]) * 1e9; //5.e9; => Sensitivity
// - Fix Costs - Provision for dismantling - 30% du OCC
double DismantlingCost = 0.3 * OCC; //
// - Fix Costs - Provision for important maintenance - 600 € / kW
double MaintenanceCost = 600 * ElectricPower / 1.e3;
// - Fix Costs - Staff, external consumption, Central functions, taxes - CdC 2014 : 120 €/kW
double FixCost_OM = 110 * ElectricPower / 1e3;
// - Var Costs - Fuel cost - CdC : 5.2 Euro / MWh
double FuelCost = 5.2;
// - Var Costs - Spent Fuel managment provisions - CdC : 4 Euro / MWh
double SpentFuelProvisionCost = 3.8;
// --------------------------------
// Energy Production Profile
// --------------------------------
// Load Factor and energy production
vector <double> LoadFactor_Profile (NTimeSteps, 0);
vector <double> Energy_Profile (NTimeSteps, 0);
for (int t(ProductionStart); t < ProductionStop; t++)
{
LoadFactor_Profile[t] = LoadFactor;
Energy_Profile[t] = ElectricPower * LoadFactor_Profile[t] * 1e-6 * 365.25 * 24.; // MWh
}
// --------------------------------
// Investment and Interest Cost
// --------------------------------
// OCC = Overnight Construction Cost
// IDC = Interest During Construction Cost
// TIC = Total Investment Cost = OCC + IDC
vector <double> OCC_Profile (NTimeSteps, 0);
vector <double> TIC_Profile (NTimeSteps, 0);
vector <double> IDC_Profile (NTimeSteps, 0);
OCC_Profile = CapexProfile_Gaus(OCC, NTimeSteps, ConstructionPeriod);
/*
// Méthode plus officielle => Même résultat
TIC_Profile = Levelization(OCC_Profile, InterestRate_IDC, ConstructionPeriod);
for (int t(0); t < NTimeSteps; t++) IDC_Profile[t] = TIC_Profile[t] - OCC_Profile[t];
*/
//Methode plus naturelle... Même résultat
TIC_Profile[0] = OCC_Profile[0];
for (int t(1); t <= ConstructionPeriod; t++)//
//for (int t(1); t < ConstructionPeriod; t++) => CHECK si = ou pas !!! Résultat différent ici !!!
{
for (int i(0); i < t; i++)
{
IDC_Profile[t] += InterestRate_IDC * TIC_Profile[i];
}
TIC_Profile[t] = OCC_Profile[t] + IDC_Profile[t];
}
double IDC = 0.;
for (auto& n : IDC_Profile) IDC += n;
double TIC = 0.;
for (auto& n : TIC_Profile) TIC += n;
// ###################################################################################
// OUTPUT Calculation
// ###################################################################################
// --------------------------------
// Fix Costs Calulation
// --------------------------------
/*
Pour les frais futurs qui nécéssite une provision.
1 - Je calcule le cout courant @ t = futur
2 - J'actualise @ t = 0
3 - Je suppose que j'emprunte @ t= 0 et que je place
4 - Je paye une charge annuelle constante pendant la production pour rembourser l'emprunt
*/
// - Fix Costs - Constant Investment Annuity [Eco energie EDP]
double FixCost_Investment_Annuity = PMT(DiscountRate_Operation, ProductionPeriod, TIC);
// - Fix Costs - Provision for dismantling
double DismantlingCost_Levelized = Lev(DismantlingCost, DiscountRate_LongTerm, ProductionStart, ProductionStop);
double FixCost_Dismantling = PMT(DiscountRate_Operation, ProductionPeriod, DismantlingCost_Levelized);
// - Fix Costs - Provision for important maintenance
double MaintenanceCost_Levelized = Lev(MaintenanceCost, DiscountRate_LongTerm, ProductionStart, ProductionStart + ProductionPeriodBeforeMaintenance);
double FixCost_Maintenance = PMT(DiscountRate_Operation, ProductionPeriod, MaintenanceCost_Levelized);
// --------------------------------
// Costs Share and LCOE Calulation
// --------------------------------
double CostElectricity_L, Energy_L = 0;
vector <double> CostElectricity_Profile(NTimeSteps, 0);
vector <double> CostElectricity_L_Profile(NTimeSteps, 0);
vector <double> Energy_L_Profile(NTimeSteps, 0);
vector <double> FixCost_Investment_L_Profile(NTimeSteps, 0);
vector <double> FixCost_Dismantling_L_Profile(NTimeSteps, 0);
vector <double> FixCost_Maintenance_L_Profile(NTimeSteps, 0);
vector <double> FixCost_OM_L_Profile(NTimeSteps, 0);
vector <double> VarCost_Fuel_L_Profile(NTimeSteps, 0);
vector <double> VarCost_SpentFuel_L_Profile(NTimeSteps, 0);
vector <double> FixCost_Investment_Profile(NTimeSteps, 0);
vector <double> FixCost_Dismantling_Profile(NTimeSteps, 0);
vector <double> FixCost_Maintenance_Profile(NTimeSteps, 0);
vector <double> FixCost_OM_Profile(NTimeSteps, 0);
vector <double> VarCost_Fuel_Profile(NTimeSteps, 0);
vector <double> VarCost_SpentFuel_Profile(NTimeSteps, 0);
double FixCost_Investment_L, FixCost_Dismantling_L, FixCost_Maintenance_L, FixCost_OM_L = 0;
double VarCost_Fuel_L, VarCost_SpentFuel_L = 0;
for (int t(ProductionStart); t < ProductionStop; t++)
{
FixCost_Investment_Profile[t] = FixCost_Investment_Annuity;
FixCost_Dismantling_Profile[t] = FixCost_Dismantling;
FixCost_Maintenance_Profile[t] = FixCost_Maintenance;
FixCost_OM_Profile[t] = FixCost_OM;
VarCost_Fuel_Profile[t] = FuelCost * Energy_Profile[t];
VarCost_SpentFuel_Profile[t] = SpentFuelProvisionCost * Energy_Profile[t];
FixCost_Investment_L_Profile[t] = Lev(FixCost_Investment_Profile[t], DiscountRate_Operation, ProductionStart, t);
FixCost_Dismantling_L_Profile[t] = Lev(FixCost_Dismantling_Profile[t], DiscountRate_Operation, ProductionStart, t);
FixCost_Maintenance_L_Profile[t] = Lev(FixCost_Maintenance_Profile[t], DiscountRate_Operation, ProductionStart, t);
FixCost_OM_L_Profile[t] = Lev(FixCost_OM_Profile[t], DiscountRate_Operation, ProductionStart, t);
VarCost_Fuel_L_Profile[t] = Lev(VarCost_Fuel_Profile[t], DiscountRate_Operation, ProductionStart, t);
VarCost_SpentFuel_L_Profile[t] = Lev(VarCost_SpentFuel_Profile[t], DiscountRate_Operation, ProductionStart, t);
CostElectricity_Profile[t] = FixCost_Investment_Profile[t] +
FixCost_Dismantling_Profile[t] +
FixCost_Maintenance_Profile[t] +
FixCost_OM_Profile[t] +
VarCost_Fuel_Profile[t] +
VarCost_SpentFuel_Profile[t];
CostElectricity_L_Profile[t] = FixCost_Investment_L_Profile[t] +
FixCost_Dismantling_L_Profile[t] +
FixCost_Maintenance_L_Profile[t] +
FixCost_OM_L_Profile[t] +
VarCost_Fuel_L_Profile[t] +
VarCost_SpentFuel_L_Profile[t];
Energy_L_Profile[t] = Lev(Energy_Profile[t], DiscountRate_Operation, ProductionStart, t);
}
for (auto& n : CostElectricity_L_Profile) CostElectricity_L += n;
for (auto& n : Energy_L_Profile) Energy_L += n;
for (auto& n : FixCost_Investment_L_Profile) FixCost_Investment_L += n;
for (auto& n : FixCost_Dismantling_L_Profile) FixCost_Dismantling_L += n;
for (auto& n : FixCost_Maintenance_L_Profile) FixCost_Maintenance_L += n;
for (auto& n : FixCost_OM_L_Profile) FixCost_OM_L += n;
for (auto& n : VarCost_Fuel_L_Profile) VarCost_Fuel_L += n;
for (auto& n : VarCost_SpentFuel_L_Profile) VarCost_SpentFuel_L += n;
double LCOE = CostElectricity_L / Energy_L;
double Share_Capital = FixCost_Investment_L / CostElectricity_L * 100;
double Share_Dismantling = FixCost_Dismantling_L / CostElectricity_L * 100;
double Share_Maintenance = FixCost_Maintenance_L / CostElectricity_L * 100;
double Share_FixOM = FixCost_OM_L / CostElectricity_L * 100;
double Share_Fuel = VarCost_Fuel_L / CostElectricity_L * 100;
double Share_SpentFuel = VarCost_SpentFuel_L / CostElectricity_L * 100;
// ###################################################################################
// OUTPUT Writing
// ###################################################################################
cout << endl << "######################################" << endl;
//cout << "Total Electricity Production : " << << " MWh" << endl;
//cout << "Levelized Total Electricity Production : " << << " MWh" << endl;
//cout << "Total Cost Of Production : " << << " €" << endl;
//cout << "Levelized Total Cost Of Production : " << << " €" << endl;
cout << " => LCOE : " << LCOE << " Euro / MWh" << endl;
cout << "######################################" << endl << endl;
cout << "######################################" << endl;
cout << "Cost" << endl;
cout << "######################################" << endl;
cout << "------------------------------" << endl;
cout << "Investment data" << endl;
cout << "------------------------------" << endl;
cout << "Overnight Construction Cost......... : " << OCC / 1e9 << " Md €" << endl;
cout << "Interest During Construction (at " << 100.*InterestRate_IDC << "%) : " << IDC / 1e9 << " Md €" << endl;
cout << "Total Investment Cost............... : " << TIC / 1e9 << " Md €" << endl;
cout << "Fix Cost - Annuity from TStart (at " << 100.*DiscountRate_Operation << "%). : " << FixCost_Investment_Annuity / 1e9 << " Md € / year" << endl;
cout << "------------------------------" << endl;
cout << "Maintenance at t = " << ProductionPeriodBeforeMaintenance << endl;
cout << "------------------------------" << endl;
cout << "Maintenance Cost........................... : " << MaintenanceCost / 1e9 << " Md €" << endl;
cout << "Levelized Maintenance Cost................. : " << MaintenanceCost_Levelized / 1e9 << " Md €" << endl;
cout << "Fix Cost - Provision at TStart (at " << 100.*DiscountRate_Operation << "%) : " << FixCost_Maintenance / 1e9 << " Md € / year" << endl;
cout << "------------------------------" << endl;
cout << "Dismantling" << endl;
cout << "------------------------------" << endl;
cout << "Dismantling Cost............................. : " << DismantlingCost / 1e9 << " Md €" << endl;
cout << "Levelized Dismantling Cost (at " << 100.*DiscountRate_LongTerm << "%)........... : " << DismantlingCost_Levelized / 1e9 << " Md €" << endl;
cout << "Fix Cost - Provision at TStart (at " << 100.*DiscountRate_Operation << "%) : " << FixCost_Dismantling / 1e9 << " Md € / year" << endl;
cout << "------------------------------" << endl;
cout << "Operation Fix" << endl;
cout << "------------------------------" << endl;
cout << "Fix Operation Cost : " << FixCost_OM / 1e9 << " Md € / year" << endl;
cout << "------------------------------" << endl;
cout << "Fuel" << endl;
cout << "------------------------------" << endl;
cout << "Var Fuel Cost..................... : " << FuelCost << " € / MWh" << endl;
cout << "Var Fuel Cost charge @TStart...... : " << FuelCost * Energy_Profile[ProductionStart] << " € / year" << endl;
cout << "Var Spent Fuel Cost............... : " << SpentFuelProvisionCost << " € / MWh" << endl;
cout << "Var Spent Fuel Cost charge @TStart : " << SpentFuelProvisionCost * Energy_Profile[ProductionStart] << " € / year" << endl;
cout << "######################################" << endl;
cout << endl << "######################################" << endl;
cout << "Share" << endl;
cout << "######################################" << endl;
cout << "Capital : " << Share_Capital << " %" << endl;
cout << "Dismantling : " << Share_Dismantling << " %" << endl;
cout << "Maintenance : " << Share_Maintenance << " %" << endl;
cout << "Fix OM : " << Share_FixOM << " %" << endl;
cout << "Fuel : " << Share_Fuel << " %" << endl;
cout << "Spent Fuel : " << Share_SpentFuel << " %" << endl;
cout << endl;
cout << endl << "######################################" << endl;
// #################################################################################
// Build histo
// #################################################################################
TObjArray Hlist(0); // create an array of Histograms
THStack *hs_Cost = new THStack("HSCost", "Nuclear Cost");
TH1F* h;
TLegend *TL_Cost = new TLegend(0.3, 0.55, 0.9, 0.9);
TLegend *TL_Prod = new TLegend(0.5, 0.75, 0.9, 0.9);
int NBinsX = ConstructionPeriod + ProductionPeriod;
double XBinMin = -ConstructionPeriod - 0.5;
double XBinMax = ProductionPeriod - 0.5;
// Construction
h = new TH1F("TH_OCC", "Construction Cost Profile", NBinsX, XBinMin, XBinMax);
h->SetFillColor(kOrange);
for (auto t(0); t < NBinsX; t++) h->AddBinContent(t + 1, OCC_Profile[t]);
hs_Cost->Add(h);
TL_Cost->AddEntry(h, "OCC Profile", "f");
/*
h = new TH1F("TH_IDC", "IDC Profile", NBinsX, XBinMin, XBinMax);
h->SetFillColor(kOrange + 7);
for (auto t(0); t < NTimeSteps; t++) h->AddBinContent(t + 1, IDC_Profile[t]);
hs_Cost->Add(h);
TL_Cost->AddEntry(h, "IDC Profile", "f");
*/
// - Fix Charges - Capital loan
h = new TH1F("TH_Cap", "Investment charges Levelized", NBinsX, XBinMin, XBinMax);
h->SetFillColor(kRed + 2);
for (auto t(0); t < NBinsX; t++) h->AddBinContent(t + 1, FixCost_Investment_L_Profile[t]);
hs_Cost->Add(h);
TL_Cost->AddEntry(h, "Investment charges - Lev.", "f");
// - Fix Charges - Dismantling
h = new TH1F("TH_Dis", "Dismantling charges Levelized", NBinsX, XBinMin, XBinMax);
h->SetFillColor(kRed);
for (auto t(0); t < NBinsX; t++) h->AddBinContent(t + 1, FixCost_Dismantling_L_Profile[t]);
hs_Cost->Add(h);
TL_Cost->AddEntry(h, "Dismantling charges - Lev.", "f");
// - Fix Charges - Maintenance
h = new TH1F("TH_Maint", "Maintenance charges Levelized", NBinsX, XBinMin, XBinMax);
h->SetFillColor(kRed - 6);
for (auto t(0); t < NBinsX; t++) h->AddBinContent(t + 1, FixCost_Maintenance_L_Profile[t]);
hs_Cost->Add(h);
TL_Cost->AddEntry(h, "Maintenance charges - Lev.", "f");
// - Fix Charges - OM
h = new TH1F("TH_FixOM", "Fix OM charges Levelized", NBinsX, XBinMin, XBinMax);
h->SetFillColor(kRed - 6);
for (auto t(0); t < NBinsX; t++) h->AddBinContent(t + 1, FixCost_OM_L_Profile[t]);
hs_Cost->Add(h);
TL_Cost->AddEntry(h, "Fix OM charges - Lev.", "f");
// - Var Costs - Fuel
h = new TH1F("TH_Fuel", "Fuel Levelized", NBinsX, XBinMin, XBinMax);
h->SetFillColor(kGreen + 1);
for (auto t(0); t < NBinsX; t++) h->AddBinContent(t + 1, VarCost_Fuel_L_Profile[t]);
hs_Cost->Add(h);
TL_Cost->AddEntry(h, "Fuel Lev.", "f");
// - Var Costs - Spent Fuel managment provisions
h = new TH1F("TH_SpentFuel", "Fuel Managment Prov.", NBinsX, XBinMin, XBinMax);
h->SetFillColor(kGreen + 3);
for (auto t(0); t < NBinsX; t++) h->AddBinContent(t + 1, VarCost_SpentFuel_L_Profile[t]);
hs_Cost->Add(h);
TL_Cost->AddEntry(h, "Fuel Managment Prov. - Lev.", "f");
// Energy
TH1F *h_E = new TH1F("TH_E", "Energy", NBinsX, XBinMin, XBinMax);
for (auto t(0); t < NBinsX; t++) h_E->AddBinContent(t + 1, Energy_Profile[t]);
h_E->SetLineColor(kBlue + 1);
h_E->SetLineWidth(4);
TL_Prod->AddEntry(h_E, "energy Production", "l");
TH1F *h_E_L = new TH1F("TH_E_L", "Energy", NBinsX, XBinMin, XBinMax);
for (auto t(0); t < NBinsX; t++) h_E_L->AddBinContent(t + 1, Energy_L_Profile[t]);
h_E_L->SetLineColor(kBlue - 9);
h_E_L->SetLineWidth(4);
TL_Prod->AddEntry(h_E_L, "energy Production Lev", "l");
// #################################################################################
// Plot Histo
// #################################################################################
TCanvas *C1 = new TCanvas("C1", "Nuclear Cost", 10, 10, 1200, 900);
C1->Divide(2, 2);
C1->cd(1);
TH1F *h_Template = new TH1F("h_template", "Cost", 25, -ConstructionPeriod * 1.25, ProductionPeriod * 1.25);
h_Template->GetYaxis()->SetRangeUser(0, TIC * 1.5 / ConstructionPeriod);
h_Template->GetXaxis()->SetTitle("Time (y)");
h_Template->GetYaxis()->SetTitle("Price (Euro)");
h_Template->SetStats(0);
h_Template->Draw();
TL_Cost->Draw();
hs_Cost->Draw("same");
C1->Modified(); C1->Update();
C1->cd(3);
TH1F *h_Template2 = new TH1F("h_template2", "Energy", 25, -ConstructionPeriod * 1.25, ProductionPeriod * 1.25);
h_Template2->GetYaxis()->SetRangeUser(0, Energy_Profile[ConstructionPeriod] * 1.5);
h_Template2->GetXaxis()->SetTitle("Time (y)");
h_Template2->GetYaxis()->SetTitle("Energy (MWh_{electric})");
h_Template2->SetStats(0);
h_Template2->Draw();
TL_Prod->Draw();
h_E->Draw("same");
h_E_L->Draw("same");
C1->Modified(); C1->Update();
// #################################################################################
// Plot LCOE data and Pie
// #################################################################################
C1->cd(4);
TPaveText *pt = new TPaveText(0.05, 0.10, 0.95, 0.90);
pt->AddText("__________ Simulation parameters __________");
pt->AddText("----- Reactor -----");
pt->AddText(Form("Construction : %d", ConstructionPeriod));
pt->AddText(Form("Production : %d", ProductionPeriod));
pt->AddText(Form("Elec. Power : %f", ElectricPower));
pt->AddText("----- Financing -----");
pt->AddText(Form("Discount Rate Op : %f", DiscountRate_Operation));
pt->AddText(Form("Interest Rate : %f", InterestRate_IDC));
pt->AddText("----- Costs -----");
pt->AddText(Form("OCC : %f", OCC));
pt->AddText(Form("TIC : %f", TIC));
pt->AddText(Form("LCOE : %f", LCOE));
pt->Draw();
C1->Modified(); C1->Update();
C1->cd(2);
Double_t *vals = new Double_t[6];
vals[0] = Share_Capital ;
vals[1] = Share_Dismantling;
vals[2] = Share_Maintenance;
vals[3] = Share_FixOM ;
vals[4] = Share_Fuel ;
vals[5] = Share_SpentFuel ;
Int_t colors[] = {kRed + 2, kBlue - 9, kOrange, kGreen + 3, kOrange + 7, kBlue};
TPie *pie = new TPie("pie", "Cost share", 6, vals, colors);
pie->SetEntryLabel(0, "Capital"); pie->SetEntryRadiusOffset(0, .05);
pie->SetEntryLabel(1, "Dismantling"); pie->SetEntryRadiusOffset(0, .05);
pie->SetEntryLabel(2, "Maintenance"); pie->SetEntryRadiusOffset(0, .05);
pie->SetEntryLabel(3, "Fix OM"); pie->SetEntryRadiusOffset(0, .05);
pie->SetEntryLabel(4, "Fuel"); pie->SetEntryRadiusOffset(0, .05);
pie->SetEntryLabel(5, "SpentFuel"); pie->SetEntryRadiusOffset(0, .05);
pie->SetLabelsOffset(0.05) ;
//pie->SetEntryLineColor(2, 2); pie->SetEntryLineWidth(2, 5); pie->SetEntryLineStyle(2, 2);
//pie->SetEntryFillStyle(1, 3030);
pie->SetCircle(.5, .5, 0.25);
pie->Draw("nol <");
C1->Modified(); C1->Update();
TApp.Run();
cout << argv[1] << "," << argv[2] << "," << argv[3] << "," << LCOE << endl;
return 0;
}
/*
#######################
Compilation line :
#######################
g++ -o CoutNuke CoutNuke.cpp -std=c++14 `root-config --cflags --glibs`
#######################
Execution line :
#######################
./CoutNuke
*/