Soft Potato
An open-source electrochemical simulation and analysis toolkit in Python.
-
Analytical Electrochemistry
A library of commonly used electrochemical equations such as Cottrell, Nernst, Levich, Randles-Sevick, Butler-Volmer, SECM, etc.
-
Numerical PDE Solvers
1D multi-species reaction-diffusion solvers including stiff Method of Lines ODE integration (
scipy_ivpRadau/BDF), Crank–Nicolson, and implicit/explicit finite-difference engines. -
Parameter Fitting & Benchmarking
Extract diffusion coefficients (\(D\)), rate constants (\(k^0\)), transfer coefficients (\(\alpha\)), and SECM parameters (\(R_g\), \(d_{\text{offset}}\)) with full confidence intervals, or validate numerical solvers against exact analytical solutions.
-
Tutorials: Electrochemistry, Python & Linux
Interactive Jupyter notebooks for electrochemical simulations alongside practical tutorials on basic programming in Python.
Installation¶
Install the latest stable release of Soft Potato from PyPI using pip:
Don't have Python? See Installing Python.
Quick Example¶
Simulate or evaluate analytical electrochemistry in just a few lines of Python:
import numpy as np
import softpotato as sp
# 1. Analytical Cottrell current transient at a planar electrode
t = np.linspace(0.01, 10.0, 200)
current = sp.analytical.cottrell(
t=t,
n=1,
D=1e-9, # m^2 / s
c_bulk=1.0, # mol / m^3 (1 mM)
A=1e-4, # m^2 (1 cm^2)
)
# 2. Fit experimental chronoamperometric data to recover diffusivity D
fit = sp.analytical.fit_cottrell(t=t, current=current, n=1, A=1e-4, c_bulk=1.0)
print(f"Extracted D = {fit.D:.3e} m^2/s (R^2 = {fit.r_squared:.5f})")
Chip's Tip: Always Use SI Units!
Soft Potato functions use SI base units throughout: lengths in meters (\(\text{m}\)), areas in \(\text{m}^2\), diffusion coefficients in \(\text{m}^2\cdot\text{s}^{-1}\), and concentrations in \(\text{mol}\cdot\text{m}^{-3}\) (conveniently, \(1\text{ mM} = 1\text{ mol}\cdot\text{m}^{-3}\)!).
Citation¶
If you use Soft Potato in your research or project, please cite the ChemRxiv preprint:
Rodríguez, O. (2022). Soft Potato: an open source electrochemical simulator and toolkit. ChemRxiv. doi:10.26434/chemrxiv-2022-4bs3w
Support Soft Potato
If you find Soft Potato useful in your research or teaching, consider supporting its ongoing open-source development:
or on Buy Me a Coffee.