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

Bug in Circuit Library Generation #27

Closed benjamin5988 closed 11 months ago

benjamin5988 commented 1 year ago

Hi Maxime -

great package. I am having trouble generating my own circuit library -

It seems that there is a big in the circuit_to_karva() function and its related functions - some issue with floats, mins, etc. I am not familiar enough with julia to be able to figure it out.

I have tried to reproduce it here:

https://gist.github.com/benjamin5988/d0b6b24bdf4fb6ecade1e014938b7d9c

Does it work for you?

Best, Ben

benjamin5988 commented 12 months ago

Hi I am following up - do you have any feedback?

MaximeVH commented 11 months ago

Hi Ben,

There appears to be an issue with your input. For this function to work properly, the parameters corresponding to CPEs should be placed within square brackets. Also, there are too many square brackets in your circuit notation (a correct circuit notation has as many sets of square brackets as commas).

circuit_init="R1-[P2-[P3,R4],C5]" initial_guess= [249.3712, [8.9111e-09, 0.9175], [2.2931e-10, 0.9552], 78528.9522, 8.3193e-15]

That being said, I did notice these old functions needed a syntax update, which I have now implemented. The add_to_circuitlibrary function should work properly now, given that you already have a circuit library initiated and use the above inputs.

benjamin5988 commented 11 months ago

I pulled the latest version from github, but i'm still getting "no method matching min()" error as shown in the gist I sent.

Do you have any other suggestions?

benjamin5988 commented 11 months ago

i have confirmed that, to the best of my knowledge and someone more knowledgeable than me, that i reinstalled the package and the dependencies properly.

MaximeVH commented 11 months ago

Did you use the exact inputs that I provided in my previous comment? I can't reproduce any errors with those inputs.

MaximeVH commented 11 months ago

i have confirmed that, to the best of my knowledge and someone more knowledgeable than me, that i reinstalled the package and the dependencies properly.

The updates have been included in the GitHub, but not yet in the package registry, I'll have to register a new package version before you'll be able to use them directly through a reinstallation with the package manager.

benjamin5988 commented 11 months ago

thank you - i will keep trying and see if i can get it to work.

benjamin5988 commented 11 months ago

I got it to work. I think the problem was that my circuit elements were not uniquely numbered. You renumbered them properly, but I did not realize this was important.

Thanks for your help and attention.

BK