Extended Kalman Filter with Battery Estimation Example

Example implementation of the EKF using complex step differentiation and two methods for linearising and discretising the system dynamics
785 Downloads
Updated 27 Jan 2022

View License

This is an example implementation of the Extended Kalman Filter (EKF) algorithm using complex step differentiation (https://blogs.mathworks.com/cleve/2013/10/14/complex-step-differentiation/) and the following two methods for linearising and discretising the system dynamics:
- The Euler method, with the option to define intermediate steps for increased accuracy
- The Taylor-Heun and Gauss-Legendre methods ("Mazzoni, T. Computational aspects of continuous–discrete extended Kalman-filtering. Comput Stat 23, 519–539 (2008)")
As a toy example, the EKF is used with the cell model from "https://uk.mathworks.com/help/physmod/simscape/ug/lithium-battery-cell-one-rc-branch-equivalent-circuit.html" to estimate the State of Charge, along with the capacitance and internal resistance parameter values of the cell.

Cite As

Efstathios Siampis (2026). Extended Kalman Filter with Battery Estimation Example (https://www.mathworks.com/matlabcentral/fileexchange/105855-extended-kalman-filter-with-battery-estimation-example), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2020a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags
Version Published Release Notes
1.0.0