Skip to content

Commit 11f056d

Browse files
committed
#1477 merge in develop
2 parents af94506 + 049a9e5 commit 11f056d

File tree

196 files changed

+25309
-1491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+25309
-1491
lines changed

.all-contributorsrc

+22
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
],
55
"imageSize": 100,
66
"commit": false,
7+
"badgeTemplate": "[![All Contributors](https://img.shields.io/badge/all_contributors-<%= contributors.length %>-orange.svg)](#-contributors)",
78
"contributors": [
89
{
910
"login": "tinosulzer",
@@ -365,6 +366,27 @@
365366
"code",
366367
"test"
367368
]
369+
},
370+
{
371+
"login": "molel-gt",
372+
"name": "Leshinka Molel",
373+
"avatar_url": "https://avatars.githubusercontent.com/u/81125862?v=4",
374+
"profile": "https://github.com/molel-gt",
375+
"contributions": [
376+
"code",
377+
"ideas"
378+
]
379+
},
380+
{
381+
"login": "tobykirk",
382+
"name": "tobykirk",
383+
"avatar_url": "https://avatars.githubusercontent.com/u/42966045?v=4",
384+
"profile": "https://github.com/tobykirk",
385+
"contributions": [
386+
"ideas",
387+
"code",
388+
"test"
389+
]
368390
}
369391
],
370392
"contributorsPerLine": 7,

.github/release_checklist.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
- Increment version number in `version`
2-
- Increment version number in `docs/conf.py`
3-
- Update CHANGELOG.md with a summary of the release
4-
- Update (and pin) jax and jaxlib to latest version and fix any bugs that arise
1+
- Increment version number in `version`
2+
- Increment version number in `docs/conf.py`
3+
- Increment version number in `CITATION.cff`
4+
- Update CHANGELOG.md with a summary of the release
5+
- Update (and pin) jax and jaxlib to latest version and fix any bugs that arise

.github/workflows/test_on_push.yml

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
if: matrix.os == 'ubuntu-latest'
4646
run: |
4747
sudo apt install gfortran gcc libopenblas-dev graphviz
48+
sudo apt install texlive-full
4849
4950
- name: Install MacOS system dependencies
5051
if: matrix.os == 'macos-latest'

.github/workflows/update_parameter_sets_doc.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches:
66
- develop
77
paths:
8-
- 'pybamm/parameters/parameter_sets.py'
9-
- 'pybamm/parameters/CITATIONS.txt'
8+
- pybamm/parameters/parameter_sets.py
9+
- pybamm/CITATIONS.txt
1010

1111
jobs:
1212
build:

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
## Features
44

55
- `pybamm.base_solver.solve` function can take a list of input parameters to calculate the sensitivities of the solution with respect to. Alternatively, it can be set to `True` to calculate the sensitivities for all input parameters ([#1552](https://github.com/pybamm-team/PyBaMM/pull/1552))
6+
- Addes UDDS and WLTC drive cycles ([#1601](https://github.com/pybamm-team/PyBaMM/pull/1601))
7+
- Added capability for `quaternary` domains (in addition to `primary`, `secondary` and `tertiary`), increasing the maximum number of domains that a `Symbol` can have to 4. ([#1580](https://github.com/pybamm-team/PyBaMM/pull/1580))
8+
- Tabs can now be placed at the bottom of the cell in 1+1D thermal models ([#1581](https://github.com/pybamm-team/PyBaMM/pull/1581))
9+
- Added temperature dependence on electrode electronic conductivity ([#1570](https://github.com/pybamm-team/PyBaMM/pull/1570))
10+
- Added a new lithium-ion model `MPM` or Many-Particle Model, with a distribution of particle sizes in each electrode. ([#1529](https://github.com/pybamm-team/PyBaMM/pull/1529))
11+
- Added 2 new submodels for lithium transport in a size distribution of electrode particles: Fickian diffusion (`FickianSingleSizeDistribution`) and uniform concentration profile (`FastSingleSizeDistribution`). ([#1529](https://github.com/pybamm-team/PyBaMM/pull/1529))
12+
- Added a "particle size" domain to the default lithium-ion geometry, including plotting capabilities (`QuickPlot`) and processing of variables (`ProcessedVariable`). ([#1529](https://github.com/pybamm-team/PyBaMM/pull/1529))
613
- Added fitted expressions for OCPs for the Chen2020 parameter set ([#1526](https://github.com/pybamm-team/PyBaMM/pull/1497))
714
- Added `initial_soc` argument to `Simualtion.solve` for specifying the initial SOC when solving a model ([#1512](https://github.com/pybamm-team/PyBaMM/pull/1512))
815
- Added `print_name` to some symbols ([#1495](https://github.com/pybamm-team/PyBaMM/pull/1495), [#1497](https://github.com/pybamm-team/PyBaMM/pull/1497))
@@ -28,12 +35,15 @@
2835

2936
## Bug fixes
3037

38+
- Fixed a bug where the order of the indexing for the entries of variables discretised using FEM was incorrect ([#1556](https://github.com/pybamm-team/PyBaMM/pull/1556))
39+
- Fix broken module import for spyder when running a script twice ([#1555](https://github.com/pybamm-team/PyBaMM/pull/1555))
3140
- Fixed ElectrodeSOH model for multi-dimensional simulations ([#1548](https://github.com/pybamm-team/PyBaMM/pull/1548))
3241
- Removed the overly-restrictive check "each variable in the algebraic eqn keys must appear in the eqn" ([#1510](https://github.com/pybamm-team/PyBaMM/pull/1510))
3342
- Made parameters importable through pybamm ([#1475](https://github.com/pybamm-team/PyBaMM/pull/1475))
3443

3544
## Breaking changes
3645

46+
- The `Yang2017` parameter set has been removed as the complete parameter set is not publicly available in the literature ([#1577](https://github.com/pybamm-team/PyBaMM/pull/1577))
3747
- Changed how options are specified for the "loss of active material" and "particle cracking" submodels. "loss of active material" can now be one of "none", "stress-driven", or "reaction-driven", or a 2-tuple for different options in negative and positive electrode. Similarly "particle cracking" (now called "particle mechanics") can now be "none", "swelling only", "swelling and cracking", or a 2-tuple ([#1490](https://github.com/pybamm-team/PyBaMM/pull/1490))
3848
- Changed the variable in the full diffusion model from "Electrolyte concentration" to "Porosity times concentration" ([#1476](https://github.com/pybamm-team/PyBaMM/pull/1476))
3949
- Renamed `lithium-ion` folder to `lithium_ion` and `lead-acid` folder to `lead_acid` in parameters ([#1464](https://github.com/pybamm-team/PyBaMM/pull/1464))

CITATION.cff

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
cff-version: 1.1.0
2+
message: "If you use PyBaMM, please cite it as below."
3+
authors:
4+
- family-names: Sulzer
5+
given-names: Valentin
6+
orcid: "https://orcid.org/0000-0002-8687-327X"
7+
- family-names: Marquis
8+
given-names: Scott G.
9+
orcid: "https://orcid.org/0000-0002-6895-990X"
10+
- family-names: Timms
11+
given-names: Robert
12+
orcid: "https://orcid.org/0000-0002-8858-4818"
13+
- family-names: Robinson
14+
given-names: Martin
15+
orcid: "https://orcid.org/0000-0002-1572-6782"
16+
- family-names: Chapman
17+
given-names: S. Jon
18+
orcid: "https://orcid.org/0000-0003-3347-6024"
19+
journal: "Journal of Open Research Software"
20+
date-released: 2021-06-08
21+
doi: 10.5334/jors.309
22+
keywords:
23+
- "battery modelling"
24+
- "expression tree"
25+
- "python"
26+
- "symbolic differentiation"
27+
version: 0.4.0
28+
repository-code: "https://github.com/pybamm-team/PyBaMM"
29+
title: "Python Battery Mathematical Modelling (PyBaMM)"

README.md

+37-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,26 @@
11
![PyBaMM_logo](https://user-images.githubusercontent.com/20817509/107091287-8ad46a80-67cf-11eb-86f5-7ebef7c72a1e.png)
22

3-
# PyBaMM
3+
#
4+
<div align="center">
45

56
[![Build](https://github.com/pybamm-team/PyBaMM/workflows/PyBaMM/badge.svg)](https://github.com/pybamm-team/PyBaMM/actions?query=workflow%3APyBaMM+branch%3Adevelop)
67
[![readthedocs](https://readthedocs.org/projects/pybamm/badge/?version=latest)](https://pybamm.readthedocs.io/en/latest/?badge=latest)
78
[![codecov](https://codecov.io/gh/pybamm-team/PyBaMM/branch/main/graph/badge.svg)](https://codecov.io/gh/pybamm-team/PyBaMM)
89
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/pybamm-team/PyBaMM/blob/develop/)
9-
[![black_code_style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
10+
[![DOI](https://zenodo.org/badge/DOI/10.5334/jors.309.svg)](https://doi.org/10.5334/jors.309)
11+
[![release](https://img.shields.io/github/v/release/pybamm-team/PyBaMM?color=yellow)](https://github.com/pybamm-team/PyBaMM/releases)
12+
[![black code style](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)
1013
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
11-
[![All Contributors](https://img.shields.io/badge/all_contributors-31-orange.svg?style=flat-square)](#contributors-)
14+
[![All Contributors](https://img.shields.io/badge/all_contributors-33-orange.svg)](#-contributors)
1215
<!-- ALL-CONTRIBUTORS-BADGE:END -->
1316

17+
</div>
18+
19+
# PyBaMM
20+
1421
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.
1522

16-
## How do I use PyBaMM?
23+
## 💻 Using PyBaMM
1724

1825
The easiest way to use PyBaMM is to run a 1C constant-current discharge with a model of your choice with all the default settings:
1926
```python3
@@ -51,9 +58,12 @@ hosted on [Read The Docs](https://readthedocs.org/).
5158
Additional supporting material can be found
5259
[here](https://github.com/pybamm-team/pybamm-supporting-material/).
5360

54-
For further examples, see the list of repositories that use PyBaMM [here](https://github.com/pybamm-team/pybamm-example-results)
61+
Note that the examples on the default `develop` branch are tested on the latest `develop` commit. This may sometimes cause errors when running the examples on the pybamm pip package, which is synced to the `main` branch. You can switch to the `main` branch on github to see the version of the examples that is compatible with the latest pip release.
62+
63+
<!-- For further examples, see the list of repositories that use PyBaMM [here](https://github.com/pybamm-team/pybamm-example-results). -->
64+
65+
## 🚀 Installing PyBaMM
5566

56-
## How can I install PyBaMM?
5767
PyBaMM is available on GNU/Linux, MacOS and Windows.
5868
We strongly recommend to install PyBaMM within a python virtual environment, in order not to alter any distribution python files.
5969
For instructions on how to create a virtual environment for PyBaMM, see [the documentation](https://pybamm.readthedocs.io/en/latest/install/GNU-linux.html#user-install).
@@ -72,21 +82,25 @@ conda install -c conda-forge pybamm
7282
### Optional solvers
7383
On GNU/Linux and MacOS, an optional [scikits.odes](https://scikits-odes.readthedocs.io/en/latest/)-based solver is available, see [the documentation](https://pybamm.readthedocs.io/en/latest/install/GNU-linux.html#scikits-odes-label).
7484

75-
## Citing PyBaMM
85+
## 📖 Citing PyBaMM
7686

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

79-
> Sulzer, V., Marquis, S. G., Timms, R., Robinson, M., & Chapman, S. J. (2020). Python Battery Mathematical Modelling (PyBaMM). _ECSarXiv. February, 7_.
89+
> Sulzer, V., Marquis, S. G., Timms, R., Robinson, M., & Chapman, S. J. (2021). Python Battery Mathematical Modelling (PyBaMM). _Journal of Open Research Software, 9(1)_.
8090
8191
You can use the bibtex
8292

8393
```
84-
@article{sulzer2020python,
85-
title={Python Battery Mathematical Modelling (PyBaMM)},
86-
author={Sulzer, Valentin and Marquis, Scott G and Timms, Robert and Robinson, Martin and Chapman, S Jon},
87-
journal={ECSarXiv. February},
88-
volume={7},
89-
year={2020}
94+
@article{Sulzer2021,
95+
title = {{Python Battery Mathematical Modelling (PyBaMM)}},
96+
author = {Sulzer, Valentin and Marquis, Scott G. and Timms, Robert and Robinson, Martin and Chapman, S. Jon},
97+
doi = {10.5334/jors.309},
98+
journal = {Journal of Open Research Software},
99+
publisher = {Software Sustainability Institute},
100+
volume = {9},
101+
number = {1},
102+
pages = {14},
103+
year = {2021}
90104
}
91105
```
92106

@@ -99,15 +113,19 @@ pybamm.print_citations()
99113
to the end of your script. This will print bibtex information to the terminal; passing a filename to `print_citations` will print the bibtex information to the specified file instead. A list of all citations can also be found in the [citations file](https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/CITATIONS.txt). In particular, PyBaMM relies heavily on [CasADi](https://web.casadi.org/publications/).
100114
See [CONTRIBUTING.md](https://github.com/pybamm-team/PyBaMM/blob/develop/CONTRIBUTING.md#citations) for information on how to add your own citations when you contribute.
101115

102-
## How can I contribute to PyBaMM?
116+
## 🛠️ Contributing to PyBaMM
103117

104118
If you'd like to help us develop PyBaMM by adding new methods, writing documentation, or fixing embarrassing bugs, please have a look at these [guidelines](https://github.com/pybamm-team/PyBaMM/blob/develop/CONTRIBUTING.md) first.
105119

106-
## Licensing
120+
## 📫 Get in touch
121+
122+
For any questions, comments, suggestions or bug reports, please see the [contact page](https://www.pybamm.org/contact).
123+
124+
## 📃 License
107125

108126
PyBaMM is fully open source. For more information about its license, see [LICENSE](https://github.com/pybamm-team/PyBaMM/blob/develop/LICENSE.txt).
109127

110-
## Contributors ✨
128+
## ✨ Contributors
111129

112130
Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)):
113131

@@ -155,6 +173,8 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
155173
<td align="center"><a href="https://github.com/asinghgaba"><img src="https://avatars.githubusercontent.com/u/77078706?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Amarjit Singh Gaba</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=asinghgaba" title="Code">💻</a></td>
156174
<td align="center"><a href="https://github.com/KennethNwanoro"><img src="https://avatars.githubusercontent.com/u/78538806?v=4?s=100" width="100px;" alt=""/><br /><sub><b>KennethNwanoro</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=KennethNwanoro" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=KennethNwanoro" title="Tests">⚠️</a></td>
157175
<td align="center"><a href="https://github.com/alibh95"><img src="https://avatars.githubusercontent.com/u/65511923?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Ali Hussain Umar Bhatti</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=alibh95" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=alibh95" title="Tests">⚠️</a></td>
176+
<td align="center"><a href="https://github.com/molel-gt"><img src="https://avatars.githubusercontent.com/u/81125862?v=4?s=100" width="100px;" alt=""/><br /><sub><b>Leshinka Molel</b></sub></a><br /><a href="https://github.com/pybamm-team/PyBaMM/commits?author=molel-gt" title="Code">💻</a> <a href="#ideas-molel-gt" title="Ideas, Planning, & Feedback">🤔</a></td>
177+
<td align="center"><a href="https://github.com/tobykirk"><img src="https://avatars.githubusercontent.com/u/42966045?v=4?s=100" width="100px;" alt=""/><br /><sub><b>tobykirk</b></sub></a><br /><a href="#ideas-tobykirk" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=tobykirk" title="Code">💻</a> <a href="https://github.com/pybamm-team/PyBaMM/commits?author=tobykirk" title="Tests">⚠️</a></td>
158178
</tr>
159179
</table>
160180

docs/conf.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@
206206

207207
# Example configuration for intersphinx: refer to the Python standard library.
208208
intersphinx_mapping = {
209-
"python": ("https://docs.python.org/", None),
210-
"sphinx": ("http://www.sphinx-doc.org/en/stable/", None),
211-
"numpy": ("http://docs.scipy.org/doc/numpy/", None),
212-
"scipy": ("http://docs.scipy.org/doc/scipy/reference", None),
213-
"matplotlib": ("http://matplotlib.org", None),
209+
"python": ("https://docs.python.org/3/", None),
210+
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
211+
"numpy": ("https://numpy.org/doc/stable", None),
212+
# "scipy": ("http://docs.scipy.org/doc/scipy/reference", None),
213+
"matplotlib": ("https://matplotlib.org", None),
214214
}

docs/source/expression_tree/unary_operator.rst

+2
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ Unary Operators
8181

8282
.. autofunction:: pybamm.r_average
8383

84+
.. autofunction:: pybamm.size_average
85+
8486
.. autofunction:: pybamm.z_average
8587

8688
.. autofunction:: pybamm.yz_average

docs/source/models/lithium_ion/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Lithium-ion Models
66
base_lithium_ion_model
77
spm
88
spme
9+
mpm
910
dfn
1011
newman_tobias
1112
yang2017
+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Many Particle Model (MPM)
2+
===========================
3+
4+
.. autoclass:: pybamm.lithium_ion.MPM
5+
:members:

docs/source/models/submodels/external_circuit/function_control_external_circuit.rst

+3
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,7 @@ Function control external circuit
88
:members:
99

1010
.. autoclass:: pybamm.external_circuit.PowerFunctionControl
11+
:members:
12+
13+
.. autoclass:: pybamm.external_circuit.CCCVFunctionControl
1114
:members:

docs/source/models/submodels/particle/index.rst

+1
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ Particle
99
fickian_many_particles
1010
polynomial_single_particle
1111
polynomial_many_particles
12+
size_distribution/index
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Particle Size Distribution Base Model
2+
=====================================
3+
4+
.. autoclass:: pybamm.particle.BaseSizeDistribution
5+
:members:
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Fast Single Size Distribution
2+
=============================
3+
4+
.. autoclass:: pybamm.particle.FastSingleSizeDistribution
5+
:members:
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Fickian Single Size Distribution
2+
================================
3+
4+
.. autoclass:: pybamm.particle.FickianSingleSizeDistribution
5+
:members:
6+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Particle Size Distribution
2+
==========================
3+
4+
.. toctree::
5+
:maxdepth: 1
6+
7+
base_distribution
8+
fickian_single_distribution
9+
fast_single_distribution

0 commit comments

Comments
 (0)