flasc.model_fitting.yaw_pow_fitting#

Module for fitting yaw loss power curve.

Classes

yaw_pow_fitting

Class for fitting yaw loss power curve.

class flasc.model_fitting.yaw_pow_fitting.yaw_pow_fitting(df, df_upstream=None, ti=0)[source]#

Class for fitting yaw loss power curve.

set_df(df, df_upstream, ti)[source]#

Set the dataframe for the yaw power curve fitting object.

Parameters:
  • df (pd.DataFrame) -- DataFrame containing the relevant data.

  • df_upstream (pd.DataFrame) -- DataFrame containing the upstream conditions.

  • ti (int) -- Index of the turbine to fit the yaw power curve to.

calculate_curves(vane_bounds=(-15.0, 15.0), dv=1.0, Pmin=10.0)[source]#

Calculate the yaw-power curve.

Parameters:
  • vane_bounds (tuple) -- Tuple containing the lower and upper bounds of the vane angle. Default is (-15.0, 15.0).

  • dv (float) -- Bin width for the vane angle. Default is 1.0.

  • Pmin (float) -- Minimum power value to consider. Default is 10.0.

estimate_cos_pp_fit(opt_yshift_range=None, opt_bias_range=(-15.0, 15.0), opt_pp_range=(1.0, 10.0), opt_Ns=41)[source]#

Estimate the best fit for a cos(x-x0)^pp curve.

Parameters:
  • opt_yshift_range (tuple) -- Tuple containing the lower and upper bounds for the y shift. Default is None.

  • opt_bias_range (tuple) -- Tuple containing the lower and upper bounds for the bias. Default is (-15.0, 15.0).

  • opt_pp_range (tuple) -- Tuple containing the lower and upper bounds for the power. Default is (1.0, 10.0).

  • opt_Ns (int) -- Number of samples to use for the optimization. Default is 41.

Returns:

Optimal parameters for the cos(x-x0)^pp curve.

Where x[0] is the y shift, x[1] is the bias, and x[2] is the exponent pp.

Return type:

x_opt (np.array)

plot(save_path=None, fig_dpi=250)[source]#

Plot the yaw-power curve.

Parameters:
  • save_path (str) -- Path to save the figure. Default is None.

  • fig_dpi (int) -- DPI of the figure. Default is 250.

Returns:

A tuple (matplotlib.figure.Figure, matplotlib.axes.Axes) containing the figure and axes.