MaximeVH / EquivalentCircuits.jl

A julia package to either fit the parameters of a specified equivalent electrical circuit to electrochemical impedance data, or to suggest a plausible circuit configuration for a given set of measurements (either through a comparison of circuits from the literature, or through an evolutionary algorithm approach).
MIT License
24 stars 6 forks source link

CPE / 'P' is different from definition inside "impedance.py" #16

Closed StefanPofahl closed 1 year ago

StefanPofahl commented 1 year ago

Could it be, that the definitions for CPE/'P' are not correct? see here: CPE

MaximeVH commented 1 year ago

Unfortunately, there is a lack of standard definitions of Warburg and CPE elements in the literature. There are two different definitions for CPEs in common use, the one derived by Boukamp and the one in Barsoukov and Mcdonald's popular textbook.

For previous work reviewing and comparing equivalent circuits, I have implemented all definitions. They have the same modeling capacity, but if you want to conveniently compare specific parameters to those using a particular definition, I can provide an option for that. I appreciate all your feedback and will be looking into all your suggestions and questions in December.

StefanPofahl commented 1 year ago

Here is my proposal for the part in: function circuitfunction(Circuit) original:

replace(Circuit,match=>"T*(2*π*f)^(-N)"*"*(cos((π*N)*0.5)-sin((π*T)*0.5)im)")

new:

replace(Circuit,match=>"(1/(T*(2im*π*f)^N))")
StefanPofahl commented 1 year ago

unfortunately, there is a deviation between impedance.py and EquivalentSircuits.jl for more complicated EC. For a simple one like "[C1,P2]" there is a perfect match, but for more complicated one like: "[C1-P2,[R3,C4-L5-P6]]", there is a difference in the simulation. Please have a look on my script to compare both packages: debug_EquivalentCircuit_Impedance_Simulation.jl

StefanPofahl commented 1 year ago

I have set up a simple script for the simulation of the equivalent circuit: "[C1-P2,R3]" The results of three different ways are compared: example_simple_EquivCirc_including_constant_phase.jl

StefanPofahl commented 1 year ago

Here is a link regarding the two different approaches: http://www.consultrsr.net/resources/eis/zarc.htm