Skip to content

PyBaMM Battery Experiments

Simulate lithium-ion battery charge/discharge runs with PyBaMM and check numerical accuracy

Stars
55,780
Licence
MIT
Files
4 files

What it does

This skill teaches the agent to set up and run lithium-ion battery simulations using the PyBaMM physics library. The agent turns a requested charge, discharge or rest protocol into a validated JSON file, runs a bundled script, and checks results by re-running at tighter solver tolerances and a finer mesh. It can also compare predicted voltage curves against a user's measured CSV data and report the residual errors.

Great for

  • Battery researchers or engineers who want reproducible single-cell SPM or DFN simulations
  • Students learning electrochemical battery modeling with a worked reference example
  • Developers validating whether numerical settings change battery simulation results

Skip it if

  • Controlling a real battery cycler or setting safe operating limits for hardware, because the skill explicitly does not do this and the models are isothermal and exclude aging and pack control
  • Predicting degradation or lifetime, since aging, plating and mechanical effects are not modeled and copying degradation parameters between cells can be misleading

Try asking

  • “Simulate a 0.5C discharge for 600 s, a 120 s rest and a 0.5C charge for a single cell using the SPM model”
  • “Run the bundled Chen2020 reference protocol and show the voltage curve and net discharge capacity”
  • “Compare my measured cycling CSV (time_s, voltage_V, current_A) against an SPM prediction and report RMSE and bias”
Step-by-step guide: how to use PyBaMM Battery ExperimentsInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 4 original files, the MIT licence and an attribution note.

    pybamm.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip pybamm.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip pybamm.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Use the 26.9.0.0 PyBaMM documentation rather than the latest docs, since latest may describe unreleased APIs
  • Check that measured data uses matching time origin, temperature, SOC and capacity before trusting the residuals; a small voltage error with a mismatched current does not validate the model
  • Output directories must be new, so choose a fresh output name for each run

What's inside

  • assets/chen2020-protocol.json
  • references/protocol-and-comparison.md
  • scripts/simulate_battery.py
  • SKILL.md

Redistributed unmodified from K-Dense-AI/scientific-agent-skills under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.