os.path.join(file_dir, "../windtoolkit_geo_center_us.p"))

# plot wind rose
wind_rose.plot_wind_rose()

# =============================================================================
print("Finding baseline and optimal yaw angles in FLORIS...")
# =============================================================================

# Without uncertainty
# Instantiate the Optimization object
yaw_opt = YawOptimizationWindRose(
    fi,
    df.wd,
    df.ws,
    minimum_yaw_angle=min_yaw,
    maximum_yaw_angle=max_yaw,
    minimum_ws=minimum_ws,
    maximum_ws=maximum_ws,
)

# Determine baseline power with and without wakes
df_base = yaw_opt.calc_baseline_power()

# Perform optimization
df_opt = yaw_opt.optimize()

# With uncertainty
# Instantiate the Optimization object
yaw_opt = YawOptimizationWindRose(
    fi,
Esempio n. 2
0
# freq = np.abs(np.sort(np.random.randn(len(wd))))
# freq = freq / freq.sum()

# df = wind_rose.make_wind_rose_from_user_data(wd, ws)

# plot wind rose
wind_rose.plot_wind_rose()
# plt.show()

# lkj
# Instantiate the Optimization object
yaw_opt = YawOptimizationWindRose(
    fi,
    df.wd,
    df.ws,
    minimum_yaw_angle=min_yaw,
    maximum_yaw_angle=max_yaw,
    minimum_ws=minimum_ws,
    maximum_ws=maximum_ws,
    opt_options=opt_options,
)

# Determine baseline power with and without wakes
df_base = yaw_opt.calc_baseline_power()

# Perform optimization
df_opt = yaw_opt.optimize()

print("base: ", df_base["power_baseline"])
print("opt: ", df_opt["power_opt"])

# Initialize power rose
Esempio n. 3
0
# Use simple weibull
wind_rose = wfct.wind_rose.WindRose()
freq = wind_rose.weibull(ws_list)
freq = freq / np.sum(freq)
# freq = np.ones_like(ws_list) / num_cases

# Compute and time the AEP calculation

# # Now check the timing
print("===START TEST===")
start = time.perf_counter()

# Instantiate the Optimization object
# Note that the optimization is not performed in this example.
# Assuming power is zero below 3 m/s
yaw_opt = YawOptimizationWindRose(fi, wd_list, ws_list, minimum_ws=3)

# Determine baseline power with and without wakes
df_base = yaw_opt.calc_baseline_power()

# Create wind rose DataFrame
df = pd.DataFrame({"wd": wd_list, "ws": ws_list, "freq_val": freq})

# Initialize power rose
case_name = "Example " + str(N_row) + " x " + str(N_row) + " Wind Farm"
power_rose = pr.PowerRose()
power_rose.make_power_rose_from_user_data(case_name, df,
                                          df_base["power_no_wake"],
                                          df_base["power_baseline"])

# convert to Watt-hours
Esempio n. 4
0
else:
    df = wind_rose.load(
        os.path.join(file_dir,
                     "../optimization/scipy/windtoolkit_geo_center_us.p"))

# plot wind rose
wind_rose.plot_wind_rose()

# =============================================================================
print("Finding power with and without wakes in FLORIS...")
# =============================================================================

# Instantiate the Optimization object
# Note that the optimization is not performed in this example.
yaw_opt = YawOptimizationWindRose(fi, df.wd, df.ws, minimum_ws=minimum_ws)

# Determine baseline power with and without wakes
df_base = yaw_opt.calc_baseline_power()

# Initialize power rose
case_name = "Example " + str(N_row) + " x " + str(N_row) + " Wind Farm"
power_rose = pr.PowerRose()
power_rose.make_power_rose_from_user_data(case_name, df,
                                          df_base["power_no_wake"],
                                          df_base["power_baseline"])

# Display AEP analysis
fig, axarr = plt.subplots(2, 1, sharex=True, figsize=(6.4, 6.5))
power_rose.plot_by_direction(axarr)
power_rose.report()