\chapter{Energy Management Optimization}
\section{Optimization Problems}
In general vehicle propulsion design systems are in general at least three different optimization problems:

\begin{itemize}
	\item structural optimization where the best powertrain structure is examined;
	\item parametric optimization where the best parameters for a fixed powertrain structure are examined;
	\item control system optimization where the goal is to find the best possible supervisory control algorithms.
\end{itemize}

Unfortunately these three elements are not independent and in the presence, there is no optimization method which would deal with all aspects simultaneously.

The control algorithms results are influenced by the chosen driving profile and especially by their causal or non-causal design. In the first case, the optimization is based only on the past and present data. In the second case, the supervisory control algorithm also utilizes future driving profile information to determine the optimal driving policy. In general, this information is obtained with trip planning instruments such as GPS and on-line traffic situation information.

The difference between casual and non-casual solutions can show the quality of control. Usually, if the casual solution achieves 95~\% of non-casual solutin quality, there is not much ways how to do better~\cite{guzzela07}.


\section{Optimization Methods}
In general terms, optimization means to find an optimal solution of a given problem. The main objective of energy optimization is to decrease the overall energy use of the vehicle for a given route. The task is usually restricted by some constraints i.e. drivability or components characteristics.

In the simplest case of a real function, the optimal solution is the maximal or the minimal value. In more complicated problems, we try to find the best available set of decision values which maximize or minimize the cost function under other system constraints.

There is a variety of methods which are adapted for different conditions and situations. The most intuitive and rather simple to implement are heuristic methods based on Boolean or fuzzy rules. These techniques can provide good results when properly tuned. Unfortunately, their control quality strongly depends on the chosen threshold, which can vary continuously during the driving cycle. These facts were the main reasons to develop model-based methods that optimize energy consumption. Two available approaches are static and dynamic optimization methods.

Speaking about the first one, only duty-cycle operations can be performed to ensure good performance. One mission usually needs thousands of seconds and during this period of time optimal control values have to be evaluated by means of optimization algorithms constituting a very high calculation complexity.

According to the latest published case studies \cite{guzzela07}, the most frequent energy optimization methods are the dynamic programming and the minimum principle based methods.

\subsection{Dynamic Programming (DP)}
Dynamic programming is widely used optimization method for a given time period. This method is particularly adapted to sequential optimization problems, which means that we try to minimize a cost function in separated time intervals. This implies that the method requires griding of state and time variables, thus the optimal trajectory can be computed only for discretized values.

The main idea of this method is based on Bellman's principle of optimality which says, that: \textit{``An optimal policy has the property that whatever the initial state and initial decision are, the remaining decisions must constitute an optimal policy with regard to the state resulting from the first decision''} \cite{bellman57}.

Advantageous fact is, that the computational time increases linearly with the final time $t_f$. On the other hand, the computational burden depends exponentially on the number of state variables. In the case of reasonably long drive missions it is possible to use dynamic programming methods if the number of state variables is small. One other property of  DP algorithm is that it calculate the optimal decisions backward in time or state beginning from final to initial state.

This implies that the method consists of a backward optimization process which is able to determine an approximation of the cost function V - solution of Hamilton-Jacobi-Bellman equation.

So the dynamic programming principle is defined by:

\begin{equation}
V_t(x_t)=\min_{u_t}\{L(x_t,u_t)+V_{t+1}(x_{t+1},u_{t+1})\}
\end{equation}

where $V_t(x_t)$ is the cost function in the actual step, $L(x_t)$ is the function to minimize in the actual step, $V_{t+1}(x_{t+1})$ is the cost function in the previous steps and $x$ is the state variable.

Due to the discretization, there may be some parasitic effects introduced. The values have to be interpolated or approximated by the nearest neighbor. This can cause i.e. an artificial increase or decrease of battery energy calculated over the optimal trajectory. The amount of parasitic effect must be examined to decide if the state-space discretization is acceptable or if it is necessary to increase the number of grid points. \cite{guzzela07}

Improved algorithms with reduced computational time are available such as the iterative dynamic programming algorithm based on the receding horizon. At  each iteration, the state space is selected as a small fraction of the entire space, cantered around the optimal trajectory evaluated in the previous iteration \cite{back05}.

Also, to reduce computational burden, we can try to simplify the original optimization problem, for example by linearizing the cost function and then by using classic simplex algorithm. In this case, we recede from the optimal solution and we must evaluate, if the solution is still suitable or not.

Matlab/Simulink will be used as modelling and simulation tool. While performing simulation tests, we must be aware, that Matlab is an interpreted programming language so its time performance is much lower compared to C/C++ and other. In addition, particularly in dynamic programming, we need to use loop operations due to the recursive character of the method. Matlab language is not optimized to execute for-loops and it is much more eligible to implement the loops as matrix operations. Thus to obtain proper results and computational time limits, we must tune well the algorithms \cite{guzzela07}.

\subsection{Analytical Optimization Methods}
One of the ways to decrease computational time is analytical optimization method based on minimum principle. It was proved that a necessary condition for solving the optimal control problem is that the control should be chosen so as to minimize the Hamiltonian. For that purpose the Lagrange method is used to transform the constraint optimization problem to an unconstraint optimization problem~\cite{boyd09}. Thereby we must introduce the Lagrange multipliers and so the Hamiltonian is defined as

\begin{equation}
H(x,u,t)=L(x,u,t)+\lambda^T(t)f(x,u,t)
\end{equation}

where $L(x,u,t)$ is the performance index, $\lambda^T(t)$ are the Lagrange multipliers, $f(x,u,t)$ are the constraints, $x$ is the state variable, $u$ is the command variable and $t$ is time.

The original optimization problem and the Hamiltonian formulation are equivalent. For an inequality optimization problem, this condition follows

\begin{equation}
\frac{\partial H}{\partial u}=\frac{\partial L}{\partial u}+\lambda^T\frac{\partial f}{\partial u}=0
\end{equation}

where\\
 $\lambda \geq 0$ if $f(x,u,t)=0$ (active constraint)\\
 $\lambda = 0$ if $f(x,u,t)<0$ (inactive constraint)

Thus, in the subspace in which the constraints are not active, a stationary point will be sought in these directions. Where the constraints are active, since the sign of the multipliers is given, a special optimization problem with equality constraints will be solved.

In real applications, the minimization problem is very complex and constrained so the computational burden can be very high. That is why we try to simplify the problem by approximations. For example, in \cite{guzzela07} is proposed to approximate the SoC and to simplify the internal battery parameters by i.e. neglecting the internal resistance. This assumption may not be valid so it is necessary to examine each case. Otherwise the optimization problem can be reduced to searching for a constant parameter $\lambda$ that approximates $\lambda~(t)$ for a given mission.

This optimization problem is straightforward. For every time t the Hamiltonian must be minimized with respect to the control variable $u(t)$. A further simplification is possible when the Hamiltonian can be expressed as an explicit function of the control variable.

In some special applications, the Hamiltonian turns out to be an affine function of the control variable. In this case, the minimum principle states that the optimal control variable is found at its extreme values, depending on the sign of the switching function $\partial~H/\partial~u$. When the switching function is zero, determining the optimal trajectory requires additional information, typically the second derivative of the Hamiltonian with respect to the variable $u$.

In \cite{rousseau08}, the introduced approach is a simplified parametrization of the problem by division in separates zones. The number of parameters is reduced and so the main task is how to find the appropriate parameters to define command value by a simple fashion. We can try to find limits and thresholds when some parameters become constant and create different functionality zones. Then we can optimize the problem according to the zones and not only to the time, so we may define different optimization strategies for different zones. This should notably simplify the problem because we need to work only with a reduced number of parameters. Of course the resulting strategy will be sub-optimal.



%\section{Synthetical Optimization Algorithm}
%Considerable studies have been made on hybrid power sources which combine SC with batteries, in order to meet both peak and average power demands in systems such as portable electronics, spacecraft power systems, or HEVs. Compared with a battery alone under pulse load conditions, the hybrid demonstrates longer running time, and higher power density.
%
%For systems containing multiple power sources or multiple energy storage systems, an appropriate power management algorithm is indispensable. A fuzzy logic supervisory-based power management strategy was introduced for a fuel cell/ultra-capacitor/battery combined electric vehicle~\cite{schouten03}. An adaptive control method was proposed for power sharing in hybrid FC/battery power sources~\cite{musardo05}. Some theoretical analyses on this question using simple component models with respect to energy efficiency or power capabilities were conducted, and provided with a method to optimize such power sources. Wavelet decomposition algorithm was also introduced for the power management of an HEV~\cite{zhang08}. These power management strategies have been proven effective in addressing the lifetime of the fuel cell stack due to negative impact of frequent and rapid load demand variations in real world drive cycles, but they fail to deal with system efficiency properly.
%
%The most important characteristics of previous power management algorithm are based on the following principles:
%
%\begin{itemize}
%\item The high power component of SC deals with rapid variation power requirement for transient response;
%\item The high energy component of battery deals with slow variation power requirement for prolonging the life time of battery;
%\item The frequency domain decomposition is the major algorithm to manage the power splitting between multiple power components;
%\item There is a trade-off between the long life time and the high efficiency for the HEV system. However, most of the algorithms focus on the long life time while neglecting the optimization of system's efficiency.
%\end{itemize}
%
%Synthetical Optimization Algorithm (SOA) based on optimal total efficiency of HEV is proposed for minimizing the energy consumption after integrating the multiple power components.
%
%In contrast with conventional algorithms by distributing the power between the battery and the SC based on different frequency decomposition, SOA is an innovative method to assign the power by considering the synthetical power between the battery and the SC co-ordinately. It means that, for the SOA, the operating points of both the battery and the SC may properly not be the optimal ones independently. However, it must be the point for minimizing the total energy consumption for the whole system. This is the significant feature comparing with conventional algorithms.
%
%It is a real time algorithm without turning to the prediction of future information, and the battery life time and the whole system's efficiency are balanced coordinately.
%
%\begin{figure}[ht]
%    \center
%    \includegraphics[width=10cm]{images/pow_transmission.png}
%    \caption{Power transmission between the DC/DC converter, battery and the SC}
%    \label{fig:pow_transmission}
%\end{figure}
%
%There are three major components inside the HEV: battery, SC and DC/DC converter. They should suffer different power loss and efficiency issues while the power transmits among them. The power transmission can be shown in figure~\ref{fig:pow_transmission}, and we have
%
%\begin{equation}
%P_D=P_B+P_{Con}
%\end{equation}
%
%where $P_D$ is demanded power, $P_B$ battery output power, $P_{Con}$ DC/DC converter output power.
%
%Here, we want to emphasis that there is a difference between the output power and the consumption power for the battery and the SC if their efficiency has been considered. Therefore, the consumption power is larger than the output power, since part of the power will be lost within the resistance and so on.
%
%For simplify, we will consider the efficiency of DC/DC convert to be constant and we obtain
%
%\begin{equation}
%P_{Con}=P_{SC}\eta_{Con}
%\end{equation}
%
%where $P_{SC}$ is SC output power.
%
%After considering the efficiency impact from the battery, SC and the DC/DC converter, the power consumption of the whole hybrid system can be derived
%
%\begin{align}
%P_D & =P_B+P_{SC}\eta_{Con}=P_{BC}\eta_{B}+P_{SCC}\eta_{SC}\eta_{Con} \\
%P_{DC} & =P_{BC}+P_{SCC}
%\end{align}
%
%where $P_{BC}$ is actual power consumption of the battery, $P_{SCC}$ actual power consumption of the SC and $P_{BC}$ actual power consumption corresponding to a definitely demanded power $P_D$.
%
%Due to the operating function of DC/DC converter, we can control the distribution of power between the battery and the SC easily by regulating the PWM signal of converter, and obtains
%
%\begin{equation}
%J^{*}(P_B(t),P_{SC}(t))=\min_{[u(t)]}\left[\frac{P_B(t)}{\eta_B}+\frac{P_{SC}(t)}{\eta_{SC}}\right]
%\end{equation}
%
%where\\
% $P_B$ and $P_{SC}$ are state variables and
% $u(t)=\frac{P_B(t)}{P_{SC}(t)}$ is control variable of the power splitting ration between the battery and the SC.
%
% From the equation above, it can be seen, that the optimal criterion of the proposed SOA is the function of the demand power $P_D$ and the power splitting ratio $u(t)$. Therefore, it is possible to achieve the minimum total power consumption of the whole hybrid system by regulating the power splitting ratio coordinately between the battery and the SC. In fact, the SOA is a balance algorithm to track a quasi optimal operating point rather than an absolute optimal one for the battery and the SC.
%
%In the figure~\ref{fig:optimal_pow_sr}, we can see the 2-Dimension efficiency maps of the battery and the SC in the right top and the left bottom part. Utilizing these maps, the relationship of the demanded power $P_D$ , power of the battery and the SC ($P_B$, $P_SC$), efficiency of the battery and the SC ($\eta_B, \eta_{SC}$), as well as the total power consumption $P_D$ are plotted out, and shown as the right bottom part of figure~\ref{fig:optimal_pow_sr}.
%
%\begin{figure}[ht]
%    \center
%    \includegraphics[width=10cm]{images/optimal_pow_sr.png}
%    \caption{Diagram of optimal power splitting ratio}
%    \label{fig:optimal_pow_sr}
%\end{figure}
%
%It can be seen from the subfigure at the right bottom of figure~\ref{fig:optimal_pow_sr}, that there should be a point (the blue star point) of minimum total power consumption $P_{DC}$. On the basis above, we can deduce the maps of optimal operating points.
%
%For example, in the ~\ref{fig:sr_map}, we can see the optimal power splitting ration for a fixed SC SoC=10\%. The map indicates that the power splitting ratio increases as the power demanded and the SOC of battery increase.
%
%\begin{figure}[ht]
%    \center
%    \includegraphics[width=10cm]{images/sr_map.png}
%    \caption{Map of optimal power splitting ratio while SC SOC=10\%}
%    \label{fig:sr_map}
%\end{figure}

\section{Moving Average Real-time Optimization Algorithm}
Even thought some complex sophisticated algorithms and methods were developed and introduced, their computational complexity may be too high with respect to a cheap HW architecture used in real applications. Thus some methods based on simple decisions and computations should be studied.

The main idea of our presented method is to compute the moving average of the demanded power ($P_D$) within a given look-ahead horizon.  In other words, we try to smooth the demanded power so that the power delivered by the batteries doesn't change rapidly. The quick power changes are then provided by SC.

As we can see from the expression~\eqref{eq:Pdtrans} of instantaneous power demand depends on the position and not on the time. It is the reason that the algorithm uses future traffic information and GPS data to predict the power demand. The SoC of batteries and SC are then calculated using the power profile of the route, the positioning information and the different efficiency maps and interpolation operated on them.

Some basic rules have to be formulated:

\begin{itemize}
\item if $P_D$ represents slow variation of demanded power, the whole power will be taken over by the battery;
\item if $P_D$ represents  rapid variation of demanded power, the average value will be taken in charge by battery and the rapid variation will be compensated by the SC;
\item if $SoC_{SC} < 25$ \% and $P_{SC} > 0$ (discharge), stop to provide energy from the SC; In this case all the demanded power and the SC charging power will be supplied by the battery;
\item if $SoC_{SC} > 100$ \% and $P_{SC} < 0$ (charge), stop the charge of SC and activate the SC for energy supply.
\end{itemize}

In the first step, we must be able to determine the demanded power and the demanded energy of longitudinal vehicle motion as a position-based forms which is done according to the expression~\eqref{eq:Pdtrans}. After that it is possible to discretize the look-ahead horizon and the route profile into proper segments with an equal length $\Delta s$ respectively. In our algorithm, $\Delta s = 20~m$.

\begin{figure}[ht]
    \center
    \includegraphics[width=12cm]{images/mov_avrg_alg.png}
    \caption{Schematic diagram of moving average algorithm}
    \label{fig:mov_avrg_alg}
\end{figure}

In figure~\ref{fig:mov_avrg_alg} is shown the schematic diagram of moving average algorithm. In the first step, the demanded power can be optionally divided into smaller parts. Then the algorithm computes for each part the moving average $<P_D>$ of future demanded power. After that, we can express the SC's power demand as:

\begin{equation}
P_{SC}=P_D-<P_D>
\end{equation}

In ideal case, the mean value of $P_{SC}$ should approximately equal zero which would mean, that all the energy delivered from SC will be equally recuperated and restored into them. In other words, the final energy  stored in the SC at the end of the driving cycle would be the same as the initial energy at the beginning of the driving cycle. However this is not true in real cases, because the SC can provide power with some efficiency and in the same way can be recharged with some efficiency so it is not possible to recuperate the same amount of energy as the amount of energy that was used. This means, some energy will be lost while transmitting the power.

Moreover, the distribution of power demand may not be regular, and the positive power demand may be to high, so the SC cannot deliver enough energy and the battery must be used. Whereas the negative power demand may be also too high to be recuperated by the SC.

That is why, the future estimated SC power demand is examined within a look-ahead horizon to determine moving average of power demand and corresponding amount of energy. If the average value is positive, it means, that the SC should provide more energy than he may recuperate back afterwards and we receive the additional battery energy needed to recharge the SC. If the value is negative, we receive the amount of energy which won't be probably possible to recuperate, because the SC will be fully charged. The main objective is to eliminate situations, when the SC are completely discharged so they cannot compensate quick power demand variations which has then to be compensated by battery. Also, this is the way how we can ensure, that the final $SoC_{SC}$ will be 100 \%. The opposite case are the situations, when the SC are fully charged and we don't want to lose the remaining braking energy. For that purpose, future SC power demand analysis was also introduced. Within a look-ahead horizon, the next positive and negative power demands are compared so the battery power demand can be eventualy decreased and compensated by SC in order to decharge SC enough to be able to recuperate all the available braking energy afterwards.

To summarize, the provided battery power is expressed as:

\begin{equation}
P_{B}=<P_D>+P_{Add}
\end{equation}

 where $<P_D>$ is moving average of demanded power and $P_{Add}$ is actual additional power demand when SC cannot provide enough power or cannot recuperate all the instantaneous power.

After a brief description of the algorithm, we can conclude, that the method is divided into two main parts:

\begin{enumerate}
	\item the total power demand smoothing within a look-ahead horizon and determining the battery power demand; and
	\item the SC recharge energy prediction and determination within a look-ahead horizon.
\end{enumerate}

In figure~\ref{fig:mov_avrg_alg_flow_chart} you can see the flow chart of moving average algorithm. In figure~\ref{fig:mov_avrg_SC} is a detailed diagram of \textit{SC discharge and recharge control} block from figure~\ref{fig:mov_avrg_alg_flow_chart}.

\begin{figure}
    \center
    \includegraphics[scale=1, trim=0in 0.7in 0in 0.7in, clip]{images/mov_avrg_alg_flow_chart.pdf}
    \caption{Moving average algorithm flow chart}
    \label{fig:mov_avrg_alg_flow_chart}
\end{figure}

\begin{figure}
    \center
    \includegraphics[scale=0.7, trim=1.4in 2.5in 4.0in 1.3in, clip]{images/mov_avrg_SC}
    \caption{Schematic diagram of SC control in moving average algorithm}
    \label{fig:mov_avrg_SC}
\end{figure}

\subsection{Power Transfer Efficiency}
For determining the SoC of battery and SC, we must respect the energy losses during the power transmission between different components. For the calculation, efficiency maps are used in combination with interpolation methods. Different methods were examined while they were giving approximately the same results. After the efficiency values are determined, we can express the actual power demands as:

\begin{align}
P_{Ba} & =\frac{P_B}{\eta_B} \text{... for } P_{B}>0\;  \text{(discharge)}\notag \\
P_{Ba} & =P_B\eta_B \text{... for } P_{B}<0\;  \text{(charge)}\notag \\
P_{SCa} & =\frac{P_{SC}}{\eta_{SC}} \text{... for } P_{SC}>0\; \text{(discharge)}\\
P_{SCa} & =P_{SC}\eta_{SC} \text{... for } P_{SC}<0\; \text{(charge)}\notag
\end{align}

where $P_{Ba}$ , $P_{SCa}$  are the battery and SC actual power demands and $\eta_{B}, \eta_{SC}$ are the battery and SC efficiencies respectively.


\subsection{Simulation Results and Analysis}
\label{sec:sim_conditions}
\subsubsection{Simulation Conditions}
The vehicle powered by the HE system is a medium passenger bus, which is the prototype vehicle to carry out the simulation. The power sources are compounded of 200 series connection SCs and a branch of 45 series connection 130 Ah Li batteries. A 6-speed automatic gearbox is installed between electric motor and wheels. It allows high level torques to ensure accelerations and to improve vehicle efficiency. The parameters of the prototype vehicle are listed in table~\ref{tab:vehicle_params_1}.


\begin{table}[ht]
\centering
\small
\begin{tabular}{|l|l|}
\hline
Parameters&Value \\
\hline
$M$ (nominal mass)&11800 kg \\
\hline
$M$ (total mass)&15000 kg \\
\hline
$L_{V}$ (Total length)&9312 mm \\
\hline
$r_{t}$ (Tire radius)&480 mm \\
\hline
$C_{d}$ (reynolds coefficient)&0.382 kg/m$^{3}$ \\
\hline
$A_{f}$ (windward area)&6.1 m$^{2}$ \\
\hline
\textit{$\mu $}$_{r}$ (rolling resistance coefficient)&0.016 \\
\hline
\textit{$\rho $} (air density)&1.25 kg/m$^{3}$ \\
\hline
\textit{$\delta $}$_{eqm}$ (equivalent moment inertia)&3.18 kg$\cdot $m$^{2}$ \\
\hline
$i_{s}$ (gear ratio)&$s$=1,2,3,4,5,6 \\
\hline
Power of electric motor (nominal)&105 kW \\
\hline
DC bus voltage&540 V \\
\hline
SC bank&200 series connection SCs \\
\hline
Battery pack&45 series connection batteries \\
\hline
Single SC (2 series connection) & 5200~F, 2.7~V \\
\hline
Single battery & 130~Ah, 12.8~V \\
\hline
\end{tabular}
\caption{\label{tab:vehicle_params_1} Parameters of test vehicle}
\end{table}

A corresponding demanded power profile (shown in figure~\ref{fig:dem_pow}) has been calculated by using equation~\eqref{eq:Pd} and transferred into the position-based profile by using equation~\eqref{eq:Pdtrans}.

Our simulations were performed by mathematical and simulation environment Matlab. For each simulation, the parameters from table~\ref{tab:vehicle_params_1} were used. In order to demonstrate the algorithm properties, the moving average algorithm was executed with different look-ahead horizons and with different initial battery SoCs. In addition, the simulations with battery only power source with and without braking energy recuperation were examined so we can compare the results with the first method simulations.

In table~\ref{tab:sim_params} are listed the parameters used in these particular simulations. The results for average moving algorithm and different look-ahead horizons are summarized in table~\ref{tab:mov_avrg_results}. For comparison, table~\ref{tab:bat_ener_recharge_results} contains results for battery only power source with braking energy recuperation and finally table~\ref{tab:bat_only_results} results for battery only power source without braking energy recuperation.

In order to settle the improvements of different cases, the reference energy is the energy consumed during the driving cycle by the battery only power source system without energy recuperation. Battery SoC difference from table~\ref{tab:bat_only_results} is then considered as reference quantity and as 100~\% of consumption. To calculate the improvement, we subtract from this value the battery SoC difference of another method wich gives us the absolute improvement value. It is then easy to calculate relative values.

\begin{table}[!ht]
\centering
\begin{tabular}{|l|l|}
\hline
Parameters & Value \\
\hline
$\Delta $ s & 20~m \\
\hline
n (=L/$\Delta $ s) & 270 \\
\hline
Route distance L & 5400~m \\
\hline
Total energy demand	 & 1,72E+04~kW \\
\hline
Total braking energy & -1,28E+03~kW \\
\hline
Braking energy percentage & 7.5~\% \\
\hline
Minimal battery SoC & 10~\% \\
\hline
Minimal SC SoC & 25~\% \\
\hline
\end{tabular}
\caption{\label{tab:sim_params} Simulation parameters}
\end{table}


\begin{table}[!ht]
\centering
\small
\begin{tabular}{|l|c|c|c|c|c|}
	\hline
	Initial battery SoC [\%] & 100 & 80 & 60 & 40 & 30 \\
	\hline
	Final battery SoC [\%] & 90.3 & 69.4 & 48.5 & 27.5 & 16.9 \\
	\hline
	$SoC_B$ difference [\%] & 9.7 & 10.6 & 11.5 & 12.5 & 13.1 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.78 & 0.86 & 0.93 & 1.01 & 1.07 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{13.18} & \cratemax{14.87} & \cratemax{16.57} & \cratemax{18.73} & \cratemax{20.05} \\
	\hline
	\cratestd{C-rate standard deviation $[h^{-1}]$} & \cratestd{1.12} & \cratestd{1.28} & \cratestd{1.44} & \cratestd{1.65} & \cratestd{1.78} \\
	\hline
\end{tabular}
\caption{\label{tab:bat_only_results} Battery only power source without energy recuperation simulation results}
\end{table}


\begin{table}[!ht]
\centering
\small
\begin{minipage}[c]{\textwidth}
\centering
\begin{tabular}{|l|c|c|c|c|c|}
	\hline
	Initial battery SoC [\%] & 100 & 80 & 60 & 40 & 30 \\
	\hline
	Final battery SoC [\%] & 90.7 & 69.7 & 48.9 & 27.9 & 17.3 \\
	\hline
	$SoC_B$ difference [\%] & 9.3 & 10.3 & 11.1 & 12.1 & 12.7 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.81 & 0.89 & 0.96 & 1.04 & 1.09 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{13.17} & \cratemax{14.86} & \cratemax{16.56} & \cratemax{18.72} & \cratemax{20.03} \\
	\hline
	\cratestd{C-rate standard deviation $[h^{-1}]$} & \cratestd{1.14} & \cratestd{1.30} & \cratestd{1.46} & \cratestd{1.67} & \cratestd{1.80} \\
	\hline
	\improvement{Improvement\footnote[1]{Compared to the battery only power source} [\%]} & \improvement{3.9} & \improvement{3.6} & \improvement{3.2} & \improvement{2.8} & \improvement{2.6} \\
	\hline
\end{tabular}
\end{minipage}
\caption{\label{tab:bat_ener_recharge_results} Battery only power source with energy recuperation simulation results}
\end{table}

\begin{table}[!ht]
\centering
\small
\begin{minipage}[c]{\textwidth}
\centering
\begin{tabular}{|l|c|c|c|c|c|}
	\hline
	Battery power look-ahead horizon & \multicolumn{5}{l|}{110} \\
	\hline
	SC recharge power look-ahead horizon & \multicolumn{5}{l|}{80} \\
	\hline
	Total route look-ahead horizon & \multicolumn{5}{l|}{270} \\
	\hline
	Initial battery SoC [\%] & 100 & 80 & 60 & 40 & 30 \\
	\hline
	Final battery SoC [\%] & 92.4 & 72.0 & 51.6 & 31.3 & 21.0 \\
	\hline
	$SoC_B$ difference [\%] & 7.6 & 8.0 & 8.4 & 8.7 & 9.0 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.61 & 0.64 & 0.67 & 0.70 & 0.72 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{0.86} & \cratemax{0.91} & \cratemax{0.96} & \cratemax{1.01} & \cratemax{1.05} \\
	\hline
	\cratestd{C-rate standard deviation $[h^{-1}]$} & \cratestd{0.12} & \cratestd{0.13} & \cratestd{0.14} & \cratestd{0.15} & \cratestd{0.16} \\
	\hline
	\improvement{Improvement\footnote[1]{Compared to the battery only power source} [\%]} & \improvement{22.2} & \improvement{24.9} & \improvement{27.4} & \improvement{29.9} & \improvement{31.4} \\
	\hline
	Maximal computational time [s] & 0.0037 & 0.0039 & 0.0037 & 0.0036 & 0.0037 \\
	\hline
\end{tabular}

\begin{tabular}{|l|c|c|c|c|c|}
	\hline
	Battery power look-ahead horizon & \multicolumn{5}{l|}{270} \\
	\hline
	SC recharge power look-ahead horizon & \multicolumn{5}{l|}{270} \\
	\hline
	Total route look-ahead horizon & \multicolumn{5}{l|}{270} \\
	\hline
	Initial battery SoC [\%] & 100 & 80 & 60 & 40 & 30 \\
	\hline
	Final battery SoC [\%] & 91.8 & 71.2 & 50.8 & 30.2 & 19.9 \\
	\hline
	$SoC_B$ difference [\%] & 8.2 & 8.8 & 9.2 & 9.8 & 10.1 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.66 & 0.71 & 0.74 & 0.79 & 0.81 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{9.74} & \cratemax{11.26} & \cratemax{12.76} & \cratemax{14.71} & \cratemax{15.93} \\
	\hline
	\cratestd{C-rate standard deviation $[h^{-1}]$} & \cratestd{0.60} & \cratestd{0.70} & \cratestd{0.79} & \cratestd{0.91} & \cratestd{0.99} \\
	\hline
	\improvement{Improvement [\%]} & \improvement{15.1} & \improvement{17.5} & \improvement{19.6} & \improvement{21.7} & \improvement{22.9} \\
	\hline
	Maximal computational time [s] & 0.0043 & 0.0038 & 0.0044 & 0.0050 & 0.0040 \\
	\hline
\end{tabular}

\begin{tabular}{|l|c|c|c|c|c|}
	\hline
	Battery power look-ahead horizon & \multicolumn{5}{l|}{50} \\
	\hline
	SC recharge power look-ahead horizon & \multicolumn{5}{l|}{20} \\
	\hline
	Total route look-ahead horizon & \multicolumn{5}{l|}{100} \\
	\hline
	Initial battery SoC [\%] & 100 & 80 & 60 & 40 & 30 \\
	\hline
	Final battery SoC [\%] & 91.3 & 70.7 & 50.2 & 29.6 & 19.3 \\
	\hline
	$SoC_B$ difference [\%] & 8.7 & 9.3 & 9.8 & 10.4 & 10.7 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.70 & 0.75 & 0.79 & 0.84 & 0.86 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{5.92} & \cratemax{7.00} & \cratemax{8.13} & \cratemax{9.71} & \cratemax{10.76} \\
	\hline
	\cratestd{C-rate standard deviation $[h^{-1}]$} & \cratestd{0.40} & \cratestd{0.46} & \cratestd{0.53} & \cratestd{0.63} & \cratestd{0.69} \\
	\hline
	\improvement{Improvement [\%]} & \improvement{10.4} & \improvement{12.6} & \improvement{14.7} & \improvement{16.7} & \improvement{17.9} \\
	\hline
	Maximal computational time [s] & 0.0035 & 0.0036 & 0.0035 & 0.0036 & 0.0040 \\
	\hline
\end{tabular}
\end{minipage}
\caption{\label{tab:mov_avrg_results} Moving average algorithm simulation results with different parameters}
\end{table}


\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/dem_pow.png}
    \caption{Demanded power for complete driving cycle}
    \label{fig:dem_pow}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/B_SC_pow_dem.png}
    \caption{Battery and SC power demand for complete driving cycle}
    \label{fig:B_SC_pow_dem}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/SoC_B_SC.png}
    \caption{Battery and SC SoC for complete driving cycle}
    \label{fig:SoC_B_SC}
\end{figure}


In figure~\ref{fig:B_SC_pow_dem} is shown a battery and SC power demands calculated by moving average algorithm with horizon settings stated in the first part of table~\ref{tab:mov_avrg_results} for driving cycle shown in figure~\ref{fig:dem_pow}. As we can see, the battery power demand is kept around mean value and the rapid variations are eliminated. These rapid variations are compensated by SC power demand, which varies a lot. In figure~\ref{fig:SoC_B_SC} is shown the battery and SC SoC progress with initial values on 100~\% in both cases. In order to guarantee low battery power demand variations, the battery cannot be recharged and delivers almost constant power. That is why the SoC of battery decreases constantly to the value 92.4~\%. In contrast, the SCs are discharged and charged rapidly, so the SCs SoC varies. We can see, that at the end of the driving cycle, the SCs are fully recharged. Also, their SoC never reaches the minimal value of 25~\% which means, that the battery doesn't have to be used to compensate the power demand and there is not so many energy losses.

\subsubsection{Impact of Look-ahead Horizons' Parameters}
The simulations with different look-ahead horizons were performed. In table~\ref{tab:mov_avrg_results} are in the first part results for the case, where the driving cycle is not divided into multiple parts and moving average is computed for look-ahead horizon size around one third of the cycle. In the second part, the driving cycle is not divided either and the average of all cycle is computed. Lastly, the driving cycle is divided into smaller parts and the power demand values are computed separately for these parts.

As we can see, the best results produces the first parameters' configuration. In this case, the additional battery power is computed more precisely. This causes slight battery power demand variations as illustrates figure~\ref{fig:B_SC_pow_dem}, but on the other hand ensures the SC recharge, so the battery does not have to be used to compensate quick power demands which cannot be delivered by SCs which is very inefficient.

This phenomena appears in the second case. The average battery power was calculated for the whole driving cycle and as we can see in figure~\ref{fig:B_SC_pow_dem_all_horizon}, the value is nearly constant for most of the time. However, the additional battery power to recharge the SCs is computed on a too large horizon which results in the fact, that in positions approximatelly 40, 90, 120, 130 and 150, the SC are discharged on the minimal SoC value as seen in figure~\ref{fig:SoC_B_SC_all_horizon} and they cannot deliver more energy for rapid variations and the battery has to compensate these power demands with much lower efficiency. This causes of course higher energy losses and it negatively influences the battery lifetime.

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/B_SC_pow_dem_all_horizon.png}
    \caption{Battery and SC demanded power - moving average algorithm (look-ahead horizon is all the route)}
    \label{fig:B_SC_pow_dem_all_horizon}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/SoC_B_SC_all_horizon.png}
    \caption{Battery and SC SoC - moving average algorithm (look-ahead horizon is all the route)}
    \label{fig:SoC_B_SC_all_horizon}
\end{figure}

In the third parameters' configuration, the driving cycle was divided into multiple parts. In contrast to the second configuration, the look-ahead horizons and part sizes are too small to compute the average battery power demand. This means, that the resulting battery power demand will vary more importantly than in the previous cases. This will of course increase the energy losses and decrease battery lifetime.

As it will be described later in this section, in the case of algorithm parameters mentioned in tables~\ref{tab:sim_params} and \ref{tab:mov_avrg_results}, the computational times are much lower than the maximal possible computational time. For that reason, we could try to increase the algorithm accuracy and therefore the energy economy by increasing the sampling rate. However in the case of sampling every 20 meters, we can suppose that the velocity stays in general mostly constant for each step, which implies that increasing the sampling rate won't give us a lot of new information and the algorithm results will be almost the same. Computing energy consumption optimization with higher precision can play an important role when the velocity profile changes rapidly in the case of i.e. sport driving or high traffic disturbance.


\subsubsection{Battery with SC versus Battery as the only Power Source}
There are more reasons why to use the combination of battery and SC as a power source. One of them, which were already mentioned, is to eliminate rapid battery variations and so increase the battery life.

{\bfseries Another one is the fact, that the SC can deliver or recuperate high power demands with higher efficiency. It is then possible not only increase the battery life, but also to consume less energy during the driving cycle.}

The amount of saved energy depends of course on the efficiency maps of different components, but also on the demanded power profile. For example, if the demanded power will be constant, the SC won't be used at all and the battery will provide all the energy so the result will be the same as when using the battery as the only power source.

In another case, it is possible to save some energy, if the power demand varies which is a general case. The negative power demand correspond to braking energy necessary to be recuperated by the SC and so can be increased the efficiency  of the power source system composed of batteries and SC. According to our simulations, the overall energy used by the combination of battery and SC is always less or equal to the energy used only by battery.

According to the results of our simulations in tables~\ref{tab:mov_avrg_results},~\ref{tab:bat_ener_recharge_results}~and~~\ref{tab:bat_only_results}, we can see the improvements in energy saving in comparison to the battery only strategy without braking energy recuperation. In figure~\ref{fig:energy_improvement} are shown the improvements of the battery with braking energy recuperation strategy and of the first parameters' configuration of the moving average algorithm. For the fist case, we can see, that the improvement is not higher than 4~\% and also, it decreases with the initial battery SoC, because also the recharging efficiency decreases notably.

In contrast, when using battery and SC combination, the improvement increases significantly, because the efficiency of energy recuperation by SC is still very high between 1 and 0.9. This means, that we are capable to recuperate more energy with less losses even if the initial battery SoC is very low. We can also say, that the amount of recuperated braking energy will be approximately the same independently on the battery SoC. The improvements are then given mostly by battery efficiency and it's energy losses. According to our simulations, the power save improvement with SC is for the given power demand profile between 22 and 32~\%.

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/energy_improvement.png}
    \caption{Energy save improvement compared to battery only source without energy recuperation}
    \label{fig:energy_improvement}
\end{figure}

\subsubsection{C-rate}
C-rate parameter describes the discharge intensity of a battery and can be used to evaluate energy storage system performance with SC. This parameter can be defined as

\begin{equation}
C_r = \frac{P_{batt}}{0.69\cdot V_{oc}\cdot C_{batt}}
\end{equation}

Generally, cycling the battery at high C-rates reduces the life of the battery~\cite{miller07} and for that reason rapid high power battery demands should be eliminated. While performing our simulations, we measured also the average value and standard deviation of this parameter. In both cases, the values were significantly improved when the SC was included into the energy system. Especially important is the standard deviation which expresses how much of dispersion from average value there is. In other words, if the standard deviation value is high, it means, that the parameter varies a lot. Whereas small standard deviations indicates that the parameter stays close to the average value. Comparing the C-rate standard deviation values in tables~\ref{tab:mov_avrg_results} and \ref{tab:bat_only_results}, we can conclude that the use of SC significantly decreased the battery power demand variations which implies that the life of the battery was increased.

\subsubsection{Computational Burden}
\label{subsec:comp_burd}
In real-time applications, the computational complexity is essential. The moving average algorithm does not require heavy computational operations and in addition does not proceed recursively as for example the dynamic programming algorithm. The actual needed value of battery and super capacitors power demand is calculated from future predicted values within the look-ahead horizon. If the computational time is  too high, we can simply decrease the horizon size.

In our case, the maximal possible or the worst case computational time is given by:

\begin{equation}
t_{max}=\frac{\Delta s}{v_{max}}
\end{equation}

The calculated power demand in figure~\ref{fig:dem_pow} is derived from velocity profile, which has the maximal value $v_{max}=59.9~km/h=16.6~m/s$ and the discretization distance $\Delta s=20~m$. Using the formula above, we receive the maximal computational time $t_{max}=1.2~s$.

In table~\ref{tab:mov_avrg_results} are maximal computational times needed for determination of the power demands for one disretization step simulation in Matlab. For all the cases with different computational horizons, the maximal value is $t_{max sim}=0.0050~s$ which is far from the maximal computational time $t_{max}$. This means that cheaper processors may be used with a reduced price.

The simulation results also show, that the computational time increases with the horizon size. It is then possible to reduce the horizon size in the case of too high computational times.


\subsection{Conclusions}
We may see clearly from the method used in the previous section that we necessarily need the exact position of the vehicle, the state of charge of the batteries and power demand which is dependent on the velocity. The information on the vehicle position may be given by a GPS sensor corrupted by errors with an unknown distribution. If the position is not precise the predicted demanded power will be generally erroneous which will influence the power distribution. We may do the same comments on the velocity variation. Prediction of the future velocity will permit us to better predict the route profile and power demand profile. It is evident that the quality of batteries and super capacities models are of paramount importance in the optimization algorithm.

The main reasons for introducing this energy management control strategy are especially:

\begin{itemize}
	\item the effort to increase battery life cycles by eliminating quick power demands from the battery because nowadays batteries are not very well adapted for rapid variations of power delivery;
	\item improvement of vehicle autonomy and energy saves by increasing energy recuperation efficiency; and
	\item reduction of computational times by introducing simple calculation operations and methods.
\end{itemize}


\section{Demanded Power Filter Algorithm}
The demanded power filter algorithm is based on the same idea as the moving average algorithm. It means that the principle is to smooth the demanded power profile in order to eliminate battery's power demand variations by following the filtered profile. The rapid variations given by subtracting the filtered profile from the original power demand are then provided by SC.

It is necessary to filter out rapid variations, i.e. high frequencies. For that purpose we use a first order filter approximation. The transfer function in Laplace notation can be expressed as:

\begin{equation}
F(s)= \frac{a}{bs+c}
\end{equation}

where $s$ is the Laplace transform variable, $a$ and $b$ are constants.

In figure~\ref{fig:B_pow_dem_filter} is shown with the red line the filtered power profile. The original power demand is the same as in the previous section used for the moving average algorithm simulations and is shown in figure~\ref{fig:dem_pow}. The parameters of the filter are $a=c=1$ and $b=50$.

From figure~\ref{fig:B_pow_dem_filter} is visible, that the filtered profile follows well the original one. However the simulations' results has shown, that it is necessary to additionally recharge the SCs by battery because the SCs were not recharged enough by braking energy recuperation to be able to provide all the demanded power. In this case, battery was supposed to provide high power quick demands with lower efficiency similarly as in the case of figure~\ref{fig:B_SC_pow_dem_all_horizon}. In addition, as it was already mentioned in previous sections, this phenomena can significantly decrease the battery life cycle. That is the reason the average additional SCs' recharging value is calculated as shown with the green line in figure~\ref{fig:B_pow_dem_filter}.

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/B_pow_dem_filter.png}
    \caption{Filtered demanded power profile and additional battery power needed to recharge SC}
    \label{fig:B_pow_dem_filter}
\end{figure}

From the filtered profile and the calculated additional power demand, we receive the total battery power demand as shown in figure~\ref{fig:B_SC_pow_dem_filter} together with SC power demand.

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/B_SC_pow_dem_filter.png}
    \caption{Battery and SC demanded power - demanded power filter algorithm}
    \label{fig:B_SC_pow_dem_filter}
\end{figure}

Simulations with the same conditions as settled in the section~\ref{sec:sim_conditions} were performed. In figure~\ref{fig:SoC_B_SC_filter} is shown the battery and SC SoC progress during the driving cycle. For the initial battery state of charge $SoC_{Binit}=100~\%$ we ended at final value $SoC_{Bfinal}=92.4~\%$ which is the same as in the case of moving average algorithm with the same SC recharge horizon of 80 points. Also for other initial conditions the algorithms have approximately the same results and performance including the computational burden as well.

In conclusion, we can say, that the benefits are similar as in the case of moving average algorithm. Briefly it concerns the battery life cycle improvement, energy economy with recuperation efficiency improvement and low computational complexity.

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/SoC_B_SC_filter.png}
    \caption{Battery and SC SoC - demanded power filter algorithm}
    \label{fig:SoC_B_SC_filter}
\end{figure}

\section{Predictive Optimization Power Management Algorithm (POEM)}
In this section, POEM algorithm~\cite{bin10} is addressed by combining the so called receding horizon
philosophy and DP. It is a predictive algorithm by using future traffic and road terrain information
ahead of the vehicle. This section is first dealt with the power transformation from the time-based
to the position-based. Then, the SOC of battery and SC at the end of the look-ahead horizon are
predicted according to the dynamics model, and a cost function is proposed in view of the
efficiency of battery, SC, DC/DC converter and electric motor simultaneously. Two objectives are
taken into account: minimize the total energy loss of the VHE system, and protect the system
from possible constraint violations. Since the dynamic system and the cost function represent the
strong nonlinearities, DP algorithm is employed over the look-ahead horizon to backward search
the optimal PSR trajectory. A sequence of future control actions PSR is obtained, and applied to
the plant until new measurements are available. During the DP optimization procedure, the power
profile, the SOC of battery and SC at the beginning and the end of the look-ahead horizon are
considered to ensure the tracking performance. Inspiring by the receding horizon philosophy, DP
algorithm is adopted along the total route recursively, and a new sequence control variable is
determined which replaces the previous one at each step. Finally, an almost global optimal PSR
trajectory is achieved. The succeeding algorithm is based on the following assumptions:

\begin{itemize}
\item A limited future traffic and road terrain information ahead of the controlled vehicle can be obtained.
\item The deviation of operating conditions for each battery (and SC) within the pack (and bank) is neglected.
\item The velocity shaping will not be considered as a factor to reduce the energy consumption, in short, the optimization is achieved based on the precise tracking of the demanded power.
\end{itemize}

\subsection{Energy-based SOC Definition}
SOC is defined to calculate the battery capacity accurately, that is the prediction of remaining
battery energy. However, due to the released charge of battery subjects to many factors, such as
the discharge duty, battery temperature and battery charging discharging cycles. Therefore, it is
difficult to estimate the remaining battery capacity by using the charge-based $SOC_{Q*}$ definition~\eqref{eq:SoC}, and is unable to reflect the remaining battery energy reasonably.

According to the energy conservation law, an energy-based SOC definition is adopted in this
study, and defined as

\begin{equation}
SoC(t) = \frac{E(t)}{E_p}
\label{eq:SoC_E}
\end{equation}

where, $E$ is the remaining energy of battery (or SC), $E_p$ is the total energy for a fully charged
battery (or SC). The transfer relationship between the energy and the charge is as follows

\begin{equation}
E = \frac{Q^2}{2C}
\label{eq:Eb}
\end{equation}

where, $C$ is the capacitance of battery (or SC).

Then, a relationship between two definitions~\eqref{eq:SoC} and~\eqref{eq:SoC_E} can be deduced

\begin{equation}
SoC(t) = \frac{Q_p^2}{2E_p \cdot C}\cdot SoC_Q^2(t)\Rightarrow SoC(t)=SoC_Q^2(t)
\label{eq:SoC_t}
\end{equation}

As the primary energy source in the VHE systems, there are two different ways to constrain
the battery SOC, i.e. the charge sustaining and the charge depletion. In this study, the charge
depletion is adopted. To prevent battery and SC from excessive wear, the constraint over the
charge-based $SOC_Q$ is


\begin{equation}
0.2 \leq SoC_{Qb} \leq 1
\end{equation}

For SC, the healthful operating range over the charge-based $SOC_Q$ is constrained within

\begin{equation}
0.5 \leq SoC_{Qsc} \leq 1
\end{equation}

According to equation~\eqref{eq:SoC_t}, the corresponding operating range over the energy-based SOC can be
obtained:

\begin{align}
SoC_{b min} & \leq SoC_{b} \leq SoC_{b max} \notag \\
SoC_{sc min} & \leq SoC_{sc} \leq SoC_{sc max}
\end{align}

where $SOC_{b min}=0.04$, $SOC_{b max}=1$, $SOC_{sc min}=0.25$, $SOC_{sc max}=1$.

The energy-based SOC definition will be adopted to design the control algorithm later.

\subsection{Position-based power calculation}
The road grade may change frequently at the actual road environment, especially in the
mountain terrain, and has become a major impact on the energy consumption. In general, the
proper measurement to record the road grade by GPS and 3D-map is dependent on position rather
than time. Therefore, the time-based equation~\eqref{eq:Pd} is not suitable for the purpose of control
algorithm design, and a power calculation depends on position instead of time is preferable. Using
the transformation~\eqref{eq:trans1} and~\eqref{eq:trans2}, equation~\eqref{eq:Pd} can be transferred into a position-based form~\eqref{eq:Pdtrans}.

Furthermore, a demanded energy consumption along the demanded power $P_D$ over a distance
$0\sim s$ is derived

\begin{equation}
\label{eq:Edtrans}
\begin{array}{l}
 E_D = \int_0^s P_D \left( s \right) ds = \left[ {\frac{\rho }{2}A_f C_d \int_0^s v^2 ds + Mg\left( {\mu_r \cos \theta + \sin \theta } \right) s } \right] \\
 {\begin{array}{*{20}c}
 \hfill & \hfill \\
\end{array} } + M\left( {1 + \delta _{eqm} } \right) \left( v^2(s)-v^2(0) \right) \\
 \end{array}
\end{equation}


\subsection{SOC prediction at the end of look-ahead horizon}
\label{sec:SoC}
Since the demanded power and the demanded energy of longitudinal motion vehicle have
been expressed as the position-based forms~\eqref{eq:Pdtrans} and~\eqref{eq:Edtrans}, the look-ahead horizon and the route
profile can easily be discretized into proper segments with an equal length. Figure~\ref{fig:diag_poem} is the
schematic diagram to illustrate the theory of POEM algorithm.

In this diagram, the total route profile and the look-ahead horizon have been discretized into $n$ and $(p-1)$ segments with the equal length $\Delta s$ respectively. $SOC_{bop}$ and $SOC_{scop}$ are the beginning SOC of battery and SC. $k$ is the beginning step for the look-ahead horizon. $L$ is the distance of the total route. $\Delta~SOC$ and $q$ are the discretized range and the number of SOC for the common operating bound of battery or SC. $SOC^*_{min}(k+p-1)$ and $SOC^*_{max}(k+p-1)$ are the bound of SOC at the future step $k+p-1$. $g$ is the discretized number of SOC at the future step $k+p-1$ within the bound of $SOC^*_{min}(k+p-1)$ and $SOC^*_{max}(k+p-1)$. $SOC_{b,g+1}(i)$ and $SOC_{sc,g+1}(i)$ are the SOC values of battery and SC at step i corresponding to $g+1$th reachable $SOC_b$ and $SOC_{sc}$ at the end of the look-ahead horizon.

\begin{figure}[h]
    \center
    \includegraphics[width=12cm]{images/diag_poem.png}
    \caption{Schematic diagram of POEM algorithm~\cite{bin10}}
    \label{fig:diag_poem}
\end{figure}

Inspired by the receding horizon philosophy, all reachable $SOC_b$ and $SOC_{sc}$ at the step $k+p-1$ are predicted at first, shown as the top sub figure of figure~\ref{fig:diag_poem}. It can be done by taking advantage of the future route information and the dynamics model of battery and SC. Suppose $E_D(k)$ is given as

\begin{equation}
E_D(k) = \int_{k\cdot \Delta s}^{(k+p-1)\cdot \Delta s} P_D (s)ds
\end{equation}

It is the summation of demanded energy consumption along the demanded power $P_D$ over the
look-ahead horizon $p$ from the beginning step $k$ to the future step $k+p-1$. Then, the minimum and
the maximum values of the reachable $SOC_b$ at the future step $k+p-1$ (i.e. $SOC_{bmin}(k+p-1)$ and
$SOC_{bmax}(k+p-1)$) should be subjected to~\cite{bin10}

\begin{align}
\sigma_{min} & = \frac{\left[ \left( SoC_{bop}(k)-SoC_{bmax}(k+p-1) \right) \cdot E_{pb} + SoC_{scop}(k) \cdot E_{psc}- \frac{E_D(k)}{\epsilon_m(k)} \right]}{E_{psc}}  \notag \\
\sigma_{max} & = \frac{\left[ \left( SoC_{bop}(k)-SoC_{bmin}(k+p-1) \right) \cdot E_{pb} + SoC_{scop}(k) \cdot E_{psc}- \frac{E_D(k)}{\epsilon_m(k)} \right]}{E_{psc}}  \\
& SoC_{min} \leq \sigma_{min}, \sigma_{max} \leq SoC_{max} \notag
\end{align}

where, $E_{pb}$ and $E_{psc}$ are the total energy of the fully charged battery and SC. similarly, the
maximum and the minimum values of $SOC_{sc}$ at the future step $k+p-1$ (i.e. $SOC_{scmin}(k+p-1)$ and
$SOC_{scmax}(k+p-1)$) are achieved.
The set of reachable $SOC_b$ and $SOC_{sc}$ at the future step $k+p-1$ can be written as

\begin{equation}
\psi_{b}(k+p-1) =
 \begin{Bmatrix}
  SoC_{bmin}(k+p-1) \\
  \vdots \\
  SoC_{b,j}(k+p-1) \\
  \vdots \\
  SoC_{bmax}(k+p-1)
 \end{Bmatrix}
\end{equation}

\begin{equation}
\psi_{sc}(k+p-1) =
 \begin{Bmatrix}
  SoC_{scmin}(k+p-1) \\
  \vdots \\
  SoC_{sc,j}(k+p-1) \\
  \vdots \\
  SoC_{scmax}(k+p-1)
 \end{Bmatrix}
\end{equation}

where $SOC_{b,j}(k+p-1)$ and $SOC_{sc,j}(k+p-1)$ are the reachable $SOC_b$ and $SOC_{sc}$ at the step $k+p-1$.
They are subjected to

\begin{align}
SOC_{b,j}(k+p-1) & =SOC_{bmin}(k+p-1)+(j-1)\cdot \Delta SoC \notag \\
SOC_{sc,j}(k+p-1) & =SOC_{scmin}(k+p-1)+(g-j+1)\cdot \Delta SoC \\
1 \leq j \leq g+1 \notag
\end{align}

From the schematic diagram of POEM algorithm in figure~\ref{fig:diag_poem}, the total steps $p$ of the look-ahead horizon determines how far the information about the upcoming route information reaches, and the range of each step determines the position resolution of this information. Since adding more information means an increased algorithm computational time, a trade off is made. In section~\ref{sec:cost_function}, the impact on the algorithm performance due to the horizon p and segment length $\Delta s$ is discussed.

\subsection{Cost Function}
\label{sec:cost_function}
In order to improve the operating efficiency of the VHE system, the energy loss caused by the
power transmission through the components of the battery, SC, DC/DC converter and the electric
motor should be considered~\cite{bin10}

\begin{equation}
L_b(i)=\left| P_b(i)\cdot \Delta s \cdot \left[ \frac{1}{\eta_b'(P_b(i),SoC_b(i))}-1 \right] \right|
\end{equation}

\begin{equation}
L_sc(i)=\left| P_cv(i)\cdot \Delta s \cdot \left[ \frac{1}{\eta_{sc}'(P_{sc}(i),SoC_{sc}(i))\cdot\eta_{cv}(P_{cv}(i))}-1 \right] \right|
\end{equation}

\begin{equation}
L_m(i)=\left| P_D(i)\cdot \Delta s \cdot \left[ \frac{1}{\eta_m(T_m(i),\omega_m(i))}-1 \right] \right|
\end{equation}

where, $L_b$, $L_{sc}$ and $L_m$ are the energy loss of battery, SC and electric motor respectively, $\eta_b'$ and $\eta_{sc}'$ are the efficiency functions of battery and SC\footnote{For our simulations, we have used $L_2$ norm function.}. They are parameterized with the power and the energy-based SoC. The control variable is PSR between the load power of battery and the power passed through the electric motor inverter, and defined as

\begin{equation}
u_p(i)=\frac{P_b(i)\cdot \epsilon_m(i)}{P_D(i)}
\end{equation}

obviously, the load power of DC/DC converter is

\begin{equation}
P_*(i)=P_*(i\cdot \Delta s)
\end{equation}

To minimize the total energy loss of the VHE system, a cost function over the look-ahead
horizon from step $k$ to step $k+p-1$ is then evaluated from the recursion

\begin{align}
J^{*}& =\min_{[u]}\sum_{i=k}^{k+p-1}[L_b(i)+L_{SC}(i)+L_m(i)] \notag \\
 & =\min_{[u]}\sum_{i=k}^{k+p-1}[L_b(i)+L_{SC}(i)]+\min_{[u_g]}\sum_{i=k}^{k+p-1}L_m(i)
\label{eq:Jmin}
\end{align}

subject to
\[
   \left \{
   \begin{array}{r c l}
      T_m & \in & [T_{m~min}, T_{m~max}]\\
      \omega_m & \in & [ \omega_{m~min}, \omega_{m~max}]\\
      SOC_b(i) & \in & [ SOC_b(i)_{m~min}, SOC_b(i)_{m~max}]\\
      SOC_{SC}(i) & \in & [ SOC_{SC}(i)_{m~min}, SOC_{SC}(i)_{m~max}]\\
   \end{array}
   \right .
\]\\

where $L_b$, $L_{SC}$, $L_m$ are the energy losses of battery, SC and electric motor respectively. And $u=[u_p,u_g]$,$u_g$ is the gear ratio of gearbox.

The equation~\eqref{eq:Jmin} indicates that the cost function can be divided into two terms, one for the energy loss minimization of battery and SC, and the other one for the electric motor. The second term indicates that the energy loss of the electric motor can be minimized independently by the control of gear ratio. In short, the operating points of electric motor can be regulated via gear ratio to approach the optimal efficiency operating points, and finally obtain the minimum energy loss of electric motor.

\subsection{Implementation of POEM algorithm}
After the beginning SoC and all reachable $SoC_b$ and $SOC_{sc}$ at the future step $k+p-1$ have been
obtained (section~\ref{sec:SoC}), DP optimization will be employed backward from all reachable $SOC_b$ and
$SOC_{sc}$ to the beginning SoC to search an optimal trajectory according to the cost function~\eqref{eq:Jmin}.
The POEM algorithm is outlined below~\cite{bin10}:

\begin{enumerate}
\renewcommand{\labelenumi}{\Roman{enumi}}
	\item For the beginning SoC at step $k$
	\[
	SoC_{scop}(k),SoC_{bop}(k)
	\]
	\item At future step $k+p-1$
	
	Let
	
	\[
		J^*_{k+p-1,j}(X_j(k+p-1))=\min_{u_j(k+p-1)}\left[ L_{b,j}(k+p-1)+L_{sc,j}(k+p-1)+L_{m}(k+p-1) \right]
	\]
	where
	\[
		L_{b,j}(k+p-1)=\left| P_b(k+p-1)\cdot \Delta s \cdot \left[ \frac{1}{\epsilon_{b,j}'(k+p-1)}-1 \right] \right|
	\]
	\[
		L_sc(k+p-1)=\left| P_cv(i)\cdot \Delta s \cdot \left[ \frac{1}{\epsilon_{sc,j}'(k+p-1)\cdot\epsilon_{cv}(k+p-1)}-1 \right] \right|
	\]

	\[
		L_m(k+p-1)=\left| P_D(k+p-1)\cdot \Delta s \cdot \left[ \frac{1}{\epsilon_m(k+p-1)}-1 \right] \right|
	\]
	
	\[
		\epsilon_{b,j}'(k+p-1)=\eta_{b,j}'(P_b(k+p-1),SoC_{b,j}(k+p-1))
	\]
	
	\[
		\epsilon_{sc,j}'(k+p-1)=\eta_{sc,j}'(P_sc(k+p-1),SoC_{sc,j}(k+p-1))
	\]
	
	\[
		\epsilon_{cv}(k+p-1)=\eta_{cv}(P_{cv}(k+p-1))
	\]
	
	\[
		\epsilon_{m}(k+p-1)=\eta_m(T_m(k+p-1),\omega_m(k+p-1))
	\]
	and the future $SoC$ at step $k+p-1$ subject to
	\[
		SoC_{b,j}(k+p-1)\in \psi_b(k+p-1)	
	\]
	\[
		SoC_{sc,j}(k+p-1)\in \psi_{sc}(k+p-1)	
	\]
	\item Step $k \leq i < k+p-1$
	\[
		J^*_{j}(X_j(i))=\min_{u_j(i)} \left\{ \left[ L_{b,j}(i)+L_{sc,j}(i)+L_{m}(i) \right] + J^*_{j}(X_j(i+1))\right\}
	\]
	where
	\[
		X_j(i)=\left[ SoC_{b,j}(i), SoC_{sc,j}(i) \right]
	\]
	\item Repeat [II] for $j =1,2,\ldots,g+1$. The optimal cost is
	\[
		J_k^*=\min_{1\leq j \leq g+1}J^*_{k,j}
	\]
	\item Feed the model of battery and SC with optimal $PSR_{u^*_p}(k)$ at step $k$, and yield the optimal SoC of battery and SC at step $k+1$
	\[
		SoC_{bop}(k+1)=SoC_{bop}(k)- \frac{P_D(k)\cdot \Delta s}{\epsilon_m(k)\cdot E_{pb}}\cdot u^*_p(k)
	\]
	\[
		SoC_{scop}(k+1)=SoC_{scop}(k)- \frac{P_D(k)\cdot \Delta s}{\epsilon_m(k)\epsilon_cv(k)\cdot E_{psc}}\cdot (1-u^*_p(k))
	\]
	\item Replace the beginning $SoC_{bop}(k)$, $SoC_{scop}(k)$ with the updated values $SoC_{bop}(k+1)$, $SoC_{scop}(k+1)$ at step [V], and repeat [I] for $k=1,2,\ldots,n+p-1$. Finally, the minimum energy loss of the total route is
	\[
	J^*_{sum}=\sum_{k=1}^{n+p-1}J^*_k
	\]
\end{enumerate}

A flow diagram to implement POEM algorithm is shown as figure~\ref{fig:flow_diag_poem}, which has been
divided into two control loops. For the inner loop from step [II] to step [IV], the DP optimization
is used to backward search from the future step $k+p-1$ to the beginning step $k$ to obtained the
optimal trajectory, wherein the light and dark color shadow areas are the SoC searching areas
concerning battery and SC respectively (shown as the top sub figure of figure~\ref{fig:diag_poem}). For the outer
loop from step [I] to step [VI], the inner loop is used to go through the total route recursively,
and update the control variable at each step with DP optimized values (corresponding to the
bottom sub figure of figure~\ref{fig:diag_poem}). The virtue of POEM algorithm is that the requirement of total
prescribed route information has been neglected, and makes it more fit for uncertain traffic
environment, although the local optimization is obtained in contrast with the global optimization
with respect to DP. Above all, the performance of the POEM algorithm is similar to that of a
skillful driver and reduces the computational time greatly.

\begin{figure}[h]
    \center
    \includegraphics[width=10cm]{images/flow_diag_poem.png}
    \caption{Flow diagram to implement POEM algorithm~\cite{bin10}}
    \label{fig:flow_diag_poem}
\end{figure}

\subsection{Simulation and Analysis of POEM}
The control performance of POEM algorithm based on the computer simulation is examined. The simulation conditions of the prototype vehicle, computer configuration and the driving cycle are introduced at first. Then, three criteria, including the final battery SoC, computational time, and C-rate are analyzed to evaluate the performance of POEM algorithm. Furthermore, the impact of POEM horizon step $p$ on the control performance is discussed.

\subsubsection{Simulation Conditions}
The vehicle powered by the HE system is a medium passenger bus, which is the prototype vehicle to carry out the simulation. The power sources are compounded of 200 series connection SCs and a branch of 45 series connection 130 Ah Li batteries. A 6-speed automatic gearbox is installed between electric motor and wheels. It allows high level torques to ensure accelerations and to improve vehicle efficiency. The parameters of the prototype vehicle are listed in table~\ref{tab:vehicle_params}.

\begin{table}[ht]
\centering
\small
\begin{tabular}{|l|l|}
\hline
Parameters&Value \\
\hline
$M$ (nominal mass)&11800 kg \\
\hline
$M$ (total mass)&15000 kg \\
\hline
$L_{V}$ (Total length)&9312 mm \\
\hline
$r_{t}$ (Tire radius)&480 mm \\
\hline
$C_{d}$ (reynolds coefficient)&0.382 kg/m$^{3}$ \\
\hline
$A_{f}$ (windward area)&6.1 m$^{2}$ \\
\hline
\textit{$\mu $}$_{r}$ (rolling resistance coefficient)&0.016 \\
\hline
\textit{$\rho $} (air density)&1.25 kg/m$^{3}$ \\
\hline
\textit{$\delta $}$_{eqm}$ (equivalent moment inertia)&3.18 kg$\cdot $m$^{2}$ \\
\hline
$i_{s}$ (gear ratio)&$s$=1,2,3,4,5,6 \\
\hline
Power of electric motor (nominal)&105 kW \\
\hline
DC bus voltage&540 V \\
\hline
SC bank&200 series connection SCs \\
\hline
Battery pack&45 series connection batteries \\
\hline
Single SC (2 series connection) & 5200~F, 2.7~V \\
\hline
Single battery & 130~Ah, 12.8~V \\
\hline
\end{tabular}
\caption{\label{tab:vehicle_params} Parameters of test vehicle}
\end{table}



\begin{figure}[!hb]
\begin{center}
\includegraphics[width=15cm]{images/1112.pdf}
\caption{Test vehicle}
\label{fig:12}
\end{center}
\end{figure}

The length of the driving circle is $5400 m$, the maximum speed is $16.6 m/s$. A corresponding demanded power profile (shown in figure~\ref{fig:dp_sim_profile}) has been calculated by using equation~\eqref{eq:Pd} and transferred into the position-based profile by using equation~\eqref{eq:Pdtrans}.

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_profile1.png}
    \caption{Demanded power for complete driving cycle}
    \label{fig:dp_sim_profile}
\end{figure}
%
%\begin{figure}[!ht]
%    \center
%    \includegraphics[width=12cm]{urban_cycle.png}
%    \caption{Experiment data of an urban driving cycle}
%    \label{fig:urban_cycle}
%\end{figure}

As a key parameter of POEM, the look-ahead horizon $p$ should be chosen in such a way that it integrate sufficient informations over which the optimization makes sense. On the other hand, the look-ahead horizon should at the same time not be chosen too large since it influences the computational efficiency greatly. In order to study the influence of the horizon $p$ on the performance of POEM, the length $\Delta s$ of each segment (i.e. resolution) in position of the road measurements is set to $20 m$ at first, which is about double lengths of the prototype vehicle. This length is used as basis to obtain different look-ahead horizons by varying $p$. Clearly a time required to go through the length $\Delta s$ depends on the velocity, and the minimum value can be obtained in the case of the maximum velocity of the total route. Thus, it is used as a minimum time threshold to determine the horizon $p$, as long as the corresponding computational time is inferior to this threshold.

The simulation is carried out on a PC computer running Matlab 7.1, with Pentium 4 dual-core 32-bit 3.00 GHz processor and 1GB RAM. The beginning SOC of battery and SC is 100\%, and the SC SoC at the end of the total route equals the beginning value (i.e. 100\%) after finishing the route. The case of pure battery drive without helping of SC is used as the benchmark to evaluate the performance of the proposed algorithm.

%The detailed parameters of POEM are listed in table~\ref{tab:poem_params}.
%
%
%\begin{table}[!ht]
%\tiny
%\begin{tabular}
%{|p{115pt}|p{20pt}|p{20pt}|p{20pt}|p{20pt}|p{20pt}|p{20pt}|p{20pt}|p{20pt}|p{20pt}|}
%\hline
%Parameters &
%\multicolumn{9}{|l|}{Value}  \\
%\hline
%\textit{$\Delta $s }(m) &
%\multicolumn{9}{|l|}{20}  \\
%\hline
%$p$&
%Case3: =9&
%Case4: =12&
%Case5: =15&
%Case6: =18&
%Case7: =21&
%Case8: =24&
%Case9: =27&
%Case10: =32&
%Case11: =37 \\
%\hline
%Look-ahead horizon length ($p\times $\textit{$\Delta $s}) (m) &
%180&
%240&
%300&
%360&
%420&
%480&
%540&
%640&
%740 \\
%\hline
%Distance of route $L $(m)&
%\multicolumn{9}{|l|}{5583}  \\
%\hline
%$n$ (=$L$/\textit{$\Delta $s}) &
%\multicolumn{9}{|l|}{280}  \\
%\hline
%\textit{$\Delta $SOC} ({\%})&
%\multicolumn{9}{|l|}{0.025}  \\
%\hline
%$q $(96/\textit{$\Delta $SOC})&
%\multicolumn{9}{|l|}{3840}  \\
%\hline
%\end{tabular}
%\caption{\label{tab:poem_params} Parameters of POEM algorithm}
%\end{table}

\subsubsection{Simulation Results Analysis}
Different simulations based on the POEM algorithm were made. The list of simulation parameters is in the table~\ref{tab:sim_params2} and gives the most important facts about driving cycle power profile shown in the figure~\ref{fig:dp_sim_profile}. First the simulations with battery only system (without recuperation) were made and they are summarized in the table~\ref{tab:bat_only_results2}. These results are used afterwards as reference values to compare the POEM algorithm results and to determine energy save improvement while using SCs.

As we have already mentioned, the key parameter is the look-aheah horizon ($p$). Table~\ref{tab:dp_sim_res} presents results and improvements achieved by POEM algorithm applied on the given power profile while using different look-ahead horizons and different initial battery SoCs. We can see, that the best energy save improvements are achieved for the largest horizon of 269 points which is the whole driving cycle. While decreasing the look-ahead horizon, the improvements are also decreased. In the case of $p=269$ and $SoC_{binit}=30~\%$ the energy save improvement is about 37.25~\%. In the case of $p=10$ and $SoC_{binit}=30~\%$ the improvement is about 25.72~\% which is 11.53~\% less than in the first case. This is due to the fact, that we need to use the most largest horizon possible and to use the most of predicted information to find the best suboptimal solution along the cycle. 

Although we receive better results for larger horizons, we must consider also the computational times. In the case of large look-ahead horizon ($p=269$), the computational time for one horizon window is more than 328 seconds. However for $p=10$, the computational time is only approximately 0.58 seconds. These results show, that we must chose the look-ahead horizon accordingly to the optimization level and computational time. 

Another important examined parameter is the C-rate. It's significance was explained in previous section. After analysing the results, we can conclude that the POEM algorithm decreased significantly the C-rates in every look-ahead horizon cases compared to the battery only simulations. As for the energy save improvements, better results give simulations on large horizons.

These results are also verified by graphic representations shown in the figures~\ref{fig:dp_sim_hor269}, \ref{fig:dp_sim_hor30} and \ref{fig:dp_sim_hor10}. The figures show battery and SC SoCs and power demands for $SoC_{binit}=30~\%$ and horizons p=269,~30,~10 respectively. From the SCs' SoC in figure~\ref{fig:dp_sim_hor269}, we can see that the algorithm could optimize the SCs' usage on the whole cycle and so they are used more than in two cases. This results in better overall efficiency and so better energy saves. Also, we can observe that the battery power is more constant which decreases the C-rate and undirectly improves the battery life. On the other hand, the results calculated on horizon p=10 in figure~\ref{fig:dp_sim_hor10} show, that the SCs could not be used so efficiently because of the limited future information. That is why the battery contribution is higher and also more oscilative which results in higher energy losses and higher C-rate values. However this results are still better than in the case of battery only system.

\begin{table}[!ht]
\centering
\begin{tabular}{|l|l|}
	\hline
	Parameters & Value \\
	\hline
	$\Delta s$ [m] & 20 \\
	\hline
	$\Delta SoC$ [\%] & 0.025 \\
	\hline
	n (=L/$\Delta s$) & 270 \\
	\hline
	Route distance L [m] & 5400 \\
	\hline
	Total energy demand & 1,70E+04~kW \\
	\hline
	Total braking energy & -1,51E+03~kW \\
	\hline
	Braking energy percentage & 8.9~\% \\
	\hline
	Initial/final SC SoC [\%] & 100/100 \\
	\hline	
\end{tabular}
\caption{\label{tab:sim_params2} Simulation parameters}
\end{table}


\begin{table}[!ht]
\centering
\small
\begin{tabular}{|l|c|c|}
	\hline
	Initial battery SoC [\%] & 100 & 30 \\
	\hline
	Final battery SoC [\%] & 90.31 & 16.74 \\
	\hline
	$SoC_B$ difference [\%] & 9.69 & 13.26 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.78 & 1.06 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{13.06} & \cratemax{19.77} \\
	\hline
	\cratestd{C-rate standard deviation $[h^{-1}]$} & \cratestd{1.14} & \cratestd{1.82} \\
	\hline
\end{tabular}
\caption{\label{tab:bat_only_results2} Battery only power source without energy recuperation simulation results}
\end{table}



\begin{table}[!ht]
\centering
\begin{minipage}[c]{\textwidth}
\centering
\scriptsize
\begin{tabular}{|l|c|c|c|c|c|c|c|c|}
	\hline
	Look-ahead horizon $p$ & \multicolumn{2}{c|}{269} & \multicolumn{2}{c|}{30} & \multicolumn{2}{c|}{15} & \multicolumn{2}{c|}{10} \\
	\hline
	Initial battery SoC [\%] & 100 & 30 & 100 & 30 & 100 & 30 & 100 & 30 \\
	\hline
	Final battery SoC [\%] & 93.01 & 21.68 & 92.85 & 21.29 & 92.60 & 20.67 & 92.35 & 20.15 \\
	\hline
	$SoC_B$ difference [\%] & 6.99 & 8.32 & 7.15 & 8.71 & 7.40 & 9.33 & 7.65 & 9.85 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.56 & 0.67 & 0.57 & 0.70 & 0.59 & 0.75 & 0.61 & 0.79 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{0.67} & \cratemax{0.80} & \cratemax{1.57} & \cratemax{2.16} & \cratemax{1.58} & \cratemax{2.18} & \cratemax{7.02} & \cratemax{12.47} \\
	\hline
	\cratestd{C-rate std dev. $[h^{-1}]$} & \cratestd{0.24} & \cratestd{0.29} & \cratestd{0.36} & \cratestd{0.47} & \cratestd{0.49} & \cratestd{0.67} & \cratestd{0.64} & \cratestd{0.90} \\
	\hline
	\improvement{Improvement\footnote[1]{Compared to the battery only power source} [\%]} & \improvement{27.86} & \improvement{37.25} & \improvement{26.21} & \improvement{34.31} & \improvement{23.63} & \improvement{29.64} & \improvement{21.05} & \improvement{25.72} \\
	\hline
	Max. comp. time [s] & 328.6734 & 347.3578 & 4.7281 & 5.0164 & 1.0614 & 0.9301 & 0.5191 & 0.5811 \\
	\hline
\end{tabular}
\end{minipage}
\caption{\label{tab:dp_sim_res} POEM algorithm simulation results for different look-ahead horizons}
\end{table}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_dp1.png}
    \caption{Battery and SC SoC and power obtained by dynamic programming algorithm (p=269, $SoC_{binit}=30~\%$)}
    \label{fig:dp_sim_hor269}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/dp_sim_hor30.png}
    \caption{Battery and SC SoC and power obtained by dynamic programming algorithm (p=30, $SoC_{binit}=30~\%$)}
    \label{fig:dp_sim_hor30}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/dp_sim_hor10.png}
    \caption{Battery and SC SoC and power obtained by dynamic programming algorithm (p=10, $SoC_{binit}=30~\%$)}
    \label{fig:dp_sim_hor10}
\end{figure}


\pagebreak
\subsection{Conclusion and Future Work}
In view of complex traffic environment, a new algorithm (POEM) is proposed for the energy optimization of VHE system. The configuration and modelling of the VHE system powered by battery and SC is addressed at first. Then, multiple route information including traffic and road terrain is utilized to predict the future\textit{SoC} of battery and SC at the end of the look-ahead horizon. A cost function which represents the total energy loss is given. The DP algorithm is applied over the look-ahead horizon (window) to obtain the optimal PSR trajectory between battery and SC. Enlighten by the receding horizon philosophy, the above prediction of future \textit{SOC} and DP optimization procedure are employed recursively along the total route, and a
suboptimal PSR trajectory which minimize the energy loss are obtained. The characteristics of the proposed algorithm are summarized as:

\begin{enumerate}
	\item The energy efficiency of the VHE system and the battery life time can be improved with the proper control of horizon $p$.
	\item The computational time has been reduced significantly and more computer data memory usage can be saved.
	\item The limited information over the look-ahead horizon instead of the total route information is required for POEM.
\end{enumerate}



\section{Algorithms Comparison}

In this section is presented the comparison of the Moving Average Algorithm, the POEM Algorithm. As the reference values to calculate improvements are used values calculated for the EV system with battery only power source without SC usage. As we have already mentioned in the previous sections, these two algorithms improve significantly the battery energy saves and increase the battery life time by decreasing battery C-rate.

In order to compare this two algorithms, we made a number of simulations for three different power profiles, that are shown in figures~\ref{fig:alg_comp_profile1}, \ref{fig:alg_comp_profile2} and \ref{fig:alg_comp_profile3}. The simulation results for different power profiles are summarized in tables~\ref{tab:algs_compar_1}, \ref{tab:algs_compar_2} and \ref{tab:algs_compar_3} respectively. Regarding the results, we can conclude that the improvement strongly depends on the driving cycle and the power profile. In the first case, the amount of braking energy is about 8.9~\%. Then the improvements are between approximately 20 and 35~\% compared to the battery only source. In the case of the second power profile, the braking energy amount is only about 2.1~\%, so we can recuperate less energy. That is why the improvements are smaller between approximately 3 and 6~\%.

If we compare the results of Moving Average and POEM algorithm calculated on the whole power profile, we can observe, that the POEM algorithm gives better results concerning the energy saves. Moving Average algorithm gives slightly better results for C-rate parameter. However both algorithms decrease C-rate significantly compared to the battery only source. 

Important fact are the computational times of algorithms. Here, the Moving Average algorithm gives much better results due to very small computational times (in order of milliseconds) which can be beneficent for further functionalities of the algorithm. On the contrary, the POEM algorithm calculated on the whole profile cycle has very high computational burden (more than 300 seconds). As mentioned in previous sections, when we suppose the maximal speed $v_{max}=16.6~km/h$ and $\Delta s = 20~m$, the maximal computational time is $t_{max}=1.2~s$. To achieve this maximal computational times also for the POEM algorithm, we must reduce the look-ahead horizon to about p=25~points. After performing simulations with p=25 on the first power profile, we received the final battery $SoC_{bfinal}=92.85~\%$ for $SoC_{binit}=100~\%$ and $SoC_{bfinal}=21.16~\%$ for $SoC_{binit}=30~\%$ which is comparable to the Moving Average algorithm calculated on the whole cycle.

From the graphs of battery and SC SoCs and power demands flows, that the progressions of the two algorithms are very similar which is desirable and justifies the correct function of algorithms. 

In the last case, we made simulations on a constant power profile shown in the figure~\ref{fig:alg_comp_profile3}. From figure~\ref{fig:alg_comp_avrg3} is visible, that the battery power demand calculated by Moving Average algorithm follows exactly the demanded constant power profile, because the average value is constant along whole cycle. Energy consumption is then the same as for the battery only system. However POEM algorithm tries to find the best PSR between battery and SC so we can observe battery power oscillations (figure~\ref{fig:alg_comp_dp3}).

%%%%%%%%%%%%%%%%%%%%%%%% PROFILE CASE 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[!ht]
\centering
\small
\begin{minipage}[c]{\textwidth}
\centering
\begin{tabular}{|l|c|c|c|c|c|c|}
	\hline
	$\Delta s$ [m] & \multicolumn{6}{l|}{20} \\
	\hline
	n (=L/$\Delta s$) & \multicolumn{6}{l|}{270} \\
	\hline
	Route distance L [m] & \multicolumn{6}{l|}{5400} \\
	\hline
	Total energy demand & \multicolumn{6}{l|}{1,70E+04~kW} \\
	\hline
	Total braking energy & \multicolumn{6}{l|}{-1,51E+03~kW} \\
	\hline
	Braking energy percentage & \multicolumn{6}{l|}{8.9\%} \\
	\hline
	Look-ahead horizon & \multicolumn{6}{l|}{269} \\
	\hline
	Initial/final SC SoC [\%] & \multicolumn{6}{l|}{100/100} \\
	\hline
	Algorithm & \multicolumn{2}{c|}{DP} & \multicolumn{2}{c|}{Average} & \multicolumn{2}{c|}{Battery only} \\
	\hline
	Initial battery SoC [\%] & 100 & 30 & 100 & 30 & 100 & 30 \\
	\hline
	Final battery SoC [\%] & 93.01 & 21.68 & 92.58 & 21.20 & 90.31 & 16.74 \\
	\hline
	$SoC_B$ difference [\%] & 6.99 & 8.32 & 7.42 & 8.8 & 9.69 & 13.26 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.56 & 0.67 & 0.60 & 0.71 & 0.78 & 1.06 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{0.67} & \cratemax{0.80} & \cratemax{1.15} & \cratemax{1.48} & \cratemax{13.06} & \cratemax{19.77} \\
	\hline
	\cratestd{C-rate standard deviation $[h^{-1}]$} & \cratestd{0.24} & \cratestd{0.29} & \cratestd{0.17} & \cratestd{0.21} & \cratestd{1.14} & \cratestd{1.82} \\
	\hline
	\improvement{Improvement\footnote[1]{Compared to the battery only power source} [\%]} & \improvement{27.86} & \improvement{37.25} & \improvement{23.43} & \improvement{33.63} & \improvement{---} & \improvement{---} \\
	\hline
	Maximal computational time [s] & 328.6734 & 347.3578 & 0.0166 & 0.0159 & --- & --- \\
	\hline
\end{tabular}
\end{minipage}
\caption{\label{tab:algs_compar_1} Algorithms comparison for profile 1}
\end{table}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_profile1.png}
    \caption{Demanded power for complete driving cycle case 1}
    \label{fig:alg_comp_profile1}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_dp1.png}
    \caption{Battery and SC SoC and power obtained by dynamic programming algorithm (profile case 1)}
    \label{fig:alg_comp_dp1}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_avrg1.png}
    \caption{Battery and SC SoC and power obtained by moving average algorithm (profile case 1)}
    \label{fig:alg_comp_avrg1}
\end{figure}


%%%%%%%%%%%%%%%%%%%%%%%% PROFILE CASE 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{table}[!ht]
\centering
\small
\begin{minipage}[c]{\textwidth}
\centering
\begin{tabular}{|l|c|c|c|c|c|c|}
	\hline
	$\Delta s$ [m] & \multicolumn{6}{l|}{20} \\
	\hline
	n (=L/$\Delta s$) & \multicolumn{6}{l|}{270} \\
	\hline
	Route distance L [m] & \multicolumn{6}{l|}{5400} \\
	\hline
	Total energy demand & \multicolumn{6}{l|}{1.69E+04~kW} \\
	\hline
	Total braking energy & \multicolumn{6}{l|}{-3.61E+02~kW} \\
	\hline
	Braking energy percentage & \multicolumn{6}{l|}{2.1\%} \\
	\hline
	Look-ahead horizon & \multicolumn{6}{l|}{269} \\
	\hline
	Initial/final SC SoC [\%] & \multicolumn{6}{l|}{100/100} \\
	\hline
	Algorithm & \multicolumn{2}{c|}{DP} & \multicolumn{2}{c|}{Average} & \multicolumn{2}{c|}{Battery only} \\
	\hline
	Initial battery SoC [\%] & 100 & 30 & 100 & 30 & 100 & 30 \\
	\hline
	Final battery SoC [\%] & 92.27 & 20.49 & 92.16 & 20.45 & 91.91 & 19.89 \\
	\hline
	$SoC_B$ difference [\%] & 7.73 & 9.51 & 7.84 & 9.55 & 8.09 & 10.11 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.62 & 0.77 & 0.63 & 0.77 & 0.65 & 0.81 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{1.59} & \cratemax{2.18} & \cratemax{1.41} & \cratemax{1.89} & \cratemax{2.36} & \cratemax{3.57} \\
	\hline
	\cratestd{C-rate standard deviation $[h^{-1}]$} & \cratestd{0.38} & \cratestd{0.52} & \cratestd{0.31} & \cratestd{0.39} & \cratestd{0.45} & \cratestd{0.60} \\
	\hline
	\improvement{Improvement\footnote[1]{Compared to the battery only power source} [\%]} & \improvement{4.45} & \improvement{5.93} & \improvement{3.09} & \improvement{5.54} & \improvement{---} & \improvement{---} \\
	\hline
	Maximal computational time [s] & 335.2695 & 329.6244 & 0.0072 & 0.0072 & --- & --- \\
	\hline
\end{tabular}
\end{minipage}
\caption{\label{tab:algs_compar_2} Algorithms comparison for profile 2}
\end{table}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_profile2.png}
    \caption{Demanded power for complete driving cycle case 2}
    \label{fig:alg_comp_profile2}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_dp2.png}
    \caption{Battery and SC SoC and power obtained by dynamic programming algorithm (profile case 2)}
    \label{fig:alg_comp_dp2}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_avrg2.png}
    \caption{Battery and SC SoC and power obtained by moving average algorithm (profile case 2)}
    \label{fig:alg_comp_avrg2}
\end{figure}

%%%%%%%%%%%%%%%%%%%%%%%% PROFILE CASE 3 - CONSTANT %%%%%%%%%%%%%%%%%%%%%
\begin{table}[!ht]
\centering
\small
\begin{minipage}[c]{\textwidth}
\centering
\begin{tabular}{|l|c|c|c|c|c|c|}
	\hline
	$\Delta s$ [m] & \multicolumn{6}{l|}{20} \\
	\hline
	n (=L/$\Delta s$) & \multicolumn{6}{l|}{270} \\
	\hline
	Route distance L [m] & \multicolumn{6}{l|}{5400} \\
	\hline
	Total energy demand & \multicolumn{6}{l|}{1.62E+04~kW} \\
	\hline
	Total braking energy & \multicolumn{6}{l|}{0~kW} \\
	\hline
	Braking energy percentage & \multicolumn{6}{l|}{0\%} \\
	\hline
	Look-ahead horizon & \multicolumn{6}{l|}{269} \\
	\hline
	Initial/final SC SoC [\%] & \multicolumn{6}{l|}{100/100} \\
	\hline
	Algorithm & \multicolumn{2}{c|}{DP} & \multicolumn{2}{c|}{Average} & \multicolumn{2}{c|}{Battery only} \\
	\hline
	Initial battery SoC [\%] & 100 & 30 & 100 & 30 & 100 & 30 \\
	\hline
	Final battery SoC [\%] & 92.70 & 21.31 & 92.69 & 21.43 & 92.69 & 21.43 \\
	\hline
	$SoC_B$ difference [\%] & 7.30 & 8.69 & 7.31 & 8.57 & 7.31 & 8.57 \\
	\hline
	Average C-rate $[h^{-1}]$ & 0.59 & 0.70 & 0.59 & 0.69 & 0.59 & 0.69 \\
	\hline
	\cratemax{Maximal C-rate $[h^{-1}]$} & \cratemax{0.67} & \cratemax{0.80} & \cratemax{0.60} & \cratemax{0.70} & \cratemax{0.60} & \cratemax{0.70} \\
	\hline
	\cratestd{C-rate standard deviation $[h^{-1}]$} & \cratestd{0.21} & \cratestd{0.25} & \cratestd{0.00} & \cratestd{0.00} & \cratestd{0.00} & \cratestd{0.00} \\
	\hline
	\improvement{Improvement\footnote[1]{Compared to the battery only power source} [\%]} & \improvement{0.14} & \improvement{-1.40} & \improvement{0.00} & \improvement{0.00} & \improvement{---} & \improvement{---} \\
	\hline
	Maximal computational time [s] & 326.3664 & 352.1459 & 0.0071 & 0.0086 & --- & --- \\
	\hline
\end{tabular}
\end{minipage}
\caption{\label{tab:algs_compar_3} Algorithms comparison for profile 3}
\end{table}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_profile3.png}
    \caption{Demanded power for complete driving cycle case 3}
    \label{fig:alg_comp_profile3}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_dp3.png}
    \caption{Battery and SC SoC and power obtained by dynamic programming algorithm (constant profile case 3)}
    \label{fig:alg_comp_dp3}
\end{figure}

\begin{figure}[!ht]
    \center
    \includegraphics[width=12cm]{images/alg_comp_avrg3.png}
    \caption{Battery and SC SoC and power obtained by moving average algorithm (constant profile case 3)}
    \label{fig:alg_comp_avrg3}
\end{figure}


