The problem
Detailed 3-D thermal models show hotspots inside a module, but they are far too slow for a BMS that must estimate cell core temperatures every second on a small processor. Lumped models are fast but miss gradients. Model order reduction keeps most of the 3-D accuracy at a tiny fraction of the cost, and it allows a temperature observer to estimate unmeasured points from a few sensors.
Objectives
- Build a 3-D transient thermal model of a module and extract its linear state-space form.
- Reduce the model with balanced truncation and a Krylov projection method.
- Compare accuracy and cost of reduced models against the full model across drive cycles.
- Implement the reduced model in Simulink with a Kalman filter to estimate hotspot temperatures.
- Assess real-time feasibility on an embedded target.
What you need
Tools and toolboxes
- Partial Differential Equation Toolbox — 3-D geometry, meshing and transient thermal finite-element model of the module, and extraction of system matrices.
- Control System Toolbox — State-space objects, balred and balanced truncation, frequency-response comparison and Kalman filter design.
- MATLAB — Sparse matrix handling, Krylov projection implementation, error analysis and scripting.
- Simulink — Real-time simulation of the reduced model with an observer and drive-cycle heat inputs.
- Embedded Coder — Optional: generate C code for the reduced model and observer to measure execution time and memory.
Software
- MATLAB R2023b or later
- Partial Differential Equation Toolbox
- Control System Toolbox
- Simulink
Extra parts and data
None beyond the software above.
Key concepts
- State-space thermal model
- A discretised linear heat-conduction model can be written as E·dx/dt = A·x + B·u, y = C·x, where x is nodal temperature, u are heat sources and boundary temperatures and y are chosen output temperatures.
- Balanced truncation
- Transforms the model so each state is equally controllable and observable, then removes states with small Hankel singular values. It has an error bound, but needs Gramians that are costly for very large models.
- Krylov (moment-matching) reduction
- Projects the model onto a subspace that matches its transfer function at chosen frequencies. It scales to large sparse models but has no general error bound.
- Observer
- A Kalman filter running on the reduced model corrects its estimate with a few measured surface temperatures, so unmeasured core and hotspot temperatures can be estimated.
Step-by-step guide
- 1
Define the module and outputs
Choose an example module, for example a 4×3 group of prismatic cells with a cold plate underneath, and define the inputs (heat generation per cell and coolant temperature) and outputs (each cell's core temperature, the module hotspot and the locations where sensors could be placed). Write accuracy targets, for example below 0.5 °C error on outputs across drive cycles, and a cost target such as fewer than 50 states.
Checkpoint: A module drawing with inputs, outputs and sensor locations, and written accuracy and cost targets.
- 2
Build the 3-D thermal model
Create the geometry in the PDE Toolbox, assign anisotropic conductivity to cells (lower through-thickness than in-plane), and properties for the cold plate and interface layers. Apply a convective boundary to the coolant and natural convection on outer surfaces. Mesh and run a transient study with a constant heat load to check steady temperatures and time constants. Record the number of degrees of freedom and the solve time.
Checkpoint: A mesh-convergence check showing output temperatures change less than a set amount between two mesh densities.
- 3
Extract the state-space model
Assemble the finite-element matrices, using the toolbox's matrix assembly functions, to obtain mass, stiffness and load matrices. Form the sparse descriptor model with one input per cell heat source and the coolant temperature, and outputs as selection vectors at the required nodes. Verify the state-space model reproduces the PDE Toolbox transient solution for the same input. Save the matrices to a MAT-file for the reduction steps.
Checkpoint: State-space and PDE-solver transient responses agree to within numerical tolerance at all outputs.
- 4
Generate reference responses
Compute heat-generation profiles for each cell from a vehicle and electrical model on WLTP, MIDC and a fast-charge event, including some cell-to-cell variation. Simulate the full model for each to create reference output temperatures. Record the full model's computation time for each run. Include a cooling-failure case with reduced coolant convection to test reduced models away from nominal conditions. Store inputs and outputs in a standard format so every reduced model is tested on exactly the same data.
Checkpoint: Reference temperature traces for every output and scenario, with full-model run times recorded.
- 5
Krylov reduction
Implement a block Arnoldi projection in MATLAB matching moments at zero frequency and one or two low frequencies relevant to thermal dynamics. Use sparse LU factorisation for the shifted solves. Build reduced models of increasing order and simulate them on all scenarios. Check stability of each reduced model and apply a one-sided or two-sided projection that preserves it where needed.
Checkpoint: A plot of maximum output error against reduced order for the Krylov method, with all reduced models stable.
- 6
Balanced truncation
If the full model is too large for direct Gramian computation, first reduce it with Krylov to a few hundred states, then apply balred or balanced truncation in Control System Toolbox. Plot Hankel singular values to choose the order and compare the a-priori error bound with observed error. Compare frequency responses of full and reduced models with bode or sigma.
Checkpoint: A Hankel singular value plot, chosen order, and observed error below the bound on all scenarios.
- 7
Compare methods
Tabulate error against order and computation cost for Krylov, balanced truncation and a lumped one-node-per-cell model as a baseline. Include run time per simulated second and memory for state matrices. Identify the smallest model that meets the accuracy target for every scenario, including the fast-charge case with the largest gradients. Report errors for the hottest cell separately because it matters most for safety, and note whether errors concentrate in fast transients or in steady states.
Checkpoint: A comparison table with the chosen reduced model meeting both accuracy and cost targets, or a reasoned explanation if no model does.
- 8
Design the temperature observer
Discretise the chosen reduced model at the BMS sample time, for example 1 s. Design a Kalman filter that uses only a few surface sensor locations as measurements. Test it with wrong initial temperatures and measurement noise, and compare estimated core and hotspot temperatures with the full-model reference. Tune process and measurement noise covariances from model error and sensor specifications, and test with sensor bias as well as noise to see how the estimate degrades in realistic conditions.
Checkpoint: Observer estimates converge from a wrong start and keep hotspot error below the target across scenarios.
- 9
Sensor placement study
Evaluate observer accuracy for different numbers and positions of sensors, using an observability measure or simple exhaustive search over candidate locations. Show how few sensors are needed and where they should go. Discuss the practical cost of sensors versus estimation accuracy. Include practical constraints such as sensors only on accessible surfaces or busbars. Check the recommended layout across all scenarios, including the cooling-failure case, so it is not tuned to one operating condition.
Checkpoint: A plot of estimation error against number of sensors with the recommended layout marked.
- 10
Real-time feasibility and report
Implement the reduced model and observer in Simulink and, if Embedded Coder is available, generate C code and measure execution time and memory on a target or with a processor-in-the-loop run. Present the full workflow, comparisons, observer results and feasibility. State the limitations: linear conduction only, constant properties and a fixed coolant convection coefficient. Report flash and RAM use as well.
Checkpoint: Measured or estimated execution time per step well within the sample time, and a complete thesis chapter.
Testing & validation
- Mesh convergence of the 3-D model.
- State-space model matches the PDE solver.
- Reduced-model error against order for each method and scenario.
- Observer convergence and hotspot estimation error with few sensors.
- Execution time and memory of the reduced model and observer.
Expected results
A reduced-order module thermal model with a few dozen states that tracks the 3-D model's hotspot and core temperatures within a stated error, plus an observer that estimates them from a few sensors in real time.
Research angle for your PhD
Research questions: which reduction method gives the smallest model meeting a hotspot accuracy target across realistic EV duty cycles, how many sensors does an observer on that model need, and what is the real-time cost? Metrics: maximum and RMS output error, reduced order, run time per step, memory and observer error. Baselines: lumped per-cell model and the full 3-D model. Validation: multiple drive and fast-charge scenarios not used for reduction choices, and ideally measured module data. A complete pipeline from 3-D model to embedded observer with error bounds and sensor-placement results is a strong publishable contribution.
Take it further
- Handle temperature-dependent coolant convection with parameter-varying reduced models.
- Couple the reduced thermal model with an electrical model for joint SOC and temperature estimation.
- Compare with data-driven reduction such as dynamic mode decomposition.
- Validate against measured thermocouple data from a physical module test.
Viva and review questions
Why not just use a lumped model in the BMS?
A lumped model gives one temperature per cell and misses gradients and hotspots; a reduced 3-D model keeps those details at similar computational cost.
What do Hankel singular values tell you?
They measure how much each balanced state contributes to the input–output behaviour, so states with small values can be removed with little error.
Why combine Krylov and balanced truncation?
Balanced truncation needs Gramians that are too costly for very large models, so Krylov first reduces the model to a size where balanced truncation and its error bound can be used.
Why does the observer need only a few sensors?
The reduced model captures how heat spreads through the module, so measurements at well-chosen surface points constrain the whole temperature field.
Learn it at DIYguru
These DIYguru courses and programmes teach what this project needs.
