Skip to main content

A Python package for working with battery discharge data and physics-based battery models

Project description

Ampere - Advanced Model Package for ElectRochemical Experiments

Ampere is a Python module for working with battery models.

Using a scikit-learn-like API, we hope to make visualizing, fitting, and analyzing impedance spectra more intuitive and reproducible.

Ampere is currently in the alpha phase and new features are rapidly being added. If you have a feature request or find a bug, please feel free to file an issue or, better yet, make the code improvements and submit a pull request! The goal is to build an open-source tool that the entire electrochemical community can use and improve

Ampere currently provides:

  • A simple API for fitting, predicting, and plotting discharge curves
  • A simple API for generating data, or fitting with arbitrary charge / discharge patterns.

Installation

Dependencies

Ampere requires:

  • Python (>=3.5)
  • SciPy (>=1.0)
  • NumPy (>=1.14)
  • Matplotlib (>=2.0)
  • Cython (>=0.29)

Several example notebooks are provided in the examples/ directory. Opening these will require Jupyter notebook or Jupyter lab.

User Installation

The easiest way to install Ampere is using pip:

pip install ampere

However, it depends on Cython and Microsoft c++ libraries in order to install (on windows). Those should be added as follows:

pip install --upgrade cython setuptools

follow these instructions to install the proper c++ libraries using Microsoft tools.

That may or may not work, depending upon your system. An alternative method of installation that works is:

git clone https://github.com/nealde/ampere

I've recently added the Cython-generated c files back to the repo, so it may be as simple as:

cd ampere python setup.py install

However, if that doesn't work, the following will rebuild the files:

cd ampere/models/P2D

python setup.py build_ext --inplace

cd ../SPM

python setup.py build_ext --inplace

This will build the local C code that is needed by the main compiler. Then, you can cd back up to the main folder and

python setup.py install

That will typically work. I'm still working on getting pip installation working, and it will likely require some package modifications, following SKLearn as a guide.

Examples and Documentation

Examples and documentation will be provided after my Defense, which is set for the end of May.

On the Horizon

  • Currently, all models are solved with Finite Difference discretization. I would love to use some higher order spatial discretizations.

  • Currently, the results have not been verified with external models. That is still on the to-do list, and to incorporate those values into the test suite would be excellent.

  • Some of my published work regarding surrogate models for solving and fitting will be implemented once they are fully fleshed out.

  • Add ability to serialize / deserialize models from disk, to save the result of an optimization

  • add ability to have custom Up / Un functions for different battery chemistries

  • add documentation / fix docstrings to be accurate

  • add Latex equations and node spacings

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

ampere-0.5.9.tar.gz (259.3 kB view details)

Uploaded Source

File details

Details for the file ampere-0.5.9.tar.gz.

File metadata

  • Download URL: ampere-0.5.9.tar.gz
  • Upload date:
  • Size: 259.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.6.13

File hashes

Hashes for ampere-0.5.9.tar.gz
Algorithm Hash digest
SHA256 0c5920c306c681d97853cdcd841b4a38ce3df138e64f225bfd3c9903a7044c17
MD5 67b44c5606196cf2c17f5b1de810296d
BLAKE2b-256 12afb67fa24444e823d6c219e3b9f8062cb69c7ba9896a740eb118bbaac47bba

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