Jochen Kieninger
Electrochemical Methods for the Micro- and Nanoscale
www.electrochemical-methods.org

Task 7.2 (Electrochemical impedance spectroscopy - Randles circuit)¶

In [1]:
from sympy import re, im, I, simplify, symbols, sqrt, atan
In [2]:
Ru, Rct, Cdl, omega = symbols('R_u R_ct C_dl, omega', real=True)

The complex impedance of a Randles circuit with uncompensated resistance $R_u$ in series with a parallel circuit of the charge transfer resistance $R_ct$ and the double layer capacity $C_{dl}$ is:

In [3]:
Z = Ru+1/(I*omega*Cdl + 1/Rct)
Z
Out[3]:
$\displaystyle R_{u} + \frac{1}{i C_{dl} \omega + \frac{1}{R_{ct}}}$

Because of the uncompensated resistance, the equations are not as handsome as one would wish,

  • Real part:
In [4]:
simplify(re(Z))
Out[4]:
$\displaystyle \frac{R_{ct} + R_{u} \left(C_{dl}^{2} R_{ct}^{2} \omega^{2} + 1\right)}{C_{dl}^{2} R_{ct}^{2} \omega^{2} + 1}$
  • Imaginary part:
In [5]:
simplify(im(Z))
Out[5]:
$\displaystyle - \frac{C_{dl} R_{ct}^{2} \omega}{C_{dl}^{2} R_{ct}^{2} \omega^{2} + 1}$
  • Absolute value:
In [6]:
simplify(sqrt(re(Z)**2 + im(Z)**2))
Out[6]:
$\displaystyle \frac{\sqrt{C_{dl}^{2} R_{ct}^{4} \omega^{2} + \left(R_{ct} + R_{u} \left(C_{dl}^{2} R_{ct}^{2} \omega^{2} + 1\right)\right)^{2}}}{C_{dl}^{2} R_{ct}^{2} \omega^{2} + 1}$
  • Phase:
In [7]:
simplify(atan(im(Z)/re(Z)))
Out[7]:
$\displaystyle - \operatorname{atan}{\left(\frac{C_{dl} R_{ct}^{2} \omega}{R_{ct} + R_{u} \left(C_{dl}^{2} R_{ct}^{2} \omega^{2} + 1\right)} \right)}$