flasc.model_fitting.yaw_pow_fitting.yaw_pow_fitting#
- class flasc.model_fitting.yaw_pow_fitting.yaw_pow_fitting(df, df_upstream=None, ti=0)[source]#
Bases:
object
Class for fitting yaw loss power curve.
Methods
Calculate the yaw-power curve.
Estimate the best fit for a cos(x-x0)^pp curve.
Plot the yaw-power curve.
Set the dataframe for the yaw power curve fitting object.
- 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)