-
Notifications
You must be signed in to change notification settings - Fork 5
/
plot_comparison.py
131 lines (108 loc) · 4.27 KB
/
plot_comparison.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
"""
Plots the loads flowers
"""
import numpy as np
import matplotlib.pyplot as plt
####################################### INPUTS#####################################
#DTU 10MW
design_loads_original = np.array([
[3.706034e+05, 1.101813e+05, 5.244604e+04, #Extreme loads
2.423309e+04, -2.305209e+04, -6.270792e+04,
3.369653e+04, 6.593],
[4.779218e+04, 2.218892e+04, 1.158065e+04, #fatigue loads
1.491166e+03, 1.923159e+03, 1.871442e+04,
1.701559e+04]
])
#V1
design_loads_redesigned = np.array([
[3.942804e+05, 1.565319e+05, 5.701050e+04, #Extreme loads
2.912175e+04, -2.573848e+04, -7.283247e+04,
4.263604e+04, 8.747500e+00],
[5.645567e+04, 3.963797e+04, 1.023125e+04, #Fatigue loads
1.508731e+03, 1.028497e+03, 1.784370e+04,
2.101190e+04]
])
# #V2
# design_loads_redesigned = np.array([
# [ 3.646420e+05, 1.101813e+05, 4.978893e+04, #Extreme loads
# 2.446630e+04, -2.065615e+04, -6.937121e+04,
# 3.088640e+04, 9.401650e+00],
# [4.379754e+04 , 1.885766e+04 , 9.585024e+03 , #Fatigue loads
# 1.246914e+03, 9.654324e+02, 1.685751e+04 ,
# 1.999097e+04 ]
# ])
#V2 updated
design_loads_redesigned2 = np.array([
[ 3.320336e+05, 1.093607e+05, 5.055221e+04, #Extreme loads
2.445882e+04, -2.063784e+04, -6.646970e+04,
3.901013e+04, 9.657310e+00],
[4.281686e+04 , 1.862161e+04 , 9.503877e+03 , #Fatigue loads
1.226084e+03, 9.570726e+02, 1.560122e+04 ,
2.027070e+04 ]
])
#AEP = np.array([32919, 35553.8, 34253.4]) #[original 10MW, redesigned 10MW] MWh
AEP = np.array([32919, 34253.4, 33913.2])
AEP_percent = []
for i in range(len(AEP)-1):
percent = (AEP[i+1] - AEP[0])/AEP[0]*100
AEP_percent.append(percent)
print('V1 AEP: '+str(AEP_percent[0])+' %')
print('V2 AEP: '+str(AEP_percent[1])+' %')
######################################################################################33
comparison_extrem1 = np.divide(design_loads_redesigned[0], design_loads_original[0])
comparison_fatigue1 = np.divide(design_loads_redesigned[1],design_loads_original[1])
comparison_extrem2 = np.divide(design_loads_redesigned2[0], design_loads_original[0])
comparison_fatigue2 = np.divide(design_loads_redesigned2[1],design_loads_original[1])
ylabels= np.array(["Tower-base FA [kNm]",
"Tower-base SS [kNm]",
"Yaw-bearing pitch [kNm]",
"Yaw-bearing roll [kNm]",
"Shaft torsion [kNm]",
"OoP BRM [kNm]",
"IP BRM [kNm]",
"Tower clearance [m]"])
rads = np.arange(0, (2 * np.pi), 0.01)
r = np.ones(len(rads))
#Extrem
plt.figure(figsize=(10, 6))
plt.subplot(polar=True)
theta = np.linspace(0, 2 * np.pi, len(comparison_extrem1)+1)
comparison_extrem1 = np.append(comparison_extrem1,comparison_extrem1[0])
comparison_extrem2 = np.append(comparison_extrem2,comparison_extrem2[0])
# Arrange the grid into equal parts in degrees
lines, labels = plt.thetagrids(range(0, 360, int(360/len(ylabels))), (ylabels))
# Plot actual sales graph
plt.plot(rads, r, '--k')
plt.plot(theta, comparison_extrem1 ,'r',marker = 'D')
plt.plot(theta, comparison_extrem2 ,'b',marker = 'D')
# Add legend and title for the plot
plt.title("Extreme loads",fontsize = 15)
plt.tight_layout()
plt.legend(['DTU 10MW', "Redesign V1", "Redesign V2"], bbox_to_anchor=(1.1, 1.05))
# #Fatigue
plt.figure(figsize=(10, 6))
plt.subplot(polar=True)
theta = np.linspace(0, 2 * np.pi, len(comparison_fatigue1)+1)
comparison_fatigue1 = np.append(comparison_fatigue1,comparison_fatigue1[0])
comparison_fatigue2 = np.append(comparison_fatigue2,comparison_fatigue2[0])
theta = np.linspace(0, 2 * np.pi, len(comparison_fatigue1))
# Arrange the grid into equal parts in degrees
lines, labels = plt.thetagrids(range(0, 360, int(360/(len(ylabels)-1.2))), (ylabels[0:-1]))
# Plot actual sales graph
plt.plot(rads, r, '--k')
plt.plot(theta, comparison_fatigue1 ,'r',marker = 'D')
plt.plot(theta, comparison_fatigue2 ,'b',marker = 'D')
# Add legend and title for the plot
plt.title("Fatigue loads",fontsize = 15)
plt.tight_layout()
plt.legend(['DTU 10MW', "Redesign V1", "Redesign V2"], bbox_to_anchor=(0.1, 1.05))
## AEP comparison
fig = plt.figure()
ax = fig.add_axes([0,0,1,1])
plt.grid()
ax.set_title("IIIB AEP")
turbine = ['DTU 10MW', "Redesign V1", "Redesign V2"]
AEP= [AEP[0],AEP[1], AEP[2]]
ax.bar(turbine,AEP, color = ["grey", "red", "blue"] )
ax.set_ylabel('AEP [MWh]')
plt.show()