# Solar Power Prediction Modeling Based on Artificial Neural Networks under Partial Shading
## 4 Learning Parameter and Simulation
With the help of the ANN model in Figure 10, the partial shading condition solar system module with a bypass diode connected can be represented as Figure 11.  
Figure 10: Artificial neural network SPICE model using MATLAB/Simulink. Figure 9: I–V characteristics curve under standard conditions for the KC200 GT model. When the photovoltaic system operates under partial shading conditions, as shown in Figure 11, the I-V characteristics curves vary depending on the number of bypass diodes connected. The number of bypass diodes directly affects the number of maximum power points (MPP). The I-V characteristics curves under partial shading conditions, according to the number of bypass diodes, are shown in Figure 12a,b [21]. Figure 12a corresponds to a model with two bypass diodes connected, whereas Figure 12b corresponds to a model with three bypass diodes connected. The data represented by the lines are the ANN data. Taking into account some errors generated in the parameters and the graph-extraction process, the measurement and ANN data are consistent. This study focuses on irradiation, and Figure 12a,b illustrate the results of varying the irradiation inputs of for each artificial neural network model in Figure 11. By using Figure 12a,b, it is possible to plot the P-V characteristic curves of Figure 13a,b. It can be observed that the number of cells divided by the bypass diode corresponds to the occurrence of MPPs. Figure 11: MATLAB/Simulink model for a photovoltaic system connected with a bypass diode. Figure 8:0 I–V characteristics curve of a photovoltaic system under partial shading conditions (**a**) with two bypass diodes connected and (**b**) with three bypass diodes connected. MSE (Mean Squared Error) is used to calculate the error between measured data and predicted data, and it is calculated as follows:  
Figure 8:1  
where \(n\) is the number of the data point, \(y_{i}\) is the measurement value of the \(i\)th data point and \(\overset{\sim}{y_{i}}\) is the ANN value of the \(i\)th data point. Figure 14a shows the differences between the measured current and the predicted current of the model with two connected bypass diodes for an input of 1000-800 W/m\({}^{2}\) and 1000-500 W/m\({}^{2}\). The differences between the measured current and the predicted current are shown in Figure 14b, when the model with three connected bypass diodes is utilized for an input of 1000-800-300 W/m\({}^{2}\) and 1000-500-300 W/m\({}^{2}\). The results in Figure 14a,b are based on the same training data, with only differences in the number of connected bypass diodes and the number of cells per module. As a result, the errors are similar. The proposed model in this study exhibits even better performance with a maximum MSE of 0.15, while the smallest MSE achieved in the previous works was 0.32 [22]. Figure 8:2 (**a**) The error between the measured current and the predicted current for the model with two connected bypass diodes. (**b**) The error between the measured current and the predicted current for the model with three connected bypass diodes. Figure 8:3 P–V characteristics curve of a photovoltaic system under partial shading conditions (**a**) with two bypass diodes connected and (**b**) with three bypass diodes connected.