Hamming's lessons for simulating physical systems (including Li-ion cells)
This post is a summary of Hamming’s lectures on simulation (18–20, pp. 128–150). I think this is relevant for this blog because we often need to simulate Li-ion cells and batteries during R&D as well as the real operation.
Hamming’s lectures mostly concern simulations of clear or complicated, but not complex or chaotic systems (in the terms of Cynefin framework). At one place he explicitly says he declined proposals to simulate complex economic and ecological systems. He was prudent: we know the bad reputation of macroeconomic models and simulation.
The good news is that Li-ion cells and battery packs are not complex systems (at least when it comes to simulating their physical behaviour).
Simulation is cheaper and faster than a real experiment, and sometimes the only thing possible
We do computer simulations of physical systems (such as a Li-ion cell) because they are cheaper and faster than real lab experiments. Often we can get more accurate readings from a simulation than we can get from direct measurement in the real world. Field measurements, or even laboratory measurements, are often hard to get accurately in dynamic situations. Furthermore, in a simulation, we can often run over much wider ranges of the independent variables than we can do with any lab setup.
Simulating unstable systems is hard; the good news is that Li-ion cell and battery systems are mostly stable systems
When the simulation has a great deal of stability, meaning resistance to small changes in its overall behavior, then a simulation is quite feasible; but when small changes in some details can produce greatly different outcomes then a simulation is a difficult thing to carry out accurately.
Fortunately, both cell’s short-term (state-of-charge) and long-term (capacity fade, state-of-health) processes are stable. I think the processes of state-of-charge and state-of-health imbalance among multiple cells in a battery are also stable, or, at least, not diverging from small deviations in initial state conditions.
Prove the simulation is reliable
"Why should anyone believe the simulation is relevant?" — Do not begin any simulation until you have given this question a great deal of thought and found appropriate answers. The question covers both the accuracy of the model and the accuracy of the computations.
Never confuse the simulation with the reality: if the simulation showed that event X can happen with probability Y, it doesn't mean that in the real world, event X can happen with probability Y. At least, assume a larger confidence interval.
Only do simulations against laws of hard sciences such as physics or chemistry, or other firmly established and objective rules (rather than "laws" of pseudosciences such as macroeconomics or social sciences).
Embed sanity checks into the simulation, such as checking the law of energy conservation, or the Kirchhoff's laws.
Try to get some live experimental data to verify your simulation. Check against real measurement, if possible.
Tune the simulation parameters using independent physical experiments. Think about all possible parameter and state interdependencies and convert a parameter into a function, if necessary (e. g., cell’s internal resistance can be a function of the state-of-charge and the temperature).
Ask someone to independently check your simulation (the model or the code): see the next section. Ideally, cross-verify advice from two or more experts.
Field experts must review the simulation code step-by-step
If programmers who are not field experts implement the simulation, someone who intimately understands the problem must be involved in the detailed programming of the simulation. It's too easy to misinterpret details when translating symbolic equations of the model into code.
Only field experts can discern acceptable simplifications and omissions of details from the details critical to the accuracy of the simulation.
On the other hand, even if you are an amateur in the field, actively try to make sense of the simulation logic and ask the experts about the places that don't make sense to you. Experts can also miss something.
Do simple simulation first
Do simple simulation first to get early insights into the whole system which would be disguised in a full-scale simulation. Evolve it to a more complete, more accurate simulation later.
Carefully think about a few simulation results instead of skimming through many
Volume output seems to be a poor substitute for acquiring an intimate feeling for the situation being simulated.