## 3 Real-Time Optimization-Based Strategy
### \(\lambda\)-Control Strategy
The corresponding equations are given by  
Figure 6:0  
\[\text{and }u_{X}i_{LX}=u_{X}i_{dcX}\eta_{gX}{}^{y_{gX}}\text{ with}\left\{ \begin{array}{l}\gamma_{gX}=-1,\ i_{LX}>0\\ \gamma_{gX}=1,\ i_{LX}\leq 0\end{array} \right. \tag{15}\]  
with the assumption that the DC-DC converters are well controlled (14), and the DC bus and its related controller can be reduced as well:  
\[\left\{ \begin{array}{l}u_{bus}=u_{bus\text{-}ref}\\ i=i_{t}=i_{\text{-}ref}\end{array} \right. \tag{16}\]  
According to the dynamical model of the DC bus, no internal losses are considered. The EMR and the control scheme of the corresponding reduced model are depicted in Figure 7. The accumulation elements (dynamic model) and their corresponding controllers have been replaced by conversion elements (static model). The mathematical description level consists of defining the performance index with the control variables. The hydrogen mass flow \(Q_{m}\) is defined according to the net output power \(P_{fc}\) of the fuel cell by using manufacturer's data. A second-order interpolation is then achieved to analytically express the performance index:  
\[\left\{ \begin{array}{c}Q_{m}=a{P_{fc}}^{2}+b{P_{fc}}+c\\ {P_{fc}}=\frac{{u_{bus}}{u_{fcfc}}}{{\eta_{fc}}}\end{array} \right. \tag{17}\]  
were \(a\), \(b\), and \(c\) are the interpolation coefficients. It may be noticed that the performance index \(J\) is expressed with \(i_{dcb\text{-}rf}\) and \(i_{dcfc\text{-}rf}\) the control variables:  
\[J=\int_{t_{0}}^{t}\!\!\left(a\!\left(\frac{u_{bus}i_{dcfc\text{-}rf}}{\eta_{ gc}}\right)^{2}+b\frac{u_{bus}i_{dcfc\text{-}rf}}{\eta_{gf}}+c+A_{b}\!\left( \frac{u_{bus}i_{dcb\text{-}rf}\eta_{gb}^{\gamma_{gb}}}{u_{b}}\right)^{2}\! \right)dt \tag{18}\]  
The control problem resolution aims to find the right values of the control variables to comply with the optimal control problem formulation. In this paper, the considered optimal method is the \(\lambda\)_-control_, which is based on the calculus of variations [39]. This consists in minimizing at each time the Hamiltonian function H defined by  
\[ \begin{array}{l}H=a\!\left(\frac{u_{bus}i_{dc\text{-}rf}}{\eta_{ gc}}\right)^{2}\!+b\frac{u_{bus}i_{dc\text{-}rf}}{\eta_{ gc}}+c\\ +A_{b}\!\left(\frac{u_{bus}i_{dc\text{-}rf}\eta_{gb}^{\gamma_{gb}}}{u_{b}} \right)^{2}+\lambda_{sc\text{-}rf}(t)\frac{d}{dt}E_{sc}+\lambda_{b\text{-}rf}( t)\frac{d}{dt}E_{b}\end{array}  \tag{19}\]  
The control variables expressions can be deduced from  
\[\left\{ \begin{array}{c}\frac{\partial H}{\partial u_{dc\text{-}rf}}=0\\ \frac{\partial H}{\partial i_{dcb\text{-}rf}}=0\end{array} \right. \tag{20}\]  
if no minimum of \(H\), within the boundaries of the control variables (\(i_{dc\text{-}rf}\) and \(i_{dcb\text{-}rf}\)), is assumed. This leads to the expressions  
\[i_{dcfc\text{-}rf}=-\frac{\eta_{gf}^{2}c\eta_{gsc}^{\gamma_{gc}^{gc}}\lambda_ {sc\text{-}rf}+\eta_{gfc}b}{2u_{bus}a} \tag{21}\]  
Figure 7: Energetic macroscopic representation and control scheme of the reduced model. \[\text{and}\ i_{\text{\emph{dch-ref}}}=\frac{\left(\eta_{gb}^{y^{\prime}_{gb}}\lambda_ {b\text{-ref}}-\eta_{gsc}^{y^{\prime}_{gc}}\lambda_{sc\text{-ref}}\right)\mu_{b} ^{2}}{2A_{b}\eta_{gb}^{2y^{\prime}_{gb}}u_{bus}} \tag{22}\]  
The values of \(a\), \(b\), \(c\) and \(\eta_{gX}\) are deduced from look-up tables defined offline. The key parameters are the Lagrange multipliers \(\lambda_{b\text{-\emph{ref}}}\) and \(\lambda_{sc\text{-\emph{ref}}}\). They allow to respect the constraints on the state variables from (10) to (13). However, these parameters are suited for specific driving conditions and can be precisely calculated when the data of the future driving cycle data are known a priori. As a possible solution for real time, the \(\lambda\)_-control_ aims to vary the Lagrange multipliers by using a feedback control to comply with any driving condition [16; 40]. In this research, priority is given to the physical limits of the secondary energy storage sources.