Skip to content

Commit

Permalink
update layout optimization examples
Browse files Browse the repository at this point in the history
  • Loading branch information
bayc committed Feb 15, 2024
1 parent 9910b44 commit 912e480
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
11 changes: 2 additions & 9 deletions examples/15_optimize_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,9 @@
# Setup 72 wind directions with a random wind speed and frequency distribution
wind_directions = np.arange(0, 360.0, 5.0)
np.random.seed(1)
wind_speeds = 8.0 + np.random.randn(1) * 0.5
wind_speeds = 8.0 + np.random.randn(1) * 0.5 * np.ones_like(wind_directions)
# Shape frequency distribution to match number of wind directions and wind speeds
freq = (
np.abs(
np.sort(
np.random.randn(len(wind_directions))
)
)
.reshape( ( len(wind_directions), len(wind_speeds) ) )
)
freq = (np.abs(np.sort(np.random.randn(len(wind_directions)))))
freq = freq / freq.sum()

fi.reinitialize(wind_directions=wind_directions, wind_speeds=wind_speeds)
Expand Down
4 changes: 2 additions & 2 deletions examples/16c_optimize_layout_with_heterogeneity.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
# and 1 wind speed with uniform probability
wind_directions = [270., 90.]
n_wds = len(wind_directions)
wind_speeds = [8.0]
wind_speeds = [8.0] * np.ones_like(wind_directions)
# Shape frequency distribution to match number of wind directions and wind speeds
freq = np.ones((len(wind_directions), len(wind_speeds)))
freq = freq / freq.sum()
Expand Down Expand Up @@ -165,7 +165,7 @@
print(
'Turbine geometric yaw angles for wind direction {0:.2f}'.format(wind_directions[1])\
+' and wind speed {0:.2f} m/s:'.format(wind_speeds[0]),
f'{layout_opt.yaw_angles[1,0,:]}'
f'{layout_opt.yaw_angles[1, :]}'
)

plt.show()

0 comments on commit 912e480

Please sign in to comment.