Coder Social home page Coder Social logo

bpx-example's Introduction

๐Ÿ”‹ PyBaMM BPX example

An example repository showing how to import parameters defined using the BPX standard. To try out the examples locally on your own machine follow the installation instructions below.

The simplest way to use BPX parameters in PyBaMM is to run a 1C constant-current discharge with a model of your choice with all the default settings and load the BPX JSON file:

import pybamm
model = pybamm.lithium_ion.DFN()  # Doyle-Fuller-Newman model
parameter_values = pybamm.ParameterValues.create_from_bpx("example-params.json")
sim = pybamm.Simulation(model, parameter_values=parameter_values)
sim.solve([0, 3600])  # solve for 1 hour
sim.plot()

๐Ÿ’ป About PyBaMM

The example simulations use the package PyBaMM (Python Battery Mathematical Modelling). PyBaMM (Python Battery Mathematical Modelling) is an open-source battery simulation package written in Python. Our mission is to accelerate battery modelling research by providing open-source tools for multi-institutional, interdisciplinary collaboration. Broadly, PyBaMM consists of (i) a framework for writing and solving systems of differential equations, (ii) a library of battery models and parameters, and (iii) specialized tools for simulating battery-specific experiments and visualizing the results. Together, these enable flexible model definitions and fast battery simulations, allowing users to explore the effect of different battery designs and modeling assumptions under a variety of operating scenarios.

๐Ÿš€ Installation

In order to run the examples in this repository you will need to install PyBaMM (version 22.12 or newer) and BPX.

We recommend installing within a virtual environment in order to not alter any python distribution files on your machine.

PyBaMM is available on GNU/Linux, MacOS and Windows. For more detailed instructions on how to install PyBaMM, see the PyBaMM documentation.

Linux/Mac OS

To install the requirements on Linux/Mac OS use the following terminal commands:

  1. Clone the repository
git clone https://github.com/pybamm-team/bpx-example
  1. Change into the bpx-example directory
cd bpx-example
  1. Create a virtual environment
virtualenv env
  1. Activate the virtual environment
source env/bin/activate
  1. Install the required packages
pip install -r requirements.txt

Windows

To install the requirements on Windows use the following commands:

  1. Clone the repository
git clone https://github.com/pybamm-team/bpx-example
  1. Change into the bpx-example directory
cd bpx-example
  1. Create a virtual environment
python -m virtualenv env
  1. Activate the virtual environment
\path\to\env\Scripts\activate

where \path\to\env is the path to the environment created in step 3 (e.g. C:\Users\'Username'\env\Scripts\activate.bat).

  1. Install the required packages
pip install -r requirements.txt

As an alternative, you can set up Windows Subsystem for Linux. This allows you to run a full Linux distribution within Windows.

Troubleshooting

Problem: ModuleNotFoundError: No module named 'wheel'.

Solution: Use the command pip install wheel before installing the requirements.

Problem: error: unable to create file "...": Filename too long. fatal: unable to checkout working tree

Solution: 1. Configure Windows to accept long file paths. 2. Configure git client to accept long paths: git config --global core.longpaths true

bpx-example's People

Contributors

rtimms avatar

Stargazers

 avatar  avatar Edwin Khoo avatar  avatar

Watchers

Martin Robinson avatar Valentin Sulzer avatar Scott Marquis avatar  avatar

Forkers

bimec

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.