Battery Cell Fit
search/get_schema ("pybamm simulate", "battery model").pybamm_health and list available models with pybamm_models;pybamm_simulate; track asynchronous runs via pybamm_job_statusOverview
Fitting a physics-based cell model is a loop, not a call: pick the cheapest model that can express the data, simulate against the experimental curves, adjust the parameter set, and only trust the fit after it predicts a condition it was not fitted on. This skill runs that loop with Paramus PyBaMM tools and reports the fitted parameters with their validation error — not just a best-fit curve.
Guidance vs execution: model listing, simulation and job management come from the tested Paramus PyBaMM tools. Do not re-implement SPM/DFN solvers in ad-hoc code.
When to Use
- Experimental cycling data (V–t curves, capacity fade, rate tests) exists and the user wants fitted model parameters or a predictive model of the cell
- Comparing what model complexity (SPM vs SPMe vs DFN) the data can support
Do not use for: pack-level thermal or BMS design questions, pure statistical state-of-health forecasting with no physics model, or screening archival datasets before any lab data exists (that retrieval step belongs to the battery-archive app once it ships). The trigger here is user-supplied cycling data plus a fit/validate request.
Domain Judgment
- Cheapest adequate model wins: a DFN fitted to sparse data yields unidentifiable parameters that look precise — prefer SPMe when the data cannot constrain DFN.
- Fit error and validation error are different numbers and both are mandatory: a parameter set that only reproduces its fitting data is a description, not a model.
- Identifiability before fitting: use correlation analysis to check that the parameters you intend to fit actually produce separable effects in the data; drop or fix the ones that do not, and say so.
- Units and C-rate conventions (nC vs C/n) are the most common silent error — state the convention once and check every dataset against it.
Failure modes
pybamm_healthfails → stop and report; no local ODE re-implementation.- Data too sparse for the requested model level → report the identifiability limit and propose the cheaper model rather than forcing the fit.
- Simulation job fails or times out → retry once with a reduced experiment; if it persists, report the blocked step with the job id.
- Validation error far above fit error → say the model is overfit or the wrong level, and deliver the diagnosis instead of the parameter table as the headline.
Example
Asked: "Here are our NMC/graphite pouch-cell rate tests at 0.2C, 0.5C, 1C and 2C — fit a
model and tell me if it predicts." The skill confirms the service with pybamm_health,
lists models with pybamm_models, and selects SPMe as the cheapest level that captures
the rate-dependent polarization visible between 0.2C and 2C. Fitting iterates on the
diffusion and kinetic parameters via pybamm_simulate runs tracked through
pybamm_job_status / pybamm_job_result, with correlation_analysis confirming which
parameters move the residuals. The 0.5C holdout — excluded from fitting — is then
predicted: the validation curve tracks the experiment within a few mV over most of the
discharge, which the report states as the validation error, explicitly separate from the
fit error on 0.2C/1C/2C. Capacity-fade slope across the fitted cycles is checked with
linear_regression. The verdict: usable for interpolation within the tested rate window,
not for extrapolation beyond 2C.
Input
experimental cycling data (tabular V–t per condition, or capacity per cycle),
Output
chosen model level with reason, fitted parameter table, fit error, holdout
Orchestrates · 7 tools
The skill decides at runtime which to call.
pybamm_health pybamm_models pybamm_simulate pybamm_job_status pybamm_job_result linear_regression correlation_analysis
Frequently Asked Questions
What does Battery Cell Fit do?
Fit a PyBaMM battery model to experimental cell cycling data - choose the model level, estimate the parameter set against the data, and validate with a prediction on a held-out condition. Use when a user provides cycling data (current/voltage/capacity over cycles or C-rates) and asks for fitted parameters or a validated model. Multi-tool WORKFLOW with model-choice and validation judgment.
What do I provide and what do I get back?
You provide: experimental cycling data (tabular V–t per condition, or capacity per cycle),. You get: chosen model level with reason, fitted parameter table, fit error, holdout.
Which tools does it orchestrate?
7 catalog tools, chosen at runtime: pybamm_health, pybamm_models, pybamm_simulate, pybamm_job_status, pybamm_job_result, linear_regression, correlation_analysis.