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 2418 dimensional #2419

Merged
merged 141 commits into from
Mar 1, 2023
Merged
Show file tree
Hide file tree
Changes from 135 commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
3b18847
#2418 SPM builds but doesn't solve
valentinsulzer Nov 1, 2022
3c261c9
#2418 DFN builds but can't solve
valentinsulzer Nov 1, 2022
bb2d595
#2418 SPMe builds but doesn't solve
valentinsulzer Nov 1, 2022
ce76821
#2418 removing timescale and length scale
valentinsulzer Nov 2, 2022
a80e91c
#2418 basic SPM works
valentinsulzer Nov 2, 2022
f2923a4
style: pre-commit fixes
pre-commit-ci[bot] Nov 2, 2022
00ca3f8
#2418 working on basic models
valentinsulzer Nov 2, 2022
37e7937
Merge branch 'issue-2418-dimensional' of github.com:pybamm-team/PyBaM…
valentinsulzer Nov 2, 2022
59a42cf
#2418 working on flake8
valentinsulzer Nov 3, 2022
563a5d5
#2418 made SEI dimensional, some other random changes
valentinsulzer Nov 4, 2022
a55c522
#2418 working on thermal and mechanical models
valentinsulzer Nov 5, 2022
185f23d
#2418 remove first-order lead-acid models
valentinsulzer Nov 6, 2022
0512766
#2418 flake8 and remove lead-acid properly
valentinsulzer Nov 6, 2022
4c6bbdf
#2418 merge develop
valentinsulzer Nov 6, 2022
c564377
style: pre-commit fixes
pre-commit-ci[bot] Nov 6, 2022
f806319
#2418 remove C_rate parameter (set to 1)
valentinsulzer Nov 6, 2022
e5e84a5
#2418 fixed SPM, fixed diffusion models
valentinsulzer Nov 6, 2022
349d5b4
merge
valentinsulzer Nov 6, 2022
e54f638
Merge branch 'issue-2418-dimensional' of github.com:pybamm-team/PyBaM…
valentinsulzer Nov 6, 2022
6170a1d
merge develop
valentinsulzer Nov 7, 2022
116393e
#2418 working on standard models
valentinsulzer Nov 8, 2022
c3c57c8
style: pre-commit fixes
pre-commit-ci[bot] Nov 8, 2022
5deddaf
debugging DFN
valentinsulzer Nov 8, 2022
5c7493e
Merge branch 'issue-2418-dimensional' of github.com:pybamm-team/PyBaM…
valentinsulzer Nov 8, 2022
ac84d10
merge simplifications
valentinsulzer Nov 8, 2022
466131a
#2418 DFN now works (with reference potentials)
valentinsulzer Nov 8, 2022
efdb914
merge
valentinsulzer Nov 9, 2022
6410607
#2418 almost all SPM unit tests pass
valentinsulzer Nov 9, 2022
e998ddd
#2418 fix division by zero warning
valentinsulzer Nov 9, 2022
a880f9a
#2418 flake8
valentinsulzer Nov 9, 2022
3e07b17
working on polynomial particle model
valentinsulzer Nov 9, 2022
e7b4c85
merge
valentinsulzer Nov 9, 2022
d16497d
merge
valentinsulzer Nov 10, 2022
a99f2f7
#2418 testing polynomial models
valentinsulzer Nov 10, 2022
e8abbc0
working on unit tests
valentinsulzer Nov 14, 2022
7ff854c
#2418 working on tests
valentinsulzer Nov 14, 2022
4857881
#2418 tests
valentinsulzer Nov 14, 2022
1038634
#2418 working on tests
valentinsulzer Nov 15, 2022
ba3453c
#2418 fixing more tests
valentinsulzer Nov 15, 2022
91df22d
style: pre-commit fixes
pre-commit-ci[bot] Nov 15, 2022
1068788
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Nov 15, 2022
c5b2e60
#2418 unit tests
valentinsulzer Nov 15, 2022
8d8d658
#2418 merge develop
valentinsulzer Nov 19, 2022
ca8f3ad
#2418 fixing tests
valentinsulzer Nov 20, 2022
850d6b3
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Nov 22, 2022
1cc64b0
#2418 skip external variables, will be removed
valentinsulzer Nov 22, 2022
678f854
merge develop
valentinsulzer Nov 26, 2022
a287e6a
fix temp [C]
valentinsulzer Nov 26, 2022
11f3cbb
#2418 debugging
valentinsulzer Nov 26, 2022
95fe21e
#2418 merge 2491
valentinsulzer Nov 26, 2022
ce4a6b3
#2418 fixing tests, unit tests should finish now
valentinsulzer Nov 26, 2022
54b09e8
#2418 fixing tests
valentinsulzer Nov 26, 2022
3bbd7a7
Merge branch 'issue-2491-parameter-events' into issue-2418-dimensional
valentinsulzer Nov 27, 2022
68b8b72
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Nov 29, 2022
8a45e76
#2418 debugging
valentinsulzer Nov 29, 2022
808ae56
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Nov 30, 2022
c94881d
#2418 unit tests
valentinsulzer Nov 30, 2022
352b6d1
#2418 ecm parameters
valentinsulzer Nov 30, 2022
dc3a9c2
#2418 integration tests
valentinsulzer Nov 30, 2022
029d0b7
debugging
valentinsulzer Nov 30, 2022
0cf71ad
#2418 better conditioning for algebraic equations
valentinsulzer Nov 30, 2022
6a5489f
#2418 fix unit tests, add scaling to some algebraic equations
valentinsulzer Nov 30, 2022
9359f7a
#2418 fix unit tests
valentinsulzer Nov 30, 2022
0fe3a9d
#2418 lead-acid
valentinsulzer Nov 30, 2022
fffbe96
merge develop
valentinsulzer Dec 5, 2022
aaff9d6
#2418 debugging
valentinsulzer Dec 5, 2022
a0650a6
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Dec 6, 2022
e0e7b54
fix SEI model
valentinsulzer Dec 7, 2022
7c699b0
fix li plating
valentinsulzer Dec 7, 2022
a135113
#2418 fix cracking
valentinsulzer Dec 7, 2022
0f9922d
#2418 merge
valentinsulzer Dec 11, 2022
9c2ad72
Merge branch 'porosity-times-concentration' into issue-2418-dimensional
valentinsulzer Dec 12, 2022
22f5603
flake8
valentinsulzer Dec 12, 2022
cf00094
#2418 flake8
valentinsulzer Dec 12, 2022
b50ac7e
merge
valentinsulzer Dec 12, 2022
85a72d3
fix current driven utilization
valentinsulzer Dec 12, 2022
ccc76ee
#2418 fix spm lam tests
valentinsulzer Dec 12, 2022
cf646a2
use cumulative trapezoid
valentinsulzer Dec 12, 2022
01b810d
debugging
valentinsulzer Dec 13, 2022
8714c0f
#2418 debugging
valentinsulzer Dec 13, 2022
a0fbd0a
remove skips to avoid conflicts
valentinsulzer Dec 13, 2022
173027c
#2418 merge external variable removal
valentinsulzer Dec 13, 2022
99494c8
loosen tol for split electrlyte concentration test
valentinsulzer Dec 13, 2022
24c9655
#2418 fix electrolyte and thermal tests
valentinsulzer Dec 13, 2022
b867532
working on newman-tobias
valentinsulzer Dec 13, 2022
4e015f1
NT
valentinsulzer Dec 13, 2022
ececf95
debugging NT
valentinsulzer Dec 13, 2022
d43c152
merge
valentinsulzer Dec 14, 2022
17f2f5c
merge changes, still note conserving lithium
valentinsulzer Dec 14, 2022
ec07855
Merge branch 'issue-2551-electrolyte' into issue-2418-dimensional
valentinsulzer Dec 14, 2022
8d0657e
debugging lead-acid
valentinsulzer Dec 14, 2022
2ae1bf5
#2418 fix lead-acid tests
valentinsulzer Dec 15, 2022
01d1c23
#2418 flake8
valentinsulzer Dec 15, 2022
d2f5d2c
merge develop
valentinsulzer Jan 9, 2023
5d6d5c0
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Jan 9, 2023
5ae4ef2
merge contact resistance update
valentinsulzer Jan 26, 2023
1baf01f
#2418 fix contact resistance test and spectral volume test
valentinsulzer Jan 26, 2023
603f79f
merge develop
valentinsulzer Feb 17, 2023
7ff5563
style: pre-commit fixes
pre-commit-ci[bot] Feb 17, 2023
c6fd9c1
fix BV test
valentinsulzer Feb 17, 2023
87d441e
fix some DFN tests
valentinsulzer Feb 17, 2023
9d6d7d3
merge develop
valentinsulzer Feb 17, 2023
fc606ec
Merge branch 'issue-2418-dimensional' of github.com:pybamm-team/PyBaM…
valentinsulzer Feb 17, 2023
bdcd75a
fix unit test
valentinsulzer Feb 17, 2023
338be72
merge develop
valentinsulzer Feb 17, 2023
d9a88c6
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Feb 17, 2023
48d5044
fix output comparison test
valentinsulzer Feb 18, 2023
f4072f2
quartic profile
valentinsulzer Feb 18, 2023
7803bf3
changelog
valentinsulzer Feb 18, 2023
5302e86
fix half-cell bug
valentinsulzer Feb 18, 2023
21c8e4c
integration tests
valentinsulzer Feb 18, 2023
e337e62
half-cell test
valentinsulzer Feb 18, 2023
5fdee96
updating docs
valentinsulzer Feb 18, 2023
50b41f9
style
valentinsulzer Feb 18, 2023
07f1f57
coverage
valentinsulzer Feb 18, 2023
72f8688
coverage - parameters
valentinsulzer Feb 18, 2023
db705a3
more coverage
valentinsulzer Feb 18, 2023
917ed6f
scikit fem coverage
valentinsulzer Feb 18, 2023
ae30a97
tests and coverage
valentinsulzer Feb 18, 2023
908395a
working on examples
valentinsulzer Feb 19, 2023
b1f1742
Merge branch 'issue-2703-temperature' into issue-2418-dimensional
valentinsulzer Feb 19, 2023
c8416cc
fix plating example
valentinsulzer Feb 19, 2023
85ea886
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Feb 19, 2023
c21cdfb
working on examples
valentinsulzer Feb 19, 2023
c1780c6
remove typical electrolyte concentration and fix tests
valentinsulzer Feb 19, 2023
9dfe43a
fix lead-acid tests
valentinsulzer Feb 19, 2023
b92ba78
#2418 fix electrolyte concentration
valentinsulzer Feb 19, 2023
314cb12
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Feb 19, 2023
5337210
cracking model
valentinsulzer Feb 19, 2023
72351b3
tests and urls
valentinsulzer Feb 19, 2023
ee69970
latexify
valentinsulzer Feb 20, 2023
3708a08
fix examples
valentinsulzer Feb 20, 2023
b99b0fc
another fix attempt
valentinsulzer Feb 20, 2023
73b2a3c
rob comments
valentinsulzer Feb 21, 2023
d7ed340
Merge branch 'issue-2418-dimensional' of https://github.com/pybamm-te…
Feb 22, 2023
339b745
Divided dl_cr by 3600 to replace deleted constant t0_cr
Feb 23, 2023
eb492fc
Merge pull request #2724 from DrSOKane/issue-2418-dimensional
valentinsulzer Feb 23, 2023
9ff550f
#2418 merge develop
valentinsulzer Feb 23, 2023
dc71db2
Update pybamm/CITATIONS.txt
valentinsulzer Feb 23, 2023
0483f46
Merge branch 'develop' into issue-2418-dimensional
valentinsulzer Feb 28, 2023
5816493
#2418 changelog
valentinsulzer Feb 28, 2023
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@

- Fixed the length scaling for the first dimension of r-R plots ([#2663](https://github.com/pybamm-team/PyBaMM/pull/2663)).

## Breaking changes

- All PyBaMM models are now dimensional. This has been benchmarked against dimensionless models and found to give around the same solve time. Implementing dimensional models greatly reduces the barrier to entry for adding new models. However, this comes with several breaking changes: (i) the `timescale` and `length_scales` attributes of a model have been removed (they are no longer needed) (ii) several dimensionless variables are no longer defined, but the corresponding dimensional variables can still be accessed by adding the units to the name (iii) some parameters used only for non-dimensionalization, such as "Typical current [A]", have been removed ([#2419](https://github.com/pybamm-team/PyBaMM/pull/2419))

# [v23.1](https://github.com/pybamm-team/PyBaMM/tree/v23.1) - 2023-01-31

## Features
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guide/installation/GNU-linux.rst
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ Optional - scikits.odes solver

Users can install `scikits.odes <https://github.com/bmcage/odes>`__ in
order to use the wrapped SUNDIALS ODE and DAE
`solvers <https://pybamm.readthedocs.io/en/latest/source/solvers/scikits_solvers.html>`__.
`solvers <https://pybamm.readthedocs.io/en/latest/source/api/solvers/scikits_solvers.html>`__.
Currently, only GNU/Linux and macOS are supported.

GNU/Linux
Expand Down

Large diffs are not rendered by default.

234 changes: 57 additions & 177 deletions examples/notebooks/Creating Models/6-a-simple-SEI-model.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
}
],
"source": [
"sim.solve([0, 1]) # solve up to a dimensionless time of 1"
"sim.solve([0, 1]) # solve up to a time of 1"
]
},
{
Expand Down Expand Up @@ -407,7 +407,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "pybamm",
"language": "python",
"name": "python3"
},
Expand All @@ -421,7 +421,12 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.13"
"version": "3.9.16"
},
"vscode": {
"interpreter": {
"hash": "187972e187ab8dfbecfab9e8e194ae6d08262b2d51a54fa40644e3ddb6b5f74c"
}
}
},
"nbformat": 4,
Expand Down
811 changes: 325 additions & 486 deletions examples/notebooks/Getting Started/Tutorial 3 - Basic plotting.ipynb

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,7 @@
"drive_cycle = pd.read_csv(\"pybamm/input/drive_cycles/US06.csv\", comment=\"#\", header=None).to_numpy()\n",
"\n",
"# Create interpolant\n",
"timescale = parameter_values.evaluate(model.timescale)\n",
"current_interpolant = pybamm.Interpolant(drive_cycle[:, 0], drive_cycle[:, 1], timescale * pybamm.t)\n",
"current_interpolant = pybamm.Interpolant(drive_cycle[:, 0], drive_cycle[:, 1], pybamm.t)\n",
"\n",
"# Set drive cycle\n",
"parameter_values[\"Current function [A]\"] = current_interpolant"
Expand Down Expand Up @@ -555,7 +554,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "pybamm",
"language": "python",
"name": "python3"
},
Expand All @@ -569,7 +568,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.9.16"
},
"toc": {
"base_numbering": 1,
Expand All @@ -586,7 +585,7 @@
},
"vscode": {
"interpreter": {
"hash": "1a781583db2df3c2e87436f6d22cce842c2e50a5670da93a3bd820b97dc43011"
"hash": "187972e187ab8dfbecfab9e8e194ae6d08262b2d51a54fa40644e3ddb6b5f74c"
}
}
},
Expand Down
13 changes: 1 addition & 12 deletions examples/notebooks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,12 @@ The easiest way to start with PyBaMM is by running and comparing some of the inb

It is also easy to add new models or change the setting that are used:

- [Add a model (documentation)](https://pybamm.readthedocs.io/en/latest/tutorials/add-model.html)
- [Add a model (example)](./create-model.ipynb)
- [Change model options](./models/using-model-options_thermal-example.ipynb)
- [Using submodels](./using-submodels.ipynb)
- [Change the settings](./change-settings.ipynb) (parameters, spatial method or solver)
- [Change the applied current](./parameterization/change-input-current.ipynb)

For more advanced usage, new sets of parameters, spatial methods and solvers can be added:

- [Add parameters](https://pybamm.readthedocs.io/en/latest/tutorials/add-parameter-values.html)
- [Add a spatial method](https://pybamm.readthedocs.io/en/latest/tutorials/add-spatial-method.html)
- [Add a solver](https://pybamm.readthedocs.io/en/latest/tutorials/add-solver.html)

## Expression tree structure

PyBaMM is built around an expression tree structure.
Expand All @@ -51,7 +44,7 @@ The following notebooks are specific to different stages of the PyBaMM pipeline,

### Models

Several battery models are implemented and can easily be used or [compared](./models/lead-acid.ipynb). The notebooks below show the solution of each individual model. We always welcome [new models](https://pybamm.readthedocs.io/en/latest/tutorials/add-model.html)!
Several battery models are implemented and can easily be used or [compared](./models/lead-acid.ipynb). The notebooks below show the solution of each individual model.

Once you are comfortable with the expression tree structure, a good starting point to understand the models in PyBaMM is to take a look at the [basic SPM](https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/models/full_battery_models/lithium_ion/basic_spm.py) and [basic DFN](https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/models/full_battery_models/lithium_ion/basic_dfn.py), since these define the entire model (variables, equations, initial and boundary conditions, events) in a single class and so are easier to understand. However, we recommend that you subsequently use the full models as they offer much greater flexibility for coupling different physical effects and visualising a greater range of variables.

Expand All @@ -74,13 +67,9 @@ The following spatial methods are implemented
- Spectral Volumes (1D only)
- Finite Elements (only for 2D current collector domains)

See [here](https://pybamm.readthedocs.io/en/latest/tutorials/add-spatial-method.html) for instructions on adding new spatial methods.

### Solvers

The following notebooks show examples for generic ODE and DAE solvers. Several solvers are implemented in PyBaMM and we encourage users to try different ones to find the most appropriate one for their models.

- [ODE solver](./solvers/ode-solver.ipynb)
- [DAE solver](./solvers/dae-solver.ipynb)

See [here](https://pybamm.readthedocs.io/en/latest/tutorials/add-solver.html) for instructions on adding new solvers.
6 changes: 3 additions & 3 deletions examples/notebooks/change-settings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"display_name": "pybamm",
"language": "python",
"name": "python3"
},
Expand All @@ -696,11 +696,11 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.13"
"version": "3.9.16"
},
"vscode": {
"interpreter": {
"hash": "1a781583db2df3c2e87436f6d22cce842c2e50a5670da93a3bd820b97dc43011"
"hash": "187972e187ab8dfbecfab9e8e194ae6d08262b2d51a54fa40644e3ddb6b5f74c"
}
}
},
Expand Down
11 changes: 8 additions & 3 deletions examples/notebooks/expression_tree/expression-tree.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"\n",
"## Stage 1 - Symbolic Expression Trees\n",
"\n",
"At each stage, the expression tree consists of certain types of nodes. In the first stage, the model is first proposed using [`pybamm.Parameter`](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/parameter.html), [`pybamm.Variable`](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/variable.html), and other [unary](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/unary_operator.html) and [binary](https://pybamm.readthedocs.io/en/latest/source/expression_tree/binary_operator.html) operators (which also includes spatial operators such as [`pybamm.Gradient`](https://pybamm.readthedocs.io/en/latest/source/expression_tree/unary_operator.html#pybamm.Gradient) and [`pybamm.Divergence`](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/unary_operator.html#pybamm.Divergence)). For example, the right hand side of the equation\n",
"At each stage, the expression tree consists of certain types of nodes. In the first stage, the model is first proposed using [`pybamm.Parameter`](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/parameter.html), [`pybamm.Variable`](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/variable.html), and other [unary](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/unary_operator.html) and [binary](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/binary_operator.html) operators (which also includes spatial operators such as [`pybamm.Gradient`](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/unary_operator.html#pybamm.Gradient) and [`pybamm.Divergence`](https://pybamm.readthedocs.io/en/latest/source/api/expression_tree/unary_operator.html#pybamm.Divergence)). For example, the right hand side of the equation\n",
"\n",
"$$\\frac{d c}{dt} = D \\nabla \\cdot \\nabla c$$\n",
"\n",
Expand Down Expand Up @@ -244,7 +244,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "pybamm",
"language": "python",
"name": "python3"
},
Expand All @@ -258,7 +258,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.12"
"version": "3.9.16"
},
"toc": {
"base_numbering": 1,
Expand All @@ -272,6 +272,11 @@
"toc_position": {},
"toc_section_display": true,
"toc_window_display": true
},
"vscode": {
"interpreter": {
"hash": "187972e187ab8dfbecfab9e8e194ae6d08262b2d51a54fa40644e3ddb6b5f74c"
}
}
},
"nbformat": 4,
Expand Down
12 changes: 8 additions & 4 deletions examples/notebooks/initialize-model-with-solution.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@
").to_numpy()\n",
"# create interpolant\n",
"param = model.default_parameter_values\n",
"timescale = param.evaluate(model.timescale)\n",
"current_interpolant = pybamm.Interpolant(drive_cycle[:, 0], drive_cycle[:, 1], timescale * pybamm.t)\n",
"current_interpolant = pybamm.Interpolant(drive_cycle[:, 0], drive_cycle[:, 1], pybamm.t)\n",
"# set drive cycle\n",
"param[\"Current function [A]\"] = current_interpolant"
]
Expand Down Expand Up @@ -312,7 +311,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "pybamm",
"language": "python",
"name": "python3"
},
Expand All @@ -326,7 +325,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.0"
"version": "3.9.16"
},
"toc": {
"base_numbering": 1,
Expand All @@ -340,6 +339,11 @@
"toc_position": {},
"toc_section_display": true,
"toc_window_display": true
},
"vscode": {
"interpreter": {
"hash": "187972e187ab8dfbecfab9e8e194ae6d08262b2d51a54fa40644e3ddb6b5f74c"
}
}
},
"nbformat": 4,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@
"outputs": [],
"source": [
"# choose option(s)\n",
"options = {\n",
" \"particle size\": \"distribution\"\n",
"}\n",
"options = {\"particle size\": \"distribution\"}\n",
"\n",
"# load model\n",
"model = pybamm.lithium_ion.DFN(options=options, name=\"MP-DFN\")"
Expand Down Expand Up @@ -168,11 +166,11 @@
"source": [
"# plot some variables that depend on particle size\n",
"output_variables = [\n",
" \"Negative particle surface concentration distribution\",\n",
" \"Positive particle surface concentration distribution\",\n",
" \"X-averaged negative particle surface concentration distribution\",\n",
" \"Negative area-weighted particle-size distribution\",\n",
" \"Positive area-weighted particle-size distribution\",\n",
" \"Negative particle surface concentration distribution [mol.m-3]\",\n",
" \"Positive particle surface concentration distribution [mol.m-3]\",\n",
" \"X-averaged negative particle surface concentration distribution [mol.m-3]\",\n",
" \"Negative area-weighted particle-size distribution [m-1]\",\n",
" \"Positive area-weighted particle-size distribution [m-1]\",\n",
" \"Terminal voltage [V]\",\n",
"]\n",
"\n",
Expand Down Expand Up @@ -340,8 +338,8 @@
"\n",
"# plot\n",
"output_variables = [\n",
" \"X-averaged negative area-weighted particle-size distribution\",\n",
" \"X-averaged positive area-weighted particle-size distribution\",\n",
" \"X-averaged negative area-weighted particle-size distribution [m-1]\",\n",
" \"X-averaged positive area-weighted particle-size distribution [m-1]\",\n",
" \"Terminal voltage [V]\"\n",
"]\n",
"quickplot = pybamm.QuickPlot(\n",
Expand Down Expand Up @@ -383,7 +381,7 @@
"# define current function\n",
"t_cutoff = 3450 # [s]\n",
"t_rest = 3600 # [s]\n",
"I_typ = params[\"Typical current [A]\"] # current for 1C\n",
"I_typ = params[\"Nominal cell capacity [A.h]\"] # current for 1C\n",
"\n",
"def current(t):\n",
" return I_typ * pybamm.EqualHeaviside(t, t_cutoff)\n",
Expand Down Expand Up @@ -473,7 +471,7 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "pybamm",
"language": "python",
"name": "python3"
},
Expand All @@ -487,7 +485,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.0"
"version": "3.9.16"
},
"toc": {
"base_numbering": 1,
Expand All @@ -501,6 +499,11 @@
"toc_position": {},
"toc_section_display": true,
"toc_window_display": true
},
"vscode": {
"interpreter": {
"hash": "187972e187ab8dfbecfab9e8e194ae6d08262b2d51a54fa40644e3ddb6b5f74c"
}
}
},
"nbformat": 4,
Expand Down
Loading