Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 1127 extra notebooks #1131

Merged
merged 7 commits into from
Sep 1, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Features


- Added Getting Started notebook on solver options and changing the mesh. Also added a notebook detailing the different thermal options, and a notebook explaining the steps that occur behind the scenes in the `Simulation` class ([#1131](https://github.com/pybamm-team/PyBaMM/pull/1131))
- Added particle submodel that use a polynomial approximation to the concentration within the electrode particles ([#1130](https://github.com/pybamm-team/PyBaMM/pull/1130))
- Added Modulo, Floor and Ceiling operators ([#1121](https://github.com/pybamm-team/PyBaMM/pull/1121))
- Added DFN model for a half cell ([#1121](https://github.com/pybamm-team/PyBaMM/pull/1121))
Expand All @@ -23,7 +25,7 @@

## Breaking changes

- The "fast diffusion" particle option has been renamed "uniform profile" ([#1130](https://github.com/pybamm-team/PyBaMM/pull/1130))
- The "fast diffusion" particle option has been renamed "uniform profile" ([#1130](https://github.com/pybamm-team/PyBaMM/pull/1130))
- The modules containing standard parameters are now classes so they can take options
(e.g. `standard_parameters_lithium_ion` is now `LithiumIonParameters`) ([#1120](https://github.com/pybamm-team/PyBaMM/pull/1120))
- Renamed `quick_plot_vars` to `output_variables` in `Simulation` to be consistent with `QuickPlot`. Passing `quick_plot_vars` to `Simulation.plot()` has been deprecated and `output_variables` should be passed instead ([#1099](https://github.com/pybamm-team/PyBaMM/pull/1099))
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ 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)).
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.
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, and can either be downloaded and used locally, or used online through [Google Colab](https://colab.research.google.com/github/pybamm-team/PyBaMM/blob/master/).

Further details can be found in a number of [detailed examples](examples/notebooks/README.md), hosted here on
github. In addition, there is a [full API documentation](http://pybamm.readthedocs.io/),
Expand Down
Binary file added examples/notebooks/Getting Started/SPMe.pkl
Binary file not shown.
Binary file added examples/notebooks/Getting Started/SPMe_sol.pkl
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,15 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In this tutorial we have seen how easy it is to run and compare different electrochemical models. In [Tutorial 3](./Tutorial%203%20-%20Basic%20plotting.ipynb) we cover how to simulate and compare different models."
"In this tutorial we have seen how easy it is to run and compare different electrochemical models. In [Tutorial 3](./Tutorial%203%20-%20Basic%20plotting.ipynb) we show how to create different plots using PyBaMM's built-in plotting capability."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In [Tutorial 2](./Tutorial%202%20-%20Compare%20models.ipynb), we made use of PyBaMM's automatic plotting function. This gave a good quick overview of many of the key variables in the model. However, by passing in just a few arguments it is easy to plot any of the many other variables that may be of interest to you. We start by building and solving a model as before:"
"In [Tutorial 2](./Tutorial%202%20-%20Compare%20models.ipynb), we made use of PyBaMM's automatic plotting function when comparing models. This gave a good quick overview of many of the key variables in the model. However, by passing in just a few arguments it is easy to plot any of the many other variables that may be of interest to you. We start by building and solving a model as before:"
]
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [
{
Expand All @@ -29,10 +29,10 @@
{
"data": {
"text/plain": [
"<pybamm.solvers.solution.Solution at 0x7f5a7dda5048>"
"<pybamm.solvers.solution.Solution at 0x7f58bbcf9470>"
]
},
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -179,6 +179,8 @@
" 'Negative particle concentration [mol.m-3]',\n",
" 'X-averaged negative particle concentration',\n",
" 'X-averaged negative particle concentration [mol.m-3]',\n",
" 'R-averaged negative particle concentration',\n",
" 'R-averaged negative particle concentration [mol.m-3]',\n",
" 'Negative particle surface concentration',\n",
" 'Negative particle surface concentration [mol.m-3]',\n",
" 'X-averaged negative particle surface concentration',\n",
Expand All @@ -191,6 +193,8 @@
" 'Positive particle concentration [mol.m-3]',\n",
" 'X-averaged positive particle concentration',\n",
" 'X-averaged positive particle concentration [mol.m-3]',\n",
" 'R-averaged positive particle concentration',\n",
" 'R-averaged positive particle concentration [mol.m-3]',\n",
" 'Positive particle surface concentration',\n",
" 'Positive particle surface concentration [mol.m-3]',\n",
" 'X-averaged positive particle surface concentration',\n",
Expand Down Expand Up @@ -381,12 +385,12 @@
" 'X-averaged positive electrode surface potential difference',\n",
" 'Positive electrode surface potential difference [V]',\n",
" 'X-averaged positive electrode surface potential difference [V]',\n",
" 'Negative particle distribution in x',\n",
" 'Negative particle flux',\n",
" 'X-averaged negative particle flux',\n",
" 'Negative particle distribution in x',\n",
" 'Positive particle distribution in x',\n",
" 'Positive particle flux',\n",
" 'X-averaged positive particle flux',\n",
" 'Positive particle distribution in x',\n",
" 'Negative electrode effective conductivity',\n",
" 'Negative electrode current density',\n",
" 'Negative electrode current density [A.m-2]',\n",
Expand All @@ -398,10 +402,22 @@
" 'Electrolyte current density [A.m-2]',\n",
" 'Ohmic heating',\n",
" 'Ohmic heating [W.m-3]',\n",
" 'X-averaged Ohmic heating',\n",
" 'X-averaged Ohmic heating [W.m-3]',\n",
" 'Volume-averaged Ohmic heating',\n",
" 'Volume-averaged Ohmic heating [W.m-3]',\n",
" 'Irreversible electrochemical heating',\n",
" 'Irreversible electrochemical heating [W.m-3]',\n",
" 'X-averaged irreversible electrochemical heating',\n",
" 'X-averaged irreversible electrochemical heating [W.m-3]',\n",
" 'Volume-averaged irreversible electrochemical heating',\n",
" 'Volume-averaged irreversible electrochemical heating[W.m-3]',\n",
" 'Reversible heating',\n",
" 'Reversible heating [W.m-3]',\n",
" 'X-averaged reversible heating',\n",
" 'X-averaged reversible heating [W.m-3]',\n",
" 'Volume-averaged reversible heating',\n",
" 'Volume-averaged reversible heating [W.m-3]',\n",
" 'Total heating',\n",
" 'Total heating [W.m-3]',\n",
" 'X-averaged total heating',\n",
Expand All @@ -416,6 +432,8 @@
" 'Sei interfacial current density',\n",
" 'Sei interfacial current density [A.m-2]',\n",
" 'Sei interfacial current density per volume [A.m-3]',\n",
" 'Negative surface area per unit volume distribution in x',\n",
" 'Positive surface area per unit volume distribution in x',\n",
" 'Negative electrode interfacial current density',\n",
" 'X-averaged negative electrode interfacial current density',\n",
" 'Negative electrode interfacial current density [A.m-2]',\n",
Expand Down Expand Up @@ -554,7 +572,7 @@
" 'Terminal power [W]']"
]
},
"execution_count": 2,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -567,12 +585,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"You can also search the list of variables for a particular string (e.g. \"electrolyte\")"
"There are a _lot_ of variables. You can also search the list of variables for a particular string (e.g. \"electrolyte\")"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 4,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -660,13 +678,13 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "26530e3fbec34dfa921fda4c1490a8f5",
"model_id": "500cc762737441e29f10ad74539ab7ca",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -692,13 +710,13 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "d1d16e2c52654cf48e1d3cd398c4ed18",
"model_id": "cf2959d990cb4fc3a8b540f23601f2a5",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -724,13 +742,13 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "3d08bfd164df409ca3838bb1edd4d4c9",
"model_id": "7ec90fc467fc4a5aaf48dd137cd88551",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -748,13 +766,13 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 8,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "c248e1ccf0c34d53b5f2c0e44115e8d5",
"model_id": "8ecaf998bb0748cdaea4e350b2bc4b31",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -776,8 +794,15 @@
"source": [
"In this tutorial we have seen how to use the plotting functionality in PyBaMM.\n",
"\n",
"In [Tutorial 4](./Tutorial%204%20-%20Setting%20parameter%20values.ipynb) we show how to change model options."
"In [Tutorial 4](./Tutorial%204%20-%20Setting%20parameter%20values.ipynb) we show how to change parameter values."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\u001b[33mWARNING: You are using pip version 20.1.1; however, version 20.2 is available.\n",
"You should consider upgrading via the '/home/ferranbrosa/PyBaMM/env/bin/python -m pip install --upgrade pip' command.\u001b[0m\n",
"Note: you may need to restart the kernel to use updated packages.\n"
]
}
Expand Down Expand Up @@ -139,8 +137,8 @@
" 'EC initial concentration in electrolyte [mol.m-3]': 4541.0,\n",
" 'Electrode height [m]': 0.065,\n",
" 'Electrode width [m]': 1.58,\n",
" 'Electrolyte conductivity [S.m-1]': <function electrolyte_conductivity_Nyman2008 at 0x7f24ae784158>,\n",
" 'Electrolyte diffusivity [m2.s-1]': <function electrolyte_diffusivity_Nyman2008 at 0x7f24ae7840d0>,\n",
" 'Electrolyte conductivity [S.m-1]': <function electrolyte_conductivity_Nyman2008 at 0x7f4fbd88a620>,\n",
" 'Electrolyte diffusivity [m2.s-1]': <function electrolyte_diffusivity_Nyman2008 at 0x7f500fac02f0>,\n",
" 'Initial concentration in electrolyte [mol.m-3]': 1000.0,\n",
" 'Initial concentration in negative electrode [mol.m-3]': 29866.0,\n",
" 'Initial concentration in positive electrode [mol.m-3]': 17038.0,\n",
Expand Down Expand Up @@ -411,10 +409,9 @@
" 'Negative electrode diffusivity [m2.s-1]': 3.3e-14,\n",
" 'Negative electrode double-layer capacity [F.m-2]': 0.2,\n",
" 'Negative electrode electrons in reaction': 1.0,\n",
" 'Negative electrode exchange-current density [A.m-2]': <function graphite_LGM50_electrolyte_exchange_current_density_Chen2020 at 0x7f24ae7c1ae8>,\n",
" 'Negative electrode exchange-current density [A.m-2]': <function graphite_LGM50_electrolyte_exchange_current_density_Chen2020 at 0x7f5004e5d840>,\n",
" 'Negative electrode porosity': 0.25,\n",
" 'Negative electrode specific heat capacity [J.kg-1.K-1]': 700.0,\n",
" 'Negative electrode surface area to volume ratio [m-1]': 383959.0,\n",
" 'Negative electrode thermal conductivity [W.m-1.K-1]': 1.7,\n",
" 'Negative electrode thickness [m]': 8.52e-05,\n",
" 'Negative particle distribution in x': 1.0,\n",
Expand Down Expand Up @@ -679,10 +676,9 @@
" 'Positive electrode diffusivity [m2.s-1]': 4e-15,\n",
" 'Positive electrode double-layer capacity [F.m-2]': 0.2,\n",
" 'Positive electrode electrons in reaction': 1.0,\n",
" 'Positive electrode exchange-current density [A.m-2]': <function nmc_LGM50_electrolyte_exchange_current_density_Chen2020 at 0x7f24ae7c1f28>,\n",
" 'Positive electrode exchange-current density [A.m-2]': <function nmc_LGM50_electrolyte_exchange_current_density_Chen2020 at 0x7f4fbd88a510>,\n",
" 'Positive electrode porosity': 0.335,\n",
" 'Positive electrode specific heat capacity [J.kg-1.K-1]': 700.0,\n",
" 'Positive electrode surface area to volume ratio [m-1]': 382184.0,\n",
" 'Positive electrode thermal conductivity [W.m-1.K-1]': 2.1,\n",
" 'Positive electrode thickness [m]': 7.56e-05,\n",
" 'Positive particle distribution in x': 1.0,\n",
Expand Down Expand Up @@ -734,8 +730,8 @@
"output_type": "stream",
"text": [
"EC initial concentration in electrolyte [mol.m-3]\t4541.0\n",
"Electrolyte conductivity [S.m-1]\t<function electrolyte_conductivity_Nyman2008 at 0x7f24ae784158>\n",
"Electrolyte diffusivity [m2.s-1]\t<function electrolyte_diffusivity_Nyman2008 at 0x7f24ae7840d0>\n",
"Electrolyte conductivity [S.m-1]\t<function electrolyte_conductivity_Nyman2008 at 0x7f4fbd88a620>\n",
"Electrolyte diffusivity [m2.s-1]\t<function electrolyte_diffusivity_Nyman2008 at 0x7f500fac02f0>\n",
"Initial concentration in electrolyte [mol.m-3]\t1000.0\n",
"Negative electrode Bruggeman coefficient (electrolyte)\t1.5\n",
"Positive electrode Bruggeman coefficient (electrolyte)\t1.5\n",
Expand Down Expand Up @@ -763,7 +759,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2b686feb685b4668b970d49bb137c9d2",
"model_id": "2679c387ef134d2eaf3aa2926e45e025",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -839,7 +835,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "256191f9988349ffaf5396faf4bb1fef",
"model_id": "84b98b54fb614eabb0799673de97f6fd",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -912,7 +908,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "bb5a94d141e94425954d4c1963d0f14c",
"model_id": "4f01888556824b2ca66bd91c0fe61783",
"version_major": 2,
"version_minor": 0
},
Expand Down Expand Up @@ -974,7 +970,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "9534fe9341194950b1dc4169752331c2",
"model_id": "08ef31fef963457cbbfe6519c0b5e8ad",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -1000,13 +996,20 @@
"source": [
"In this notebook we have seen how we can change the parameters of our model. In [Tutorial 5](./Tutorial%205%20-%20Run%20experiments.ipynb) we show how can we define and run experiments."
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "PyBaMM development (env)",
"display_name": "Python 3",
"language": "python",
"name": "pybamm-dev"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -1018,7 +1021,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.6.8"
"version": "3.6.9"
}
},
"nbformat": 4,
Expand Down
Loading