Skip to main content

Equivalent circuit model

This repository contains Python code for running an equivalent circuit model (ECM) developed for a 2013 Nissan Leaf battery cell and module. The ecm package contains source code for the equivalent circuit model while the examples folder provides scripts for running the ECM for a battery cell, module, and pack. Model parameters are determined from hybrid pulse power characterization (HPPC) and discharge tests conducted at ORNL. The battery cell and module specifications were provided by NREL.

Installation

The Anaconda or Miniconda distribution of Python 3 is recommended for this project. The ecm package requires Matplotlib, NumPy, Pandas, and SciPy.

The simplest way to install the ECM package is with pip. This can be done from within the equiv-circ-model directory:

# Install the ecm package
pip install -e .

A requirements file is provided for running the ECM in a virtual environment using pip:

# Create a new virtual environment
python -m venv env

# Activate the environment
source env/bin/activate

# Install packages needed for the ECM
pip install -r requirements.txt

# From within equiv-circ-model directory, install the ecm package
pip install -e .

# Deactivate the environment
deactivate

# Remove the environment by deleting the `env` folder

An environment yaml file is also provided for running the ECM in a conda environment:

# Create a new conda environment and install packages needed for the ECM
conda env create -f environment.yml

# Activate the environment
conda activate ecm

# From within equiv-circ-model directory, install the ecm package
pip install -e .

# Deactivate the environment
conda deactivate

# Remove the environment and its installed packages
conda env remove -n ecm

Usage

Examples of using the ecm package are provided in the examples folder. Examples are organized into subfolders for battery cell and battery module models. From within the subfolder, each script can be run from the command line such as:

# View plots of the battery cell HPPC data
cd ~/equiv-circ-model/examples/cell
python view_hppc_data.py

# Run the ECM for a battery cell and compare to HPPC battery cell data
cd ~/equiv-circ-model/examples/cell
python hppc_vt.py

Project structure

ecm - Python package containing source code for the equivalent circuit model (ECM).

examples/cell - Example scripts for running the battery cell ECM.

examples/cell-to-module - Examples of using a cell model to predict a battery module.

examples/cell-to-pack - Examples of using a cell model to predict a battery pack.

examples/data - Data files from 2013 Nissan Leaf battery cell and module tests. This data is used for developing and validating the ECM.

examples/module - Example scripts for running a battery module ECM.

examples/module-to-pack - Examples of using a module model to predict a battery pack.

Contributing

Comments, suggestions, and other feedback can be submitted on the Issues page.

License

This code is available under the MIT License - see the LICENSE file for more information.

Metadata

Release files for ecm-thinkclock 20.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecm-thinkclock 20.3
File Size Uploaded Provenance
ecm_thinkclock-20.3.tar.gz 12.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ecm-thinkclock 20.3
File Interpreter ABI Platform
ecm_thinkclock-20.3-py3-none-any.whl Python 3 none any Details

Total release size: 29.5 kB

Release files / ecm_thinkclock-20.3.tar.gz

Download URL ecm_thinkclock-20.3.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2f5b35d16d0a2478264548d2ec34af65c5a93ccfe90ac875c5ed6a579a26de19
BLAKE2b-256 checksum
How to use checksums
030e6ff1ec9db49f3011a3801374ca02af451e766367ca74b4990aa8aa746595
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.9

Release files / ecm_thinkclock-20.3-py3-none-any.whl

Download URL ecm_thinkclock-20.3-py3-none-any.whl
Size 17.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c2fa684f63292229fa9cc03d1c0209db650c880246b37318f0b030889b51c8e7
BLAKE2b-256 checksum
How to use checksums
ec46cbe30ec8310ca0012fda37b870876e778eef89b40cf90cfa378918e4ce13
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.8.9

Security for ecm-thinkclock 20.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

20.3 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page