Skip to main content

A battery pack simulator for PyBaMM

Project description

logo

liionpack Documentation Status codecov Open In Colab DOI

Overview of liionpack

liionpack takes a 1D PyBaMM model and makes it into a pack. You can either specify the configuration e.g. 16 cells in parallel and 2 in series (16p2s) or load a netlist.

Installation

Follow the steps given below to install liionpack. The package must be installed to run the included examples. It is recommended to create a virtual environment for the installation, see the documentation.

To install liionpack using pip, run the following command:

pip install liionpack

Conda

The following terminal commands are for setting up a conda development environment for liionpack. This requires the Anaconda or Miniconda Python distribution. This environment installs liionpack in editable mode which is useful for development of the liionpack source code. General users should install liionpack with pip.

# Create a conda environment named lipack
cd liionpack
conda env create --file environment.yml

# Activate the environment
conda activate lipack

# Exit the environment
conda deactivate

# Delete the environment
conda env remove --name lipack

LaTeX

In order to use the draw_circuit functionality a version of Latex must be installed on your machine. We use an underlying Python package Lcapy for making the drawing and direct you to its installation instructions here for operating system specifics.

Example Usage

The following code block illustrates how to use liionpack to perform a simulation:

import liionpack as lp
import numpy as np
import pybamm

# Generate the netlist
netlist = lp.setup_circuit(Np=16, Ns=2, Rb=1e-4, Rc=1e-2, Ri=5e-2, V=3.2, I=80.0)

output_variables = [
    'X-averaged total heating [W.m-3]',
    'Volume-averaged cell temperature [K]',
    'X-averaged negative particle surface concentration [mol.m-3]',
    'X-averaged positive particle surface concentration [mol.m-3]',
]

# Heat transfer coefficients
htc = np.ones(32) * 10

# Cycling experiment, using PyBaMM
experiment = pybamm.Experiment([
    "Charge at 20 A for 30 minutes",
    "Rest for 15 minutes",
    "Discharge at 20 A for 30 minutes",
    "Rest for 30 minutes"],
    period="10 seconds")

# PyBaMM parameters
parameter_values = pybamm.ParameterValues("Chen2020")

# Solve pack
output = lp.solve(netlist=netlist,
                  parameter_values=parameter_values,
                  experiment=experiment,
                  output_variables=output_variables,
                  htc=htc)

Documentation

There is a full API documentation, hosted on Read The Docs that can be found here.

Contributing to liionpack

If you'd like to help us develop liionpack by adding new methods, writing documentation, or fixing embarrassing bugs, please have a look at these guidelines first.

Get in touch

For any questions, comments, suggestions or bug reports, please see the contact page.

Acknowledgments

PyBaMM-team acknowledges the funding and support of the Faraday Institution's multi-scale modelling project and Innovate UK.

The development work carried out by members at Oak Ridge National Laboratory was partially sponsored by the Office of Electricity under the United States Department of Energy (DOE).

License

liionpack is fully open source. For more information about its license, see LICENSE.

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

liionpack-0.3.11.tar.gz (4.4 MB view details)

Uploaded Source

Built Distribution

liionpack-0.3.11-py3-none-any.whl (31.0 kB view details)

Uploaded Python 3

File details

Details for the file liionpack-0.3.11.tar.gz.

File metadata

  • Download URL: liionpack-0.3.11.tar.gz
  • Upload date:
  • Size: 4.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for liionpack-0.3.11.tar.gz
Algorithm Hash digest
SHA256 b18f204b3b730cb45b66ad1e1891775c67f81b04f678494eed29da8613a041dc
MD5 02c23f352afccf1044e55c48a89c6465
BLAKE2b-256 7099996d4ea364360b760a73459d226a4e18e3cad8ddd73148af5c2c1e55e401

See more details on using hashes here.

File details

Details for the file liionpack-0.3.11-py3-none-any.whl.

File metadata

  • Download URL: liionpack-0.3.11-py3-none-any.whl
  • Upload date:
  • Size: 31.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for liionpack-0.3.11-py3-none-any.whl
Algorithm Hash digest
SHA256 4064ce04d5043dd80a6745a428fdb80b7261e7eedb8a2c0ee5cb7671b93f1e71
MD5 14251bae8a4cffa72881675b3b0d85a4
BLAKE2b-256 a81911723f7ce9fa2bb1e7d28c8050dd90534337fe85f36788b65fa0e252c4e6

See more details on using hashes here.

Supported by

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