EV ArticlesFeatured

Fuel Cell EV Design: A System-Level Approach

Hydrogen fuel cells are gaining more attention as we witness an increased awareness of eco-friendly transportation. However, using them as power sources for electric vehicles and deploying them at scale still has obstacles to overcome. These include: 

  • Broad flammability range of hydrogen which creates safety concerns and requires careful handling.
  • Limited availability of physical prototypes for real-world testing and their associated costs
  • Traditional development process that makes refining controls and diagnostics time-consuming and costly.

The propulsion system of a Fuel Cell Electric Vehicle (FECV) involves components from diverse engineering domains such as electrical, mechanical, thermal, and even chemical. Many factors govern the reactions inside a fuel cell, and a software control system must account for them to squeeze the most power and efficiency out of the device. Optimizing the design of individual components inside a fuel cell and the overall system using system-level simulation can lead to more effective design choices, help test against what-if scenarios and minimize overall development times and costs. 

Figure 1. PEM fuel cell. 
Copyright © 2022-2023 The MathWorks, Inc.

Polymer Electrolyte Membrane (PEM) fuel cell, shown in Figure 1, is the most popular type of fuel cell for mobility applications due to its low operating temperature, low pressure, and high efficiency. In the next few sections, we will discuss the benefits of modeling such fuel cells, integrating them as part of the vehicle powertrain and performing system level studies.

Defining the Fuel Cell Model 

Fuel Cell models can capture the behavior of complete fuel cell systems down to detailed thermodynamic and diffusion characteristics of mixed gases. The model shown below (Figure 2) uses a custom library and a custom Simscape domain for multispecies gas modeling. The membrane electrode assembly is a custom component designed using Simscape code that you can adapt to meet specific requirements. For more information, please see this example: PEM Fuel Cell System.

Figure 2. Fuel cell system using the Simscape custom fuel cell domain, including membrane model.  Copyright © 2022-2023 The MathWorks, Inc.

Simulation models of fuel cells offer ease of testing for a broad range of operating conditions, including those that may not be safe or practical with hardware prototypes. They allow for analyzing the overall performance of the fuel cell system, such as estimating FCEV ranges and determining energy flows between batteries and fuel cell stacks. Insights gained from simulation help develop better hardware prototypes, improve effectiveness, and reduce testing costs.

Selecting Fidelity Levels for Fuel Cell System Modeling

The model presented here uses a first principles approach with full gas dynamics, is suitable for component sizing, control design and validation, controller tuning, and identifying concentrations of all gas species in the system’s branches. For some applications, a lower fidelity level is required or sufficient, either because individual simulations take too long or because only a rough behavior needs to be represented. For these cases, Simscape Electrical™ includes a simple fuel cell block reflecting voltage versus current behavior (Figure 3). 

Figure 3. Computational time increases as a function of model complexity.
Copyright © 2022-2023 The MathWorks, Inc.

Simscape Electrical™ also contains more detailed models based on first principles but without gas dynamics (second from right), as well as lookup table–based statistical models (second from left) without dynamics. The latter do however require extensive measurements for gathering the required data. Depending on the application, these different models enable you to select the model that best suits your needs in terms of level of detail and simulation speed. You can also extract a lookup table–based model from the detailed model and use it to speed up simulations in later development stages without sacrificing accuracy. Together with other methods for simulation acceleration, such as parallelization or cloud computing, you can increase productivity and shorten development times.

Benefits of Using Fuel Cell Models Before Hardware Prototypes 

Models offer several benefits in designing and developing fuel cell technologies because they empower engineers to compare different design variants, including the selection and sizing of components, and conduct tradeoff studies. Once an initial model is created, you can optimize parameters and identify the best operation strategies. Such models also enable you to design and validate control algorithms along with the system even before hardware is available. You can start from a simplified model and mature your control strategies together with the overall system. When the system design is complete and validated, you can implement the control algorithms on processors using automated code generation.

MATLAB®, Simulink®, and Stateflow offer capabilities for C/C++, HDL, and structured text code generation that can run on any processor, FPGA, or PLC. Specifically for automotive applications, code generation features also include support for AUTOSAR-compliant workflows. 

Overall, frontloading design decisions with simulation prototypes reduces the need for more expensive hardware prototypes and helps de-risk implementation during the final integration phase. As an example, Plug Power Inc. used MATLAB®, Simulink®, to develop and test algorithms, simulate components and systems, and streamline the development process of Fuel Cells from idea to implementation. Similarly, Nuvera designed the software that controls their fuel cell engine – which typically includes hundreds of fuel cells stacked together with coolant flowing between them using MATLAB® and Simulink®. You may explore more on how these industry leaders are developing and employing hydrogen fuel cells using their detailed development stories.

Implementation and Real-Time Testing of Fuel Cell Controls

With Model-Based design, you can validate your control algorithms by doing rapid prototyping before generating production-ready code. You can also generate code from the Fuel Cell system model and perform hardware-in-the-loop (HIL) testing to avoid costly damages to the fuel cell hardware prototypes. MathWorks partners with Speedgoat Inc. to provide state-of-the-art real-time systems. Together, our solutions allow customers to continuously verify and validate their designs along a complete Model-Based Design workflow, including simulation, rapid control prototyping, HIL testing, and deployment.

Integrating Fuel Cells into Your Electric Vehicle Model

Fuel Cell models can be used as the power source for building a fuel cell electric vehicle or can be integrated with an existing vehicle model built using Powertrain Blockset™ or Simscape™ platform. This system level model can be used for performing system integration studies like testing the dynamic response of fuel cells against the larger electrical system, component selection, design control and diagnostic algorithms, and optimize configurations of the fuel cells for different vehicle configurations. Explore this FECV Reference Application that represents a detailed working model with a fuel cell, motor-generator, battery, direct-drive transmission, and associated powertrain control algorithms.


System-level simulation can help engineers optimize the design of hydrogen fuel cells in electric vehicles. Fuel cell models are important because they facilitate the comparison of design variants, selection of components, and validation of control algorithms. Simulation can provide insights into the system’s performance and efficiency. Different models can be used depending on the application’s requirements. Formal test methods and real-time simulation can validate control algorithms before generating production-ready code. Code generation from the simulation model can eliminate manual algorithm translation errors. Following the Model-Based Design process outlined in this article can help accelerate the development and testing of your Fuel Cell Electric Vehicle!

If you want to know more about this topic, join us for the upcoming webinar series, “Powering the Future with Hydrogen Fuel Cell” on 26-27 April. 

Authored by:

Shripad Chandrachood

Shripad is a Principal Engineer at MathWorks focused on supporting key applications in the areas of electric mobility, power conversion, and grid simulation. For the past 15 years at MathWorks, he has helped customers adopt modeling and simulation workflows for developing advanced power electronics and energy systems and led business development initiatives in the Energy Production and Industrial Automation sectors.

Prasanna Deshpande

Prasanna Deshpande is a Manager of Automotive Industry Application Engineering Team with MathWorks India and specializes in the field of Automotive Electrification, Model-Based Control Design and automation. He and his team members closely work with Automotive OEMs, Suppliers, Startups and Services in adopting Model-Based Design for system simulation, embedded code generation and real-time testing. Prasanna brings more than 16 years of experience with various clients from the automotive industry.

Subscribe & Stay Informed

Subscribe today for free and stay on top of latest developments in EV domain.

Leave a Reply

error: Content is protected !!