Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,18 +31,18 @@ jobs:
matrix:
include:
# All Python versions against the latest PyBaMM
- {python-version: "3.10", pybamm-version: "26.9"}
- {python-version: "3.11", pybamm-version: "26.9"}
- {python-version: "3.12", pybamm-version: "26.9"}
- {python-version: "3.13", pybamm-version: "26.9"}
- {python-version: "3.14", pybamm-version: "26.9"}
- {python-version: "3.10", pybamm-version: "26.10"}
- {python-version: "3.11", pybamm-version: "26.10"}
- {python-version: "3.12", pybamm-version: "26.10"}
- {python-version: "3.13", pybamm-version: "26.10"}
- {python-version: "3.14", pybamm-version: "26.10"}
# Older PyBaMM versions against the latest Python they support.
# Keep exactly the latest 6 releases (see policy in pyproject.toml).
- {python-version: "3.14", pybamm-version: "26.4"}
- {python-version: "3.14", pybamm-version: "26.5"}
- {python-version: "3.14", pybamm-version: "26.6"}
- {python-version: "3.14", pybamm-version: "26.7"}
- {python-version: "3.14", pybamm-version: "26.8"}
- {python-version: "3.14", pybamm-version: "26.9"}

steps:
- uses: actions/checkout@v4
Expand Down
39 changes: 14 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,47 +57,36 @@ Two decisions determine the right block: **thermal ownership** and **integration

| Block | Thermal | Strategy | Use when |
|---|---|---|---|
| `CellElectrothermal` | PyBaMM (internal) | Monolithic ODE | Single cell, coupled electro-thermal, ODE model |
| `CellElectrical` + `LumpedThermal` | PathSim (external) | Monolithic ODE | Pack-level, custom cooling, ODE model |
| `CellCoSimElectrothermal` | PyBaMM (internal) | Co-simulation | DAE models (DFN, lead_acid.Full), mixed solvers |
| `CellCoSimElectrical` + `LumpedThermal` | PathSim (external) | Co-simulation | DAE models with external thermal network |
| `CellElectrothermal` | PyBaMM (internal) | Monolithic | Single cell, coupled electro-thermal |
| `CellElectrical` + `LumpedThermal` | PathSim (external) | Monolithic | Pack-level, custom cooling |
| `CellCoSimElectrothermal` | PyBaMM (internal) | Co-simulation | PyBaMM's own solvers, mixed solvers |
| `CellCoSimElectrical` + `LumpedThermal` | PathSim (external) | Co-simulation | PyBaMM's own solvers with external thermal network |

`LumpedThermal` is a single-node thermal block (`mass`, `Cp`, `UA`, `T0`) that receives `Q_dot` from a `CellElectrical` block and feeds back cell temperature.

## PyBaMM model compatibility
## PyBaMM models

Thermal sub-model and heat-source options are injected automatically — pass the bare model class with no `options=`.
All blocks accept any PyBaMM battery model, e.g. `lithium_ion.SPM`, `SPMe`, `DFN`, `lead_acid.LOQS`, `lead_acid.Full` or `equivalent_circuit.Thevenin`. Thermal sub-model and heat-source options are injected automatically — pass the bare model class with no `options=`.

| PyBaMM model | Default parameter set | `CellElectrical` | `CellElectrothermal` | `CellCoSimElectrical` | `CellCoSimElectrothermal` |
|---|---|:---:|:---:|:---:|:---:|
| `lithium_ion.SPM` | `Chen2020` | ✅ | ✅ | ✅ | ✅ |
| `lithium_ion.SPMe` | `Chen2020` | ✅ | ✅ | ✅ | ✅ |
| `lithium_ion.DFN` | `Chen2020` | ❌ DAE | ❌ DAE | ✅ | ✅ |
| `lead_acid.LOQS` | `Sulzer2019` | ✅ ¹ | ✅ ¹ | ✅ ² | ✅ ² |
| `lead_acid.Full` | `Sulzer2019` | ❌ DAE | ❌ DAE | ✅ | ✅ |
| `equivalent_circuit.Thevenin` | `ECM_Example` | ✅ | ✅ | ✅ ³ | ✅ ³ |
Known limitations of the co-simulation blocks:

¹ Not on PyBaMM 26.7 — there `LOQS` is a DAE, use a `CellCoSim*` block instead. It is an ODE again from 26.8 on.

² PyBaMM < 26.7 only — pass `pybamm_solver=pybamm.CasadiSolver(mode="safe")`; the default `IDAKLUSolver` errors on `LOQS`. Fixed in 26.7.

³ `initial_soc=1.0` fails because PyBaMM requires event values to be strictly positive at `t=0`; the "Maximum SoC" event is zero exactly at full charge. Any value below 1.0 (e.g. `initial_soc=0.99`) works.
- `lead_acid.LOQS` on PyBaMM < 26.7: pass `pybamm_solver=pybamm.CasadiSolver(mode="safe")`; the default `IDAKLUSolver` errors on `LOQS`.
- `equivalent_circuit.Thevenin`: `initial_soc=1.0` fails because PyBaMM requires event values to be strictly positive at `t=0`; use e.g. `initial_soc=0.99`.

```python
import pybamm
from pathsim_batt import CellElectrothermal, CellCoSimElectrical
from pathsim_batt import CellElectrical, CellElectrothermal

# Custom chemistry / parameter set
cell = CellElectrothermal(
model=pybamm.lithium_ion.SPMe(),
parameter_values=pybamm.ParameterValues("Mohtat2020"),
)

# Lead-acid via co-simulation (DAE model)
cell = CellCoSimElectrical(
model=pybamm.lead_acid.Full(),
parameter_values=pybamm.ParameterValues("Sulzer2019"),
dt=1.0,
# High-fidelity model
cell = CellElectrical(
model=pybamm.lithium_ion.DFN(),
parameter_values=pybamm.ParameterValues("Chen2020"),
)

# Equivalent circuit model
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ classifiers = [
"Topic :: Scientific/Engineering",
]
dependencies = [
"pathsim>=0.22",
"pathsim>=0.26",
# PyBaMM ships native code that can't be installed in Pyodide. The
# marker resolves to a normal eager install on every real platform and
# is skipped on Emscripten so the pure-Python parts of the toolbox
Expand All @@ -37,7 +37,7 @@ dependencies = [
# remove its CI row and any workarounds only it needed. A version may be
# dropped earlier if it blocks a fix or feature. Raising the lower bound
# requires a minor (not patch) pathsim-batt release.
"pybamm>=26.4,<26.10; sys_platform != 'emscripten'",
"pybamm>=26.5,<26.11; sys_platform != 'emscripten'",
]

[project.optional-dependencies]
Expand Down
Loading
Loading