## 2 Materials and Methods
### An Enhanced Approach to Wind Power Curve Optimization via the Improved PCF Algorithm
#### 2.1.3 Refinement of the PCF Algorithm  
As delineated in Figure 1, the refined PCF algorithm commences with the standardized corrections of power data categorized by the Bin method, culminating in the acquisition of finalized wind speed-power datasets. A pivotal enhancement involves the integration of a ridge regression regularization component into the PCF framework, traditionally grounded in the least squares methodology. This addition, coupled with the employment of B-spline fitting for segmented modeling, facilitates the derivation of a theoretically ideal static power curve. The algorithm operates on the following foundational principles:  
1. PCF Algorithm Foundation: Consider a training dataset represented by: \[D=[(x_{1},y_{1}),(x_{2},y_{2}),(x_{3},y_{3})\dots(x_{N},y_{N})]\] (6) At its core, the polynomial fitting approach functions as a linear model articulated by the following equation: \[y(x,\omega)=\sum_{j=0}^{M}\omega_{j}x_{i}^{j}\] (7)  
In this formula, M is the highest degree of the polynomial, \(x_{i}^{j}\) represents the j-power of \(x_{i}\), and \(\omega_{j}\) is the coefficient of \(x_{i}^{j}\). The crux of the fitting process lies in devising an error metric to evaluate the accuracy of the polynomial approximation. This involves formulating a model parameterized by \(\theta\), which, upon processing x inputs, yields predicted outcomes. The model's refinement phase employs training data \(x_{i}\) to generate predictions, subsequently measuring the deviation L from the actual values \(y_{i}\). Model optimization is achieved by iteratively adjusting parameter \(\theta\) to minimize this discrepancy until an optimal congruence between prediction and reality is attained. The error metric is thus a function crafted to quantify the disparity between these predicted and actual values, encapsulated by \(\theta\). The dataset encompasses N samples, with each \(x_{n}\) being associated with an output \(t_{n}\). Adopting square loss as the evaluation metric and introducing coefficients \(\frac{1}{2}\) to streamline computations, the loss function, upon integration of the model and training data, is articulated as  
\[E(\omega)=\frac{1}{2}\sum_{n=1}^{M}\{y(x_{n},\omega)-t_{n}\}^{2} \tag{8}\]  
Figure 1: Improved PCF algorithm flow. Taking the partial derivative \(\omega_{j}\) and setting it to zero,  
\[ \begin{array}{c}Let\frac{\partial L(\omega)}{\partial\omega_{k}}=0\Rightarrow\\ \frac{1}{2}\sum\limits_{i=1}^{N}2\left(\sum\limits_{j=0}^{M}\omega_{j}x_{i}^{j }-y_{i}\right)x_{i}^{j+k}=0\Rightarrow\\ \sum\limits_{i=1}^{N}\sum\limits_{j=0}^{M}\omega_{j}x_{i}^{j}=\sum\limits_{i= 1}^{N}x_{i}^{k}y_{i}(k=0,1,2\ldots,M)\end{array}  \tag{9}\]  
The quest for polynomial coefficients \(\omega_{0}^{*},\omega_{1}^{*},\omega_{2}^{*},\ldots,\omega_{M}^{*}\) necessitates solving the ensuing system of linear equations:  
\[ \begin{bmatrix}N&\sum X_{i}&\ldots&\sum X_{i}^{M}\\ \sum X_{i}&\sum X_{i}^{2}&\ldots&\sum X_{i}^{M+1}\\ \sum X_{i}^{2}&\sum X_{i}^{3}&\ldots&\sum X_{i}^{M+2}\\ \sum X_{i}^{M}&\sum X_{i}^{M+1}&\ldots&\sum X_{i}^{2M}\end{bmatrix}\begin{pmatrix} \omega_{0}\\ \omega_{1}\\ \omega_{2}\\ \vdots\\ \omega_{m}\end{pmatrix} = \begin{bmatrix}\sum y_{i}\\ \sum x_{i}y_{i}\\ \sum x_{i}^{2}y_{i}\\ \vdots\\ \sum x_{i}^{M}y_{i}\end{bmatrix}  \tag{10}\]  
The calculation is as follows:  
\[\sum\limits_{i=1}^{N}x_{i}^{j}(j=0,1,2,\ldots,2M) \tag{11}\]  
\[\sum\limits_{i=1}^{N}x_{i}^{j}y_{i}(j=0,1,2,\ldots,M) \tag{12}\]  
Substituting these determinations into the system facilitates the resolution of the polynomial coefficients, marking the completion of the model's optimization. 2. B-Spline Fitting Algorithm  
The utilization of the PCF algorithm for wind power curve modeling has shown commendable efficacy in the segments preceding the turbine's rated power output. However, its fitting effect tends to wane in the sections post-rated power, where data stability is more pronounced.