-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
648 lines (544 loc) · 32.1 KB
/
main.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
# -*- coding: utf-8 -*-
"""
Functions for estimating electricity prices, eeg levies, remunerations and other components, based on customer type and annual demand
@author: Abuzar and Shakhawat
"""
from typing import ValuesView
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy import interpolate
from scipy.interpolate import InterpolatedUnivariateSpline
def calculate_mean_price_household(customer_type, val_yearly_demand):
"""
Parameters
----------
customer_type : Type of customer, differentiated between household and industrial customers
total_demand : yearly electricity demand for household customers in KWh/y and for industrial customers in MWh/y
Returns
-------
mean_price: average price for the customer for the next year in cents/kWh
"""
def plotting(x,y, title, x_label, y_label, name_plot):
fig = plt.figure()
values = x
plt.plot (x,y)
plt.title(title)
plt.xlabel(x_label)
plt.ylabel(y_label)
plt.xticks(x,values)
plt.xticks(rotation = 45)
fig.savefig(name_plot, dpi=fig.dpi)
def haupt_tarif(data):
#haupt_tarrif = df_with_data
df_with_data = pd.read_excel(data)
yearly_mean = df_with_data.price.mean()
haupt_tarrif = df_with_data[df_with_data["hour"].isin([8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]) & df_with_data["Day"].isin(['Wednesday', 'Thursday', 'Friday', 'Monday', 'Tuesday'])]
cond = df_with_data['hour'].isin(haupt_tarrif['hour'])
df_with_data.drop(haupt_tarrif[cond].index, inplace = True)
ht_factor = haupt_tarrif.price.mean()/yearly_mean
return ht_factor
def neben_tarif(data):
#neben_tarrif = df_with_data
df_with_data = pd.read_excel(data)
yearly_mean = df_with_data.price.mean()
neben_tarrif = df_with_data[(df_with_data["hour"].isin([1, 2, 3, 4, 5, 6, 7, 20, 21, 22, 23, 24]) & df_with_data["Day"].isin(['Wednesday', 'Thursday', 'Friday', 'Monday', 'Tuesday'])) |(df_with_data["Day"].isin(['Saturday', 'Sunday']))]
neben_tarrif.head()
cond = df_with_data['hour'].isin(neben_tarrif['hour'])
df_with_data.drop(neben_tarrif[cond].index, inplace = True)
nt_factor = neben_tarrif.price.mean()/yearly_mean
return nt_factor
ht_factor = haupt_tarif("ht_nt_price.xlsx")
nt_factor = neben_tarif("ht_nt_price.xlsx")
#household electricity prices between 2500-5000 KWh/y
household_prices = pd.read_excel(r'Energiepreisentwicklung.xlsx',sheet_name='5.8.2 Strom - € - Haushalte', skiprows = 5, nrows = 26, index_col = 0)
household_prices = household_prices.iloc[:,0]
household_prices = household_prices.reset_index()
household_prices["index"]= household_prices["index"].str.slice(start = 5)
household_prices.columns = ["year","price"]
household_prices = household_prices.set_index("year")
household_prices.index = household_prices.index.astype(str)
household_prices.index = pd.to_datetime(household_prices.index, errors='ignore')
household_prices = household_prices.astype(float)
household_prices = household_prices.resample('12M').mean()
household_prices.index = household_prices.index.astype(str)
household_prices.index= household_prices.index.str.slice(start = 0, stop = -6)
household_prices = household_prices[6:].reset_index()
household_prices = household_prices[household_prices.year >= str(2016)]
household_prices
if ((customer_type == 0) & ((val_yearly_demand >= 2500) & (val_yearly_demand <= 5000))):
print("Do you already know your electricty price?")
#print("Yes = 1 / No = 2")
print("Yes = 0 / No = 1")
#choose = 0
val = input("Enter your value: ")
val = int(val)
if (val == 0):
print("Do you have a fixed electricity price or HT/NT price structure?")
val_ht_nt = input("Enter 0 (zero) for yearly mean price and Enter 1 for HT/NT price structure: ")
val_ht_nt = int(val_ht_nt)
if (val_ht_nt == 1):
val1 = input("Enter HT value: ")
val1 = float(val1)
val2 = input("Enter NT value: ")
val2 = float(val2)
# ht_industrie_prices_without_VAT = household_prices
ht_household_prices = household_prices
ht_household_prices["year"] = ht_household_prices["year"].astype(int)
ht_year = ht_household_prices["year"]
ht_price = ht_household_prices["price"] * ht_factor
ht_new_year = np.append(ht_year, (ht_year.iloc[-1] + 1))
ht_new_price = np.append(ht_price, val1)
print(ht_new_year)
print(ht_new_price)
plotting(ht_new_year, ht_new_price, "HT Price", "Year", "Price", "images/HT Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
nt_household_prices = household_prices
nt_household_prices["year"] = nt_household_prices["year"].astype(int)
nt_year = nt_household_prices["year"]
nt_price = nt_household_prices["price"] * nt_factor
nt_new_year = np.append(nt_year, (nt_year.iloc[-1] + 1))
nt_new_price = np.append(nt_price, val2)
print(nt_new_year)
print(nt_new_price)
plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val_ht_nt == 0):
val1 = input("Enter yearly mean price for electricity: ")
val1 = float(val1)
yt_household_prices = household_prices
yt_household_prices["year"] = yt_household_prices["year"].astype(int)
yt_year = yt_household_prices["year"]
yt_price = yt_household_prices["price"]
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, (val1))
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val == 1):
yt_household_prices = household_prices
yt_household_prices["year"] = yt_household_prices["year"].astype(int)
yt_year = yt_household_prices["year"]
yt_price = yt_household_prices["price"]
f = interpolate.interp1d(yt_year, yt_price, fill_value = "extrapolate")
yt_new = f(yt_year.iloc[-1] + 1)
return yt_new
#print(p_2021 = f(yt_year.iloc[-1] + 1))
#print(yt_year.dtypes())
#yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
#yt_new_price = np.append(yt_price, (f(yt_year.iloc[-1] + 1)))
# ht_new_price = ht_new_price * ht_factor
#print(yt_new_year)
#print(yt_new_price)
#plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
def calculate_mean_price_industrial(customer_type, val_yearly_demand):
"""
Parameters
----------
customer_type : Type of customer, differentiated between household and industrial customers
total_demand : yearly electricity demand for household customers in KWh/y and for industrial customers in MWh/y
Returns
-------
mean_price: average price for the customer for the next year in cents/kWh
"""
def plotting(x,y, title, x_label, y_label, name_plot):
fig = plt.figure()
values = x
plt.plot (x,y)
plt.title(title)
plt.xlabel(x_label)
plt.ylabel(y_label)
plt.xticks(x,values)
plt.xticks(rotation = 45)
fig.savefig(name_plot, dpi=fig.dpi)
def haupt_tarif(data):
#haupt_tarrif = df_with_data
df_with_data = pd.read_excel(data)
yearly_mean = df_with_data.price.mean()
haupt_tarrif = df_with_data[df_with_data["hour"].isin([8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]) & df_with_data["Day"].isin(['Wednesday', 'Thursday', 'Friday', 'Monday', 'Tuesday'])]
cond = df_with_data['hour'].isin(haupt_tarrif['hour'])
df_with_data.drop(haupt_tarrif[cond].index, inplace = True)
ht_factor = haupt_tarrif.price.mean()/yearly_mean
return ht_factor
def neben_tarif(data):
#neben_tarrif = df_with_data
df_with_data = pd.read_excel(data)
yearly_mean = df_with_data.price.mean()
neben_tarrif = df_with_data[(df_with_data["hour"].isin([1, 2, 3, 4, 5, 6, 7, 20, 21, 22, 23, 24]) & df_with_data["Day"].isin(['Wednesday', 'Thursday', 'Friday', 'Monday', 'Tuesday'])) |(df_with_data["Day"].isin(['Saturday', 'Sunday']))]
neben_tarrif.head()
cond = df_with_data['hour'].isin(neben_tarrif['hour'])
df_with_data.drop(neben_tarrif[cond].index, inplace = True)
nt_factor = neben_tarrif.price.mean()/yearly_mean
return nt_factor
ht_factor = haupt_tarif("ht_nt_price.xlsx")
nt_factor = neben_tarif("ht_nt_price.xlsx")
#household electricity prices between 2500-5000 KWh/y
household_prices = pd.read_excel(r'Energiepreisentwicklung.xlsx',sheet_name='5.8.2 Strom - € - Haushalte', skiprows = 5, nrows = 26, index_col = 0)
household_prices = household_prices.iloc[:,0]
household_prices = household_prices.reset_index()
household_prices["index"]= household_prices["index"].str.slice(start = 5)
household_prices.columns = ["year","price"]
household_prices = household_prices.set_index("year")
household_prices.index = household_prices.index.astype(str)
household_prices.index = pd.to_datetime(household_prices.index, errors='ignore')
household_prices = household_prices.astype(float)
household_prices = household_prices.resample('12M').mean()
household_prices.index = household_prices.index.astype(str)
household_prices.index= household_prices.index.str.slice(start = 0, stop = -6)
household_prices = household_prices[6:].reset_index()
household_prices = household_prices[household_prices.year >= str(2016)]
household_prices
#industrial 2000 - 20000 MWh
industrie_prices_without_VAT = pd.read_excel(r'Energiepreisentwicklung.xlsx',sheet_name='5.8.3 Strom - € - Industrie', skiprows = 5, nrows = 26, index_col = 0)
industrie_prices_without_VAT = industrie_prices_without_VAT.iloc[:,0]
industrie_prices_without_VAT = industrie_prices_without_VAT.reset_index()
industrie_prices_without_VAT["index"]= industrie_prices_without_VAT["index"].str.slice(start = 5)
industrie_prices_without_VAT.columns = ["year","price"]
industrie_prices_without_VAT = industrie_prices_without_VAT.set_index("year")
industrie_prices_without_VAT.index = industrie_prices_without_VAT.index.astype(str)
industrie_prices_without_VAT.index = pd.to_datetime(industrie_prices_without_VAT.index, errors='ignore')
industrie_prices_without_VAT = industrie_prices_without_VAT.astype(float)
industrie_prices_without_VAT = industrie_prices_without_VAT.resample('12M').mean()
industrie_prices_without_VAT.index = industrie_prices_without_VAT.index.astype(str)
industrie_prices_without_VAT.index= industrie_prices_without_VAT.index.str.slice(start = 0, stop = -6)
industrie_prices_without_VAT = industrie_prices_without_VAT.reset_index()
industrie_prices_without_VAT = industrie_prices_without_VAT[industrie_prices_without_VAT.year >= str(2016)]
#industrial prices > 150000 MWh/y
v_big_industrial_prices_BDEW = {'year': range(2019,2021), 'price': [3.77,3.05]}
v_big_industrial_prices_BDEW = pd.DataFrame(data=v_big_industrial_prices_BDEW)
v_big_industrial_prices_BDEW
#industrial prices between 70000-150000 MWh/y
big_industrial_prices_BDEW = {'year': range(2016,2021), 'price': [8.37, 9.96, 8.96, 9.28, 10.07]}
big_industrial_prices_BDEW = pd.DataFrame(data=big_industrial_prices_BDEW)
big_industrial_prices_BDEW
#industrial prices between 20000-70000 MWh/y
mid_industrie_prices = pd.read_excel(r'mid_size_industrial_prices.xlsx')
mid_industrie_prices.columns = ['year', 'price']
mid_industrie_prices
if ((customer_type == 1) & (val_yearly_demand > 0) & (val_yearly_demand < 2000)):
print("Do you already know your electricty price?")
#print("Yes = 1 / No = 2")
print("Yes = 0 / No = 1")
#choose = 0
val = input("Enter your value: ")
val = int(val)
if (val == 0):
print("Do you have a fixed electricity price or HT/NT price structure?")
val_ht_nt = input("Enter 0 (zero) for yearly mean price and Enter 1 for HT/NT price structure: ")
val_ht_nt = int(val_ht_nt)
if (val_ht_nt == 1):
val1 = input("Enter HT value: ")
val1 = float(val1)
val2 = input("Enter NT value: ")
val2 = float(val2)
ht_industrie_prices_without_VAT = household_prices
ht_industrie_prices_without_VAT["year"] = ht_industrie_prices_without_VAT["year"].astype(int)
ht_year = ht_industrie_prices_without_VAT["year"]
ht_price = ht_industrie_prices_without_VAT["price"] * ht_factor
ht_new_year = np.append(ht_year, (ht_year.iloc[-1] + 1))
ht_new_price = np.append(ht_price, val1)
print(ht_new_year)
print(ht_new_price)
plotting(ht_new_year, ht_new_price, "HT Price", "Year", "Price", "images/HT Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
nt_industrie_prices_without_VAT = household_prices
nt_industrie_prices_without_VAT["year"] = nt_industrie_prices_without_VAT["year"].astype(int)
nt_year = nt_industrie_prices_without_VAT["year"]
nt_price = nt_industrie_prices_without_VAT["price"] * nt_factor
nt_new_year = np.append(nt_year, (nt_year.iloc[-1] + 1))
nt_new_price = np.append(nt_price, val2)
print(nt_new_year)
print(nt_new_price)
plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val_ht_nt == 0):
val1 = input("Enter yearly mean price for electricity: ")
val1 = float(val1)
yt_industrie_prices_without_VAT = household_prices
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, (val1))
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val == 1):
yt_industrie_prices_without_VAT = household_prices
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
f = interpolate.interp1d(yt_year, yt_price, fill_value = "extrapolate")
p_2021 = f(2021)
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, (f((yt_year.iloc[-1] + 1))))
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif ((customer_type == 1) & (val_yearly_demand >= 2000) & (val_yearly_demand <= 20000)):
print("Do you already know your electricty price?")
#print("Yes = 1 / No = 2")
print("Yes = 0 / No = 1")
#choose = 0
val = input("Enter your value: ")
val = int(val)
if (val == 0):
print("Do you have a fixed electricity price or HT/NT price structure?")
val_ht_nt = input("Enter 0 (zero) for yearly mean price and Enter 1 for HT/NT price structure: ")
val_ht_nt = int(val_ht_nt)
if (val_ht_nt == 1):
val1 = input("Enter HT value: ")
val1 = float(val1)
val2 = input("Enter NT value: ")
val2 = float(val2)
ht_industrie_prices_without_VAT = industrie_prices_without_VAT
ht_industrie_prices_without_VAT["year"] = ht_industrie_prices_without_VAT["year"].astype(int)
ht_year = ht_industrie_prices_without_VAT["year"]
ht_price = ht_industrie_prices_without_VAT["price"] * ht_factor
ht_new_year = np.append(ht_year, (ht_year.iloc[-1] + 1))
ht_new_price = np.append(ht_price, val1)
print(ht_new_year)
print(ht_new_price)
plotting(ht_new_year, ht_new_price, "HT Price", "Year", "Price", "images/HT Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
nt_industrie_prices_without_VAT = industrie_prices_without_VAT
nt_industrie_prices_without_VAT["year"] = nt_industrie_prices_without_VAT["year"].astype(int)
nt_year = nt_industrie_prices_without_VAT["year"]
nt_price = nt_industrie_prices_without_VAT["price"] * nt_factor
nt_new_year = np.append(nt_year, (nt_year.iloc[-1] + 1))
nt_new_price = np.append(nt_price, val2)
print(nt_new_year)
print(nt_new_price)
plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val_ht_nt == 0):
val1 = input("Enter yearly mean price for electricity: ")
val1 = float(val1)
yt_industrie_prices_without_VAT = industrie_prices_without_VAT
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, (val1))
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val == 1):
# val1 = input("Enter your preferred price: ")
# val1 = float(val1)
yt_industrie_prices_without_VAT = industrie_prices_without_VAT
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
f = interpolate.interp1d(yt_year, yt_price, fill_value = "extrapolate")
p_2021 = f(2021)
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, (f((yt_year.iloc[-1] + 1))))
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif ((customer_type == 1) & (val_yearly_demand > 20000) & (val_yearly_demand <= 70000)):
print("Do you already know your electricty price?")
#print("Yes = 1 / No = 2")
print("Yes = 0 / No = 1")
#choose = 0
val = input("Enter your value: ")
val = int(val)
if (val == 0):
print("Do you have a fixed electricity price or HT/NT price structure?")
val_ht_nt = input("Enter 0 (zero) for yearly mean price and Enter 1 for HT/NT price structure: ")
val_ht_nt = int(val_ht_nt)
if (val_ht_nt == 1):
val1 = input("Enter HT value: ")
val1 = float(val1)
val2 = input("Enter NT value: ")
val2 = float(val2)
ht_industrie_prices_without_VAT = mid_industrie_prices
ht_industrie_prices_without_VAT["year"] = ht_industrie_prices_without_VAT["year"].astype(int)
ht_year = ht_industrie_prices_without_VAT["year"]
ht_price = ht_industrie_prices_without_VAT["price"] * ht_factor
ht_new_year = np.append(ht_year, (ht_year.iloc[-1] + 1))
ht_new_price = np.append(ht_price, val1)
print(ht_new_year)
print(ht_new_price)
plotting(ht_new_year, ht_new_price, "HT Price", "Year", "Price", "images/HT Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
nt_industrie_prices_without_VAT = mid_industrie_prices
nt_industrie_prices_without_VAT["year"] = nt_industrie_prices_without_VAT["year"].astype(int)
nt_year = nt_industrie_prices_without_VAT["year"]
nt_price = nt_industrie_prices_without_VAT["price"] * nt_factor
nt_new_year = np.append(nt_year, (nt_year.iloc[-1] + 1))
nt_new_price = np.append(nt_price, val2)
print(nt_new_year)
print(nt_new_price)
plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val_ht_nt == 0):
val1 = input("Enter yearly mean price for electricity: ")
val1 = float(val1)
yt_industrie_prices_without_VAT = mid_industrie_prices
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, (val1))
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val == 1):
yt_industrie_prices_without_VAT = mid_industrie_prices
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
f = interpolate.interp1d(yt_year, yt_price, fill_value = "extrapolate")
p_2021 = f(2021)
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, (f((yt_year.iloc[-1] + 1))))
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif ((customer_type == 1) & (val_yearly_demand > 70000) & (val_yearly_demand <= 150000)):
print("Do you already know your electricty price?")
#print("Yes = 1 / No = 2")
print("Yes = 0 / No = 1")
#choose = 0
val = input("Enter your value: ")
val = int(val)
if (val == 0):
print("Do you have a fixed electricity price or HT/NT price structure?")
val_ht_nt = input("Enter 0 (zero) for yearly mean price and Enter 1 for HT/NT price structure: ")
val_ht_nt = int(val_ht_nt)
if (val_ht_nt == 1):
val1 = input("Enter HT value: ")
val1 = float(val1)
val2 = input("Enter NT value: ")
val2 = float(val2)
ht_industrie_prices_without_VAT = big_industrial_prices_BDEW
ht_industrie_prices_without_VAT["year"] = ht_industrie_prices_without_VAT["year"].astype(int)
ht_year = ht_industrie_prices_without_VAT["year"]
ht_price = ht_industrie_prices_without_VAT["price"] * ht_factor
ht_new_year = np.append(ht_year, (ht_year.iloc[-1] + 1))
ht_new_price = np.append(ht_price, val1)
print(ht_new_year)
print(ht_new_price)
plotting(ht_new_year, ht_new_price, "HT Price", "Year", "Price", "images/HT Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
nt_industrie_prices_without_VAT = big_industrial_prices_BDEW
nt_industrie_prices_without_VAT["year"] = nt_industrie_prices_without_VAT["year"].astype(int)
nt_year = nt_industrie_prices_without_VAT["year"]
nt_price = nt_industrie_prices_without_VAT["price"] * nt_factor
nt_new_year = np.append(nt_year, (nt_year.iloc[-1] + 1))
nt_new_price = np.append(nt_price, val2)
print(nt_new_year)
print(nt_new_price)
plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val_ht_nt == 0):
val1 = input("Enter yearly mean price for electricity: ")
val1 = float(val1)
yt_industrie_prices_without_VAT = big_industrial_prices_BDEW
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, val1)
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "HT Price", "Year", "Price", "images/HT Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val == 1):
yt_industrie_prices_without_VAT = big_industrial_prices_BDEW
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
f = interpolate.interp1d(yt_year, yt_price, fill_value = "extrapolate")
p_2021 = f(2021)
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, (f((yt_year.iloc[-1] + 1))))
yt_new_price = yt_new_price
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif ((customer_type == 1) & (val_yearly_demand > 150000)):
print("Do you already know your electricty price?")
#print("Yes = 1 / No = 2")
print("Yes = 0 / No = 1")
#choose = 0
val = input("Enter your value: ")
val = int(val)
if (val == 0):
print("Do you have a fixed electricity price or HT/NT price structure?")
val_ht_nt = input("Enter 0 (zero) for yearly mean price and Enter 1 for HT/NT price structure: ")
val_ht_nt = int(val_ht_nt)
if (val_ht_nt == 1):
val1 = input("Enter HT value: ")
val1 = float(val1)
val2 = input("Enter NT value: ")
val2 = float(val2)
ht_industrie_prices_without_VAT = v_big_industrial_prices_BDEW
ht_industrie_prices_without_VAT["year"] = ht_industrie_prices_without_VAT["year"].astype(int)
ht_year = ht_industrie_prices_without_VAT["year"]
ht_price = ht_industrie_prices_without_VAT["price"] * ht_factor
ht_new_year = np.append(ht_year, (ht_year.iloc[-1] + 1))
ht_new_price = np.append(ht_price, val1)
print(ht_new_year)
print(ht_new_price)
plotting(ht_new_year, ht_new_price, "HT Price", "Year", "Price", "images/HT Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
nt_industrie_prices_without_VAT = v_big_industrial_prices_BDEW
nt_industrie_prices_without_VAT["year"] = nt_industrie_prices_without_VAT["year"].astype(int)
nt_year = nt_industrie_prices_without_VAT["year"]
nt_price = nt_industrie_prices_without_VAT["price"] * nt_factor
nt_new_year = np.append(nt_year, (nt_year.iloc[-1] + 1))
nt_new_price = np.append(nt_price, val2)
print(nt_new_year)
print(nt_new_price)
plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val_ht_nt == 0):
val1 = input("Enter yearly mean price for electricity: ")
val1 = float(val1)
yt_industrie_prices_without_VAT = v_big_industrial_prices_BDEW
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, val1)
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "HT Price", "Year", "Price", "images/HT Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
elif (val == 1):
yt_industrie_prices_without_VAT = v_big_industrial_prices_BDEW
yt_industrie_prices_without_VAT["year"] = yt_industrie_prices_without_VAT["year"].astype(int)
yt_year = yt_industrie_prices_without_VAT["year"]
yt_price = yt_industrie_prices_without_VAT["price"]
f = interpolate.interp1d(yt_year, yt_price, fill_value = "extrapolate")
p_2021 = f(2021)
yt_new_year = np.append(yt_year, (yt_year.iloc[-1] + 1))
yt_new_price = np.append(yt_price, (f((yt_year.iloc[-1] + 1))))
yt_new_price = yt_new_price
print(yt_new_year)
print(yt_new_price)
plotting(yt_new_year, yt_new_price, "Price", "Year", "Price", "images/Price.png")
# plotting(nt_new_year, nt_new_price, "NT Price", "Year", "Price", "images/NT Price.png")
print("Which type of Customer category you have?")
print("Enter 0 (zero) for Household customers and 1 (one) for Industrial customers.")
val1 = input("Please enter your value: ")
val1 = int(val1)
if (val1 == 0):
print("What is your yearly electricty demand (in KWh/y)?")
val2 =input("Please enter your value: ")
val2 = float(val2)
elif(val1 == 1):
val2 = input("What is your yearly electricty demand in (MWh/y)? ")
val2 = float(val2)
# output pf the main function
price = calculate_mean_price_household(val1,val2)
price = float(price)
fixed_rate_values = {"base_price": 0, "power_price": 0, "energy_price": price}
print(fixed_rate_values)
calculate_mean_price_industrial(val1,val2)