## 3 The Establishment of the Photovoltaic Array Fault Diagnosis Model
### The Establishment of the Initial LSSVM Multi-Classifiers Model  
#### 3.1.1 The Method of LSSVM Classifier  
In [22], [PERSON] and [PERSON] present the LSSVM, which uses the least squares linear system error square and loss function as the empirical loss of training sample set, changing the constraint condition from inequation to equation; then, the convex quadratic programming problem transforms and is able to solve the problem of linear equations, and calculation speed of the model is improved.  
The objective function and constraint condition of LSSVM are:  
\[\left\{\begin{array}{l}\min\frac{1}{2}\|\mathbf{\omega}\|^{2}+C\sum \limits_{i=1}^{g}\epsilon_{i}\\ s.t\,y_{i}[(\mathbf{\omega}\ast x_{i})+b]=1-\epsilon_{i},\epsilon_{i}\geq 0,i=1, \ldots,g\end{array}\right. \tag{6}\]  
In the above linear equations, \(\mathbf{\omega}\) is the weight vector, \(C\) is the penalty factor, \(g\) is the number of training samples, \(\epsilon\) is slack variable, \(\epsilon_{i}\) is the \(i\)th component of the slack variable \(\epsilon\), \(x_{i}\in R^{\text{m}}\) is the training sample, and \(\text{m}\) is the dimension of the training sample's feature vectors; in this paper,\(I_{\text{m}}\) presents the output characteristics \(U_{\text{OC}}\), \(I_{\text{SC}}\), \(U_{\text{m}}\), \(I_{\text{m}}\) and equivalent circuit internal parameters \(I_{\text{ph}}\)', \(R_{\text{s}}\)', \(R_{\text{sh}}\)' of photovoltaic array; \(y_{i}\in y=\{1,-1\}\) is the output; \(y_{i}\) presents the states of short circuit, open circuit, abnormal aging, and normal; \(b\) is the classification threshold.  
The above optimization problem is the convex quadratic programs of \(\mathbf{\omega}\) and \(b\), so we introduce the Lagrangian function, which can be constructed as follows:  
\[J(\mathbf{\omega},b,\alpha)=\frac{1}{2}\
orm{\mathbf{\omega}}^{2}+C{\sum\limits_{i=1}^ {g}\varepsilon_{i}}\ -{\sum\limits_{i=1}^{g}\alpha_{i}\Big{[}y_{i}\Big{(}\mathbf{\omega}^{ \text{T}}K\big{(}x_{i},x_{j}\big{)}+b\Big{)}-1+\varepsilon_{i}\Big{]}} \tag{7}\]  
In the Formula (7), \(\alpha\) is the Lagrangian multiplier, and \(K\left(x_{i},x_{j}\right)\) is the kernel function.  
The Lagrangian function converts the primal problem (6) into the dual problem (8)  
\[\left\{\begin{array}{c}\min\frac{1}{2}{\sum\limits_{i=1}^{g}\sum\limits_{j=1 }^{g}y_{i}y_{j}K\big{(}x_{i},x_{j}\big{)}\alpha_{i}\alpha_{j}-\sum\limits_{j=1 }^{g}\alpha_{j}\\ s.t.\sum\limits_{i=1}^{g}y_{i}\alpha_{i}=0,\\ 0\leq\alpha_{i}\leq C,\ i=1,\ldots,g\end{array}\right. \tag{8}\]  
Through Equation (8), we can get:  
\[\alpha^{*}=\big{(}{\alpha_{1}}^{*},\ldots{\alpha_{g}}^{*}\big{)}^{T}\]  
\[\omega^{*}=\sum\limits_{i=1}^{g}{\alpha_{i}}^{*}y_{i}x_{i},\ {\alpha_{i}}^{*}\in(0,C)\]  
\[b^{*}=y_{i}-\sum\limits_{i=1}^{g}{\alpha_{i}}^{*}y_{i}K\big{(}x_{i},x_{j}\big{)},\ {\alpha_{i}}^{*}\in(0,C)\]  
The optimal hyperplane is constructed, then the decision function is obtained:  
\[f(x)=\text{sgn}\{\sum\limits_{i=1}^{g}\alpha^{*}y_{i}K\big{(}x_{i},x_{j}\big{)} +b^{*}\} \tag{9}\]  
Through the above problem-solving procedure, the LSSVM multi-classifiers model is built. In order to obtain the optimal LSSVM multi-classifiers, we can optimize the parameters of \(C\) and \(K\left(x_{i},x_{j}\right)\).