This guide walks you through running your first battery simulation with PyBaMM. By the end, you’ll have a working simulation and know how to access and visualize results.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pybamm-team/PyBaMM/llms.txt
Use this file to discover all available pages before exploring further.
Run a basic 1C discharge
The simplest simulation is a 1C constant-current discharge using the Doyle-Fuller-Newman model:This runs the DFN model with default parameters (Chen2020) and plots all key variables interactively.
Basic discharge
Simulate a charge/discharge experiment
Define a multi-step experiment with plain English strings:
Charge/discharge cycle
Access solution variables
After solving, you can extract any model variable from the solution:
Access solution data
Try a different model and parameters
Swap the model and parameter set with minimal changes:Available parameter sets include:
Different model and parameters
Chen2020, Marquis2019, OKane2022, ORegan2022, Ecker2015, and more. See Parameter Sets for the full list.Next steps
Battery Models
Explore SPM, SPMe, DFN, MPM, MSMR and other physics-based models.
Simulations Guide
Learn all Simulation options: solvers, parameters, saving, and loading.
Experiments Guide
Define complex charge/discharge protocols with experiment strings.
API Reference
Full reference for every class, method, and parameter.
You can run PyBaMM notebooks interactively in Google Colab without any local installation by opening notebooks from the PyBaMM GitHub repository in Colab.