Skip to main content

Battery Simulation Blocks for PathSim

Project description

PathSim-Batt Logo

Battery simulation blocks for PathSim

PyPI License

DocumentationPathSim HomepageGitHub


PathSim-Batt extends the PathSim simulation framework with battery cell blocks using PyBaMM as the electrochemical backend. All blocks follow the standard PathSim block interface and can be connected into simulation diagrams.

Install

pip install pathsim-batt

Blocks

Block Description Key Parameters
CellElectrothermal Coupled electrical + thermal cell (PathSim integrates PyBaMM ODE incl. temperature) model, parameter_values, initial_soc
CellElectrical Electrical only, isothermal; wire to LumpedThermal for external thermal coupling model, parameter_values, initial_soc
CellCoSimElectrothermal Coupled electrical + thermal co-simulation cell (PyBaMM steps internally) model, parameter_values, initial_soc, dt
CellCoSimElectrical Electrical co-simulation cell for external thermal coupling model, parameter_values, initial_soc, dt
LumpedThermal Single-node thermal model for external thermal coupling mass, Cp, UA, T0

PyBaMM integration

The cell blocks wrap PyBaMM models behind the PathSim block interface.

  • CellElectrothermal / CellElectrical use PathSim monolithic integration (DynamicalSystem) and exported CasADi ODE right-hand sides.
  • CellCoSimElectrothermal / CellCoSimElectrical use periodic co-simulation (Wrapper) and call pybamm.Simulation.step() internally.

Only models that yield a pure ODE after discretisation are supported by the monolithic blocks (CellElectrothermal, CellElectrical) — currently SPMe and SPM. Models such as DFN that produce a DAE system (algebraic variables) will raise NotImplementedError there.

For DAE models (e.g. DFN), use the co-simulation blocks (CellCoSimElectrothermal, CellCoSimElectrical).

  • ODE-type PyBaMM models (SPMe, SPM) can be injected via the model parameter
  • Any parameter set can be used via parameter_values (defaults to Chen2020)
  • Immediate initialisation — the PyBaMM model is discretised during block construction
import pybamm

model  = pybamm.lithium_ion.SPMe(options={"thermal": "lumped"})
params = pybamm.ParameterValues("Mohtat2020")
cell   = CellElectrothermal(model=model, parameter_values=params)

# DAE example (DFN): use co-simulation mode
dfn_cell = CellCoSimElectrothermal(
  model=pybamm.lithium_ion.DFN(options={"thermal": "lumped"}),
  parameter_values=params,
  dt=0.1,
)

Thermal coupling modes

Mode Block Owns cell temperature Use when
Internal CellElectrothermal PyBaMM Single-cell simulations, quick setup
External CellElectrical + LumpedThermal PathSim Multi-cell packs, custom cooling models
Co-sim internal CellCoSimElectrothermal PyBaMM DAE models (e.g. DFN), mixed-solver workflows
Co-sim external CellCoSimElectrical + LumpedThermal PathSim DAE models with external thermal network

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pathsim_batt-0.2.0.tar.gz (42.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pathsim_batt-0.2.0-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file pathsim_batt-0.2.0.tar.gz.

File metadata

  • Download URL: pathsim_batt-0.2.0.tar.gz
  • Upload date:
  • Size: 42.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pathsim_batt-0.2.0.tar.gz
Algorithm Hash digest
SHA256 80d283f4a601d8e55767792c128cdf9a1bced36768a8fe85bb1ff3be0c733868
MD5 8a9b663a8499176a69cbf5fe5c7945af
BLAKE2b-256 5c4ab3c3353934be743e563f5c8556d96bccfaa044ff8300100e1d22214d3654

See more details on using hashes here.

Provenance

The following attestation bundles were made for pathsim_batt-0.2.0.tar.gz:

Publisher: pypi_deployment.yml on pathsim/pathsim-batt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pathsim_batt-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pathsim_batt-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pathsim_batt-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 42eb5d79761c5a21ab8497c8d22e3a6bb941dfc31eff306cd061c5f8092f456d
MD5 2014f46c05fe2a8b2de4323ef758671d
BLAKE2b-256 380b11f6aee7de61b79c0678c98784a901ec4a6a0b76e7fc3340c6fa179fe880

See more details on using hashes here.

Provenance

The following attestation bundles were made for pathsim_batt-0.2.0-py3-none-any.whl:

Publisher: pypi_deployment.yml on pathsim/pathsim-batt

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page