Skip to content

Commit

Permalink
Merge pull request #856 from pybamm-team/issue-820-release
Browse files Browse the repository at this point in the history
Issue 820 release
  • Loading branch information
valentinsulzer authored Feb 26, 2020
2 parents 4bf5990 + 109f395 commit 801492b
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 128 deletions.
3 changes: 1 addition & 2 deletions .requirements-docs.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
# Requirements for readthedocs.io
numpy>=1.14
scipy>=1.0
scipy>=1.3
pandas>=0.23
anytree>=2.4.3
autograd>=1.2
scikit-fem>=0.2.0
casadi>=3.5.0
guzzle-sphinx-theme
sphinx>=1.5
python-Levenshtein>=0.12.0
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM)
# [v0.2.0](https://github.com/pybamm-team/PyBaMM/tree/v0.2.0) - 2020-02-26

This release introduces many new features and optimizations. All models can now be solved using the pip installation - in particular, the DFN can be solved in around 0.1s. Other highlights include an improved user interface, simulations of experimental protocols (GITT, CCCV, etc), new parameter sets for NCA and LGM50, drive cycles, "input parameters" and "external variables" for quickly solving models with different parameter values and coupling with external software, and general bug fixes and optimizations.

## Features

Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/pybamm-team/PyBaMM/master?filepath=examples%2Fnotebooks)
[![black_code_style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)

Python Battery Mathematical Modelling solves continuum models for batteries, using both numerical methods and asymptotic analysis.
PyBaMM (Python Battery Mathematical Modelling) solves physics-based electrochemical DAE models by using state-of-the-art automatic differentiation and numerical solvers. The Doyle-Fuller-Newman model can be solved in under 0.1 seconds, while the reduced-order Single Particle Model and Single Particle Model with electrolyte can be solved in just a few milliseconds. Additional physics can easily be included such as thermal effects, fast particle diffusion, 3D effects, and more. All models are implemented in a flexible manner, and a wide range of models and parameter sets (NCA, NMC, LiCoO2, ...) are available. There is also functionality to simulate any set of experimental instructions, such as CCCV or GITT, or specify drive cycles.

## How do I use PyBaMM?

Expand All @@ -19,6 +19,24 @@ sim = pybamm.Simulation(model)
sim.solve()
sim.plot()
```
or simulate an experiment such as CCCV:
```python3
import pybamm
experiment = pybamm.Experiment(
[
"Discharge at C/10 for 10 hours or until 3.3 V",
"Rest for 1 hour",
"Charge at 1 A until 4.1 V",
"Hold at 4.1 V until 50 mA",
"Rest for 1 hour",
]
* 3,
)
model = pybamm.lithium_ion.DFN()
sim = pybamm.Simulation(model, experiment=experiment, solver=pybamm.CasadiSolver())
sim.solve()
sim.plot()
```
However, much greater customisation is available. It is possible to change the physics, parameter values, geometry, submesh type, number of submesh points, methods for spatial discretisation and solver for integration (see DFN [script](examples/scripts/DFN.py) or [notebook](examples/notebooks/models/dfn.ipynb)).

For new users we recommend the [Getting Started](examples/notebooks/Getting%20Started/) guides. These are intended to be very simple step-by-step guides to show the basic functionality of PyBaMM.
Expand Down Expand Up @@ -50,7 +68,7 @@ instructions please see [here](INSTALL-WINDOWS.md)

If you use PyBaMM in your work, please cite our paper

"Sulzer, V., Marquis, S. G., Timms, R., Robinson, M., & Chapman, S. J. (2020). Python Battery Mathematical Modelling (PyBaMM). _ECSarXiv. February, 7_."
> Sulzer, V., Marquis, S. G., Timms, R., Robinson, M., & Chapman, S. J. (2020). Python Battery Mathematical Modelling (PyBaMM). _ECSarXiv. February, 7_.
You can use the bibtex

Expand Down
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@
# -- Project information -----------------------------------------------------

project = "PyBaMM"
copyright = "2018, Valentin Sulzer"
author = "Valentin Sulzer"
copyright = "2020, Valentin Sulzer"
author = "The PyBaMM Team"

# The short X.Y version
version = ""
version = "0.2"
# The full version, including alpha/beta/rc tags
release = ""
release = "0.2.0"


# -- General configuration ---------------------------------------------------
Expand Down
96 changes: 0 additions & 96 deletions examples/scripts/compare_lead_acid_3D.py

This file was deleted.

5 changes: 2 additions & 3 deletions examples/scripts/experimental_protocols/cccv.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@
pybamm.set_logging_level("INFO")
experiment = pybamm.Experiment(
[
"Discharge at C/10 for 13 hours or until 3.3 V",
"Discharge at C/10 for 10 hours or until 3.3 V",
"Rest for 1 hour",
"Charge at 1 A until 4.1 V",
"Hold at 4.1 V until 50 mA",
"Rest for 1 hour",
]
* 3,
period="2 minutes",
)
model = pybamm.lithium_ion.DFN() # use {"thermal": "x-lumped"} for thermal effects
model = pybamm.lithium_ion.DFN()
sim = pybamm.Simulation(model, experiment=experiment, solver=pybamm.CasadiSolver())
sim.solve()

Expand Down
19 changes: 0 additions & 19 deletions examples/scripts/experimental_protocols/cccv_lead_acid.py

This file was deleted.

12 changes: 12 additions & 0 deletions pybamm/CITATIONS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,15 @@ journal={ECSarXiv. February},
volume={7},
year={2020}
}

@software{scikit-fem,
author = {Tom Gustafsson and
Geordie McBain},
title = {kinnala/scikit-fem 0.4.0},
month = jan,
year = 2020,
publisher = {Zenodo},
version = {0.4.0},
doi = {10.5281/zenodo.3597656},
url = {https://doi.org/10.5281/zenodo.3597656}
}
1 change: 1 addition & 0 deletions pybamm/spatial_methods/scikit_finite_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class ScikitFiniteElement(pybamm.SpatialMethod):

def __init__(self, options=None):
super().__init__(options)
pybamm.citations.register("scikit-fem")

def build(self, mesh):
super().build(mesh)
Expand Down
2 changes: 1 addition & 1 deletion pybamm/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0, 1, 0
0, 2, 0
8 changes: 8 additions & 0 deletions tests/unit/test_citations.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ def test_sulzer_2019(self):
pybamm.lead_acid.Full(build=False)
self.assertIn("sulzer2019physical", citations._papers_to_cite)

def test_scikit_fem(self):
citations = pybamm.citations

citations._reset()
self.assertNotIn("scikit-fem", citations._papers_to_cite)
pybamm.ScikitFiniteElement()
self.assertIn("scikit-fem", citations._papers_to_cite)

def test_parameter_citations(self):
citations = pybamm.citations

Expand Down

0 comments on commit 801492b

Please sign in to comment.