Skip to content

ericfell/CVsim

Repository files navigation

Documentation Status codecov Checked with mypy linting: pylint pypi

CVsim

cvsim is a Python package for cyclic voltammogram (CV) simulation via a semi-analytical method developed by Oldham and Myland1. It is valid for CV experiments performed on disk macroelectrodes, and uses a semi-integration algorithm. In the limit of infinitely small potential steps, this algorithm is an exact solution. Due to the precision of standard potentiostats, simulations that use a potential step of 1-5 mV typically provide a reasonable accuracy-computing time trade-off, where accuracy sanity checks (e.g. Randles-Sevcik relationship for Er and Eq mechanisms) have been performed.

Currently available mechanisms:

  • One-electron process: Er , Eq , and EqC
  • Two-electron process: EqEq and Square scheme

Installation

cvsim can be installed from PyPI using pip:

pip install cvsim

See Getting started with cvsim.py for instructions on simulating CVs.

Dependencies

cvsim requires:

  • Python (>=3.10)
  • SciPy

Package Structure

  • mechanisms.py: Specifies one-/two-electron process mechanisms to be simulated.
  • fit_curve.py: Performs fitting of experimental CV data according to a desired mechanism.

Example

To simulate a reversible (Nernstian) CV:

from cvsim.mechanisms import E_rev

potential, current = E_rev(
    start_potential=0.3,       # V vs. reference
    switch_potential=-0.5,     # V vs. reference
    reduction_potential=-0.1,  # V vs. reference
    scan_rate=0.1,             # V/s
    c_bulk=1.0,                # mM (mol/m^3)
    diffusion_reactant=1e-6,   # cm^2/s
    diffusion_product=2e-6,    # cm^2/s
).simulate()

Input Parameters

  • Estart/Eswitch/Eo' = V vs ref.
  • Scanrate = V/s
  • Active species concentration = mM (mol/m3)
  • Diffusion coefficients = cm2/s

Optional Parameters

  • Potential step size = mV
  • Disk radius = mm
  • Temperature = K

and if needed

  • Standard rate constant, ko = cm/s
  • 1st order chemical rate constants (kforward, kbackward) = s-1

[1] Oldham, K. B.; Myland, J. C. Modelling cyclic voltammetry without digital simulation, Electrochimica Acta, 56, 2011, 10612-10625.

*The schemes for CEr , catalytic C'Eq , and ErCEr need development, PRs welcome!

License

MIT

About

A Python package for simulating cyclic voltammograms semi-analytically

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages