# krishnamurthybusam/lithium-ion-cell-modeling architecture

> Architecture diagram of the GitHub repository krishnamurthybusam/lithium-ion-cell-modeling, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/krishnamurthybusam/lithium-ion-cell-modeling
- Repository: https://github.com/krishnamurthybusam/lithium-ion-cell-modeling

## Overview

This repository is an engineering study and reusable toolkit for modeling the LG INR21700 M50 lithium-ion cell. The user-facing workflow moves from electrochemical fundamentals through a from-scratch SPM and full-cell DFN analysis, then parameter fitting, thermal and aging studies, and design/drive-cycle investigations; results can be recorded and queried with SQL. Reusable parameters, the SPM solver, plotting helpers, and persistence code support that work. The README documents the broader notebook capabilities; unsampled notebook internals are represented only where documented, so some relationships are omitted.

Main entry points: [`src/parameters.py`](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/parameters.py) (Cell parameters), [`src/plotting.py`](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/plotting.py) (Plot helpers), [`notebooks/02_single_particle_model_from_scratch.py`](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/02_single_particle_model_from_scratch.py) (SPM study), [`notebooks/07_doe_drivecycles_and_design.py`](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/07_doe_drivecycles_and_design.py) (Design studies)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_model["Cell modeling"]
  node_fundamentals["Fundamentals"]
  node_spm_study["SPM study"]
  node_dfn_study["DFN study"]
end

subgraph group_studies["Engineering studies"]
  node_estimation["Parameter fitting"]
  node_thermal["Thermal study"]
  node_aging["Aging study"]
  node_design["Design studies"]
  node_test_report["Test report"]
end

subgraph group_support["Reusable code"]
  node_spm_solver["SPM solver"]
  node_parameters["Cell parameters<br/>[parameters.py]"]
  node_plotting["Plot helpers<br/>[plotting.py]"]
end

subgraph group_data["Results storage"]
  node_sql_notebook["SQL workflow"]
  node_sql_utils["SQL persistence<br/>[sql_utils.py]"]
  node_sql_database[("SQL database")]
end

node_engineer(("Cell engineer"))
node_pybamm["PyBaMM"]

node_engineer -->|"starts with"| node_fundamentals
node_engineer -->|"runs notebooks"| node_spm_study
node_engineer -->|"runs notebooks"| node_dfn_study
node_engineer -->|"runs notebooks"| node_estimation
node_engineer -->|"runs notebooks"| node_thermal
node_engineer -->|"runs notebooks"| node_aging
node_engineer -->|"runs notebooks"| node_design
node_engineer -->|"runs notebooks"| node_sql_notebook
node_fundamentals -->|"uses"| node_parameters
node_fundamentals -->|"uses"| node_plotting
node_spm_study -->|"runs"| node_spm_solver
node_spm_study -->|"uses"| node_parameters
node_spm_study -->|"uses"| node_plotting
node_spm_solver -->|"loads inputs"| node_parameters
node_spm_study -->|"validates against"| node_pybamm
node_dfn_study -->|"simulates with"| node_pybamm
node_dfn_study -->|"uses"| node_parameters
node_dfn_study -->|"uses"| node_plotting
node_estimation -->|"simulates with"| node_pybamm
node_estimation -->|"uses"| node_parameters
node_estimation -->|"uses"| node_plotting
node_thermal -->|"simulates with"| node_pybamm
node_thermal -->|"uses"| node_parameters
node_thermal -->|"uses"| node_plotting
node_aging -->|"cycles with"| node_pybamm
node_aging -->|"uses"| node_plotting
node_design -->|"simulates with"| node_pybamm
node_design -->|"uses"| node_parameters
node_design -->|"uses"| node_plotting
node_design -->|"generates"| node_test_report
node_sql_notebook -->|"uses"| node_sql_utils
node_sql_notebook -->|"uses"| node_parameters
node_sql_utils -->|"writes and queries"| node_sql_database

click node_fundamentals "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/01_fundamentals_and_theory.py"
click node_spm_study "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/02_single_particle_model_from_scratch.py"
click node_spm_solver "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/spm_from_scratch.py"
click node_dfn_study "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/03_dfn_full_cell_model.py"
click node_estimation "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/04_parameter_estimation_and_validation.py"
click node_thermal "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/05_thermal_coupling_and_dynamics.py"
click node_aging "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/06_degradation_and_aging.py"
click node_design "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/07_doe_drivecycles_and_design.py"
click node_sql_notebook "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/08_data_management_sql.py"
click node_parameters "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/parameters.py"
click node_plotting "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/plotting.py"
click node_sql_utils "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/sql_utils.py"
click node_sql_database "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/tree/main/data"
click node_test_report "https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/tree/main/reports"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_fundamentals,node_spm_study,node_dfn_study toneBlue
class node_estimation,node_thermal,node_aging,node_design,node_test_report toneAmber
class node_spm_solver,node_parameters,node_plotting toneMint
class node_sql_notebook,node_sql_utils,node_sql_database toneRose
class node_engineer,node_pybamm toneIndigo
```

## Components

### Cell modeling

- [Fundamentals](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/01_fundamentals_and_theory.py): `notebooks/01_fundamentals_and_theory.py`
- [SPM study](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/02_single_particle_model_from_scratch.py): `notebooks/02_single_particle_model_from_scratch.py`
- [DFN study](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/03_dfn_full_cell_model.py): `notebooks/03_dfn_full_cell_model.py`

### Engineering studies

- [Parameter fitting](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/04_parameter_estimation_and_validation.py): `notebooks/04_parameter_estimation_and_validation.py`
- [Thermal study](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/05_thermal_coupling_and_dynamics.py): `notebooks/05_thermal_coupling_and_dynamics.py`
- [Aging study](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/06_degradation_and_aging.py): `notebooks/06_degradation_and_aging.py`
- [Design studies](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/07_doe_drivecycles_and_design.py): `notebooks/07_doe_drivecycles_and_design.py`
- [Test report](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/tree/main/reports): `reports`

### Reusable code

- [SPM solver](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/spm_from_scratch.py): `src/spm_from_scratch.py`
- [Cell parameters](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/parameters.py): `src/parameters.py`
- [Plot helpers](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/plotting.py): `src/plotting.py`

### Results storage

- [SQL workflow](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/notebooks/08_data_management_sql.py): `notebooks/08_data_management_sql.py`
- [SQL persistence](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/blob/main/src/sql_utils.py): `src/sql_utils.py`
- [SQL database](https://github.com/krishnamurthybusam/lithium-ion-cell-modeling/tree/main/data): `data`

### Other components

- **Cell engineer**
- **PyBaMM**

## Connections

- Cell engineer → Fundamentals: starts with (evidence: `README.md`)
- Cell engineer → SPM study: runs notebooks (evidence: `README.md`)
- Cell engineer → DFN study: runs notebooks (evidence: `README.md`)
- Cell engineer → Parameter fitting: runs notebooks (evidence: `README.md`)
- Cell engineer → Thermal study: runs notebooks (evidence: `README.md`)
- Cell engineer → Aging study: runs notebooks (evidence: `README.md`)
- Cell engineer → Design studies: runs notebooks (evidence: `README.md`)
- Cell engineer → SQL workflow: runs notebooks (evidence: `README.md`)
- Fundamentals → Cell parameters: uses (evidence: `notebooks/01_fundamentals_and_theory.py`)
- Fundamentals → Plot helpers: uses (evidence: `notebooks/01_fundamentals_and_theory.py`)
- SPM study → SPM solver: runs (evidence: `notebooks/02_single_particle_model_from_scratch.py`)
- SPM study → Cell parameters: uses (evidence: `notebooks/02_single_particle_model_from_scratch.py`)
- SPM study → Plot helpers: uses (evidence: `notebooks/02_single_particle_model_from_scratch.py`)
- SPM solver → Cell parameters: loads inputs (evidence: `src/spm_from_scratch.py`)
- SPM study → PyBaMM: validates against (evidence: `README.md`)
- DFN study → PyBaMM: simulates with (evidence: `notebooks/03_dfn_full_cell_model.py`)
- DFN study → Cell parameters: uses (evidence: `notebooks/03_dfn_full_cell_model.py`)
- DFN study → Plot helpers: uses (evidence: `notebooks/03_dfn_full_cell_model.py`)
- Parameter fitting → PyBaMM: simulates with (evidence: `notebooks/04_parameter_estimation_and_validation.py`)
- Parameter fitting → Cell parameters: uses (evidence: `notebooks/04_parameter_estimation_and_validation.py`)
- Parameter fitting → Plot helpers: uses (evidence: `notebooks/04_parameter_estimation_and_validation.py`)
- Thermal study → PyBaMM: simulates with (evidence: `notebooks/05_thermal_coupling_and_dynamics.py`)
- Thermal study → Cell parameters: uses (evidence: `notebooks/05_thermal_coupling_and_dynamics.py`)
- Thermal study → Plot helpers: uses (evidence: `notebooks/05_thermal_coupling_and_dynamics.py`)
- Aging study → PyBaMM: cycles with (evidence: `notebooks/06_degradation_and_aging.py`)
- Aging study → Plot helpers: uses (evidence: `notebooks/06_degradation_and_aging.py`)
- Design studies → PyBaMM: simulates with (evidence: `notebooks/07_doe_drivecycles_and_design.py`)
- Design studies → Cell parameters: uses (evidence: `notebooks/07_doe_drivecycles_and_design.py`)
- Design studies → Plot helpers: uses (evidence: `notebooks/07_doe_drivecycles_and_design.py`)
- Design studies → Test report: generates (evidence: `README.md`)
- SQL workflow → SQL persistence: uses (evidence: `notebooks/08_data_management_sql.py`)
- SQL workflow → Cell parameters: uses (evidence: `notebooks/08_data_management_sql.py`)
- SQL persistence → SQL database: writes and queries (evidence: `src/sql_utils.py`)
