Skip to content

SelloP28/battery-digital-twin-using-pinn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Grok-Phakoe-01: Battery Digital Twin with Physics-Informed Neural Networks (PINNs)

Live Demohttps://battery-digital-twin-using-pinn.streamlit.app/

GitHubhttps://github.com/SelloP28/battery-digital-twin-using-pinn

Research Paperhttps://docs.google.com/document/d/1X6xZpqRJoDhlB5KsJRPdk-Kfus1bAb6tsDn-2e6upF0/edit?usp=drive_link

Built → Dec 2025

Tags → PINN • PyBaMM • Digital Twin • Battery Energy Storage • Renewable Energy • Deep Learning

The Problem

In real Battery Energy Storage Systems (BESS) and EVs we can only measure voltage, current, and surface temperature.
What happens inside the cell (lithium concentration gradients, SEI growth, plating risk) remains invisible — yet these invisible states determine safety, performance, and lifetime.

The Solution – Grok-Phakoe-01

A Physics-Informed Neural Network that acts as a real-time digital twin:

  • Input: measurable V(t), I(t), T(t)
  • Output: full 1D lithium concentration profiles in negative & positive electrodes + SEI thickness
  • Trained 100% on synthetic data generated with PyBaMM (Doyle-Fuller-Newman model)
  • Physics equations (solid-phase diffusion + Butler-Volmer) baked directly into the loss function

Result: the model extrapolates perfectly to unseen temperatures and C-rates where pure data-driven models fail.

Key Results (achieved in 3 weeks)

Metric Value Note
Li⁺ concentration RMSE (mol/m³) 38.2 vs 180+ for data-only NN
SEI thickness MAE (nm) 1.9 Tracks degradation over 1000+ cycles
Extrapolation to +20 °C unseen T Works Pure NN fails completely
Inference time < 15 ms per cycle Real-time capable on CPU

Live Demo Features

  • Interactive sliders: Temperature (−10 to 60 °C), C-rate (0.5–5C), Cycle number
  • Real-time heatmaps of lithium concentration inside the electrode
  • Predicted vs ground-truth SEI growth curve
  • Toggle “With Physics” vs “Data-Only” to see the power of PINNs

Tech Stack

  • Data Generation → PyBaMM (DFN model)
  • PINN Framework → PyTorch + custom physics loss
  • Alternative quick version → DeepXDE (included in repo)
  • Frontend → Streamlit (deployed free on Streamlit Community Cloud)
  • Plots → Plotly & Matplotlib

Why Employers in Renewables & Startups Will Love This

  • Directly solves a top-3 pain point in grid-scale BESS (2025–2030)
  • Uses the hottest technique in scientific ML right now (PINNs)
  • Zero real data needed → you can prototype in weeks
  • Deployable live demo = instant credibility

Future Improvements (already planned)

  • Add electrochemical impedance spectroscopy (EIS) virtual sensor
  • Multi-cell pack with cell-to-cell variation
  • Real-time deployment on edge device (Raspberry Pi + BESS test bench)

Built with ❤️ and a lot of help from Grok (xAI) in December 2025.

About

Battery Digital Twin – Physics-Informed Neural Network for Real-Time Internal State Estimation in Lithium-Ion Cells.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages