Frequently Asked Questions

What method does use for fitting equivalent circuit models?

By default, fitting is performed by non-linear least squares regression of the circuit model to impedance data via curve_fit from the scipy.optimize package.[1] Real and imaginary components are fit simultaneously with uniform weighting, i.e. the objective function to minimize is,

\[\chi^2 = \sum_{n=0}^{N} [Z^\prime_{data}(\omega_n) - Z^\prime_{model}(\omega_n)]^2 + [Z^{\prime\prime}_{data}(\omega_n) - Z^{\prime\prime}_{model}(\omega_n)]^2\]

where N is the number of frequencies and \(Z^\prime\) and \(Z^{\prime\prime}\) are the real and imaginary components of the impedance, respectively. The default optimization method is the Levenberg-Marquardt algorithm (method='lm') for unconstrained problems and the Trust Region Reflective algorithm (method='trf') if bounds are provided. See the SciPy documentation for more details and options.

While the default method converges quickly and often yields acceptable fits, the results may be sensitive to the initial conditions. EIS fitting can be prone to this issue given the high dimensionality of typical equivalent circuit models. Global optimization algorithms attempt to search the entire parameter landscape to minimize the error. By setting global_opt=True in circuit_fit, will use the basinhopping global optimization algorithm (also from the scipy.optimize package[1]) instead of curve_fit. Note that the computational time may increase.

[1] Virtanen, P., Gommers, R., Oliphant, T.E. et al. SciPy 1.0: fundamental algorithms for scientific computing in Python. Nat Methods 17, 261–272 (2020). doi: 10.1038/s41592-019-0686-2

How do I cite

If you use in published work, please consider citing as

    doi = {10.21105/joss.02349},
    url = {},
    year = {2020},
    publisher = {The Open Journal},
    volume = {5},
    number = {52},
    pages = {2349},
    author = {Matthew D. Murbach and Brian Gerwe and Neal Dawson-Elli and Lok-kun Tsui},
    title = { A Python package for electrochemical impedance analysis},
    journal = {Journal of Open Source Software}

How can I contribute to

First off, thank you for your interest in contributing to the open-source electrochemical community! We’re excited to welcome all contributions including suggestions for new features, bug reports/fixes, examples/documentation, and additional impedance analysis functionality.

Feature requests and bug reports

If you want to make a suggestion for a new feature, please make an issue including as much detail as possible. If you’re requesting a new circuit element or data file type, there are special issue templates that you can select and use.

Contributing code

The prefered method for contributing code to is to fork the repository on GitHub and submit a “pull request” (PR). More detailed information on how to get started developing can be found in

Feel free to reach out via GitHub issues with any questions!