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
22 stars 6 forks source link

Fail to find suitable parameters #7

Closed StefanPofahl closed 1 year ago

StefanPofahl commented 1 year ago

If I use your sample impedance data, one suitable equivalent circuit can be defined as:

circuit_model = "[C1,[C2-[R3,C4],R5]]"
circuit_param   = (C1 = 2.322248710116646e-9, C2 = 7.146778669252158e-7, R3 = 8015.389370331851, C4 = 1.6325663887245989e-9, R5 = 5918.9481528813185)

But I do not know what the trick is to find this good optimization result. The following fails regularly to optimize the parameters in an acceptable quality:

circuit_model = "[C1,[C2-[R3,C4],R5]]"
circuit_params_preset = EquivalentCircuits.parameteroptimisation(circuit_model, fn_data_full)

Do you have an advice?

MaximeVH commented 1 year ago

Hi Stefan,

In your other code example, I saw you used an older version of the package (I saw this from the use of the circuitevolution function rather than the newer circuit_evolution function in the newest versions). The parameter optimization method has also changed since then. I have tested several of Optim.jl and BlackBoxOptim.jl's methods before and found the current one to work best in general. Still, if necessary, I could include the option to use a custom optimization algorithm as input for those specific cases where the optimization may not converge every time.

Kind regards, Maxime

StefanPofahl commented 1 year ago

Hi Maxime,

that is good news, I will test your function again with the new version of your package.

Regards,

Stefan