## 2 Methodology
### Electrical Model of the B Pack and the UC Bank  
In the powertrain you need a B pack and a UC bank to meet the vehicle charge demand; in this situation parameters \(n_{sb}\) and \(n_{pb}\) are established as the number of batteries in series and in parallel, and \(n_{suc}\) and \(n_{puc}\) are the number of ultracapacitors in series and in parallel, respectively. The total power of the battery pack (Figure 7) is determined by the following expression:  
\[P_{bo}^{T}=V_{bo}^{T}I_{bo}^{T} \tag{11}\]  
where \(V_{bo}^{T}\) is the total voltage provided by the B pack and \(I_{bo}^{T}\) is the total current provided by the B pack. The variable \(V_{bo}^{T}\) is described by the following equation:  
\[V_{bo}^{T}=n_{sb}\ V_{b}^{0}-V_{bc}-R_{bs}I_{b}) \tag{12}\]  
The total current of the B pack \(I_{bo}^{T}\) is given by the following equation:  
\[I_{bo}^{T}=n_{pb}I_{b} \tag{13}\]  
Figure 7: Multiple converter configuration diagram. where \(n_{bp}\) is defined as the number of batteries connected in parallel. By replacing Equation (13) in Equation (11) \(l_{b}\) is calculated as follows:  
\[l_{b}=\frac{{{P_{bo}}^{T}}}{{n_{pb}}{{V_{bo}}^{T}}} \tag{14}\]  
To calculate the current flowing through each of the batteries, Equation (14) is replaced by Equation (12) giving us:  
\[I_{b}=\frac{{{P_{ob}}^{T}}}{{n_{pb}}({n_{sb}}({{V_{b}}^{0}}-{{V_{bc}}}-{{R_{bs }}}{{I_{b}}}))} \tag{15}\]  
Quadratic Equation (14) is used to calculate the values of \(I_{B}\):  
\[I_{b}=\frac{{{V_{b}}^{0}}-{{V_{bc}}}}{{2{R_{bs}}}}\mp\sqrt{{\left({\frac{{{V_{ b}}^{0}}-{{V_{bc}}}}{{2{R_{bs}}}}}\right)^{2}}-\frac{{{P_{bo}}^{T}}}{{n_{pb}}{n_{ sb}}{R_{bs}}}} \tag{16}\]  
From the previous equation it is seen that there are two values of \(I_{b}\); the negative value is taken as it represents the real values of \(I_{b}\). The UC bank also supplies power to the load and is calculated as:  
\[{{P_{uo}}^{T}}{={V_{uco}}^{T}}{{I_{uuc}}^{T}} \tag{17}\]  
where \({{I_{uuc}}^{T}}\) is the total current that depends on the current flowing in each ultracapacitor and \({{V_{uco}}^{T}}\) represents the voltage dynamics of the UCs and is calculated as follows:  
\[{{V_{uco}}^{T}}{={n_{suc}}\left({{V_{uc}}-{R_{usc}}}{{I_{uc}}}\right)} \tag{18}\]  
The total current of the UCs is calculated through the number of ultracapacitors connected in parallel and calculated as:  
\[{{I_{uuc}}^{T}}={n_{puc}}{{I_{uc}}} \tag{19}\]  
where \({{I_{suc}}}\) can be calculated from the previous equation:  
\[V_{bo}^{T}=n_{sb}\ V_{b}^{0}-V_{bc}-R_{bs}I_{b}) \tag{12}\]0  
In Equations (8) and (9), \({{P_{b\_courv}}}\) and \({{P_{uc\_courv}}}\) are the powers at the output of the converters of the B pack converters and the UC bank, and are calculated from the total power of the B pack and of the UC bank in conjunction with their respective efficiencies (\({\eta_{b\_courv}}\) and \({\eta_{uc\_courv}}\)). Through this, the demand for load power is determined as follows:  
\[V_{bo}^{T}=n_{sb}\ V_{b}^{0}-V_{bc}-R_{bs}I_{b}) \tag{12}\]1  
Using the previous equation, \({{P_{uc}}^{T}}\) is expressed as follows:  
\[V_{bo}^{T}=n_{sb}\ V_{b}^{0}-V_{bc}-R_{bs}I_{b}) \tag{12}\]2  
Substituting Equations (17) and (19) into (22), we get the values of \({{I_{uc}}}\):  
\[V_{bo}^{T}=n_{sb}\ V_{b}^{0}-V_{bc}-R_{bs}I_{b}) \tag{12}\]3Note that until now the dynamic model of the converter was not necessary since the power transfer is carried out independently of the converter type. Note that in the equations of currents \(I_{b}\) and \(I_{uc}\) the values within the radical must be greater than zero for the values of the currents to be real numbers. This limits the number of Bs and UCs in series and parallel in the powertrain depending on the maximum power of both energy sources and load demand.