## 4 Energy Management Systems
### Rule-based Energy Management Systems
#### 4.1.5 Conventional Fuzzy Logic Control (FLC)  
The FLC approach determines continuous values through a series of predetermined rules, membership functions, as well as inputs that are not precise [81]. The rules are established based on the user's understanding, which can lead to suboptimal control. However, this can be enhanced through the utilization of an optimization technique for adjusting the membership functions. The standard FLC was executed and optimized using the gradient descent approach combined with a sequential quadratic programming (SQP) algorithm in the context of Simulink Design Optimization. The FLC system was designed with efficiency in mind, utilizing only two inputs, load power and battery SOC, to generate a single output, the FC power. The user's expertise is integrated into the system through a comprehensive set of rules that guide the FLC's output based on the input conditions. One example of these rules could be as follows: \"if the SOC level is high and the power load is low, then the FC output should be set at a low level\". All the rules that are utilized by the system are presented in Table 4 for easy reference. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**State** & **SOC** & **Load Power** & **FC Power** \\ \hline
1 & High & \(P_{Load}<P_{FC,min}\) & \(P_{FC,min}\) \\
2 & High & \(P_{FC,min}<P_{Load}<P_{FC,max}\) & \(P_{Load}\) \\
3 & High & \(P_{Load}>P_{FC,max}\) & \(P_{FC,max}\) \\
4 & Normal & \(P_{Load}<P_{FC,opt}\) & \(P_{FC,opt}\) \\
5 & Normal & \(P_{FC,opt}<P_{Load}<P_{FC,max}\) & \(P_{Load}\) \\
6 & Normal & \(P_{Load}>P_{FC,max}\) & \(P_{FC,max}\) \\
7 & Low & \(P_{Load}<P_{FC,max}\) & \(P_{Load}+P_{charge}\) \\
8 & Low & \(P_{Load}>P_{FC,max}\) & \(P_{FC,max}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Comparison of the state machine control status [79]. Figure 16: Energy management systems: (**a**) rate limited power, (**b**) equivalent consumption minimization strategy (ECMS), (**c**) PI control, (**d**) state machine control (SMC), and (**e**) fuzzy logic control (FLC) [80]. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline \multirow{2}{*}{**FC Power**} & \multicolumn{5}{c}{**Load Power**} \\ \cline{2-7}  & & **NH** & **NM** & **NL** & **PL** & **PM** & **PH** \\ \hline SOC & L & L & L & H & H & H \\  & M & L & L & L & M & M & H \\  & H & L & L & L & L & L & M \\ \hline \hline \end{tabular}
\end{table} 
Table 4: FLC rules {Positive (P), Negative (N), Low (L), Medium (M), High (H)} [80]. The objective of the optimization process was to reduce the deterioration cost through adjusting the parameters of the consequent membership function, all while ensuring that the SOC of the battery would not drop below 45%, starting from an initial point of 50%. The cost associated with degradation, represented by \(D_{cost}\), was precisely calculated by:  
\[D_{cost}= \propto\left(C_{fc}*D_{fc}\right)+\beta(C_{b}*D_{b}) \tag{6}\]  
The FC system cost, \(C_{fc}\), has been set according to the Department of Energy's (DoE) 2020 goal of USD 30 per kilowatt, while its degradation is \(D_{fc}\). The battery unit's cost, \(C_{b}\), follows the DoE 2020 aim of USD 125 per kilowatt hour, and its degradation is \(D_{b}\). The end-of-life (EoL) of the battery unit is assumed to be 80% of its initial capacity at the beginning-of-life (BoL). The degradation of the battery pack is determined by considering the 2 Ah capacity of each cell. \[D_{b}=\frac{C_{loss}[\text{mAh}]}{400} \tag{7}\]  
The calculation of the FC degradation, \(D_{fc}\), was established by evaluating the reduction in electrochemical surface area (ECSA) percentage under end-of-life conditions, where the ECSA was set at 27% remaining. The degradation constants \(\propto\) and \(\beta\) can standardize the cost comparison; however, for this optimization process, both constants were established as one [82]. The fuzzy logic controller block was utilized to incorporate the FLC into the Simulink model, bridging it to the fuzzy inference system (FIS) located within MATLAB.