Averaging Replicate Cells¶
BatteryProc can compute average performance curves when you have multiple cells tested under similar conditions. This is useful for visualizing the typical behaviour of a group of replicate cells, including mean and standard deviation.
When to Use Averaging¶
Use averaging when you have 2+ cells that were tested with the same protocol and you want to:
- See the average capacity fade or energy trend across the group.
- Quantify cell-to-cell variability with standard deviation bands.
- Generate a single representative plot for publication.
Averaging Flags¶
--average: This flag enables averaging for capacity-related metrics (e.g., charge/discharge capacity, CE, capacity retention).- It produces plots like
*_Average_avg_capacity_vs_cycle.png,*_Average_avg_capacity_retention_vs_cycle.png, and*_Average_avg_coulombic_efficiency_vs_cycle.png. - It also saves a CSV file (
*_Average_avg_capacity_vs_cycle.csv) containing the averaged capacity data.
- It produces plots like
--average-energy: This flag enables averaging for energy-related metrics.- It produces
*_Average_Energy_avg_energy_vs_cycle.png. - It also saves a CSV file (
*_Average_Energy_avg_energy_vs_cycle.csv) containing the averaged energy data.
- It produces
- You can use both
--averageand--average-energytogether if you need both types of averages.
Grouping Logic¶
By default, cells are considered “similar” for averaging if they share the same base filename (e.g. CellA in CellA-1.xlsx, CellA-2.xlsx) and have an identical step plan (test procedure) as recorded in the Excel’s test sheet. The tool generates a unique step plan signature for each cell (a hash of the step sequence) and only averages cells with matching signatures.
Note: Step plan signatures use the raw values from the
testsheet. Even very small mismatches (for example0.059vs0.060mA cut-off currents) produce different hashes, so cells with tiny protocol edits will not group unless you opt into--average-ignore-plan.
--average-ignore-plan: This flag applies to both capacity and energy averaging. If used, it overrides the strict step-plan matching. Cells will be grouped by common base filename alone, ignoring differences in their test protocols. When supplied without--averageor--average-energy, the CLI automatically enables capacity averaging and prints a notice so the workflow cannot silently skip averaging.
Common Averaging Behaviors¶
- Outlier Removal: BatteryProc performs basic outlier removal. If a cell’s initial capacity/energy is significantly different from others in its group (e.g., >75% variance in the first few cycles), it's excluded from that specific average.
- Cycle Truncation: Averaging is performed up to the lowest common cycle count among the valid cells in a group.
- Output Location: Averaged plots and CSVs are saved in the main output directory (one level above individual cell result folders).
- Individual Results: Individual cell processing and plot generation still occur as usual even when averaging flags are used.
Usage Examples¶
batteryproc data_folder/ --average -o results/: Average capacity metrics for similar cells indata_folder/.batteryproc data_folder/ --average-energy -o results/: Average energy metrics for similar cells.batteryproc data_folder/ --average-ignore-plan -o results/: Ignore step-plan differences and average capacity with automatic--averageactivation.batteryproc FileA1.xlsx FileA2.xlsx --average --average-energy -o results/: Average both capacity and energy forFileA1andFileA2(if their step plans match, or if--average-ignore-planis also used).
See Also¶
- Debugging Flags — Use
--debug-signaturesto see why cells are or aren't grouping. - Troubleshooting: Averaging not working — Common causes and solutions.
- CLI Reference — Full flag reference.