# Improving the Energy Conversion Efficiency for Hydrokinetic Turbines Using MPPT Controller
## 2 Design of the MPPT Control Algorithm
According to the control theory, a dynamic system can be represented in state space form by using the following formulae:  
\[\frac{d}{dt}X=\dot{X}=A\cdot X+B\cdot Y \tag{12}\]  
\[Y=C\cdot X+D\cdot Y \tag{13}\]  
where \(\dot{X}\) is the time derivative of \(X\), called the state vector; \(Y\) is the output vector; \(A\) is the state matrix; \(B\) is the input matrix; \(C\) is the output matrix; and \(D\) is the feedback matrix. The state variables are the smallest possible subset of system variables that can represent the entire state of the system at any given time; these variables are the ones that appear in the time derivative in the equations of the system. Considering the basic schematics of both the buck and boost converters, these state variables are the current that flow in the inductance and the voltage that appears across the capacitor. Because they both are switching converters and by considering continuous current conduction (the current through the inductance is always non zero), the actual model is composed of two sub-models that follow the switch state when it is either open or closed. In the following section, the state space models are determined for both boost and buck converter. These models also include part of the parasitic elements that real components have, such as the resistance of the inductance, \(r_{L}\), the on state resistance of the switch, \(R_{on}\), and the forward voltage drop of the diode, \(U_{fd}\). They were chosen as a compromise between having a model that is closer to reality and the simulation speed. The model for the boost converter shown in Figure 4 has two states: on and off. (a) Switch is on:  
\[u_{i}=L\frac{di_{i}}{dt}+r_{L}\cdot i_{L}+R_{on}\cdot i_{L} \tag{14}\]  
\[C\frac{du_{c}}{dt}=-\frac{u_{c}}{Rs} \tag{15}\]Rearranging these equations, we obtained the following state space representation:  
\[\left[ \begin{array}{c}i_{L}\\ u_{c}\end{array} \right]=\left[ \begin{array}{cc}-\frac{T_{L}+R_{\rm m}}{L}&0\\ 0&-\frac{1}{Rs\mathcal{C}}\end{array} \right]\left[ \begin{array}{c}i_{L}\\ u_{c}\end{array} \right]+\left[ \begin{array}{c}\frac{1}{\mathcal{L}}\\ 0\end{array} \right]u_{i} \tag{16}\]  
(b) Switch is off:  
\[u_{i}=L\frac{di_{L}}{dt}+r_{L}\cdot i_{L}+U_{fd}+u_{c} \tag{17}\]  
\[C\frac{du_{c}}{dt}=\frac{i_{L}}{\mathcal{C}}-\frac{u_{c}}{Rs} \tag{18}\]  
The state space representation is:  
\[\left[ \begin{array}{c}i_{L}\\ u_{c}\end{array} \right]=\left[ \begin{array}{cc}-\frac{T_{L}+R_{\rm m}}{L}&- \frac{1}{\mathcal{L}}\\ \frac{1}{\mathcal{C}}&-\frac{1}{Rs\mathcal{C}}\end{array} \right]\left[ \begin{array}{c}i_{L}\\ u_{c}\end{array} \right]+\left[ \begin{array}{c}\frac{1}{\mathcal{L}}\\ 0\end{array} \right]u_{i}+\left[ \begin{array}{c}-\frac{1}{\mathcal{L}}\\ 0\end{array} \right]U_{fd} \tag{19}\]  
By using the averaging method over one switching period, we could determine the complete state space model of a boost converter. \[A=A1\cdot d+A2\cdot(1-d) \tag{20}\]  
\[B=B1\cdot d+B2\cdot(1-d) \tag{21}\]  
where \(d\) is the duty cycle, the amount of time the switch is on in one switching cycle. Using Equations (20) and (21), we determined the state matrix and input matrix:  
\[A=\left[ \begin{array}{cc}-\frac{r_{L}+R_{\rm m}}{L}&-\frac{1-d}{L}\\ \frac{1-d}{\mathcal{C}}&-\frac{1}{Rs\mathcal{C}}\end{array} \right],\;B=\left[ \begin{array}{c}\frac{1}{L}\\ 0\end{array} \right]u_{i}+\left[ \begin{array}{c}-\frac{1-d}{L}\\ 0\end{array} \right]U_{fd} \tag{22}\]  
The model for the buck converter is shown in Figure 5.  
The buck converter state space model was designed in a similar way to the boost converter, by writing the equations when the switch was on and off, identifying the state and output matrix, and using state averaging to obtain the full model. By using the same method, we obtained the following final state and output matrix:  
\[A=\left[ \begin{array}{cc}-\frac{r_{L}+d_{\rm R}}{L}&-\frac{1}{\mathcal{L}} \\ \frac{1}{\mathcal{C}}&-\frac{1}{Rs\mathcal{C}}\end{array} \right],\;B=\left[ \begin{array}{c}\frac{d}{L}\\ 0\end{array} \right]u_{i}+\left[