Studying the effect of pore size distribution on impedance spectroscopy


In [ ]:
%matplotlib inline
from pycap import PropertyTree, EnergyStorageDevice, Experiment
from pycap import NyquistPlot
from helpers import RefreshDisplay, PrintColumns

# build the energy storage device
ptree = PropertyTree()
ptree.parse_info('super_capacitor.info')
device = EnergyStorageDevice(ptree)

# set up the experiment
ptree = PropertyTree()
ptree.parse_info('impedance_spectroscopy.info')
eis = Experiment(ptree)

# attach observers
observers = [
    NyquistPlot(),
    RefreshDisplay(),
    PrintColumns(),
]
for o in observers:
    eis.attach(o)

# run the experiment
%time eis.run(device)

In [ ]:
# Save the impedance spectrum data into a file
from pickle import dump, load
with open('homogeneous_electrolyte_conductivity_5.5e3.dat', 'wb') as fout:
    dump(eis._data, fout)

In [ ]:
from pycap import plot_nyquist
from matplotlib import pyplot
fig = pyplot.figure(figsize=(14, 14))

plot_nyquist(load(open('inhomogeneous.dat', 'rb')), figure=fig, ls='b:')
plot_nyquist(load(open('inhomogeneous_electrolyte_conductivity.dat', 'rb')), figure=fig, ls='g--') # 1e3 to 1e4
plot_nyquist(load(open('homogeneous_electrolyte_conductivity_1e3.dat', 'rb')), figure=fig, ls='k:') # 1e3
plot_nyquist(load(open('homogeneous_electrolyte_conductivity_1e4.dat', 'rb')), figure=fig, ls='k--') # 1e4
plot_nyquist(load(open('homogeneous_electrolyte_conductivity_5.5e3.dat', 'rb')), figure=fig, ls='k-.') # 5.5e3

In [ ]: