# Parameter Identification Method of a Double-Layer Supercapacitor by Using a Real Voltage Source
## 3 Methods
### Least Squares Method (LSM) Using the External Voltage, u\({}_{\rm co}\)(t)  
As mentioned above, this section will present the application of the least squares method using the entire time series of u\({}_{\rm co}\)(t). During the acquisition of the signal, two vectors will be obtained; the first formed by the times elapsed from the beginning to the end of the measurement, t\({}_{\rm i}\), with i = 1, 2, \(\ldots\), n, and the second with the values reached by the external voltage, u\({}_{\rm coi}\), for each time instant t\({}_{\rm i}\). One of the advantages of this procedure is that it does not require the use of a high sampling frequency, which reduces the cost of the necessary instrumentation. To apply the calculation method, U\({}_{0}\), E, R\({}_{\rm c}\), and the expression of the time, t, when u\({}_{\rm co}\) would reach a certain value, that is, the function t(u\({}_{\rm co}\)) obtained in Equation (15), are available. This function can be expressed in a more compact form as follows:  
\[\rm{t=}\alpha+\beta\cdot\log(u_{\rm co}-E)+\gamma\cdot u_{\rm co}. \tag{24}\]  
To abbreviate the above expression, the constants \(\alpha\), \(\beta\), and \(\gamma\) will be defined. The first two are measured in [s], while the third is measured in [s\(\cdot\)V\({}^{-1}\)]. These constants can be expressed as a function of k\({}_{1}\), k\({}_{2}\), and k\({}_{3}\), which in turn depends on the three parameters to determinate, R, C\({}_{0}\), and k\({}_{c}\), on the variables of the RVS (E, R\({}_{\rm c}\)) and the initial cell voltage, U\({}_{0}\). Their values are as follows:  
\[\alpha=\frac{1}{k_{3}}\cdot\left[k_{1}\cdot\log\left(\frac{U_{0}-E}{k_{2}} \right)+U_{0}+\frac{R}{R_{\rm c}}\cdot E\right]. \tag{25}\]  
\[\beta=-\frac{k_{1}}{k_{3}}. \tag{26}\]  
\[\gamma=-\frac{k_{2}}{k_{3}}. \tag{27}\]Subsequently, function F, which represents the sum of the squares of the differences between the measured time instants, \(\rm{t_{i}}\), and the estimated times from (24), will be defined. The function F is expressed as follows:  
\[\rm{F=}{\sum}_{i=1}^{n}(\rm{t_{i}}-\alpha-\beta\cdot\log(\rm{u_{coi}-E})-\gamma \cdot\rm{u_{coi}})^{2}. \tag{28}\]  
The objective now is to calculate the constants \(\alpha\), \(\beta\), and \(\gamma\) that make the value F minimum. To do so, the latter will be derived with respect to each of these three parameters, and each derivative will be equal to zero. The resulting system, expressed in matrix form, is the following:  
\[\rm{ \begin{bmatrix}\sum_{i=1}^{n}\rm{t_{i}}\\ \rm{\sum_{i=1}^{n}\rm{t_{i}}\cdot\log(\rm{u_{coi}-E})}\\ \rm{\sum_{i=1}^{n}\rm{t_{i}}\cdot\rm{u_{coi}}}\end{bmatrix} =[M]\cdot \begin{bmatrix} \alpha\\ \beta\\ \gamma\end{bmatrix} = \begin{bmatrix}\rm{a_{11}}&\rm{a_{12}}&\rm{a_{13}}\\ \rm{a_{21}}&\rm{a_{22}}&\rm{a_{23}}\\ \rm{a_{31}}&\rm{a_{32}}&\rm{a_{33}}\end{bmatrix} \cdot \begin{bmatrix}\alpha\\ \beta\\ \gamma\end{bmatrix} . \tag{29}\]  
The matrix [M] is symmetric and its determinant is nonzero. The coefficient \(\rm{a_{11}}\) represents the total number of samples, \(\rm{n}\), taken from the function \(\rm{u_{co}(t)}\). The remaining elements of the matrix are as follows:  
\[\rm{a_{22}}=\sum_{i=1}^{n}(\log(\rm{u_{coi}-E}))^{2}. \tag{30}\]  
\[\rm{a_{33}}=\sum_{i=1}^{n}\rm{u_{coi}}^{2}. \tag{31}\]  
\[\rm{a_{12}}=\rm{a_{21}}=\sum_{i=1}^{n}\rm{log(\rm{u_{coi}-E})}. \tag{32}\]  
\[\rm{a_{13}}=\rm{a_{31}}=\sum_{i=1}^{n}\rm{u_{coi}}. \tag{33}\]  
\[\rm{a_{23}}=\rm{a_{32}}=\sum_{i=1}^{n}\rm{u_{coi}}.\log(\rm{u_{coi}-E}). \tag{34}\]  
Solving the equations system (29) yields the constants \(\alpha\), \(\beta\), and \(\gamma\). Once these are known, along with the values of \(\rm{k_{1}}\), \(\rm{k_{2}}\), and \(\rm{k_{3}}\), as defined in Equations (12)-(14), respectively, the parameters of the main branch of the SC can be obtained.