How acthelen/battery_digital_twin works
1. Repository purpose
- This is a research artifact for a battery digital twin study, not an application service.
- The repo’s main job is to take raw lithium iron phosphate (LFP) cell cycling data, build a reusable processed dataset, and reproduce particle-filter-based prognostics and retirement-optimization figures from the paper.
2. Raw data layer
- The core inputs are the folders under 124 LFP Capacity Data/, split into train, test1, test2, and test3.
- Each split contains many per-cell CSV files (cell1.csv, cell2.csv, etc.), representing capacity trajectories or related cycle data for individual cells.
- 124 LFP Cell Conditions.xlsx appears to hold metadata or operating-condition labels for the cells and is part of the preprocessing boundary.
3. Preprocessing / dataset assembly
- create_capacity_dataset_from_raw_files.py is the ingestion and normalization step.
- It reads the raw CSV files and compiles them into a single serialized dataset, capacity_dataset_124_lfp.pkl.
- This is the main data boundary in the repo: raw experimental files on one side, analysis-ready Python object on the other.
4. Processed dataset as shared contract
- capacity_dataset_124_lfp.pkl is the artifact consumed by the analysis scripts.
- It lets downstream scripts avoid re-parsing all the per-cell CSVs and provides a consistent representation of the 124-cell dataset used in the paper.
5. Single-cell prognostics workflow
- plot_pf_projection_each_cycle_single_cell.py runs a particle filter on one selected cell.
- Its role is explanatory and diagnostic: it shows how the estimated remaining useful life / capacity projection evolves cycle by cycle as more observations arrive.
- The script generates the figure Figures/pf_rul_prediction.pdf, which captures the particle-filter trajectory over time for one cell.
6. Multi-cell prognostics + decision workflow
- run_pf_and_optimize_retirement_six_cells.py is the higher-level analysis script.
- It applies the particle filter to six randomly selected cells and then optimizes retirement decisions for each cell individually.
- This script is where prediction and decision-making meet: prognostic uncertainty is translated into a retirement policy.
7. Decision logic boundary: MAUT
- The retirement optimization uses multi-attribute utility theory (MAUT), as noted in the README.
- Architecturally, this is the decision layer sitting on top of the predictive layer: particle-filter outputs feed into utility-based optimization.
- The outputs correspond to the utility-focused figures in Figures/, including Ah_utility.pdf, MTBC_utility.pdf, and utility_panel_cell27.pdf.
8. Outputs and reproducibility artifacts
- The Figures/ directory contains pre-generated PDFs used in the paper.
- These are not source inputs; they are rendered analysis outputs, showing capacity fade, particle-filter projections, RUL prediction, and utility tradeoffs.
- Figures/all_124_capacity_fade_curves.pdf and Figures/many_pf_trajectory_predictions.pdf suggest broader dataset-level visual summaries, while the others are cell-specific or decision-specific.
9. Data flow summary
- Raw cell CSVs + cell-condition spreadsheet → preprocessing script → serialized dataset (.pkl) → analysis scripts → particle-filter predictions and retirement optimization → PDF figures.
- That pipeline is the central architecture of the repository.
10. Repo boundaries and omissions
- There is no web UI, service layer, or database; the repo is a self-contained scientific computing workflow.
- External dependencies are not explicitly listed here, but the architecture is clearly Python-based and oriented around offline analysis, serialization, and figure generation.
- The README also documents that one anomalously fast-degrading cell from the original “124-cell” dataset was excluded from the study, which is a data curation decision relevant to interpreting the processed dataset.
Main entry points: create_capacity_dataset_from_raw_files.py Build dataset · run_pf_and_optimize_retirement_six_cells.py Retirement opt · capacity_dataset_124_lfp.pkl Capacity dataset · plot_pf_projection_each_cycle_single_cell.py Single-cell PF
Components 16
Raw data
Experimental cell cycling inputs and metadata
- Train split · Raw cycling data for training cells
124 LFP Capacity Data/train - Test 1 · Raw cycling data for one evaluation split
124 LFP Capacity Data/test1 - Test 2 · Raw cycling data for one evaluation split
124 LFP Capacity Data/test2 - Test 3 · Raw cycling data for one evaluation split
124 LFP Capacity Data/test3 - Cell conditions · Operating-condition and labeling metadata for cells
124 LFP Cell Conditions.xlsx
Preprocessing
Dataset assembly boundary from raw files to reusable pickle
- Build dataset · Reads raw CSVs and metadata, then assembles the processed capacity dataset
create_capacity_dataset_from_raw_files.py - Capacity dataset · Shared processed representation consumed by analysis scripts
capacity_dataset_124_lfp.pkl
Analysis
Particle-filter prognostics and retirement optimization
- Single-cell PF · Runs particle filter projections cycle by cycle for one selected cell
plot_pf_projection_each_cycle_single_cell.py - Six-cell PF · Applies particle filtering to multiple cells and prepares prognostic trajectories
run_pf_and_optimize_retirement_six_cells.py - Retirement opt · Converts prognostic uncertainty into utility-based retirement decisions
run_pf_and_optimize_retirement_six_cells.py
Figures
Rendered paper figures
- Fade curves · Dataset-level capacity degradation summary
Figures/all_124_capacity_fade_curves.pdf - PF trajectories · Multiple particle-filter prediction trajectories across cells
Figures/many_pf_trajectory_predictions.pdf - RUL figure · Cycle-by-cycle remaining-useful-life projection for one cell
Figures/pf_rul_prediction.pdf - Ah utility · Utility tradeoff figure for amp-hour based decision criteria
Figures/Ah_utility.pdf - MTBC utility · Utility tradeoff figure for mean time / cycle-based decision criteria
Figures/MTBC_utility.pdf - Utility panel · Cell-specific utility panel for retirement analysis
Figures/utility_panel_cell27.pdf
Connections 15
- Train split → Build dataset: raw CSVs · Training split ingested during dataset assembly
- Test 1 → Build dataset: raw CSVs · Evaluation split ingested during dataset assembly
- Test 2 → Build dataset: raw CSVs · Evaluation split ingested during dataset assembly
- Test 3 → Build dataset: raw CSVs · Evaluation split ingested during dataset assembly
- Cell conditions → Build dataset: metadata · Spreadsheet supplies cell-condition labels and context
- Build dataset → Capacity dataset: writes · Build step serializes the reusable dataset
- Capacity dataset → Single-cell PF: input · Processed dataset consumed by single-cell prognostics
- Capacity dataset → Six-cell PF: input · Processed dataset consumed by multi-cell analysis
- Single-cell PF → RUL figure: renders · Single-cell prognostics generate the RUL figure
- Six-cell PF → Retirement opt: prognostics · Predictions feed the utility-based retirement layer
- Retirement opt → Ah utility: renders · Utility outputs are visualized as Ah figure
- Retirement opt → MTBC utility: renders · Utility outputs are visualized as MTBC figure
- Retirement opt → Utility panel: renders · Utility outputs are visualized for a representative cell panel
- Six-cell PF → PF trajectories: renders · Multi-cell particle-filter trajectories are plotted
- Build dataset → Fade curves: renders · Processed dataset supports capacity fade summary plot