Skip to content

Commit 4730e80

Browse files
#730 merge master and update changelog
2 parents 0e194ed + eff7d0a commit 4730e80

14 files changed

+1359
-19
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Fixes # (issue)
66

77
## Type of change
88

9-
Please add a line in the relevant section of [CHANGELOG.md](https://github.com/pybamm-team/PyBaMM/blob/master/CHANGELOG.md) to document the change (include PR #) - note reverse order of PR #s.
9+
Please add a line in the relevant section of [CHANGELOG.md](https://github.com/pybamm-team/PyBaMM/blob/master/CHANGELOG.md) to document the change (include PR #) - note reverse order of PR #s. If necessary, also add to the list of breaking changes.
1010

1111
- [ ] New feature (non-breaking change which adds functionality)
1212
- [ ] Optimization (back-end change that speeds up the code)

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Added submodels for tortuosity ([#726](https://github.com/pybamm-team/PyBaMM/pull/726))
77
- Simplified the interface for setting current functions ([#723](https://github.com/pybamm-team/PyBaMM/pull/723))
88
- Added Heaviside operator ([#723](https://github.com/pybamm-team/PyBaMM/pull/723))
9+
- Added some "Getting Started" documentation ([#703](https://github.com/pybamm-team/PyBaMM/pull/703))
910
- Added Simulation class ([#693](https://github.com/pybamm-team/PyBaMM/pull/693)) with load/save functionality ([#732](https://github.com/pybamm-team/PyBaMM/pull/732))
1011
- Added interface to CasADi solver ([#687](https://github.com/pybamm-team/PyBaMM/pull/687), [#691](https://github.com/pybamm-team/PyBaMM/pull/691), [#714](https://github.com/pybamm-team/PyBaMM/pull/714)). This makes the SUNDIALS DAE solvers (Scikits and KLU) truly optional (though IDA KLU is recommended for solving the DFN).
1112
- Added option to use CasADi's Algorithmic Differentiation framework to calculate Jacobians ([#687](https://github.com/pybamm-team/PyBaMM/pull/687))
@@ -35,6 +36,13 @@
3536
- Added warning if `ProcessedVariable` is called outside its interpolation range ([#681](https://github.com/pybamm-team/PyBaMM/pull/681))
3637
- Improved the way `ProcessedVariable` objects are created in higher dimensions ([#581](https://github.com/pybamm-team/PyBaMM/pull/581))
3738

39+
## Breaking changes
40+
41+
- The parameters "Bruggeman coefficient" must now be specified separately as "Bruggeman coefficient (electrolyte)" and "Bruggeman coefficient (electrode)"
42+
- The current classes (`GetConstantCurrent`, `GetUserCurrent` and `GetUserData`) have now been removed. Please refer to the [`change-input-current` notebook](https://github.com/pybamm-team/PyBaMM/blob/master/examples/notebooks/change-input-current.ipynb) for information on how to specify an input current
43+
- Parameter functions must now use pybamm functions instead of numpy functions (e.g. `pybamm.exp` instead of `numpy.exp`), as these are then used to construct the expression tree directly. Generally, pybamm syntax follows numpy syntax; please get in touch if a function you need is missing.
44+
45+
3846
# [v0.1.0](https://github.com/pybamm-team/PyBaMM/tree/v0.1.0) - 2019-10-08
3947

4048
This is the first official version of PyBaMM.

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ sim.plot()
2121
```
2222
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)).
2323

24+
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.
25+
2426
Further details can be found in a number of [detailed examples](examples/notebooks/README.md), hosted here on
2527
github. In addition, there is a [full API documentation](http://pybamm.readthedocs.io/),
2628
hosted on [Read The Docs](readthedocs.io). A set of slides giving an overview of PyBaMM
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"metadata": {},
6+
"source": [
7+
"# Tutorial 1 - How to run a model"
8+
]
9+
},
10+
{
11+
"cell_type": "markdown",
12+
"metadata": {},
13+
"source": [
14+
"Welcome to PyBaMM! In this notebook, we will run your first PyBaMM model in just a few simple lines. \n",
15+
"\n",
16+
"To run through this jupyter notebook simply shift-enter to run the cells. If you are unfamiliar with jupyter notebooks we recommending checking out this [cheat sheet](https://www.cheatography.com/weidadeyue/cheat-sheets/jupyter-notebook/pdf_bw/).\n",
17+
"\n",
18+
"We begin by importing the pybamm library into this notebook:"
19+
]
20+
},
21+
{
22+
"cell_type": "code",
23+
"execution_count": 1,
24+
"metadata": {},
25+
"outputs": [],
26+
"source": [
27+
"import pybamm"
28+
]
29+
},
30+
{
31+
"cell_type": "markdown",
32+
"metadata": {},
33+
"source": [
34+
"We now load the model that we wish to run. For this notebook, we choose the single particle model with electrolyte (SPMe):"
35+
]
36+
},
37+
{
38+
"cell_type": "code",
39+
"execution_count": 2,
40+
"metadata": {},
41+
"outputs": [],
42+
"source": [
43+
"model = pybamm.lithium_ion.SPMe()"
44+
]
45+
},
46+
{
47+
"cell_type": "markdown",
48+
"metadata": {},
49+
"source": [
50+
"We now use this model to create a PyBaMM Simulation, which is used to process and solve the model:"
51+
]
52+
},
53+
{
54+
"cell_type": "code",
55+
"execution_count": 3,
56+
"metadata": {},
57+
"outputs": [],
58+
"source": [
59+
"sim = pybamm.Simulation(model)"
60+
]
61+
},
62+
{
63+
"cell_type": "markdown",
64+
"metadata": {},
65+
"source": [
66+
"We can then call 'solve' on our simulation object to solve the model (by default the the model is solved for a 1C constant current discharge):"
67+
]
68+
},
69+
{
70+
"cell_type": "code",
71+
"execution_count": 4,
72+
"metadata": {},
73+
"outputs": [],
74+
"source": [
75+
"sim.solve()"
76+
]
77+
},
78+
{
79+
"cell_type": "markdown",
80+
"metadata": {},
81+
"source": [
82+
"Finally, we can call 'plot' to generate a dynamic plot of the key variables:"
83+
]
84+
},
85+
{
86+
"cell_type": "code",
87+
"execution_count": 5,
88+
"metadata": {},
89+
"outputs": [
90+
{
91+
"data": {
92+
"application/vnd.jupyter.widget-view+json": {
93+
"model_id": "089df7a7f1f24690b734df6cf83bd550",
94+
"version_major": 2,
95+
"version_minor": 0
96+
},
97+
"text/plain": [
98+
"interactive(children=(FloatSlider(value=0.0, description='t', max=0.9999999999999999, step=0.05), Output()), _…"
99+
]
100+
},
101+
"metadata": {},
102+
"output_type": "display_data"
103+
}
104+
],
105+
"source": [
106+
"sim.plot()"
107+
]
108+
},
109+
{
110+
"cell_type": "markdown",
111+
"metadata": {},
112+
"source": [
113+
"In this tutorial, we have solved a model with the inbuilt default settings. However, PyBaMM is designed to be highly customisable. Over the course of the getting started tutorials, we will see how various settings can be changed so that the model is appropriate for your situation. \n",
114+
"\n",
115+
"In [Tutorial 2](./Tutorial%202%20-%20Setting%20Parameter%20Values.ipynb) we cover setting and changing parameter values."
116+
]
117+
},
118+
{
119+
"cell_type": "code",
120+
"execution_count": null,
121+
"metadata": {},
122+
"outputs": [],
123+
"source": []
124+
}
125+
],
126+
"metadata": {
127+
"kernelspec": {
128+
"display_name": "Python 3",
129+
"language": "python",
130+
"name": "python3"
131+
},
132+
"language_info": {
133+
"codemirror_mode": {
134+
"name": "ipython",
135+
"version": 3
136+
},
137+
"file_extension": ".py",
138+
"mimetype": "text/x-python",
139+
"name": "python",
140+
"nbconvert_exporter": "python",
141+
"pygments_lexer": "ipython3",
142+
"version": "3.6.8"
143+
}
144+
},
145+
"nbformat": 4,
146+
"nbformat_minor": 2
147+
}

0 commit comments

Comments
 (0)