Pyeis: A Python-Based Electrochemical Impedance Spectroscopy Analyzer and Simulator
Authors: Knudsen Kristian B. 
Published: February 2020

Electrochemical Impedance Spectroscopy can be a powerful analytical tool for the electrochemist as it can have the ability of separating kinetics, double-layers, adsorption, and mass-transport from a current/voltage response. This can often be a difficult task as the response depends on a large parameter space, such as: electrode configuration, porosity, pore size morphology, reference electrode, distance between working- and reference electrode, interfacial layers that depends on, among other, electrolyte composition, current collectors, potential, temperature, etc. Electrochemical processes can be described through circuit elements and a combination of these are referred to as equivalent circuit elements that model the cell or interface in question. Classically, kinetic contributions are referred to as charge-transfer resistances, double-layer as capacitors and their derivatives, and mass-transport have a wide range of terms.
PyEIS is an open-source platform that is able to simulate, evaluate data quality, fit, and plot electrochemical impedance spectroscopy data. It is built in a modular layout to facilitate add-ons, modifications, and it is therefore possible with relative ease to add any desired equivalent circuit. It is based on an open-source packages4–6 and is written in Python, a modern high-level computing language commonly used by the scientific community. PyEIS will be available as a Python package and currently includes 27 equivalent circuits where some represent simple non-faradaic and faradaic systems, the impedance of macro disk- and microdisk electrodes with well-defined mass-transport regimes, as well as non-faradaic and faradaic porous electrodes with and without solid-state diffusion.
PyEIS has the ability to simulate any equivalent circuit including the dependency on potential of the i) the charge-transfer resistance following Butler-Volmer or Marcus-Hush-Chidsey infinite or finite kinetic theories, ii) the mass-transport elements of the macro- and microdisk electrodes, and iii) the double-layer capacitance following the theories of Gouy-Chapman or Stern. This makes it possible to predict the impedance of any equivalent circuit following the potential dependency of the above-mentioned theories allowing the user to simulate and adjust experimental parameters to optimize experimental conditions.
PyEIS also contains algorithms for the linear Kramers-Kronig validity analysis that investigate the experimental data quality for causality, linearity, stability, and finite. The algorithm uses a weighed complex non-linear least-squares fitting procedure with RC-elements following the work of Boukamp1, where resistances are fitted to experimental data with log spaced time constants. The relative residuals are illustrated as a function of the measured frequency and PyEIS contains an automatic optimization algorithm that ensures a correct number of -(RC)- elements are utilized such that data is neither over- or under-fitted2.
PyEIS is able to fit experimental data through the weighed complex non-linear least squares fitting procedure using scipy’s lmfit package3 where the following statistical weighing options are available: unit, modulus, and proportional. The software is capable of batch fitting any number of spectra without any additional key strokes and the output is automatically plotted with a number of plotting options available. In additional, the parameters of the equivalent circuit model are saved and are easily accessed for post analysis.

References

B. A. Boukamp, J. Electrochem. Soc., 142, 1885–1894.

M. Schönleber, D. Klotz, and E. Ivers-Tiffée, Electrochimica Acta, 131, 20–27 (2014).

J. O. Oliphant, P. Peterson, and et al., 2001 http://www.scipy.org/.

S. van der Walt, S. C. Colbert, and G. Varoquaux, Computing in Science & Engineering, 13, 22–30 (2011).

F. Johansson, www.mpmath.org.

J. D. Hunter, Computing in Science & Engineering, 9, 90–95 (2007).