A Multi-Agent System for Smart Energy Management Devoted to Vehicle Applications : Realistic Dynamic Hybrid Electric System Using Hydrogen as a Fuel

Real-time simulation test beds for new zero-emission hybrid electric vehicles are considered as an attractive challenge for future transport applications that are fully recommended in the laboratory environment. In contrast, new zero-emission hybrid electric vehicles have a more complicated charging procedure. For this reason, an efficient simulation tools development for hydrogen consumption control becomes critical. In this vein, a New Zero Emission Hybrid Electric Vehicle Simulation (NZE-HEVSim) tool for the dynamic Fuel Cell Hybrid-Electric System is proposed to smartly control multisource activities. The designed system consists of a proton-exchange membrane fuel cell used to provide the required energy demand and a Supercapacitor system for energy recovery assistance in load peak or in fast transient. To regulate the supplied power, an efficient Real-Time Embedded Intelligent Energy Management (RT-EM-IEM) is implemented and tested through various constraints. The proposed intelligent energy management system aims to act quickly against sudden circumstances related to hydrogen depletion in the basis required fuel consumption prediction using multi-agent system (MAS). The proposed MAS strategy aims to define the proper operating agent according to energy demand and supply. The obtained results prove that the designed system meets the objectives set for RT-EM-IEM by referring to an experimental velocity database.


Introduction
Nowadays, the development of real-time simulation tools for new zero-emission vehicles (ZEV) is considered a potential solution because of their effectiveness in reducing pollutants and CO 2 emissions.Most commercially, ZEVs were accepted and promoted by several governments [1,2].Indeed, hybrid electric systems were deployed that became terrible environmental sources.New zero-emission hybrid electric vehicles are becoming trendier in the transportation sector due to their lower oil consumption [3].New zero-emission hybrid electric vehicles are generally classified into several categories and are distinguished according to their energy types such as battery, regenerative braking, flywheel, etc. [4,5].Their power sources can be a fuel cell, a supercapacitor, a motor, a battery, etc. Depending on the delivered power source, ZEV can be classified into different types (such as hybrid-series, parallel-hybrid, and hybrid-dual modes) [6][7][8].The ZEV series requires less maintenance compared to other types.The ZEV series requires only a battery and a large capacity engine to meet its energy needs and some power electronic devices like Rectifier, DC/DC converter, and an inverter.
For example, past authors [9][10][11][12] proposed a series-hybrid ZEV.The obtained results are proven and quantified the potential benefits of the optimized series-parallel hybrid system.The transmission system in a parallel-ZEV model can be supplied through a battery or internal combustion engine (ICE) or the both.The battery can be recharged thanks to a regenerative braking or through the ICE.The efficiency of the parallel Hybrid Electric Vehicle (HEV) is ~43.4%.Today a parallel-Zero Emission Vehicle (ZEV) is applied to a Chevrolet, Malibu, and Honda Civic [13].The main drawback of parallel-ZEV is the torsional vibration in the starting process, which is inevitable [14].For example, this issue was addressed in References [15][16][17][18] where obtained results proved that the system is optimized according to several test benches.Regarding the dual mode hybrid ZEV (DMH-ZEV), the HEV mode combines both series and parallel modes.The dual hybrid ZEV mode can operate in parallel or series mode.The main drawback of these vehicles is the cost and complexity [19,20].
Meanwhile, the ZEV batteries are limited due to their low autonomy [21].Indeed, the manufactured batteries require high-energy capacity.Despite all the drawbacks, batteries are still widely used in transport applications because of their ability to provide energy demand during acceleration and recovery braking [22].Unfortunately, these batteries have had various disadvantages, such as fast discharge.Indeed, batteries must be oversized to provide a high current [23,24].In support, the fuel cell powered ZEV is considered as a promising alternative power device.Among the fuel cells, the proton-exchange membrane fuel cell (PEMFC) remains the most suitable for the transport areas because it has the highest efficiency, a lower operating temperature, almost zero emissions, fast start, and high efficiency [25].For this reason, several research fields have been published to develop the locomotives served by the PEMFC to encourage the hydrogen economy development.Some of the major PEMFC advantages and drawbacks are the low temperature; low pressure (1 to 2 bar); high voltage, current, and power; sensitive to hydrogen impurities; etc. Due to the above disadvantages, PEMFC, in most applications, remains unable to provide the required power due to its limitation to follow a rapid charge variation and slow dynamics.Most of these applications showed that PEM was strongly affected by a rapid change followed by a power fluctuation.Finally, PEMFC still cannot easily respond to rapid peak demand [26].To compensate for PEMFC fluctuations, supercapacitors (SCs) or batteries can be added.For this reason, an energy storage system such as a battery or SC or both is required.The hybridization of PEMFC with other energy storage systems aims to meet the total power demand.The SC has been included as energy storage to reduce hydrogen consumption and the total cost of the system [27].SC is used as promising energy storage due to its fast charge and discharges and its capacity (20 to 200 times higher).Indeed, the regeneration acceleration and braking phases can be managed and supervised by the SC.Indeed, SC is recommended to manage the fluctuations power of the PEMFC during short and fast braking periods than batteries due to its high power [28,29].Due to its power density, high pressures, energy densities, and high capacity, SC is preferred in transport applications to batteries.For example, the authors in [30] presented an accurate configuration fuel cell/SC ZEV.The obtained results have proven that PEMFC was intervened to guarantee the power in the permanent regime.Compared with PEMFC and batteries, SC has lower energy density and higher power density.
The NZE-HEVSim tool aims to solve such issues that are related to energy demand, as it yet efficient, for the supervisory of the basic ZEV system operations (like the unexpected H 2 gas fuel depletion, fuel consumption, control the energy demands, etc.).In addition to this, the NZE-HEVSim tool applies some major functions.Indeed, NZE-HEVSim unifies the Smart Home benefits as well as New Zero Emission (NZE) needs and features, providing the costumers the ability to simulate many operations (such as charging or discharging and energy and consumption demand).In fact, this NZE-HEVSim tool presents several challenges related to performance improvement of realistic PEMFC/SC Hybrid System by ensuring, smooth and delicate Hybrid ZEV system operation to enhance its relevant reacts against unexpected H 2 gas fuel depletion; collaboration between system components by applying the mult-iagent strategy to achieve a rapid and effective response of the system against any constraint; Energies 2019, 12, 474 3 of 20 fuel consumption prediction according to a chosen runway to be traveled for appropriate algorithm selecting; and Emergency state treatment with appropriate cases when the system becomes unable to withstand the great shortage of hydrogen reserve that can cause its immediate shutdown.
The remainder of this paper is organized as follows.Section 2 focuses on literature review and contributions.Section 3 focuses on the design of the PEMFC/SC hybrid system and equipment utilities.Section 4 describes proposed algorithms for Intelligent Energy Management.Section 5 is devoted to simulation results analysis; finally, concluding remarks are discussed in Section 6.

Literature Review and Contributions
In the literature, numerous researchers have demonstrated simulation of the PEMFC/SC Zero-Emission Hybrid Electric System using a variety of types of energy storage.For example, in Reference [31], the authors developed a PEMFC ZEV system.To control energy demand, a fault-tolerant FPGA (Field-Programmable Gate Array).Indeed, an accurate control based on a non-isolated converter (DC/DC) has been proposed, and a novel method of automotive network simulation intended to allow injection and extraction of real network streams from a simulated network topology suggested.The obtained results demonstrate and evaluate the developed simulation platform using an automotive video application [32].To control a high-power Switched Reluctance Motor (SRM) for ZEV, a new modified Fuzzy Proportional Integral (MFPI) controller is developed [33].
In Reference [34], the authors proposed a simulation hybrid ZEV fuel cell/SC.The fuel cell has presented as the main source.To enable the lower dynamic Fuel Cell (FC) during rapid power changes and recover braking energy, an SC has been used.An accurate fuzzy logic (FL) control is proposed to filter non-sequential components and to minimize parasitic currents.Indeed, the presented control aims to minimize power loss and improve quality energy.The obtained results have proven the feasibility and reliability of the developed system.An efficient hybridization FC/SC hybrid ZEV has been developed using a state space model [35].The FC was used as the main energy source.To control the peak power, an SC was introduced as an auxiliary power source.To determine the desired currents, an accurate energy management was developed and realized using a PI regulator.The obtained results show the performance of the proposed strategy control according to some acting conditions.To overcome the weakness of the previously conventional control, a new IBC supervision control has been proposed for the hybrid MPPT-FC ZEV.To control the required energy and to avoid the phenomenon of fuel shortage during fast transitions, an interleaved boost DC/DC converter (IBC) is used.The proposed design is verified experimentally using a low-cost, low-power microcontroller [36].An efficient hybrid power system combining fuel cell, SC energy, and hydrogen was developed to provide load demand for the hybrid ZEV [37].An efficient PEMFC/SC Hybrid ZEV is presented using an energy storage system in [38].An optimization hydrogen fuel source algorithm was proposed and developed for future ZEV [39].To satisfy the energy demand and optimize the active power, an efficient energy system was proposed.The obtained results indicate the reliability and the effectiveness desirability of the proposed energy management strategy.However, a design and control strategy of a fuel cell/SC hybrid ZEV using hydrogen energy was developed and tested in [40].A polynomial control technique (PCT) was chosen.A precise energy management has been discussed and developed.The obtained results show the performance of the system.In Reference [41], the authors proposed a hybrid electric system (PEMFC/SC) for transport application to cover braking energy.A precise algorithm has been proposed and treated using five operation modes.These presented modes designed to minimize the power demand for the PEMFC and to improve respectively its sustainability.Advanced optimization algorithms for PEMFC Hybrid ZEV Energy Management Systems (EMSs) were proposed.A critical review of each EMS and their optimization algorithms is presented.The critical review presented aims to solve existing problems and improve the performance of future ZEVs.To develop an advanced optimization algorithm for future Hybrid ZEV, several techniques such as linear programming, dynamic programming, and genetic algorithm have been tested and verified [42].Although, the same issue was presented in [43] using metaheuristic-based energy management strategies.The proposed strategies have been included to control the required energy demand for the Fuel Cell-Electrical-Aircraft.An advanced PEMFC-Hybrid-Railroad Advanced Energy Management System (EMS) is presented in [44].The advanced strategy is developed using a combination of Fuzzy Logic Control (FLC) and Haar Wavelet Transform (Haar-WT).The proposed control aimed to avoid rapid changes in energy demand and achieve high efficiency without degrading the performance of the mechanism.In Reference [45], the authors proposed a hybrid electric system using PEMFC.To develop an intelligent detection model, an independent radial network algorithm has been included [46].The proposed algorithm deals to detect different defects types and classify them.To do this, various measures were being taken to correct these defects.An artificial neural network (ANN) was added for fault diagnosis and fault tolerance [47,48].
As we are convinced that the proposed Hybrid ZEV and the developed Controls and Energy Management Systems (EMSs) still feckless to cooperate properly between sources and avoid rapid changes in load demand.Indeed, the proposed strategy was still unable to achieve high efficiency.
This paper expands the ideas of previous studies by implementing a Real-Time Embedded System, Intelligent Energy Management (RT-ES-IEM).The adopted control strategy is used to ensure effectively the required energy demand, solve the previous issues, and improve the hybrid ZEV performance.To evaluate the PEMFC/SC hybrid system durability, safety conditions were proposed and carried out.To control required energy during the peak periods, we are developing an effective real-time energy management platform for PEMFC/SC Hybrid ZEV.
Compared to the previous cited works, the main contribution expected by this paper is to maintain hybrid ZEV smooth operation thanks to an applied real-time intelligent energy management.These latter resorts to the Multi-agent control strategy that thanks to agent coordination enhances the system performance.Indeed, the proposed strategy offers the opportunity to

•
Control the vehicle needs relying on a specific destination characteristics taking from Global Positioning System (GPS); • Control energy distribution flows to fix each agent task; • Achieve safe operation of all system components; and • Conduct real-time performance analysis.

System Design
The proposed NZE-HEVSim tool is often specified by promptly using two different energy sources: PEMFC and SCap (see Figure 1).In this way, the system state progress is predicated depending upon the coordination between its components considering vehicle speed variety all through the movement.Thereby, the NZE-HEVSim tool includes a wise energy management unit supported by a multi-agent strategy to manage effectively the process operation.In this context, every system device has been associated with an agent responsible for status control and verification as well as setting the constraints that may impede its normal functioning.So, the PEMFC, as the main source supply, is joined to an agent controlling the fuel consumption rate to perform the proper load demand.Whereas the agent SCap is given to oversee its state of charge to produce a spare instant power that guarantees normal operation within the presence of serious energy transients.The system management cited speed data issued from vehicle to repair the ability demand for choosing the acceptable intervening component.In coordination with two other optional agents (home and recharging station agents), the system rewards its hydrogen fuel deficit according to the control rules managed by the supervisor agent.Home and recharge station involvement seems to be extremely important to rescue vehicle deficit with hydrogen fuel reserve.In our case study, the house forms a self-supply residential via a renewable energy source with a backup system based on hydrogen production.Indeed, the home retains an agent who controls its inlet and outlet energy flows.Where applicable, the system uses an emergency algorithm to overcome SCap's total electrical energy depletion by cooperation with the home agent (house electrical reserve) to maintain its operation in the desired conditions.In brief, the system under study is correlated with an intelligent supervision unit, able to optimally manage all operating transitions in real-time.In fact, the energy flows distribution control relies on system requirements and the information exchange between its components.In addition, the proposed control strategy depends on several simple organized rules to be implemented in real-time and that can significantly improve system performance in the presence of multi-agent modeling.
Energies 2019, 12, 474 5 of 22 Where applicable, the system uses an emergency algorithm to overcome SCap's total electrical energy depletion by cooperation with the home agent (house electrical reserve) to maintain its operation in the desired conditions.In brief, the system under study is correlated with an intelligent supervision unit, able to optimally manage all operating transitions in real-time.In fact, the energy flows distribution control relies on system requirements and the information exchange between its components.In addition, the proposed control strategy depends on several simple organized rules to be implemented in real-time and that can significantly improve system performance in the presence of multi-agent modeling.

•
Agent "1": PEMFC PEMFC consists of a generator which, within the sight of hydrogen, creates an electric current so as to aid the heap request fulfillment.Hydrogen consumption is described according to Faraday's law [49]: This agent is present to control and identify component behavior that is a variation of its state of charge:

•
Agent "2": Recharging station The recharging station consists of an external charging station whose inlet and outlet H2 fuel amount variation is managed through the state of charge as

•
Agent "3": Supercapacitor • Agent "1": PEMFC PEMFC consists of a generator which, within the sight of hydrogen, creates an electric current so as to aid the heap request fulfillment.Hydrogen consumption is described according to Faraday's law [49]: This agent is present to control and identify component behavior that is a variation of its state of charge: • Agent "2": Recharging station The recharging station consists of an external charging station whose inlet and outlet H 2 fuel amount variation is managed through the state of charge as • Agent "3": Supercapacitor The supercapacitor presents an electrical device that through its discharge can achieve the vitality recuperation process.In this way, to guarantee its assurance against the profound release, the supercapacitor is controlled by its state of charge variation [50]: Energies 2019, 12, 474 6 of 20

•
Agent "4": Home It presents a smart building equipped by a local H 2 gas station.The stored H 2 amount is controlled by the home energy consumption and production while the storage process is made under high pressure, following the law described by the equation below [51].
The home reserve in hydrogen fuel is controlled by its state of charge variation described by the following equation. •

Main parameters
The vehicle power constitutes a very important parameter used to determine the required power.It can be expressed as The required vehicle power is given by Equation (8).
The deficit rate can be measured referring to the expression below.

General Principle
The NZE-HEVSim tool is established as the basis of intelligent energy management rules.Algorithms articulated by this work are based on the multi-agent technique.The used modeling method is distinguished by its flexibility and swift reaction via the coordination between agents.These latter are responsible for information transfer and state control to ensure energy distribution on favorable conditions.
Therefore, the multi-agent system implementation can be achieved by manipulating an agent-oriented modeling environment to develop the communication process and describe the representative interaction and its operation as a function of decision-making.Thereby, each agent sustains a range of related resources it owns and uses.These resources are identified by the available hydrogen reserve for a fuel cell vehicle or the electrical charge of a supercapacitor.
Agents are intelligent to act in their environment.They possess a capacity for perception and reaction to any change intercepted with their own actions.In addition, multi-agent systems are confined to the subsistence of a set of behavioral agents whose skills and services contribute to improving processes performance.The multi-agent system seems to be a distributed network equipped with intelligent agents that collaborate to optimize the operation of the system.
In this work, an autonomous agent is associated with each sole source providing communication between various system components.The supervision algorithm for each component is based on the analysis of states and necessities and the reaction of the control agent to any encountered event.
The communication between agents can be displayed via a sequence diagram permitting the depiction and investigation of information sharing starting with one agent then onto the next.For this situation contemplate, the data issued by the electric vehicle is utilized to settle the fundamental need of the system.In reality, the supervisor mediates to deal with the coordination between all agents and settle on the proper task choice (see Figure 2).
hydrogen reserve for a fuel cell vehicle or the electrical charge of a supercapacitor.
Agents are intelligent to act in their environment.They possess a capacity for perception and reaction to any change intercepted with their own actions.In addition, multi-agent systems are confined to the subsistence of a set of behavioral agents whose skills and services contribute to improving processes performance.The multi-agent system seems to be a distributed network equipped with intelligent agents that collaborate to optimize the operation of the system.
In this work, an autonomous agent is associated with each sole source providing communication between various system components.The supervision algorithm for each component is based on the analysis of states and necessities and the reaction of the control agent to any encountered event.
The communication between agents can be displayed via a sequence diagram permitting the depiction and investigation of information sharing starting with one agent then onto the next.For this situation contemplate, the data issued by the electric vehicle is utilized to settle the fundamental need of the system.In reality, the supervisor mediates to deal with the coordination between all agents and settle on the proper task choice (see Figure 2).The RT-EM-IEM unit carefully controls the energy flows in the vehicle through an accurate estimation of the hydrogen consumption rate and the variation of the state of charge of each system element.In this context, Figure 3 describes the communication algorithm between agents controlled by the variation of required hydrogen consumption (QREQ) and the estimated states of charge.After the data analysis of each agent is received, the RT-EM-IEM unit relies on the demand and the related solution to settle a reliable and appropriate decision to maintain the steady system operation.The RT-EM-IEM unit carefully controls the energy flows in the vehicle through an accurate estimation of the hydrogen consumption rate and the variation of the state of charge of each system element.In this context, Figure 3 describes the communication algorithm between agents controlled by the variation of required hydrogen consumption (Q REQ ) and the estimated states of charge.After the data analysis of each agent is received, the RT-EM-IEM unit relies on the demand and the related solution to settle a reliable and appropriate decision to maintain the steady system operation.
The system begins with the designation of the desired destination and the route to be traveled to estimate the hydrogen consumption rates necessary for proper vehicle operation.Indeed, according to the presented fuel reserve, the system analyzes its lack of fuel and asks for help from other agents (e.g., home or charging station) to reward the energy deficit.An emergency case is also studied which presents an absolutely critical case where the vehicle is impotent in the face of a serious fuel lack.As a solution, the system recourses to the supercapacitor and operates the vehicle in its electric mode using the house electricity reserve when needed while controlling the boost converter that connects the supercapacitor to the vehicle driving load.
Indeed, the coordination between system agents is carried out according to several well-organized tasks described in the following way.The system begins with the designation of the desired destination and the route to be traveled to estimate the hydrogen consumption rates necessary for proper vehicle operation.Indeed, according to the presented fuel reserve, the system analyzes its lack of fuel and asks for help from other agents (e.g., home or charging station) to reward the energy deficit.An emergency case is also studied which presents an absolutely critical case where the vehicle is impotent in the face of a serious fuel lack.As a solution, the system recourses to the supercapacitor and operates the vehicle in its electric mode using the house electricity reserve when needed while controlling the boost converter that connects the supercapacitor to the vehicle driving load.
Indeed, the coordination between system agents is carried out according to several well-organized tasks described in the following way.

Task 1: Parameters estimation
The NZE-HEVSim tool depends on street activity investigation characterizing the coveted route to control vehicle energy needs.Once set, the predictor parameters (vehicle speed and H2 fuel amount) are used to manipulate the agents.The GPS module integration appears to be fundamental to designate the coveted road and its characteristics via online Google Map service.Therefore, the vehicle speed is assessed by various traffic levels (see Figure 3 and Table 1).
Where, Tff and δ present the traffic level and unsteady parameter responsible for traffic level variation, respectively.

Task 1: Parameters estimation
The NZE-HEVSim tool depends on street activity investigation characterizing the coveted route to control vehicle energy needs.Once set, the predictor parameters (vehicle speed and H 2 fuel amount) are used to manipulate the agents.The GPS module integration appears to be fundamental to designate the coveted road and its characteristics via online Google Map service.Therefore, the vehicle speed is assessed by various traffic levels (see Figure 3 and Table 1).
where, T ff and δ present the traffic level and unsteady parameter responsible for traffic level variation, respectively.

Task 2: State component checking
Each agent controls its state of charge according to the vehicle energy requirement and transfer detailed information to the supervisor.The latter is controlled by referring to the estimated required H2 fuel amount prescribed to each agent's activity, as shown in Table 2.

Task 2: State component checking
Each agent controls its state of charge according to the vehicle energy requirement and transfer detailed information to the supervisor.The latter is controlled by referring to the estimated required H2 fuel amount prescribed to each agent's activity, as shown in Table 2.

Task 2: State component checking
Each agent controls its state of charge according to the vehicle energy requirement and transfer detailed information to the supervisor.The latter is controlled by referring to the estimated required H2 fuel amount prescribed to each agent's activity, as shown in Table 2.

Task 2: State component checking
Each agent controls its state of charge according to the vehicle energy requirement and transfer detailed information to the supervisor.The latter is controlled by referring to the estimated required H2 fuel amount prescribed to each agent's activity, as shown in Table 2.

Task 2: State component checking
Each agent controls its state of charge according to the vehicle energy requirement and transfer detailed information to the supervisor.The latter is controlled by referring to the estimated required H 2 fuel amount prescribed to each agent's activity, as shown in Table 2.

Agents Control Demand Remaining Lack Checked State
Agent "1"

Task 3: Decision making
The agent-to-agent communication is managed by the supervisor who works on receiving the status information of and making the most appropriate operation decision.The given Table 3 presents the making decision in the basis of states transitions.

Task 4: Emergency situation
The NZE-HEVSim tool uses an additional control algorithm to compensate the critical fuel and electric charge reserves depletion.The algorithm relies on the required SCap power supply via the house reserve with regulatory duty cycle variation (SCap-related converter control) to reach the necessary need (see Figure 4/Table 4).
Figure 5 illustrates all system behavior of agents' communication and coordination, which is used to make appropriate decisions.

Simulation Process
The performances analysis and evaluation of the proposed NZE-HEVSim tool is based on the real-time simulation test under MATLAB/Simulink.MATLAB interfacing flexibility with embedded development boards like Arduino, STM32, and Raspberry, presents the main reason behind the software choice.Indeed, the proposed system model is tested in the presence of an STM32 discovery F4 card derived from the microcontroller family.In fact, the simulation process of system model

Simulation Process
The performances analysis and evaluation of the proposed NZE-HEVSim tool is based on the real-time simulation test under MATLAB/Simulink.MATLAB interfacing flexibility with embedded development boards like Arduino, STM32, and Raspberry, presents the main reason behind the software choice.Indeed, the proposed system model is tested in the presence of an STM32 discovery F4 card derived from the microcontroller family.In fact, the simulation process of system model prototype is described by Figure 6a from which the sequence of all system tasks can be observed.Although, Figure 6b presents the overall system model implemented in MATLAB/Simulink and then targeted to the STM32 discovery F4 board for real-time simulation.

Simulation Test
The identification of the actual Hybrid ZEV system situation and the appropriate control task requires the assistance of a reference parameter: predicted vehicle speed.The speed prediction is made thanks to real-time collected GPS data: vehicle destinations and road traffic state.Thus, the NZE-HEVSim tool forecasts the necessary H 2 fuel consumption and launches its capabilities analysis regarding requirements.In this case study, a vehicle trip from Faculty of Science of Tunis (FST) to Charguia City has been chosen (see Figure 7).The distance separating the two places is ~8.3 km while the travel time is assumed for 12 min (720 s); the predicted speed values and system requirements are shown in Figure 8.

Simulation Test
The identification of the actual Hybrid ZEV system situation and the appropriate control task requires the assistance of a reference parameter: predicted vehicle speed.The speed prediction is made thanks to real-time collected GPS data: vehicle destinations and road traffic state.Thus, the NZE-HEVSim tool forecasts the necessary H2 fuel consumption and launches its capabilities analysis regarding requirements.In this case study, a vehicle trip from Faculty of Science of Tunis (FST) to Charguia City has been chosen (see Figure 7).The distance separating the two places is ~8.3 km while the travel time is assumed for 12 min (720 s); the predicted speed values and system requirements are shown in Figure 8.As shown, the speed variation depends on the traffic level.In fact, the low recorded speed values are caused by the traffic jam while the vehicle acceleration notifies the less congested traffic (Figure 8a).Thereby, it is noticeable that fuel consumption is mainly related to the vehicle speed variation.Accordingly, higher vehicle speed causes higher fuel consumption (Figure 8b).
In order to ensure optimum energy distribution to reach the desired destination, the proposed management unit transmits the required energy amount to each system component.Also, the NZE-HEVSim tool uses control algorithms to adjust power fluctuation in dynamic mode.Working

Simulation Test
The identification of the actual Hybrid ZEV system situation and the appropriate control task requires the assistance of a reference parameter: predicted vehicle speed.The speed prediction is made thanks to real-time collected GPS data: vehicle destinations and road traffic state.Thus, the NZE-HEVSim tool forecasts the necessary H2 fuel consumption and launches its capabilities analysis regarding requirements.In this case study, a vehicle trip from Faculty of Science of Tunis (FST) to Charguia City has been chosen (see Figure 7).The distance separating the two places is ~8.3 km while the travel time is assumed for 12 min (720 s); the predicted speed values and system requirements are shown in Figure 8.As shown, the speed variation depends on the traffic level.In fact, the low recorded speed values are caused by the traffic jam while the vehicle acceleration notifies the less congested traffic (Figure 8a).Thereby, it is noticeable that fuel consumption is mainly related to the vehicle speed variation.Accordingly, higher vehicle speed causes higher fuel consumption (Figure 8b).
In order to ensure optimum energy distribution to reach the desired destination, the proposed management unit transmits the required energy amount to each system component.Also, the NZE-HEVSim tool uses control algorithms to adjust power fluctuation in dynamic mode.Working As shown, the speed variation depends on the traffic level.In fact, the low recorded speed values are caused by the traffic jam while the vehicle acceleration notifies the less congested traffic (Figure 8a).Thereby, it is noticeable that fuel consumption is mainly related to the vehicle speed variation.Accordingly, higher vehicle speed causes higher fuel consumption (Figure 8b).
In order to ensure optimum energy distribution to reach the desired destination, the proposed management unit transmits the required energy amount to each system component.Also, the NZE-HEVSim tool uses control algorithms to adjust power fluctuation in dynamic mode.Working in coordination, system agents analyze their states on the basis of received information.The Figure 9 illustrates the component intervening according to system requirements.
Energies 2019, 12, 474 14 of 22 in coordination, system agents analyze their states on the basis of received information.The Figure 9 illustrates the component intervening according to system requirements.Therefore, it is noted that coordination between the system agents is carried out in the following data exchange scenarios.


Scenario "1": Own vehicle This scenario highlights the data exchange between the fuel cell and the supercapacitor agents to regulate transient events.This scenario is not distinctive because it is still encountered in each power fluctuation or peak periods.


Scenario "2": Home-to-vehicle This scenario is triggered during the depletion of the H2 vehicle fuel reserve.According to the obtained results shown in Figure 9a, the system uses the home fuel reserve to regulate its energy dues in some operation periods.So, the parameter I FC home denotes the generated fuel cell current after supplying the vehicle with dihydrogen gases (H2) home fuel.


Scenario "3": Charging station-to-vehicle This scenario is allowed when the system declines from a lack of hydrogen both at home and in the vehicle.At this way, vehicle fuel needs is supplied via the station reserve.So, I FC station indicates the output fuel cell current after vehicle charging from station.


Scenario "4": Home-to-vehicle In the emergency state, the system uses this scenario to keep the vehicle running.In fact, it is about supercapacitor charging via the electrical house reserve using the boost control algorithm with a duty cycle adaptation.So, ICTR presents the required supercapacitor supply need that will be ensured by home reserve referring to ISC req and ISC parameters.These latter denotes the required and the generated SCap current, respectively (see Figure 9b).
Referring to the state of charge variation illustrated in Figure 10, it is possible to identify the operating periods of each system component.Indeed, the activation priority recurs primarily to the vehicle agents "1" (FC) and "3" (SCap) in the presence of sufficient H2 fuel reserve and electric charge.Hence, when the SOCVH > 0 condition is achieved in absence of power transits, only the agent Therefore, it is noted that coordination between the system agents is carried out in the following data exchange scenarios.
Scenario "1": Own vehicle This scenario highlights the data exchange between the fuel cell and the supercapacitor agents to regulate transient events.This scenario is not distinctive because it is still encountered in each power fluctuation or peak periods.
Scenario "2": Home-to-vehicle This scenario is triggered during the depletion of the H 2 vehicle fuel reserve.According to the obtained results shown in Figure 9a, the system uses the home fuel reserve to regulate its energy dues in some operation periods.So, the parameter I FC home denotes the generated fuel cell current after supplying the vehicle with dihydrogen gases (H 2 ) home fuel.
Scenario "3": Charging station-to-vehicle This scenario is allowed when the system declines from a lack of hydrogen both at home and in the vehicle.At this way, vehicle fuel needs is supplied via the station reserve.So, I FC station indicates the output fuel cell current after vehicle charging from station.
Scenario "4": Home-to-vehicle In the emergency state, the system uses this scenario to keep the vehicle running.In fact, it is about supercapacitor charging via the electrical house reserve using the boost control algorithm with a duty cycle adaptation.So, I CTR presents the required supercapacitor supply need that will be ensured by home reserve referring to I SC req and I SC parameters.These latter denotes the required and the generated SCap current, respectively (see Figure 9b).Referring to the state of charge variation illustrated in Figure 10, it is possible to identify the operating periods of each system component.Indeed, the activation priority recurs primarily to the Energies 2019, 12, 474 14 of 20 vehicle agents "1" (FC) and "3" (SCap) in the presence of sufficient H 2 fuel reserve and electric charge.Hence, when the SOC VH > 0 condition is achieved in absence of power transits, only the agent "1" is activated (see Figure 10a).On the contrary, the system seeks to operate the most suitable agent based on the control rules of control as: The activation periods of Agent "4" (Home) is related to SOC VH = 0 (see Figure 10b).The operation of Agent "2" (Charging Station) requires SOC HM = 0 (see Figure 10c).Turning on Agent "3" (SCap) is ensured during peak periods and SOC ST = 0 (see Figure 10d).
Energies 2019, 12, 474 15 of 22 "1" is activated (see Figure 10a).On the contrary, the system seeks to operate the most suitable agent based on the control rules of control as: The activation periods of Agent "4" (Home) is related to SOCVH = 0 (see Figure 10b).The operation of Agent "2" (Charging Station) requires SOCHM = 0 (see Figure 10c).Turning on Agent "3" (SCap) is ensured during peak periods and SOCST = 0 (see Figure 10d).The simulation results depicted in Figure 11 denote the fuel distribution per component.In fact, the required fuel amounts are given in Figure 11a, while the possible consumed amounts are illustrated in Figure 11b.To describe the intervention rate of the agents, Table 5 extends the recovery rate ensured by each H2 delivery component.Scenario 4 describes the emergency state and is figured in Figure 12.So, from Figure 12a, it is possible to release the electrical home reserve Ihome and the output boost current I SC BO that bring closer to the control current value (ICTR).However, it can be seen from Figure 12b that the boost control activation rate (duty cycle adaptation) is ~8.88% while the normal converter operation is maintained for 657 s, which presents ~91.25% operation rate.The simulation results depicted in Figure 11 denote the fuel distribution per component.In fact, the required fuel amounts are given in Figure 11a, while the possible consumed amounts are illustrated in Figure 11b.To describe the intervention rate of the agents, Table 5 extends the recovery rate ensured by each H 2 delivery component.Scenario 4 describes the emergency state and is figured in Figure 12.So, from Figure 12a, it is possible to release the electrical home reserve I home and the output boost current I SC BO that bring closer to the control current value (I CTR ).However, it can be seen from Figure 12b that the boost control activation rate (duty cycle adaptation) is ~8.88% while the normal converter operation is maintained for 657 s, which presents ~91.25% operation rate.

Real-Time Simulation
The use of embedded software for the real-time simulation of such an application can bring several advantages.Thus, for our case study (simulation of an electric vehicle), a real-time simulation helps to improve the performance of the system to make it more attractive by reducing the fuel consumption rate.Indeed, embedded software acquires the interest of scientific researchers as long as they offer the opportunity for testing and validating more flexibly such system with cheaper costs.Moreover, once associated with simulation software, the modeling and the implementation of complex systems becomes quite easy through graphical modeling.Hence, the use of models makes it possible to follow and recognize the system requirements to demonstrate correct behavior at the simulation level.Therefore, such a model can be optimized for code generation according to the required data and details for final implementation.In this work, we have used a STM32 discovery F4 board for embedded software implementation.The choice of this system is justified by its ease communication with MATLAB/Simulink environment.In fact, by using the built-in encoder target for STM32F4, the real-time implementation of the developed Simulink model can easily loaded into the processor with few required extension hardware (STM32F4 discovery board/USB type A to mini B cable).The designed Simulink model is configured with built-in target blocks according to the application requirements.Thus, to get access to card devices, the STMicroelectronics STM32F4 support package is required to be installed which contains the necessary Simulink blocks to properly create targeted template.
The hardware implementation of our model under the STM32 card has been done successfully.In fact, after the generating model C code, the program is flashed in the target.To display the results on the board peripherals, we chose four flashing LEDs to designate the four decision keys (DFC, DST, DSC, and DHM).The selection of these output results reverts to their importance in system control as unfortunately we have no other device to expand our platform.
Table 6 gives details about the used peripherals and the mean time release of each one; Figure 13 illustrates LED blinking time.

Real-Time Simulation
The use of embedded software for the real-time simulation of such an application can bring several advantages.Thus, for our case study (simulation of an electric vehicle), a real-time simulation helps to improve the performance of the system to make it more attractive by reducing the fuel consumption rate.Indeed, embedded software acquires the interest of scientific researchers as long as they offer the opportunity for testing and validating more flexibly such system with cheaper costs.Moreover, once associated with simulation software, the modeling and the implementation of complex systems becomes quite easy through graphical modeling.Hence, the use of models makes it possible to follow and recognize the system requirements to demonstrate correct behavior at the simulation level.Therefore, such a model can be optimized for code generation according to the required data and details for final implementation.In this work, we have used a STM32 discovery F4 board for embedded software implementation.The choice of this system is justified by its ease communication with MATLAB/Simulink environment.In fact, by using the built-in encoder target for STM32F4, the real-time implementation of the developed Simulink model can easily loaded into the processor with few required extension hardware (STM32F4 discovery board/USB type A to mini B cable).The designed Simulink model is configured with built-in target blocks according to the application requirements.Thus, to get access to card devices, the STMicroelectronics STM32F4 support package is required to be installed which contains the necessary Simulink blocks to properly create targeted template.
The hardware implementation of our model under the STM32 card has been done successfully.In fact, after the generating model C code, the program is flashed in the target.To display the results on the board peripherals, we chose four flashing LEDs to designate the four decision keys (D FC , D ST , D SC , and D HM ).The selection of these output results reverts to their importance in system control as unfortunately we have no other device to expand our platform.
Table 6 gives details about the used peripherals and the mean time release of each one; Figure 13 illustrates LED blinking time.

Conclusions and Future Work
Development of real-time simulation New Zero-Emission vehicles (ZEV) tool is seen to have better potential for controlling the load demand and minimizing the high fuel costs for minimizing natural fuels and protect the environment against the pollutions caused by vehicles.In this context, a real-time hybrid ZEV composing of PEMFC and SC has been developed and tested using a simulation NZE-HEVSim tool.The developed NZE-HEVSim tool aims to solve the lack power issues during peak demand periods when the Fuel Cell was off, supervise the energy demand, the hydrogen consumptions, in fact, to supervise power fluctuations, a trained RT-EM-IEM has been developed according to several control constraints.The proposed RT-EM-IEM has been supported by a multiagent approach to manage effectively the process operation.To do this, some scenarios were proposed and verified.To streamline zero-emission vehicles (ZEV) aim, components (on/off) have been intelligently supervised by several system states.The obtained results have proven the robustness of the developed hybrid ZEV prototype.Referring to the achieved system performance, it is clear that the hybrid ZEV reacts with flexibility to all critical constraint issues thanks to the efficient MAS.Certain constraints have been solved.
Future works should aim to improve our work by developing and implementing Vehicle-Home (V2H)/Home to Home (H2H)/Home-To Grid (V2G) Simulations tool approaches.Some intelligent energy management systems will be prevented and implemented.

Figure 2 .
Figure 2. Sequence diagram for distribution flow control.

Figure 2 .
Figure 2. Sequence diagram for distribution flow control.

Figure 3 .
Figure 3. Vehicle control based on fuel prediction.

Figure 3 .
Figure 3. Vehicle control based on fuel prediction.

Figure 9 .
Figure 9. System energy distribution: (a) FC current operation per equipment and (b) SCap current operation.

Figure 9 .
Figure 9. System energy distribution: (a) FC current operation per equipment and (b) SCap current operation.

Figure 11 .
Figure 11.H2 supply per component: (a) required amount and (b) delivery amount.Figure 11.H 2 supply per component: (a) required amount and (b) delivery amount.

Figure 11 .
Figure 11.H2 supply per component: (a) required amount and (b) delivery amount.Figure 11.H 2 supply per component: (a) required amount and (b) delivery amount.

Table 2 .
Checking agent state.

Table 2 .
Checking agent state.

Table 2 .
Checking agent state.

Table 2 .
Checking agent state.

Table 2 .
Checking agent state.

Board Outputs GPIO D Pin Number Led Color Mean Time Release (ms)
Agent "1": D FC PIN 15: led 2 Blue

STM32 Board Outputs GPIO D Pin Number Led Color Mean Time Release (ms)
Figure 13.STM32 board led blinking time.