Skip to content

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.
  • --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.
  • You can use both --average and --average-energy together 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 test sheet. Even very small mismatches (for example 0.059 vs 0.060 mA 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 --average or --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 in data_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 --average activation.
  • batteryproc FileA1.xlsx FileA2.xlsx --average --average-energy -o results/: Average both capacity and energy for FileA1 and FileA2 (if their step plans match, or if --average-ignore-plan is also used).

See Also