pycex is a small electrochemistry package for Tafel and Butler-Volmer analysis from measurement data.
For now installation has to be done manually by the user but publishing of the library is planned as soon as its finished.
pycex expects the user to import files and prepare arrays externally. It does not include a dedicated IO layer.
pycex treats overpotential as:
eta = E - E_eq
You can construct ElectrochemData in either of these two ways:
ElectrochemData(eta=eta, current_density_A_cm2=j)or
ElectrochemData(
potential_V=E,
equilibrium_potential_V=E_eq,
current_density_A_cm2=j,
)import numpy as np
from pycex import ButlerVolmerFit, ElectrochemData, TafelFit
E = np.linspace(-0.12, 0.12, 121)
E_eq = 0.0
j = 1e-6 * (
np.exp(0.5 * 96485.33212 / (8.31446261815324 * 298.15) * (E - E_eq))
- np.exp(-0.5 * 96485.33212 / (8.31446261815324 * 298.15) * (E - E_eq))
)
data = ElectrochemData(
potential_V=E,
equilibrium_potential_V=E_eq,
current_density_A_cm2=j,
)
tafel = TafelFit(data, eta_min_abs=0.03, eta_max_abs=0.12).analyze().summary
bv = ButlerVolmerFit(data, eta_min_abs=0.0, eta_max_abs=0.12).analyze().resultetais overpotential in voltsjis current density in A cm^-2- The conventional sign convention is assumed: anodic current positive and cathodic current negative
- If needed, iR correction should be handled before constructing
ElectrochemData