In Part 1, we explored the concept of Functional Mock-up Units (FMUs) and how they enable simulation models to operate across different software environments. In Part 2, we provided a high-level overview of how BattGenie’s battery model Functional Mock-up Unit (FMU) is enabling the next generation of energy simulations: efficient, accurate, and ready for seamless integration into existing workflows. But what exactly is under the hood?

This week, we’re diving into the core modeling philosophy behind the BattGenie FMU: what it’s built on, why we chose it, and how that foundation supports adaptability, accuracy, and seamless integration across platforms.

From concept to code, this article dives into the physics powering BattGenie’s battery FMU.

Recap – From Concept to Core Capabilities:

In the previous articles, we introduced FMUs as a flexible solution for integrating complex models into diverse simulation environments. We then explored how BattGenie’s battery model FMU stands out by offering a practical, modular, and platform-ready approach to battery simulation.

Along the way, we highlighted several key capabilities that define the BattGenie FMU:

 

BattGenie Simulate P2D Plus FMU Features – A Quick Recap

  • Modular and scalable architecture: Supports everything from single-cell models to full battery packs.
  • Multi-physics modeling: Captures both electrochemical and thermal behavior to reflect real-world operating conditions.
  • High-speed performance: Features a compact and optimized structure designed for parallel execution across cores or compute nodes.
  • Parameter-agnostic flexibility: Adapts to a wide range of chemistries, capacities, and resistance profiles.
  • Seamless portability: Compatible with leading platforms such as MATLAB, Simulink, Python, and Modelica.
  • Transparent and interpretable design: Provides insight into internal model behavior for performance optimization, safety validation, and reliability analysis.

 

BattGenie P2D Plus FMU
BattGenie Simulate P2D Plus FMU

The Backbone – A Physics-Based Model You Can Trust

At the core of the BattGenie Simulate P2D Plus battery FMU is a physics-based framework known as the P2D model, short for the Pseudo-Two-Dimensional model. Commonly known as the Doyle-Fuller-Newman (DFN) model, it is one of the most widely recognized and validated approaches in battery modeling.

The DFN model simulates lithium particle and lithium-ion transport in both the solid particles of the electrodes and the surrounding electrolyte, respectively [1]. It captures key internal states such as Li-ion concentrations, potentials, and diffusion processes across both space and time. This enables the model to represent real-world battery behavior with a high degree of fidelity, capturing concentration and potential gradients more accurately, especially under high charge/discharge current or low temperature conditions, where empirical models or lookup tables along with Machine-Learning or AI models untrained for those conditions tend to fall short.

Rather than treating the battery as a simple voltage source, the DFN model provides a detailed view of the internal electrochemical processes that govern performance, safety, and degradation. To achieve this, the model solves a coupled set of partial differential and algebraic equations that describe lithium transport, charge conservation, electrolyte dynamics, and reaction kinetics. Some of the core equations include:

  • Solid-phase diffusion (Fick’s second law)
    Describes lithium diffusion in electrode particles
  • Electrolyte concentration dynamics
    Tracks salt concentration changes in the electrolyte
  • Charge conservation in solid/electrolyte phases
    Determines potential distributions and reaction current
  • Butler–Volmer reaction kinetics
    Connects overpotential with interfacial reaction rate

Additionally, physics-based models allow for integration of detailed hysteresis & degradation models including SEI layer formation, Li-plating, particle cracking as well as intercalation-induced stresses. With the anode chemistry moving towards higher concentrations of Silicon, modeling Hysteresis & intercalation-induced stresses are pertinent for Si-based anodes.

 

What makes up a battery ? Figure adapted from [R. Bermejo], “Numerical analysis of a finite element formulation of the P2D model for Lithium-ion cells,” Numerische Mathematik (2021), Springer Nature. Licensed under Creative Commons. https://link.springer.com/article/10.1007/s00211-021-01235-2

Why the DFN Model, and Why Now?

The DFN model forms the foundation of BattGenie’s FMU because it offers a rare combination of physical depth and practical adaptability. While more complex than equivalent circuit models, it enables predictive simulation across a wide range of chemistries, load profiles, and environmental conditions. This makes it especially valuable for applications that demand high fidelity, such as control development, thermal management, and safety analysis. Thanks to advances in numerical methods and model structuring, it is now possible to retain the benefits of the DFN framework while achieving efficient performance suitable for real-time environments and large-scale simulation.

BattGenie’s FMU builds on this foundation through custom-tailored numerical implementations, carefully selected state variables, and a modular structure that preserves key electrochemical behavior without sacrificing simulation speed. The result is a model that delivers accuracy where it matters and efficiency where it is needed, whether for rapid prototyping, hardware-in-the-loop testing, or system-level design.

As the battery industry continues to move toward smarter, safer, and more software-driven systems, physics-based models like the DFN are no longer limited to academic use. They are becoming essential tools for design, optimization, and large-scale deployment.

Battery Models and the Accuracy–Complexity Tradeoff: Battery models span a wide spectrum, each offering a different balance of accuracy, computational demand, and real-world usability. At the simplest level, equivalent circuit models (ECMs) represent batteries using resistors and capacitors. These are quick to simulate and easy to implement but provide limited insight into internal cell behavior. Empirical models and single particle models (SPM) or single particle models with electrolyte (SPMe) introduce simplified physics that improve accuracy while keeping computational costs relatively low. However, their assumptions limit performance under high current dynamic loads or variable temperatures, as the electrolyte dynamics capture limited gradients. Higher fidelity Physics-based models, such as the P2D (DFN) model, simulate lithium transport and electrochemical reactions within both electrodes and electrolyte, capturing the dynamic behavior of real batteries with high fidelity. These models are more computationally intensive but provide a richer, more predictive foundation. More advanced approaches may also include thermal coupling, aging mechanisms, or machine learning layers to model degradation and usage-specific variability. As fidelity increases, so does complexity. BattGenie’s FMU is designed to deliver the benefits of high-fidelity modeling while remaining efficient enough for practical engineering use. Not all models are created equal!
Current Battery Modeling Landscape

Inside the FMU: Architecture, Inputs, and Solver Design:

BattGenie’s FMU is engineered for flexibility, fidelity, and seamless integration. Built to comply with the Functional Mock-up Interface (FMI) 3.0 standard, the model supports co-simulation, allowing it to manage its own internal dynamics while coupling easily with other simulation components in tools like MATLAB/Simulink, Modelica, or Python-based environments.

 

Co-simulation FMU

 

At the core of the FMU is a high-resolution implementation of the DFN model, structured around several configurable parameters accounting for constitutive relationships for expressions, including individual electrode open-circuit potentials, non-linear diffusion coefficients, conductivities among others, changing with concentrations and temperatures.  A focused set of around 25 outputs is exposed by default, covering essential electrical and thermal metrics such as terminal voltage, open-circuit voltage, current, state of charge (SOC), cell temperature, internal power, and hysteresis components in both the anode and cathode. For advanced use cases, any internal variable can be configured as an output, providing full access to the model’s internal states for diagnostics, control development, or validation.

The FMU requires only two inputs: applied current and ambient temperature. This minimal interface makes it simple to integrate, while still enabling realistic simulation of a wide range of operating scenarios including variable loads, temperature shifts, and dynamic cycling.

A key differentiator of the BattGenie’s FMU is its custom-designed internal solver. For extremely stiff set of equations, traditional Differential algebraic equation (DAE) solvers fail to find consistent initial conditions for algebraic variables and as a result, often do not converge. The error in convergence is then carried forward in time step integration that makes the results erroneous. While there is ongoing work happening to develop robust solvers such as SUNDIALs that has an initialization subroutine, the solvers may still face convergence problems for highly dynamic load profiles that may be encountered in real-world battery use cases such as regenerative braking in electric vehicles. Developed specifically for high-fidelity battery simulation, BattGenie’s patented  numerical solver utilizes perturbation theory that guarantees consistent initialization of algebraic variables for any input current. With an adaptive time-stepping integration scheme, BattGenie’s method robustly solves the mixed DAE system that arises from detailed electrochemical modeling while adapting to changes in system dynamics. At the same time, it delivers results at a fixed output timestep specified by the user, ensuring compatibility with co-simulation environments and synchronized system-level analysis.

 

Configurable FMU Parameters

Designed with the End User in Mind:

While the BattGenie FMU is grounded in complex electrochemical modeling, its design prioritizes usability. Engineers can plug the FMU directly into system-level simulations with minimal setup, using intuitive inputs and clearly defined outputs. Researchers and advanced users benefit from the model’s transparency, with full access to internal variables for tuning, validation, or control-oriented experimentation. While there are other solutions of porous electrode models available including open-source platforms, none of them match the speed and robustness of the FMU developed by BattGenie.

 

Simulate P2D Plus execution in Simulink and FMUSim.exe

 

Why Not Just Use a Lookup Table or Machine Learning? Simplified battery models such as lookup tables or machine learning surrogates offer fast execution by avoiding the underlying physics. These methods can perform well under steady, well-defined conditions but often fall short when systems face transients, temperature changes, or unusual operating scenarios. Lookup tables are rigid and unable to reflect dynamic responses or internal states. Machine learning models depend heavily on large, high-quality datasets and can lose accuracy with real world noisy or untrained data. They are also difficult to interpret, which limits their usefulness in safety-critical or regulatory contexts. Additionally, Machine-Learning models are good for interpolation but fail miserably for extrapolation & predictions outside of trained conditions. In contrast, BattGenie’s FMU is based on a physics-driven approach that simulates electrochemical and thermal behavior in response to real-time inputs such as current and temperature. This allows the model to adapt to changing conditions while providing transparency and reliability. It delivers consistent performance across a wide range of scenarios, making it a more trustworthy choice for advanced simulation, diagnostics, and system-level integration. Fast is good. Accurate is crucial. Fast & Accurate is where BattGenie delivers!

Whether used for fast prototyping, BMS development, or simulation-based testing, the FMU is structured to meet the demands of both rigorous technical analysis and real-time integration. Its compatibility with multiple platforms ensures flexibility, while its performance optimization ensures that detailed modeling no longer comes at the cost of simulation speed. BattGenie’s FMU allows its customers to run and launch multiple parameter simulation cases in parallel making the cell engineering and development process significantly faster. Some additional use cases of BattGenie’s FMU include:

  1. Ability to run pack level simulations by modeling different pack design topologies by changing the number of cells in series/parallel combination along with thermal modeling.
  2. Ability to estimate model parameters by fitting experimental data to the model.
  3. Ability to determine adaptive charge profiles for temperature or anode over potential control by doing closed-loop control. 
  4. Connect and perform vehicle level simulations by connecting battery FMU with other vehicle components in MATLAB/Simulink or other platforms.
  5. Benchmark reduced order or simplified BMS models against higher fidelity battery models.
  6. Develop Digital-Twins for batteries to simulate the performance of a fleet of vehicles deployed on the road or energy storage systems deployed in the grid. 

Looking Ahead

BattGenie’s FMU is more than a high-fidelity battery model. It is a practical, deployment-ready tool designed to support engineers, researchers, and product teams across development stages, including cell characterization, system integration, virtual prototyping, and hardware-in-the-loop testing. By combining detailed physics with efficient execution, it bridges the gap between accuracy and usability.

In the next article, we will walk through how to use the FMU in simulation environments such as fmusim, MATLAB, Simulink or Python. We will cover how to define inputs, access outputs, and tune model parameters, along with examples of how the FMU can be integrated into system-level workflows. Whether you are building a digital twin or validating a new control strategy, the BattGenie FMU is ready to support and accelerate your work.

 

References

[1] Ramadesigan, Venkatasailanathan, et al. “Modeling and simulation of lithium-ion batteries from a systems engineering perspective.” Journal of the electrochemical society 159.3 (2012): R31.

[2] Chaturvedi, Nalin A., et al. “Algorithms for advanced battery-management systems.” IEEE Control systems magazine 30.3 (2010): 49-68.

 

Share
LinkedIn

Venkat Subramanian

CTO, Chief Scientific Advisor, and Co-Founder

Prof. Venkat Subramanian is currently the Ernest Dashiell Cockrell II Professor of Mechanical & Material Science Engineering at the University of Texas, Austin.

His research interests include energy systems engineering, electrochemical engineering, computationally efficient algorithms for state-of-charge (SOC) and state-of-health (SOH) estimation of lithium-ion batteries, multiscale simulation, and design of energetic materials, kinetic Monte Carlo methods, model-based battery management system for electric transportation, and renewable microgrids and nonlinear model predictive control. Prof. Subramanian was awarded the Dean’s award for excellence in graduate study in 2001 for his doctoral research.

He is a Fellow of the Electrochemical Society and a past Technical Editor of the Journal of the Electrochemical Society. He was also the chair of the IEEE Division of the Electrochemical Society. His codes for Lithium-ion batteries are the fastest reported in the literature and his algorithm for solving index 1 nonlinear DAEs is the most robust compared to any other algorithm reported as of today.

Prof. Subramanian received his B.Tech. degree in Chemical and Electrochemical Engineering from the Central Electrochemical Research Institute (CECRI), Karaikudi, India, in 1997 and the Ph.D. degree in Chemical Engineering from the University of South Carolina, Columbia, SC, USA, in 2001.

Manan Pathak

CEO and Co-Founder

Dr. Manan Pathak is the Chief Executive Officer and co-founder of BattGenie.

He earned his PhD at the University of Washington, where he obtained his graduate thesis on model-based Battery Management Systems. He has 7+ peer-reviewed publications with over 300 citations, and extensive experience with physics-based battery models, numerical methods and derivation of optimal charging profiles.

Chintan Pathak

CPO and Co-Founder

Dr. Chintan Pathak is the Chief Product Officer and co-founder of BattGenie.

He earned his PhD from the University of Washington and he obtained his graduate thesis on optimal locations of battery charging stations in the state of Washington. He has over 13 years of experience in software engineering and embedded systems.

Akshay Subramaniam

Battery Modeling Scientist

Akshay Subramaniam leads electrochemical model development and identification tasks at BattGenie. He also contributes towards BMS algorithm development and validation, and helps maintain our models, databases, and testing pipelines. He received his Ph.D. from the University of Washington during which he gained extensive experience in the development of control-oriented electrochemical models. He has 10+ peer-reviewed publications and is proficient in several aspects of battery systems engineering including numerical simulation techniques, optimization for design and fast charging, parameter estimation, and battery data analysis.

Taejin Jang

Battery Simulation Scientist

Dr. Taejin Jang is a Battery Simulation Scientist at BattGenie. Dr. Jang received his Ph.D in Materials Science from University of Texas at Austin and an MS in Chemical Engineering from UW. He also has BS and MS degrees in Materials Science & Chemical Engineering from Yokohama National University in Japan. He spent three years in the automotive devices industry at Samsung Electronics. He has 7+ years’ experience in battery modeling and simulation, encompassing Li-ion and next-generation batteries.

Bing Syuan Wang

Senior Battery Software and Data Engineer

Bing Syuan Wang is the Senior Battery Software and Data Engineer at BattGenie.
He earned his Masters in Electrical Engineering from the University of Washington. He has over 6 years’ experience in software engineering and in working with battery data.

Aditya Parsai

Fullstack Software Engineer

Aditya Parsai is a Fullstack Software Engineer at BattGenie. He graduated in Civil Engineering from IIT(BHU). With 8 years’ experience, he contributes to helping businesses succeed in the digital space by staying attuned to the evolving tech landscape. His work spans from front-end development to back-end system engineering, ensuring smooth integration and functionality. He recognizes the importance of storytelling and is adept in translating complex ideas into user-friendly interfaces to enhance user experiences.