# Neural Network Approach to MPPT Control and Irradiance Estimation
## 3 Proposed MPPT Algorithm and Irradiance Estimator
### NMPPT Algorithm  
The relation between the photovoltaic output power, current and voltage is given by:  
\[P=V\cdot I=V\cdot I(V,S,T). \tag{9}\]  
The aim of the MPPT algorithm is to find the point \((V_{mpp},\,I_{mpp})\) at which the output power \(P\) is maximal:  
\[P_{mpp}=P(V_{mpp},I_{mpp})\geq P(V,I),\forall V,I. \tag{10}\]  
It is well known that, under the uniform irradiance condition, the \(P\)-\(V\) curve is strictly concave, which can be observed from Figure 2. Thus, the MPP can be found by the means of the gradient ascend rule:  
\[V_{k+1}=V_{k}+\mu\frac{\partial P_{k}}{\partial V_{k}}=V_{k}+\mu\left(I_{k}+V _{k}\times\frac{\partial I_{k}}{\partial V_{k}}\right) \tag{11}\]  
where \(k\) is the discrete time-instant, while \(\mu\) is the positive step size that controls the convergence speed. The algorithm will converge faster for the larger step size, but it will also be more sensitive to the measurement noise. There is no exact analytical approach for determining the maximal value of \(\mu\), but it can easily be tuned experimentally. As the rule of thumb, the function that changes faster requires a smaller step size.  
The photovoltaic Equation (1) has a transcendental form and could not be directly used to calculate the partial derivative in (11). On the other hand, the NN model provides the direct dependence between the current and voltage. By differentiation of (6) with respect to voltage, the required partial derivative will take a form:  
\[\frac{\partial\hat{P}_{k}}{\partial V_{k}}=\hat{I}_{k}+V_{k}\left(\mathbf{W}_{ 1,3}^{T}\odot\mathbf{W_{2}}\right)\tanh^{\prime}\left(\mathbf{W_{1}u_{k}}+ \mathbf{b}_{1}\right) \tag{12}\]  
Figure 5: The architecture of the neural networks used for MPP voltage and irradiance estimation.  
where \(\mathbf{W}_{1,3}\) is the third column of the matrix \(\mathbf{W_{1}}\) (the column which corresponds to the input \(V\)). The symbol \(\odot\) denotes the point-to-point vector product, whereas \(\tanh^{\prime}(x)=1-\tanh(x)^{2}\) is a derivative of \(\tanh(x)\).  
Note that the input and output processing function, if used, needs to be taken into account when calculating the partial derivative (12). For example, if the training datasets are preprocessed with (7), the second term in (12) then needs to be multiplied with \(\left[u_{V,\max}-u_{V,\min}\right]^{-1}\), where \(u_{V,\max}/u_{V,\min}\) is maximal/minimal value of \(V\) in the dataset.  
The NMPPT algorithm will converge faster than model-free algorithms, in which the gradient is calculated heuristically, by using the current and voltage measurements. It is worth noting that the proposed algorithm needs only one sample of the temperature and irradiance for determining the MPP. For this reason, the update rule (11) can be applied multiple times in one time instant, which will additionally increase the convergence. However, this procedure will also increase the computational complexity and, therefore, the efficient trade-off analysis between convergence and complexity is required. It is important to emphasize that the same approach cannot be applied in model-free algorithms, because they need a new current measurement for computing the next step.