## 2 Materials and Methods  
The fuel cell (FC) system, battery/ultracapacitor (UC) hybrid ESS, and FC/ESS/renewable hybrid power system (HPS) represented in Figure 1 are analyzed under dynamic load and variable power from renewable energy sources (RESs) respectively, with the preliminary results under dynamic load presented in [34]. The load profile that was chosen was up and down the stairs with levels changed at every 2 ms using a step of 1 kW (see \(P_{Load}\) at the top of Figure 2). The renewable energy profile (see \(P_{RES}\) in the 2 nd plot of Figure 2) was generated by adding the power from two renewable sources, such as the power generated by a photovoltaic park and a wind turbine farm (see \(P_{RES1}\) and \(P_{RES2}\) in the 3 rd plot of Figure 2), and the random profile with 1 kW peak (\(P_{RES3}\) in the 4 th plot of Figure 2):  
\[P_{RES}=P_{RES1}+P_{RES2}+P_{RES3} \tag{1}\]Figure 1: Fuel cell/energy storage system (FC/ESS) renewable hybrid power system (HPS) [34]. A 6 kW FC system (with the slope limits of 100 A/s for the fueling regulators and a 0.2 s time constant) was used as the backup energy source to mitigate the variability of the power flow \(p_{RES}\) from the renewable energy sources (RESs) under power-following control (PFC) implemented in the energy management strategy (EMS) unit. This PFC-based strategy operates the battery stack in the charge-sustained mode, avoiding frequent charge-discharge cycles, as is shown below, which will obviously lead to an increase in battery lifespan. The power flow balance (2) is sustained by a 100 Ah battery with a 100 F ultracapacitor energy storage system (ESS) using a semi-active ESS topology, having the battery on a 200 V DC bus and the ultracapacitors via a bidirectional DC-DC buck-boost converter (see Figure 1):  
\[C_{DC}u_{DC}du_{DC}/dt=p_{DC}+p_{RES}+p_{ESS}-p_{Load} \tag{2}\]  
where \(C_{DC}\) is the capacitor connected on the DC bus. The power difference on the DC bus, \(p_{Load}-p_{RES}\), will be mainly generated by the FC system due to the PFC-based strategy implemented for the fueling regulators. Consequently, the mean value (MV) of the battery's power exchanged with the DC bus is almost zero, except the abrupt transition on load (as it is the case of the load profile chosen in this study):  
\[P_{Batt(MV)}\cong 0\Rightarrow P_{ESS(MV)}\cong 0 \tag{3}\]  
Figure 2: Profiles of the load demand and renewable energy. This charging mode is very useful in operating a battery stack, increasing the battery lifespan, reducing its size (capacity) and maintenance costs [35; 36]. Due to the 20 s time constant of the battery used in simulation, the dynamic compensation of the power balance (2) will be ensured by capacitor \(C_{DC}\) of 0.01 F and by 100 F ultracapacitors via the bidirectional DC-DC buck-boost converter controlled by DC voltage regulation loop [37; 38]. Thus, considering (3), the MV of the power balance (2) can be written as (4):  
\[0=P_{DC(MV)}+P_{RES(MV)}-P_{Load(MV)}\Rightarrow\eta_{boost}\cdot P_{FCgen} \cong P_{DC(MV)}=P_{Load(MV)}-P_{RES(MV)} \tag{4}\]  
The FC power (\(P_{FCgen}\)) that is generated on the DC bus is the FC net power (\(P_{FCnet}\)):  
\[V_{FC}\cdot I_{FC}=P_{FCgen}=P_{FCnet}\cong P_{FC}-P_{cm} \tag{5}\]  
where \(\eta_{boost}\) is the efficiency of the DC-DC converter; \(P_{FC}\) and \(P_{FC(net)}\) is the FC-generated power and FC net power, respectively; and \(P_{cm}\) represents the power losses of the air compressor that is modeled using (6) and a 2 nd order dynamic system with a 100 Hz natural frequency and 0.7 damping ratio [39; 40]:  
\[P_{cm}=I_{cm}\cdot V_{cm}=\Big{(}a_{2}\cdot AirrP^{2}+a_{1}\cdot Airr+a_{0} \Big{)}\Big{(}b_{1}\cdot I_{FC}+b_{0}\Big{)} \tag{6}\]  
where \(a_{0}=0.6\), \(a_{1}=0.04\), \(a_{2}=-0.00003231\), \(b_{0}=0.9987\), and \(b_{1}=46.02\).