batmods-lite 0.0.2rc0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. batmods_lite-0.0.2rc0.dist-info/METADATA +144 -0
  2. batmods_lite-0.0.2rc0.dist-info/RECORD +47 -0
  3. batmods_lite-0.0.2rc0.dist-info/WHEEL +5 -0
  4. batmods_lite-0.0.2rc0.dist-info/licenses/LICENSE +28 -0
  5. batmods_lite-0.0.2rc0.dist-info/top_level.txt +1 -0
  6. bmlite/P2D/__init__.py +25 -0
  7. bmlite/P2D/_simulation.py +444 -0
  8. bmlite/P2D/_solutions.py +647 -0
  9. bmlite/P2D/dae.py +351 -0
  10. bmlite/P2D/domains.py +659 -0
  11. bmlite/P2D/postutils.py +496 -0
  12. bmlite/P2D/submodels.py +140 -0
  13. bmlite/P2D/templates/graphiteSiOx_nmc811.yaml +54 -0
  14. bmlite/P2D/templates/graphite_lfp.yaml +59 -0
  15. bmlite/P2D/templates/graphite_nmc532.yaml +54 -0
  16. bmlite/SPM/__init__.py +25 -0
  17. bmlite/SPM/_simulation.py +437 -0
  18. bmlite/SPM/_solutions.py +552 -0
  19. bmlite/SPM/dae.py +194 -0
  20. bmlite/SPM/domains.py +458 -0
  21. bmlite/SPM/postutils.py +279 -0
  22. bmlite/SPM/submodels.py +140 -0
  23. bmlite/SPM/templates/graphiteSiOx_nmc811.yaml +37 -0
  24. bmlite/SPM/templates/graphite_lfp.yaml +42 -0
  25. bmlite/SPM/templates/graphite_nmc532.yaml +37 -0
  26. bmlite/__init__.py +55 -0
  27. bmlite/_core/__init__.py +18 -0
  28. bmlite/_core/_constants.py +17 -0
  29. bmlite/_core/_experiment.py +291 -0
  30. bmlite/_core/_idasolver.py +116 -0
  31. bmlite/_core/_templates.py +55 -0
  32. bmlite/_utils.py +193 -0
  33. bmlite/materials/__init__.py +29 -0
  34. bmlite/materials/_gen2_electrolyte.py +136 -0
  35. bmlite/materials/_graphite.py +329 -0
  36. bmlite/materials/_graphite_SiOx.py +274 -0
  37. bmlite/materials/_lfp.py +152 -0
  38. bmlite/materials/_nmc_532.py +301 -0
  39. bmlite/materials/_nmc_811.py +272 -0
  40. bmlite/materials/data/graphite_ocv.csv +257 -0
  41. bmlite/materials/data/graphite_ocv_extrap.csv +258 -0
  42. bmlite/materials/data/lfp_ocv.csv +255 -0
  43. bmlite/materials/data/nmc532_ocv.csv +222 -0
  44. bmlite/materials/data/nmc532_ocv_extrap.csv +227 -0
  45. bmlite/mathutils.py +280 -0
  46. bmlite/mesh.py +200 -0
  47. bmlite/plotutils/__init__.py +69 -0
@@ -0,0 +1,144 @@
1
+ Metadata-Version: 2.4
2
+ Name: batmods-lite
3
+ Version: 0.0.2rc0
4
+ Summary: Packaged battery models and material properties.
5
+ Author: Corey R. Randall
6
+ Author-email: corey.r.randall@gmail.com
7
+ Maintainer: Corey R. Randall
8
+ Maintainer-email: corey.r.randall@gmail.com
9
+ License-Expression: BSD-3-Clause
10
+ Project-URL: Homepage, https://github.com/NatLabRockies/batmods-lite
11
+ Project-URL: Documentation, https://batmods-lite.readthedocs.io/
12
+ Project-URL: Repository, https://github.com/NatLabRockies/batmods-lite
13
+ Project-URL: Issues, https://github.com/NatLabRockies/batmods-lite/issues
14
+ Keywords: battery,models,lithium,NMC,LFP,SPM,P2D
15
+ Classifier: Development Status :: 4 - Beta
16
+ Classifier: Intended Audience :: Science/Research
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Requires-Python: <3.15,>=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: tqdm
27
+ Requires-Dist: numpy
28
+ Requires-Dist: scipy
29
+ Requires-Dist: pandas
30
+ Requires-Dist: openpyxl
31
+ Requires-Dist: matplotlib
32
+ Requires-Dist: ruamel.yaml
33
+ Requires-Dist: scikit-sundae>=1.1.3
34
+ Provides-Extra: docs
35
+ Requires-Dist: sphinx; extra == "docs"
36
+ Requires-Dist: myst-nb; extra == "docs"
37
+ Requires-Dist: sphinx-design; extra == "docs"
38
+ Requires-Dist: sphinx-autoapi; extra == "docs"
39
+ Requires-Dist: sphinx-copybutton; extra == "docs"
40
+ Requires-Dist: pydata-sphinx-theme; extra == "docs"
41
+ Provides-Extra: tests
42
+ Requires-Dist: pytest; extra == "tests"
43
+ Requires-Dist: pytest-cov; extra == "tests"
44
+ Requires-Dist: pytest-html; extra == "tests"
45
+ Requires-Dist: pytest-xdist; extra == "tests"
46
+ Provides-Extra: dev
47
+ Requires-Dist: nox; extra == "dev"
48
+ Requires-Dist: ruff; extra == "dev"
49
+ Requires-Dist: codespell; extra == "dev"
50
+ Requires-Dist: batmods-lite[docs,tests]; extra == "dev"
51
+ Dynamic: license-file
52
+
53
+ <!-- <img alt='Logo' style='width: 75%; min-width: 250px; max-width: 500px;'
54
+ src='https://github.com/NatLabRockies/batmods-lite/blob/main/images/dark.png?raw=true#gh-dark-mode-only'/>
55
+ <img alt='Logo' style='width: 75%; min-width: 250px; max-width: 500px;'
56
+ src='https://github.com/NatLabRockies/batmods-lite/blob/main/images/light.png?raw=true#gh-light-mode-only'/> -->
57
+
58
+ # BATMODS-lite
59
+
60
+ [![ci](https://github.com/NatLabRockies/batmods-lite/actions/workflows/ci.yml/badge.svg)](https://github.com/NatLabRockies/batmods-lite/actions/workflows/ci.yml) &nbsp;
61
+ [![codecov](https://codecov.io/gh/NatLabRockies/batmods-lite/graph/badge.svg?token=MPuSOeIurf)](https://codecov.io/gh/NatLabRockies/batmods-lite) &nbsp;
62
+ [![license](https://img.shields.io/badge/license-BSD--3-blue.svg)](https://github.com/NatLabRockies/batmods-lite/blob/main/LICENSE) &nbsp;
63
+
64
+ ## Summary
65
+ Battery Analysis and Training Models for Optimization and Design Studies (BATMODS) is a Python package with an API for pre-built battery models. The original purpose of the package was to quickly generate synthetic data for machine learning models to train with. However, the models are generally useful for any battery simulations or analysis. `BATMODS-lite` includes the following:
66
+
67
+ 1) A library and API for pre-built battery models
68
+ 2) Kinetic/transport properties for common battery materials
69
+
70
+ Note that the package focuses on phsics-based models like the single-particle (SPM) and pseudo-2D (P2D) model. If you enjoy the interface but are looking to run equivalent circuit models (ECMs), you should check out [thevenin](https://github.com/NatLabRockies/thevenin), which is distributed separately, but is developed and maintained by the same team. Consequently, the interface to `thevenin` models is intentionally similar, allowing for a smooth transition between physics-based and ECM approaches.
71
+
72
+ ## Installation
73
+ `BATMODS-lite` is only available via GitHub. Please clone the repo or download the files. Also, make sure you have a Python installation with a version >=3.10. If you are new to Python, we recommend using [Anaconda](https://anaconda.com/download) to set up your installation.
74
+
75
+ Once the files are available on your machine, use your terminal to navigate into the folder and execute one of the following depending on your installation preference.
76
+
77
+ ```
78
+ pip install . (basic installation)
79
+ pip install -e .[dev] (editable installation with developer options)
80
+ ```
81
+
82
+ The editable installation is useful if you plan to make changes to your local package. It ensures that any changes are immediately available each time the package is imported, without needing to reinstall. The developer options will likely be helpful if you are modifying the package.
83
+
84
+ If you run into issues with installation due to the [scikit-sundae](https://github.com/NatLabRockies/scikit-sundae) dependency, please submit an issue [here](https://github.com/NatLabRockies/scikit-sundae/issues). We also manage this solver package, but distribute it separately since it is not developed in pure Python.
85
+
86
+ ## Get Started
87
+ The API is organized around three main classes that allow you to construct simulations, define experiments, and interact with solutions. Two basic examples are given below. These demonstrate a 2C discharge for both the single particle model (SPM) and pseudo-2D (P2D) model. Note that the experiment class interfaces with all simulations. The simulations and their respective solutions, however, will depend on the model subpackage they are loaded from. For a more detailed tutorial, please check `docs/source/examples`. If you installed the editable version with developer options, you can also build the documentation locally using `nox -s docs`.
88
+
89
+ ```python
90
+ # Single particle model example
91
+ import bmlite as bm
92
+
93
+ sim = bm.SPM.Simulation()
94
+
95
+ expr = bm.Experiment()
96
+ expr.add_step('current_C', 2., (1350., 10.))
97
+
98
+ soln = sim.run(expr)
99
+ soln.simple_plot('time_s', 'voltage_V')
100
+ ```
101
+
102
+ ```python
103
+ # Pseudo-2D model example
104
+ import bmlite as bm
105
+
106
+ sim = bm.P2D.Simulation()
107
+
108
+ expr = bm.Experiment()
109
+ expr.add_step('current_C', 2., (1350., 10.))
110
+
111
+ soln = sim.run(expr)
112
+ soln.simple_plot('time_s', 'voltage_V')
113
+ ```
114
+
115
+ **Notes:**
116
+ * If you are new to Python, check out [Spyder IDE](https://www.spyder-ide.org/). Spyder is a powerful interactive development environment (IDE) that can make programming in Python more approachable to new users.
117
+ * Another friendly option for getting started in Python is to use [Jupyter Notebooks](https://jupyter.org/). We write our examples in Jupyter Notebooks since they support both markdown blocks for explanations and executable code blocks.
118
+ * Python, Spyder, and Jupyter Notebooks can be setup using [Anaconda](https://www.anaconda.com/download/success). Anaconda provides a convenient way for new users to get started with Python due to its friendly graphical installer and environment manager.
119
+
120
+ ## Citing this Work
121
+ This work was authored by researchers at the National Laboratory of the Rockies (NLR). If you use this package in your work, please include the following citation:
122
+
123
+ > Randall, Corey R. "BATMODS-lite: Packaged battery models and material properties [SWR-25-108]." Computer software, Jun. 2025. url: [github.com/NatLabRockies/batmods-lite](https://github.com/NatLabRockies/batmods-lite). doi: [10.11578/dc.20260114.1](https://doi.org./10.11578/dc.20260114.1).
124
+
125
+ For convenience, we also provide the following for your BibTex:
126
+
127
+ ```
128
+ @misc{randall2025bmlite,
129
+ author = {Randall, Corey R.},
130
+ title = {{BATMODS-lite: Packaged battery models and material properties [SWR-25-108]}},
131
+ url = {github.com/NatLabRockies/batmods-lite},
132
+ month = {Jun.},
133
+ year = {2025},
134
+ doi = {10.11578/dc.20260114.1},
135
+ }
136
+ ```
137
+
138
+ ## Contributing
139
+ If you'd like to contribute to this package, please look through the existing [issues](https://github.com/NatLabRockies/batmods-lite/issues). If the bug you've caught or the feature you'd like to add isn't already being worked on, please submit a new issue before getting started.
140
+
141
+ <!-- You should also read through the [developer guidelines](https://batmods-lite.readthedocs.io/latest/development). Need to get on readthedocs first... -->
142
+
143
+ ## Disclaimer
144
+ This work was authored by the National Laboratory of the Rockies (NLR), operated by Alliance for Energy Innovation, LLC, for the U.S. Department of Energy (DOE). The views expressed in the repository do not necessarily represent the views of the DOE or the U.S. Government.
@@ -0,0 +1,47 @@
1
+ batmods_lite-0.0.2rc0.dist-info/licenses/LICENSE,sha256=JdVI_nal5CgFs7I89G3n0IL-GuAGkwsX70V7Petc_9U,1550
2
+ bmlite/__init__.py,sha256=yb1A1mPUAqX8tcdK_oxsosriykaqrjeDm3iFmPyVwjU,1443
3
+ bmlite/_utils.py,sha256=X7c2rPQ-XVYgV0UC9u9Y2TWEgvz_CWYcfQpEckXdzTI,6336
4
+ bmlite/mathutils.py,sha256=cZQwFgXiSkx4PIAYrNPLzIvpSEGGdOmKNflyCcqEghY,7618
5
+ bmlite/mesh.py,sha256=HV64QSfRm3QjKb2QlXHfNrlwfUGTtuaGtV76VWl616E,7157
6
+ bmlite/P2D/__init__.py,sha256=hXkxxjWSmVboRE1aDTcrZQK_NynvdAzqjKxjyjC3e_w,596
7
+ bmlite/P2D/_simulation.py,sha256=7ZY0Eeca79mjI6Pj7FXF9jzXP7YrROMHp87V8GMyrbU,15761
8
+ bmlite/P2D/_solutions.py,sha256=uUPa_JHy9mXdbcpXOcaqiD6kFyH2J1aNSQwMHnGIjGo,23365
9
+ bmlite/P2D/dae.py,sha256=kp7j2zHxRzOVc6EIHbUlbE1tOZAygLgAEaaXdnlZ7N8,12886
10
+ bmlite/P2D/domains.py,sha256=Lsk5bS5sWmyov_MlFmF1yPF2cq10AsCcdmkr5PqRsZY,22527
11
+ bmlite/P2D/postutils.py,sha256=V2IJDyIh5omcqleJUPe9tUNU721JjRuUiOTYOWs3w9I,14971
12
+ bmlite/P2D/submodels.py,sha256=O89Gm0rk3tKK9W2RiA96Ott5E-7vTlxo7a6KdRszDRo,4676
13
+ bmlite/P2D/templates/graphiteSiOx_nmc811.yaml,sha256=qcIQ9SgZTxC49Rx2aS0Mi2I7kdLrp2kUa8j2Z0jP_2Y,3662
14
+ bmlite/P2D/templates/graphite_lfp.yaml,sha256=fuM2Og-jvMLOmcjyxlTUqW6KPwVIYTXds5E0vCxWk0w,3839
15
+ bmlite/P2D/templates/graphite_nmc532.yaml,sha256=oxfF1KKMbGoA0sXr0ANBb3jFB6dQsvk2LelEOelhgQ0,3752
16
+ bmlite/SPM/__init__.py,sha256=hCMUnwVDObo2uE1cywuBi4EBqs-RUK_qQWjHbFDPS78,602
17
+ bmlite/SPM/_simulation.py,sha256=khcOEaof3ivLgkPZ1-EtpfjkgLPZcvksSkQrpNzP8D4,15456
18
+ bmlite/SPM/_solutions.py,sha256=_nCsmx-gB6SQ1yh01vQo1YLrba6peqVqJQWEUNWaV9c,18719
19
+ bmlite/SPM/dae.py,sha256=oOM28TTFtPoIwZ2X4xiLSr5_Of8s7jNrgMZILaZspyA,6839
20
+ bmlite/SPM/domains.py,sha256=zBmfpLM_rTmH2gyYIpKeWPd4zAxSNoCzsO5AN1Qq9hc,14836
21
+ bmlite/SPM/postutils.py,sha256=c93KrnhVZ4r-jSWFGhqTsES8N-vgYNVKAyNQk2j6Qvo,7657
22
+ bmlite/SPM/submodels.py,sha256=mz_mXJSzblPkQ70GcQDD12u4F9Le0RrG1mDV0qs_cyI,4692
23
+ bmlite/SPM/templates/graphiteSiOx_nmc811.yaml,sha256=Dms3yeir0R0AW4gGEKiRJ4ZFWHp7kdDujKxjAZJ-foM,2448
24
+ bmlite/SPM/templates/graphite_lfp.yaml,sha256=PPXn1CTwJur33yf_eP0cp6ocJzv-WMnz0JxrRzzztyk,2595
25
+ bmlite/SPM/templates/graphite_nmc532.yaml,sha256=PUD3i8WGokh-SQ6Z-4oA7jDT8hFb1afDGuTTnj-dSBs,2508
26
+ bmlite/_core/__init__.py,sha256=SaGsP000YmwAac8xQu7_r39KAPAcxxA-bjK9meN882Y,399
27
+ bmlite/_core/_constants.py,sha256=9290krFKfbhiO5t-SiGZ-ZIMAlwVHFrWodjlqt7QzTw,335
28
+ bmlite/_core/_experiment.py,sha256=Lf6fO1xMEmNCpgfmCNM3_DTo6AyDLJRxhhe1PbqiKNs,9895
29
+ bmlite/_core/_idasolver.py,sha256=620hk08HGkpcVH8S6HFtp8lwel7D0wjU6L0HaEPZtf4,3173
30
+ bmlite/_core/_templates.py,sha256=W5Si7nQEEYsL4GsxxXzUYXjedVVMXs_EIZzhTaiUmrY,1619
31
+ bmlite/materials/__init__.py,sha256=bn3i1e5KDMFpGNYUFScstpNaXNfC-gfkPitX_HnF0B0,762
32
+ bmlite/materials/_gen2_electrolyte.py,sha256=yrfn_WBihICKNfOew0lmQnpi-trcB-D0Adg5Fqvc5CE,4118
33
+ bmlite/materials/_graphite.py,sha256=r9-JWziPYl1pkT-K4jjT8NOko9sS7WYUeSesihuj9e4,11548
34
+ bmlite/materials/_graphite_SiOx.py,sha256=zp7rgQfxfcbjYtDJbqy3JbWreyk_WXP6tkcLPMthEF4,9115
35
+ bmlite/materials/_lfp.py,sha256=7IQqVSnyG8GjGUKtj3ZnzC2z2r0YAA4LhXPOzq9CzGE,5255
36
+ bmlite/materials/_nmc_532.py,sha256=xMjuP4dln3wZQTZ88SJ5OGRCSIvcCYNkiDLSBcEnWDk,9464
37
+ bmlite/materials/_nmc_811.py,sha256=yTKa5XbhDEJdXbQAWBKNtCANcKQVotbSmaIuBuVoTNs,8923
38
+ bmlite/materials/data/graphite_ocv.csv,sha256=SPsVntziO1cQmML0fpNUTghYpAGe14fhsQiyYOel7XI,4854
39
+ bmlite/materials/data/graphite_ocv_extrap.csv,sha256=RaGq1_3PhIxd5WU9xkOkJlv4J5YtKFW3zZNn1WHCNpQ,4864
40
+ bmlite/materials/data/lfp_ocv.csv,sha256=jyCCBb9HSdToKat3-j4_SE5SgTj9Ilo4YB1THZ7DGiw,15169
41
+ bmlite/materials/data/nmc532_ocv.csv,sha256=wiTmsNYRd6VOtm1T3OnUAWjJlpLw6aPLtDJ5K5HbYJk,4802
42
+ bmlite/materials/data/nmc532_ocv_extrap.csv,sha256=zv-XD3wDwP8d9PEFZZxiQTUHdU7pZuN2SJehMor7y7I,4891
43
+ bmlite/plotutils/__init__.py,sha256=U-jP4ycuNCHkKRz8qVvHLyQDafGsArShxrS-ngS6_Sg,2066
44
+ batmods_lite-0.0.2rc0.dist-info/METADATA,sha256=lq-SX4Kum0e56SJy1Wu4QEA7IvYC7BpoehmNMQg58DU,8604
45
+ batmods_lite-0.0.2rc0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
46
+ batmods_lite-0.0.2rc0.dist-info/top_level.txt,sha256=SbSEgKVZa-2ONs4Tzxs5tz_UNwurP6yVih-etjSJWVk,7
47
+ batmods_lite-0.0.2rc0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,28 @@
1
+ BSD 3-Clause License
2
+
3
+ Copyright (c) 2025, Alliance for Energy Innovation, LLC
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+
8
+ 1. Redistributions of source code must retain the above copyright notice, this
9
+ list of conditions and the following disclaimer.
10
+
11
+ 2. Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+
15
+ 3. Neither the name of the copyright holder nor the names of its
16
+ contributors may be used to endorse or promote products derived from
17
+ this software without specific prior written permission.
18
+
19
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1 @@
1
+ bmlite
bmlite/P2D/__init__.py ADDED
@@ -0,0 +1,25 @@
1
+ """
2
+ A packaged pseudo-2D (P2D) model. Build a model using the `Simulation` class,
3
+ and run an experiment using either the `run()` or `run_step()` methods. These
4
+ methods return `Solution` class instances with post processing, plotting, and
5
+ saving methods.
6
+
7
+ """
8
+
9
+ from ._simulation import Simulation
10
+ from ._solutions import StepSolution, CycleSolution
11
+
12
+ from . import dae
13
+ from . import domains
14
+ from . import postutils
15
+ from . import submodels
16
+
17
+ __all__ = [
18
+ 'Simulation',
19
+ 'StepSolution',
20
+ 'CycleSolution',
21
+ 'dae',
22
+ 'domains',
23
+ 'postutils',
24
+ 'submodels',
25
+ ]