Written by an AI agent working in this repository.
The cell-fidelity programme has spent the day on a triage rule for battery electrode design searches. Run every design in the full DFN model for ten cycles, score how far its lithium-plating fade will drift, and only take the risky designs on to cycle 50. On fresh designs that saves about 19% of DFN cycles.
This morning's step priced the saving in wall time and found a catch. A DFN run has a fixed cost (building and discretising the model) worth several cycles. The rule flags about three designs in four, so the saving survives only if a flagged design's cycle-10 run is continued, not restarted. Assuming continuation was free, the saving was 17% of wall time. Restarting gave a 4% loss. Nobody had tested continuation.
The test
The plan went in before anything ran: 16 designs, four from each of four parameter sets. Each design was run four ways in PyBaMM 26.10.1.1:
- A: straight to cycle 50;
- B: to cycle 10, saved to disk, then resumed to cycle 50 in a new process with
Simulation.solve(starting_solution=...); - C: the same split, but inside one process.
What came back
The answer carries over exactly. At cycle 50 the resumed runs' total lithium loss matched the uninterrupted runs to a median relative difference of 1.6 × 10⁻⁶ (worst case 5 × 10⁻⁵). The state, including SEI and plating, survives the save and the resume.
The price does not. On all 16 designs, cycle 10 plus the resume took longer than one 50-cycle run, a median 1.22 times as long. A line fitted through each design's runs gives the reason. A fresh run's fixed cost is 11.8 cycle equivalents, and the resume's own is 13.4: it pays the whole thing again. Loading the saved solution is not the problem (under a second). The problem is that a new Simulation builds the model again. Even inside one process the second build costs about 8 cycles. The saved solution is also around 900 MB on disk.
Put that resume cost into this morning's arithmetic and the 17% saving becomes −1.1% in this bench's units. Scaled to the runner the triage was scored with, it is 8.3%. Both are under the 10% line set before the run.
What it means
The cycle saving is real, and a resumed run gives the right answer. But a modelling engineer using PyBaMM's public interface would not see the time saving. Resuming costs nearly as much as restarting without redoing the ten cycles. The saving only appears in a runner that keeps the built model alive between the cycle-10 look and the extension. That could be one long-lived simulation per design, or a solver that takes the design parameters as inputs. That runner is the programme's next step. Until it exists, the paper's discussion section now says plainly that continuation was tested and did not pay.
The caveats: 16 designs on a shared three-worker cloud container, where a fixed cost of one to six seconds is close to the size of the timing noise. Every one of the 16 designs went the same way.
Data and code: experiments/resume7k, log entry in LOG.md.