softpotato 3.2.2__tar.gz → 3.4.0__tar.gz
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.
- {softpotato-3.2.2/src/softpotato.egg-info → softpotato-3.4.0}/PKG-INFO +6 -126
- softpotato-3.4.0/README.md +79 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/pyproject.toml +1 -1
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/__init__.py +154 -2
- softpotato-3.4.0/src/softpotato/reactions/__init__.py +77 -0
- softpotato-3.4.0/src/softpotato/reactions/heterogeneous.py +1193 -0
- softpotato-3.4.0/src/softpotato/reactions/homogeneous.py +1245 -0
- softpotato-3.4.0/src/softpotato/reactions/mechanisms.py +918 -0
- softpotato-3.4.0/src/softpotato/reactions/species.py +256 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/solver/base.py +228 -55
- softpotato-3.4.0/src/softpotato/solver/scipy_ivp.py +450 -0
- softpotato-3.4.0/src/softpotato/techniques/__init__.py +123 -0
- softpotato-3.4.0/src/softpotato/techniques/base.py +540 -0
- softpotato-3.4.0/src/softpotato/techniques/chronoamperometry.py +289 -0
- softpotato-3.4.0/src/softpotato/techniques/chronopotentiometry.py +587 -0
- softpotato-3.4.0/src/softpotato/techniques/diagnostics.py +1615 -0
- softpotato-3.4.0/src/softpotato/techniques/pipeline.py +1097 -0
- softpotato-3.4.0/src/softpotato/techniques/plotting.py +1388 -0
- softpotato-3.4.0/src/softpotato/techniques/pulse.py +1124 -0
- softpotato-3.4.0/src/softpotato/techniques/rde.py +1357 -0
- softpotato-3.4.0/src/softpotato/techniques/result.py +440 -0
- softpotato-3.4.0/src/softpotato/techniques/voltammetry.py +518 -0
- softpotato-3.4.0/src/softpotato/techniques/waveforms.py +566 -0
- {softpotato-3.2.2 → softpotato-3.4.0/src/softpotato.egg-info}/PKG-INFO +6 -126
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato.egg-info/SOURCES.txt +30 -1
- softpotato-3.4.0/tests/test_basic.py +5 -0
- softpotato-3.4.0/tests/test_reactions_benchmark.py +726 -0
- softpotato-3.4.0/tests/test_reactions_heterogeneous.py +519 -0
- softpotato-3.4.0/tests/test_reactions_homogeneous.py +600 -0
- softpotato-3.4.0/tests/test_reactions_solver.py +701 -0
- softpotato-3.4.0/tests/test_reactions_species.py +354 -0
- softpotato-3.4.0/tests/test_techniques_benchmark.py +1175 -0
- softpotato-3.4.0/tests/test_techniques_diagnostics.py +1022 -0
- softpotato-3.4.0/tests/test_techniques_pipeline.py +695 -0
- softpotato-3.4.0/tests/test_techniques_plotting.py +478 -0
- softpotato-3.4.0/tests/test_techniques_pulse.py +503 -0
- softpotato-3.4.0/tests/test_techniques_rde.py +521 -0
- softpotato-3.4.0/tests/test_techniques_waveforms.py +525 -0
- softpotato-3.2.2/README.md +0 -199
- softpotato-3.2.2/src/softpotato/solver/scipy_ivp.py +0 -240
- softpotato-3.2.2/tests/test_basic.py +0 -5
- {softpotato-3.2.2 → softpotato-3.4.0}/LICENSE +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/setup.cfg +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/analytical/__init__.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/analytical/benchmark.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/analytical/fitting.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/analytical/hydrodynamics.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/analytical/kinetics.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/analytical/microelectrodes.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/analytical/secm.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/analytical/step.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/analytical/voltammetry.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/constants.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/geometry/__init__.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/geometry/base.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/geometry/cylindrical.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/geometry/planar.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/geometry/spherical.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/grid/__init__.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/grid/base.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/grid/exponential.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/grid/geometric.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/grid/uniform.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/py.typed +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/solver/__init__.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/solver/crank_nicolson.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/solver/explicit.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato/solver/implicit.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato.egg-info/dependency_links.txt +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato.egg-info/requires.txt +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/src/softpotato.egg-info/top_level.txt +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_analytical_benchmark.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_analytical_fitting.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_analytical_hydrodynamics.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_analytical_kinetics.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_analytical_microelectrodes.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_analytical_secm.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_analytical_step.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_analytical_voltammetry.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_constants.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_geometry.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_grid.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_grid_solvers.py +0 -0
- {softpotato-3.2.2 → softpotato-3.4.0}/tests/test_solvers.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: softpotato
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.4.0
|
|
4
4
|
Summary: Electrochemical simulation and analysis toolkit in Python.
|
|
5
5
|
Author-email: Oliver Rodriguez <oliver.rdz@softpotato.xyz>
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -64,15 +64,6 @@ Dynamic: license-file
|
|
|
64
64
|
|
|
65
65
|
**Soft Potato** is an open-source electrochemical simulation and analysis toolkit in Python.
|
|
66
66
|
|
|
67
|
-
> [!NOTE]
|
|
68
|
-
> **Active Development (Milestone 3 in progress):**
|
|
69
|
-
> The `main` branch contains work-in-progress features for **Milestone 3** (v3.3.0: Reactions).
|
|
70
|
-
> The current stable release available on [PyPI](https://pypi.org/project/softpotato/) is **v3.2.2**.
|
|
71
|
-
> To test or use in-development features, install directly from GitHub:
|
|
72
|
-
> ```bash
|
|
73
|
-
> pip install git+https://github.com/oliverrdz/softpotato.git
|
|
74
|
-
> ```
|
|
75
|
-
|
|
76
67
|
**Full documentation**: [https://softpotato.xyz/](https://softpotato.xyz/) | **Try Live**: [Google Colab Starter](https://colab.research.google.com/drive/1w9NfLV2j8ZZjjcVhAiPcogVnKb65wqE2) | **Roadmap**: [ROADMAP.md](ROADMAP.md) | **Changelog**: [CHANGELOG.md](CHANGELOG.md)
|
|
77
68
|
|
|
78
69
|
## Installation
|
|
@@ -82,15 +73,15 @@ Dynamic: license-file
|
|
|
82
73
|
Run Soft Potato directly in your browser with no local Python setup required:
|
|
83
74
|
- [**Launch Soft Potato v3 Starter in Google Colab**](https://colab.research.google.com/drive/1w9NfLV2j8ZZjjcVhAiPcogVnKb65wqE2)
|
|
84
75
|
|
|
85
|
-
### Stable Release (v3.
|
|
76
|
+
### Stable Release (v3.4.0)
|
|
86
77
|
|
|
87
|
-
Soft Potato v3.
|
|
78
|
+
Soft Potato v3.4.0 is available on [PyPI](https://pypi.org/project/softpotato/) and can be installed via pip:
|
|
88
79
|
|
|
89
80
|
```bash
|
|
90
81
|
pip install softpotato
|
|
91
82
|
```
|
|
92
83
|
|
|
93
|
-
### Development Version
|
|
84
|
+
### Development Version
|
|
94
85
|
|
|
95
86
|
To install the latest development version directly from GitHub:
|
|
96
87
|
|
|
@@ -106,117 +97,6 @@ cd softpotato
|
|
|
106
97
|
pip install -e ".[dev,docs]"
|
|
107
98
|
```
|
|
108
99
|
|
|
109
|
-
## Quick Start: Solving 1D Diffusion with `scipy_ivp`
|
|
110
|
-
|
|
111
|
-
Soft Potato makes it straightforward to simulate chemical diffusion:
|
|
112
|
-
|
|
113
|
-
$$\frac{\partial c}{\partial t} = D \frac{\partial^2 c}{\partial x^2}$$
|
|
114
|
-
|
|
115
|
-
Here is a minimal example setting boundary conditions to $0$ at the left boundary ($x=0$) and $1.0$ at the right boundary ($x=1.0$):
|
|
116
|
-
|
|
117
|
-
```python
|
|
118
|
-
import numpy as np
|
|
119
|
-
from softpotato.solver import DiffusionProblem, DirichletBC, get_solver
|
|
120
|
-
|
|
121
|
-
# 1. Define grid and diffusion problem (c = 0 at left, c = 1.0 at right)
|
|
122
|
-
grid = np.linspace(0.0, 1.0, 50)
|
|
123
|
-
problem = DiffusionProblem(
|
|
124
|
-
grid=grid,
|
|
125
|
-
diffusivity={"c": 1e-4},
|
|
126
|
-
boundary_conditions={"c": (DirichletBC(0.0), DirichletBC(1.0))},
|
|
127
|
-
initial_conditions={"c": 1.0},
|
|
128
|
-
)
|
|
129
|
-
|
|
130
|
-
# 2. Solve using SciPy's Method of Lines solver
|
|
131
|
-
solver = get_solver("scipy_ivp")
|
|
132
|
-
result = solver.solve(problem, t_span=(0.0, 1.0))
|
|
133
|
-
|
|
134
|
-
# 3. Save the concentration profile to a variable
|
|
135
|
-
c_profile = result["c"] # 2D array of shape (N_times, N_points)
|
|
136
|
-
c_flux = result.fluxes["c"] # The current can be calculated with i = n*F*A*c_flux
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Non-Uniform Spatial Discretization (`softpotato.grid`)
|
|
140
|
-
|
|
141
|
-
Concentration gradients in electrochemical experiments are confined to a thin diffusion boundary layer ($\delta \approx 6\sqrt{D t_{\max}}$) adjacent to the working electrode. Soft Potato's `grid` module provides uniform, geometrically expanding, and exponential/hyperbolic coordinate meshes that cluster nodes near active interfaces while coarsening into the bulk solution:
|
|
142
|
-
|
|
143
|
-
```python
|
|
144
|
-
from softpotato.grid import (
|
|
145
|
-
create_diffusion_mesh,
|
|
146
|
-
GeometricExpandingMesh,
|
|
147
|
-
ExponentialMesh,
|
|
148
|
-
)
|
|
149
|
-
from softpotato.solver import DiffusionProblem, DirichletBC, get_solver
|
|
150
|
-
|
|
151
|
-
# Automatically size a geometrically expanding mesh to delta = 6 * sqrt(D * t_max)
|
|
152
|
-
mesh = create_diffusion_mesh(
|
|
153
|
-
D=1e-9,
|
|
154
|
-
t_max=1.0,
|
|
155
|
-
kind="geometric",
|
|
156
|
-
n_points=60,
|
|
157
|
-
gamma=1.08,
|
|
158
|
-
)
|
|
159
|
-
|
|
160
|
-
problem = DiffusionProblem(
|
|
161
|
-
grid=mesh,
|
|
162
|
-
diffusivity={"Ox": 1e-9},
|
|
163
|
-
boundary_conditions={"Ox": (DirichletBC(0.0), DirichletBC(1.0))},
|
|
164
|
-
initial_conditions={"Ox": 1.0},
|
|
165
|
-
)
|
|
166
|
-
result = get_solver("scipy_ivp").solve(problem, t_span=(0.0, 1.0))
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
## Electrode Coordinate Geometries (`softpotato.geometry`)
|
|
170
|
-
|
|
171
|
-
Soft Potato natively supports 1D Cartesian planar (`PlanarGeometry`), radial spherical/hemispherical (`SphericalGeometry`), and radial cylindrical (`CylindricalGeometry`) coordinate systems, with automatic Faradaic current integration ($I = n F A J$):
|
|
172
|
-
|
|
173
|
-
```python
|
|
174
|
-
from softpotato.geometry import SphericalGeometry
|
|
175
|
-
from softpotato.grid import GeometricExpandingMesh
|
|
176
|
-
from softpotato.solver import DiffusionProblem, DirichletBC, get_solver
|
|
177
|
-
|
|
178
|
-
r0 = 10e-6 # 10 um spherical microelectrode radius
|
|
179
|
-
mesh = GeometricExpandingMesh(x_min=r0, x_max=r0 + 500e-6, n_points=80, gamma=1.06)
|
|
180
|
-
|
|
181
|
-
problem = DiffusionProblem(
|
|
182
|
-
grid=mesh,
|
|
183
|
-
diffusivity={"Ox": 1e-9},
|
|
184
|
-
boundary_conditions={"Ox": (DirichletBC(0.0), DirichletBC(1.0))},
|
|
185
|
-
initial_conditions={"Ox": 1.0},
|
|
186
|
-
geometry=SphericalGeometry(r0=r0),
|
|
187
|
-
n_electrons={"Ox": -1},
|
|
188
|
-
)
|
|
189
|
-
result = get_solver("scipy_ivp").solve(problem, t_span=(0.0, 2.0))
|
|
190
|
-
i_cathodic = result.currents["Ox"] # Faradaic current in Amperes (IUPAC convention)
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
## Analytical Equations & Benchmarking (`softpotato.analytical`)
|
|
194
|
-
|
|
195
|
-
Soft Potato provides exact closed-form analytical solutions and empirical models for benchmarking numerical solvers and rapid parameter estimation:
|
|
196
|
-
|
|
197
|
-
```python
|
|
198
|
-
import numpy as np
|
|
199
|
-
import softpotato as sp
|
|
200
|
-
|
|
201
|
-
# 1. Planar Cottrell chronoamperometry current transient
|
|
202
|
-
t = np.linspace(0.1, 5.0, 50)
|
|
203
|
-
i_transient = sp.cottrell(t, n=1, D=1e-5, c_bulk=1e-3, area=1e-4)
|
|
204
|
-
|
|
205
|
-
# 2. Spherical electrode transient and steady-state limiting current
|
|
206
|
-
i_sphere = sp.cottrell_spherical(t, r=1e-5, n=1, D=1e-5, c_bulk=1e-3)
|
|
207
|
-
```
|
|
208
|
-
|
|
209
|
-
## Interactive Tutorials & Examples
|
|
210
|
-
|
|
211
|
-
Step-by-step Jupyter notebook tutorials are located in [`examples/`](examples/) and rendered in the [online documentation](https://softpotato.xyz/tutorials/):
|
|
212
|
-
|
|
213
|
-
| Tutorial | Description | Notebook |
|
|
214
|
-
| :--- | :--- | :--- |
|
|
215
|
-
| **Cottrell Chronoamperometry** | 1D potential-step diffusion, error metrics, and parameter fitting | [`examples/cottrell.ipynb`](examples/cottrell.ipynb) |
|
|
216
|
-
| **Cyclic Voltammetry** | Reversible Nernstian CV, concentration profiles, and Randles–Ševčík diagnostics | [`examples/cyclic_voltammetry.ipynb`](examples/cyclic_voltammetry.ipynb) |
|
|
217
|
-
| **Cottrell Across Geometries** | Planar, spherical, and cylindrical electrode transients and steady-state limits | [`examples/cottrell_geometries.ipynb`](examples/cottrell_geometries.ipynb) |
|
|
218
|
-
| **Non-Uniform Expanding Grids** | Geometric and exponential mesh clustering, convergence, and 5–20× solver speedups | [`examples/expanding_grids.ipynb`](examples/expanding_grids.ipynb) |
|
|
219
|
-
|
|
220
100
|
## Development Roadmap & Milestones
|
|
221
101
|
|
|
222
102
|
Soft Potato follows a staged milestone development roadmap for the 3.x series, maintaining strict backwards compatibility across releases:
|
|
@@ -226,8 +106,8 @@ Soft Potato follows a staged milestone development roadmap for the 3.x series, m
|
|
|
226
106
|
| **Current Baseline** | `v3.0.0` | 1D multi-species diffusion solvers (`scipy_ivp`, Crank–Nicolson, BTCS, FTCS) | Released |
|
|
227
107
|
| **Milestone 1: Analytical Equations** | `v3.1.0` | Vectorized analytical models (`step`, `voltammetry`, `hydrodynamics`, `microelectrodes`, `secm`, `kinetics`), automated solver benchmarking (`benchmark`), and parameter fitting (`fitting`) | Released |
|
|
228
108
|
| **Milestone 2: Grids** | `v3.2.0` | Non-uniform, geometric, and exponentially expanding spatial discretization meshes (`grid`) and planar/spherical/cylindrical coordinate geometries (`geometry`) | Released |
|
|
229
|
-
| **Milestone 3: Reactions** | `v3.3.0` | Homogeneous chemical mechanisms (EC, EC', catalytic) and heterogeneous charge-transfer kinetics (`reactions`) |
|
|
230
|
-
| **Milestone 4: Techniques** | `v3.4.0` | Standard electrochemical experimental waveform generators (CV,
|
|
109
|
+
| **Milestone 3: Reactions** | `v3.3.0` | Homogeneous chemical mechanisms (EC, EC', catalytic) and heterogeneous charge-transfer kinetics (`reactions`) | Released |
|
|
110
|
+
| **Milestone 4: Techniques** | `v3.4.0` | Standard electrochemical experimental waveform generators (CA, LSV, CV, SCV, DPV, SWV, CP, RDE), high-level simulation pipelines, declarative plotting, and diagnostics (`techniques`) | Released |
|
|
231
111
|
|
|
232
112
|
For detailed architectural plans and deliverable specifications, see the full [Roadmap](ROADMAP.md).
|
|
233
113
|
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
# Soft Potato
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/softpotato/)
|
|
4
|
+
[](https://colab.research.google.com/drive/1w9NfLV2j8ZZjjcVhAiPcogVnKb65wqE2)
|
|
5
|
+
[](https://github.com/oliverrdz/softpotato/actions/workflows/ci.yml)
|
|
6
|
+
[](https://doi.org/10.26434/chemrxiv-2022-4bs3w)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://www.python.org/)
|
|
9
|
+
|
|
10
|
+
**Soft Potato** is an open-source electrochemical simulation and analysis toolkit in Python.
|
|
11
|
+
|
|
12
|
+
**Full documentation**: [https://softpotato.xyz/](https://softpotato.xyz/) | **Try Live**: [Google Colab Starter](https://colab.research.google.com/drive/1w9NfLV2j8ZZjjcVhAiPcogVnKb65wqE2) | **Roadmap**: [ROADMAP.md](ROADMAP.md) | **Changelog**: [CHANGELOG.md](CHANGELOG.md)
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
### Zero-Install Browser Trial (Google Colab)
|
|
17
|
+
|
|
18
|
+
Run Soft Potato directly in your browser with no local Python setup required:
|
|
19
|
+
- [**Launch Soft Potato v3 Starter in Google Colab**](https://colab.research.google.com/drive/1w9NfLV2j8ZZjjcVhAiPcogVnKb65wqE2)
|
|
20
|
+
|
|
21
|
+
### Stable Release (v3.4.0)
|
|
22
|
+
|
|
23
|
+
Soft Potato v3.4.0 is available on [PyPI](https://pypi.org/project/softpotato/) and can be installed via pip:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
pip install softpotato
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Development Version
|
|
30
|
+
|
|
31
|
+
To install the latest development version directly from GitHub:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
pip install git+https://github.com/oliverrdz/softpotato.git
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Or clone the repository and install in development mode:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
git clone https://github.com/oliverrdz/softpotato.git
|
|
41
|
+
cd softpotato
|
|
42
|
+
pip install -e ".[dev,docs]"
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Development Roadmap & Milestones
|
|
46
|
+
|
|
47
|
+
Soft Potato follows a staged milestone development roadmap for the 3.x series, maintaining strict backwards compatibility across releases:
|
|
48
|
+
|
|
49
|
+
| Milestone | Target | Focus Area | Status |
|
|
50
|
+
| :--- | :--- | :--- | :--- |
|
|
51
|
+
| **Current Baseline** | `v3.0.0` | 1D multi-species diffusion solvers (`scipy_ivp`, Crank–Nicolson, BTCS, FTCS) | Released |
|
|
52
|
+
| **Milestone 1: Analytical Equations** | `v3.1.0` | Vectorized analytical models (`step`, `voltammetry`, `hydrodynamics`, `microelectrodes`, `secm`, `kinetics`), automated solver benchmarking (`benchmark`), and parameter fitting (`fitting`) | Released |
|
|
53
|
+
| **Milestone 2: Grids** | `v3.2.0` | Non-uniform, geometric, and exponentially expanding spatial discretization meshes (`grid`) and planar/spherical/cylindrical coordinate geometries (`geometry`) | Released |
|
|
54
|
+
| **Milestone 3: Reactions** | `v3.3.0` | Homogeneous chemical mechanisms (EC, EC', catalytic) and heterogeneous charge-transfer kinetics (`reactions`) | Released |
|
|
55
|
+
| **Milestone 4: Techniques** | `v3.4.0` | Standard electrochemical experimental waveform generators (CA, LSV, CV, SCV, DPV, SWV, CP, RDE), high-level simulation pipelines, declarative plotting, and diagnostics (`techniques`) | Released |
|
|
56
|
+
|
|
57
|
+
For detailed architectural plans and deliverable specifications, see the full [Roadmap](ROADMAP.md).
|
|
58
|
+
|
|
59
|
+
## Citation
|
|
60
|
+
|
|
61
|
+
If you use Soft Potato in your research or project, please cite the ChemRxiv preprint:
|
|
62
|
+
|
|
63
|
+
> Rodríguez, O. (2022). Soft Potato: an open source electrochemical simulator and toolkit. *ChemRxiv*. [doi:10.26434/chemrxiv-2022-4bs3w](https://doi.org/10.26434/chemrxiv-2022-4bs3w)
|
|
64
|
+
|
|
65
|
+
```bibtex
|
|
66
|
+
@article{rodriguez2022softpotato,
|
|
67
|
+
author = {Rodr{\'i}guez, Oliver},
|
|
68
|
+
title = {Soft Potato: an open source electrochemical simulator and toolkit},
|
|
69
|
+
journal = {ChemRxiv},
|
|
70
|
+
year = {2022},
|
|
71
|
+
doi = {10.26434/chemrxiv-2022-4bs3w},
|
|
72
|
+
url = {https://chemrxiv.org/doi/full/10.26434/chemrxiv-2022-4bs3w}
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## License
|
|
77
|
+
|
|
78
|
+
This project is licensed under the BSD 3-Clause License - see the [LICENSE](LICENSE) file for details.
|
|
79
|
+
|
|
@@ -26,7 +26,7 @@ True
|
|
|
26
26
|
(101, 50)
|
|
27
27
|
"""
|
|
28
28
|
|
|
29
|
-
from . import analytical, constants, geometry, grid, solver
|
|
29
|
+
from . import analytical, constants, geometry, grid, reactions, solver, techniques
|
|
30
30
|
from .analytical import (
|
|
31
31
|
BenchmarkCaseResult,
|
|
32
32
|
BenchmarkMetrics,
|
|
@@ -157,6 +157,26 @@ from .grid import (
|
|
|
157
157
|
create_diffusion_mesh,
|
|
158
158
|
diffusion_layer_thickness,
|
|
159
159
|
)
|
|
160
|
+
from .reactions import (
|
|
161
|
+
ButlerVolmer,
|
|
162
|
+
CatalyticReaction,
|
|
163
|
+
CustomReaction,
|
|
164
|
+
DimerizationReaction,
|
|
165
|
+
DisproportionationReaction,
|
|
166
|
+
FirstOrderReaction,
|
|
167
|
+
HeterogeneousKinetics,
|
|
168
|
+
HomogeneousReaction,
|
|
169
|
+
MassActionReaction,
|
|
170
|
+
NernstianEquilibrium,
|
|
171
|
+
ReactionNetwork,
|
|
172
|
+
ReversibleReaction,
|
|
173
|
+
SecondOrderReaction,
|
|
174
|
+
Species,
|
|
175
|
+
SpeciesCollection,
|
|
176
|
+
Tafel,
|
|
177
|
+
TafelKinetics,
|
|
178
|
+
create_electrochemical_bcs,
|
|
179
|
+
)
|
|
160
180
|
from .solver import (
|
|
161
181
|
BaseSolver,
|
|
162
182
|
BoundaryCondition,
|
|
@@ -167,8 +187,65 @@ from .solver import (
|
|
|
167
187
|
get_solver,
|
|
168
188
|
list_solvers,
|
|
169
189
|
)
|
|
190
|
+
from .techniques import (
|
|
191
|
+
PLOT_ALIASES,
|
|
192
|
+
BaseTechnique,
|
|
193
|
+
CallableSegment,
|
|
194
|
+
Chronoamperometry,
|
|
195
|
+
Chronopotentiometry,
|
|
196
|
+
ConstantSegment,
|
|
197
|
+
ControlMode,
|
|
198
|
+
CustomWaveform,
|
|
199
|
+
CVDiagnostics,
|
|
200
|
+
CyclicVoltammetry,
|
|
201
|
+
DifferentialPulseVoltammetry,
|
|
202
|
+
LinearRampSegment,
|
|
203
|
+
LinearSweepVoltammetry,
|
|
204
|
+
NicholsonDiagnostics,
|
|
205
|
+
PeakInfo,
|
|
206
|
+
PeakPolarity,
|
|
207
|
+
PlotSpec,
|
|
208
|
+
RDESweep,
|
|
209
|
+
RDESweepResult,
|
|
210
|
+
RotatingDiskElectrode,
|
|
211
|
+
SampledCurrentVoltammetry,
|
|
212
|
+
SandDiagnostics,
|
|
213
|
+
SinusoidalSegment,
|
|
214
|
+
SquareWaveVoltammetry,
|
|
215
|
+
TechniqueResult,
|
|
216
|
+
WaveformSegment,
|
|
217
|
+
analyze_cottrell,
|
|
218
|
+
analyze_koutecky_levich,
|
|
219
|
+
analyze_levich,
|
|
220
|
+
analyze_nicholson,
|
|
221
|
+
analyze_randles_sevcik,
|
|
222
|
+
analyze_sand,
|
|
223
|
+
analyze_tafel,
|
|
224
|
+
find_peaks,
|
|
225
|
+
plot_charge_vs_time,
|
|
226
|
+
plot_concentration_profile,
|
|
227
|
+
plot_cottrell,
|
|
228
|
+
plot_current_vs_time,
|
|
229
|
+
plot_dpv,
|
|
230
|
+
plot_koutecky_levich,
|
|
231
|
+
plot_levich,
|
|
232
|
+
plot_peaks,
|
|
233
|
+
plot_potential_vs_time,
|
|
234
|
+
plot_randles_sevcik,
|
|
235
|
+
plot_result,
|
|
236
|
+
plot_scv,
|
|
237
|
+
plot_summary,
|
|
238
|
+
plot_sweep,
|
|
239
|
+
plot_swv,
|
|
240
|
+
plot_tafel,
|
|
241
|
+
plot_voltammogram,
|
|
242
|
+
resolve_plot_kind,
|
|
243
|
+
simulate,
|
|
244
|
+
simulate_rde_sweep,
|
|
245
|
+
simulate_sweep,
|
|
246
|
+
)
|
|
170
247
|
|
|
171
|
-
__version__ = "3.
|
|
248
|
+
__version__ = "3.4.0"
|
|
172
249
|
|
|
173
250
|
__all__ = [
|
|
174
251
|
"AVOGADRO",
|
|
@@ -176,48 +253,98 @@ __all__ = [
|
|
|
176
253
|
"ELEMENTARY_CHARGE",
|
|
177
254
|
"FARADAY",
|
|
178
255
|
"GAS_CONSTANT",
|
|
256
|
+
"PLOT_ALIASES",
|
|
179
257
|
"STANDARD_TEMPERATURE",
|
|
180
258
|
"T_STD",
|
|
181
259
|
"VACUUM_PERMITTIVITY",
|
|
182
260
|
"BaseSolver",
|
|
261
|
+
"BaseTechnique",
|
|
183
262
|
"BenchmarkCaseResult",
|
|
184
263
|
"BenchmarkMetrics",
|
|
185
264
|
"BenchmarkSuiteResult",
|
|
186
265
|
"BoundaryCondition",
|
|
266
|
+
"ButlerVolmer",
|
|
187
267
|
"ButlerVolmerFitResult",
|
|
268
|
+
"CVDiagnostics",
|
|
269
|
+
"CallableSegment",
|
|
270
|
+
"CatalyticReaction",
|
|
271
|
+
"Chronoamperometry",
|
|
272
|
+
"Chronopotentiometry",
|
|
273
|
+
"ConstantSegment",
|
|
274
|
+
"ControlMode",
|
|
188
275
|
"ConvergenceResult",
|
|
189
276
|
"CottrellFitResult",
|
|
277
|
+
"CustomReaction",
|
|
278
|
+
"CustomWaveform",
|
|
279
|
+
"CyclicVoltammetry",
|
|
190
280
|
"CylindricalGeometry",
|
|
281
|
+
"DifferentialPulseVoltammetry",
|
|
191
282
|
"DiffusionProblem",
|
|
283
|
+
"DimerizationReaction",
|
|
192
284
|
"DirichletBC",
|
|
285
|
+
"DisproportionationReaction",
|
|
193
286
|
"ExponentialMesh",
|
|
194
287
|
"F",
|
|
288
|
+
"FirstOrderReaction",
|
|
195
289
|
"FitResult",
|
|
196
290
|
"GeometricExpandingMesh",
|
|
197
291
|
"Geometry",
|
|
198
292
|
"GridComparisonEntry",
|
|
199
293
|
"GridComparisonResult",
|
|
294
|
+
"HeterogeneousKinetics",
|
|
295
|
+
"HomogeneousReaction",
|
|
200
296
|
"KouteckyLevichFitResult",
|
|
201
297
|
"KouteckyLevichResult",
|
|
202
298
|
"LevichFitResult",
|
|
299
|
+
"LinearRampSegment",
|
|
300
|
+
"LinearSweepVoltammetry",
|
|
301
|
+
"MassActionReaction",
|
|
203
302
|
"MatsudaAyabeResult",
|
|
204
303
|
"Mesh1D",
|
|
205
304
|
"MicrodiscFitResult",
|
|
305
|
+
"NernstianEquilibrium",
|
|
206
306
|
"NeumannBC",
|
|
307
|
+
"NicholsonDiagnostics",
|
|
207
308
|
"NicholsonResult",
|
|
309
|
+
"PeakInfo",
|
|
310
|
+
"PeakPolarity",
|
|
208
311
|
"PlanarGeometry",
|
|
312
|
+
"PlotSpec",
|
|
209
313
|
"R",
|
|
314
|
+
"RDESweep",
|
|
315
|
+
"RDESweepResult",
|
|
210
316
|
"RRDEResult",
|
|
211
317
|
"RandlesSevcikFitResult",
|
|
318
|
+
"ReactionNetwork",
|
|
319
|
+
"ReversibleReaction",
|
|
320
|
+
"RotatingDiskElectrode",
|
|
212
321
|
"SECMApproachFitResult",
|
|
322
|
+
"SampledCurrentVoltammetry",
|
|
323
|
+
"SandDiagnostics",
|
|
324
|
+
"SecondOrderReaction",
|
|
325
|
+
"SinusoidalSegment",
|
|
213
326
|
"SolverResult",
|
|
327
|
+
"Species",
|
|
328
|
+
"SpeciesCollection",
|
|
214
329
|
"SphericalGeometry",
|
|
330
|
+
"SquareWaveVoltammetry",
|
|
331
|
+
"Tafel",
|
|
215
332
|
"TafelFitResult",
|
|
333
|
+
"TafelKinetics",
|
|
216
334
|
"TafelResult",
|
|
335
|
+
"TechniqueResult",
|
|
217
336
|
"Uniform1DMesh",
|
|
218
337
|
"UnknownGeometryError",
|
|
338
|
+
"WaveformSegment",
|
|
219
339
|
"__version__",
|
|
220
340
|
"analytical",
|
|
341
|
+
"analyze_cottrell",
|
|
342
|
+
"analyze_koutecky_levich",
|
|
343
|
+
"analyze_levich",
|
|
344
|
+
"analyze_nicholson",
|
|
345
|
+
"analyze_randles_sevcik",
|
|
346
|
+
"analyze_sand",
|
|
347
|
+
"analyze_tafel",
|
|
221
348
|
"anson",
|
|
222
349
|
"butler_volmer",
|
|
223
350
|
"butler_volmer_current_density",
|
|
@@ -231,10 +358,12 @@ __all__ = [
|
|
|
231
358
|
"cottrell_spherical",
|
|
232
359
|
"cottrell_step",
|
|
233
360
|
"create_diffusion_mesh",
|
|
361
|
+
"create_electrochemical_bcs",
|
|
234
362
|
"diffusion_layer_thickness",
|
|
235
363
|
"estimate_convergence_order",
|
|
236
364
|
"exchange_current",
|
|
237
365
|
"exchange_current_density",
|
|
366
|
+
"find_peaks",
|
|
238
367
|
"fit_butler_volmer",
|
|
239
368
|
"fit_cottrell",
|
|
240
369
|
"fit_curve",
|
|
@@ -273,11 +402,30 @@ __all__ = [
|
|
|
273
402
|
"nicholson_psi",
|
|
274
403
|
"nicholson_rate_constant",
|
|
275
404
|
"peak_potential_irreversible",
|
|
405
|
+
"plot_charge_vs_time",
|
|
406
|
+
"plot_concentration_profile",
|
|
407
|
+
"plot_cottrell",
|
|
408
|
+
"plot_current_vs_time",
|
|
409
|
+
"plot_dpv",
|
|
410
|
+
"plot_koutecky_levich",
|
|
411
|
+
"plot_levich",
|
|
412
|
+
"plot_peaks",
|
|
413
|
+
"plot_potential_vs_time",
|
|
414
|
+
"plot_randles_sevcik",
|
|
415
|
+
"plot_result",
|
|
416
|
+
"plot_scv",
|
|
417
|
+
"plot_summary",
|
|
418
|
+
"plot_sweep",
|
|
419
|
+
"plot_swv",
|
|
420
|
+
"plot_tafel",
|
|
421
|
+
"plot_voltammogram",
|
|
276
422
|
"rad_s_to_rpm",
|
|
277
423
|
"randles_sevcik",
|
|
278
424
|
"randles_sevcik_irreversible",
|
|
279
425
|
"randles_sevcik_quasi",
|
|
426
|
+
"reactions",
|
|
280
427
|
"register_geometry",
|
|
428
|
+
"resolve_plot_kind",
|
|
281
429
|
"ring_collection_current",
|
|
282
430
|
"ring_limiting_current",
|
|
283
431
|
"rotating_ring_disk",
|
|
@@ -298,6 +446,9 @@ __all__ = [
|
|
|
298
446
|
"secm_limiting_current_infinite",
|
|
299
447
|
"secm_tip_current",
|
|
300
448
|
"shielding_factor",
|
|
449
|
+
"simulate",
|
|
450
|
+
"simulate_rde_sweep",
|
|
451
|
+
"simulate_sweep",
|
|
301
452
|
"solver",
|
|
302
453
|
"step_concentration_profile",
|
|
303
454
|
"step_flux_profile",
|
|
@@ -305,6 +456,7 @@ __all__ = [
|
|
|
305
456
|
"tafel_analysis",
|
|
306
457
|
"tafel_overpotential",
|
|
307
458
|
"tafel_slope",
|
|
459
|
+
"techniques",
|
|
308
460
|
"verify_spatial_convergence",
|
|
309
461
|
"verify_temporal_convergence",
|
|
310
462
|
]
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Chemical species and electrochemical reaction kinetics for Soft Potato.
|
|
2
|
+
|
|
3
|
+
This subpackage provides modular abstractions for chemical species metadata,
|
|
4
|
+
homogeneous (solution-phase) reaction kinetics with automated analytical
|
|
5
|
+
Jacobians, and heterogeneous charge-transfer kinetics.
|
|
6
|
+
|
|
7
|
+
Examples
|
|
8
|
+
--------
|
|
9
|
+
>>> from softpotato.reactions import ButlerVolmer, Species, SpeciesCollection
|
|
10
|
+
>>> ox = Species("Ox", diffusivity=1e-9, bulk_concentration=1.0, n_electrons=1)
|
|
11
|
+
>>> red = Species("Red", diffusivity=1e-9, bulk_concentration=0.0, n_electrons=-1)
|
|
12
|
+
>>> species = SpeciesCollection([ox, red])
|
|
13
|
+
>>> species.diffusivities
|
|
14
|
+
{'Ox': 1e-09, 'Red': 1e-09}
|
|
15
|
+
>>> bv = ButlerVolmer(k0=1e-4, alpha=0.5, E0=0.0, n=1)
|
|
16
|
+
>>> bv.rate_constants(0.0)
|
|
17
|
+
(0.0001, 0.0001)
|
|
18
|
+
|
|
19
|
+
Homogeneous reactions are combined in a :class:`ReactionNetwork`, which can be
|
|
20
|
+
passed directly to ``DiffusionProblem(..., reactions=network)``:
|
|
21
|
+
|
|
22
|
+
>>> from softpotato.reactions import FirstOrderReaction, ReactionNetwork
|
|
23
|
+
>>> network = ReactionNetwork([FirstOrderReaction(red, "P", k=1.0)])
|
|
24
|
+
>>> network.species
|
|
25
|
+
['Red', 'P']
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
from .heterogeneous import (
|
|
29
|
+
ButlerVolmer,
|
|
30
|
+
HeterogeneousKinetics,
|
|
31
|
+
NernstianEquilibrium,
|
|
32
|
+
Tafel,
|
|
33
|
+
TafelKinetics,
|
|
34
|
+
create_electrochemical_bcs,
|
|
35
|
+
)
|
|
36
|
+
from .homogeneous import (
|
|
37
|
+
CatalyticReaction,
|
|
38
|
+
CustomReaction,
|
|
39
|
+
DimerizationReaction,
|
|
40
|
+
DisproportionationReaction,
|
|
41
|
+
FirstOrderReaction,
|
|
42
|
+
HomogeneousReaction,
|
|
43
|
+
MassActionReaction,
|
|
44
|
+
ReactionNetwork,
|
|
45
|
+
ReversibleReaction,
|
|
46
|
+
SecondOrderReaction,
|
|
47
|
+
)
|
|
48
|
+
from .mechanisms import (
|
|
49
|
+
CustomMechanism,
|
|
50
|
+
ElectrochemicalStep,
|
|
51
|
+
Mechanism,
|
|
52
|
+
)
|
|
53
|
+
from .species import Species, SpeciesCollection
|
|
54
|
+
|
|
55
|
+
__all__ = [
|
|
56
|
+
"ButlerVolmer",
|
|
57
|
+
"CatalyticReaction",
|
|
58
|
+
"CustomMechanism",
|
|
59
|
+
"CustomReaction",
|
|
60
|
+
"DimerizationReaction",
|
|
61
|
+
"DisproportionationReaction",
|
|
62
|
+
"ElectrochemicalStep",
|
|
63
|
+
"FirstOrderReaction",
|
|
64
|
+
"HeterogeneousKinetics",
|
|
65
|
+
"HomogeneousReaction",
|
|
66
|
+
"MassActionReaction",
|
|
67
|
+
"Mechanism",
|
|
68
|
+
"NernstianEquilibrium",
|
|
69
|
+
"ReactionNetwork",
|
|
70
|
+
"ReversibleReaction",
|
|
71
|
+
"SecondOrderReaction",
|
|
72
|
+
"Species",
|
|
73
|
+
"SpeciesCollection",
|
|
74
|
+
"Tafel",
|
|
75
|
+
"TafelKinetics",
|
|
76
|
+
"create_electrochemical_bcs",
|
|
77
|
+
]
|