-
Notifications
You must be signed in to change notification settings - Fork 1
/
testFunction.py
101 lines (78 loc) · 2.33 KB
/
testFunction.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
import numpy as np
from Main_Obj import *
if __name__=="__main__":
x = np.linspace(0,500,num=500)
power = np.zeros(len(x))
for i in range(len(power)):
xHAWT = np.array([0, 500])
yHAWT = np.array([250, x[i]])
xVAWT = np.array([])
yVAWT = np.array([])
xin = np.hstack([xVAWT, yVAWT, xHAWT, yHAWT])
nVAWT = len(xVAWT)
xupper = 1000
yupper = 1000
rh = 40.
rv = 3.
rt = 5.
direction = -90.
dir_rad = (direction+90) * np.pi / 180.
U_vel = 8.
params = tuple([nVAWT, rh, rv, rt, dir_rad, U_vel])
power[i] = -1.*obj(xin,params)
plt.figure(1)
plt.plot(power,x)
plt.title('HAWT Wake Model Validation')
plt.xlabel('Power (MW)')
plt.ylabel('Location of the Second Turbine (m)')
plt.show()
for i in range(len(power)):
xHAWT = np.array([0])
yHAWT = np.array([250])
xVAWT = np.array([100])
yVAWT = np.array([x[i]])
xin = np.hstack([xVAWT, yVAWT, xHAWT, yHAWT])
nVAWT = len(xVAWT)
xupper = 1000
yupper = 1000
rh = 40.
rv = 3.
rt = 5.
direction = -90.
dir_rad = (direction+90) * np.pi / 180.
U_vel = 8.
params = tuple([nVAWT, rh, rv, rt, dir_rad, U_vel])
power[i] = -1.*obj(xin,params)
plt.figure(2)
plt.plot(power,x)
plt.title('Tower Wake Model Validation')
plt.xlabel('Power (MW)')
plt.ylabel('Location of the Second Turbine (m)')
plt.show()
x = np.linspace(0, 500,num=500)
for i in range(len(power)):
xVAWT = np.array([0, 100])
yVAWT = np.array([250, x[i]])
xHAWT = np.array([])
yHAWT = np.array([])
xin = np.hstack([xVAWT, yVAWT, xHAWT, yHAWT])
nVAWT = len(xVAWT)
xupper = 1000
yupper = 1000
rh = 40.
rv = 3.
rt = 5.
direction = -90.
dir_rad = (direction+90) * np.pi / 180.
U_vel = 8.
params = tuple([nVAWT, rh, rv, rt, dir_rad, U_vel])
power[i] = -1.*obj(xin,params)
plt.figure(3)
plt.plot(power,x)
plt.title('VAWT Wake Model Validation')
plt.xlabel('Power (MW)')
plt.ylabel('Location of the Second Turbine (m)')
plt.figure(4)
plt.scatter(0,250)
plt.scatter(np.ones(500), x)
plt.show()