Skip to content

Soft Potato

An open-source electrochemical simulation and analysis toolkit in Python — plus practical tutorials on scientific computing, Python, and Linux.

Chip — Soft Potato Mascot
  • Analytical Electrochemistry Analytical Electrochemistry


    Closed-form and asymptotic equations for transient potential/current steps (Cottrell, Anson, Sand), hydrodynamics (Levich, Koutecký–Levich, RRDE), interfacial kinetics (Nernst, Butler–Volmer, Tafel), voltammetry, ultramicroelectrodes, and SECM.

    Analytical Module

  • Numerical PDE Solvers Numerical PDE Solvers


    1D multi-species reaction-diffusion solvers including stiff Method of Lines ODE integration (scipy_ivp Radau/BDF), Crank–Nicolson, and implicit/explicit finite-difference engines.

    Solver Module

  • Parameter Fitting & Benchmarking 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.

    Fitting & Benchmarks

  • Tutorials Tutorials: Electrochemistry, Python & Linux


    Interactive Jupyter notebooks for electrochemical simulations alongside practical tutorials on basic programming in Python and working effectively in Linux.

    Browse Tutorials


Installation

Install the latest stable release of Soft Potato from PyPI using pip:

pip install softpotato

For more details, including instructions on how to install from GitHub (bleeding-edge or from source), visit the full installation page.


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}\)!).

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.