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

Generate ECM from a given initial circuit guess? #3

Closed RunzeZhang123 closed 1 year ago

RunzeZhang123 commented 2 years ago

Hi, Thank you for making this wonderful package, it really helped me a lot with EIS analysis.

I noticed that this package allows us to start autonomous ECM generation from a given circuit library file. I'm curious about if there's any possibility that we can assign one or two plausible circuits as the initial guess, and let the program generate ECM based on these circuits so that the final solutions will be close to the initial guess but have some variance. For example, adding a new input parameter into the function circuit_evolution. (circuit_evolution(... , ... , ... , initial_population = 'R1-[C2,L3]')

I was wondering if you'd like to consider adding that to the program. That could be very helpful! If so, I would be very grateful for that.

StefanPofahl commented 1 year ago

As far as I understand, this is possible, the function name is: loadpopulation(), see in: README.md

RunzeZhang123 commented 1 year ago

As far as I understand, this is possible, the function name is: loadpopulation(), see in: README.md

Thank you for your reply. I did notice that the loadpopulation() allows us to start from a bunch of given circuits by providing a csv file path. I think it would be great if we can do the same by only simply typing the string of a circuit or a list of circuits instead of creating a csv file. I think it would be more flexible and helpful to customize circuits. I would really appreciate it if you'd like to consider that.

(Example: By calling circuitevolution(measurements, frequencies... initial_population = 'R1-[C2,L3]'), the program can autonomously initialize some circuits that have similar compositions with the given circuit and find the plausible circuit through evolution. )

Thanks!

StefanPofahl commented 1 year ago

Hi Runze,

I agree, these lines in the CSV are not easy to read, without a proper documentation. Maybe, it would be nice to have two ways to restrict the set of possible equivalent circuits. I have the feeling, that this package is without active maintainer.

Let's hope that MaximeVH find some time to work on the next release.

Regards,

Stefan

MaximeVH commented 1 year ago

Dear Stefan and Runze,

Thank you for all your feedback and advice on how to improve the package.

Providing a custom library of initial circuit configurations might require users to use the specific encoding of the circuits used by the evolutionary algorithm. I can implement and document this (unless I think of a better way that doesn't require the specific encoding).

I'm afraid I'm currently occupied with some pressing deadlines, but I plan to address all raised issues and pull requests in December.

Kind regards, Maxime

StefanPofahl commented 1 year ago

Hi Maxime,

that is good news! - Thanks a lot for your great project!

Regards,

Stefan

RunzeZhang123 commented 1 year ago

Hi Maxime,

Wow, that's really good news. Really appreciate your help. This project is really awesome and extremely helpful for EIS analysis!

Best regards, Runze

StefanPofahl commented 1 year ago

I plan to address all raised issues and pull requests in December

Hi Maxime,

I wish you a happy new year!

Could you be so kind and give us an update about your progress?

Regards,

Stefan

MaximeVH commented 1 year ago

Hi Stefan,

happy new year to you as well!

Apologies for the delay. The updates are almost ready and will be added here shortly, along with the new release.

Kind regards,

Maxime

StefanPofahl commented 1 year ago

Hi Maxime,

this is really good news! I am looking foreward to your new version :-)

Regards,

Stefan

MaximeVH commented 1 year ago

I have adjusted the circuit_evolution function such that it accommodates a custom circuit input. When the input to the initial_population argument of the circuit_evolution function is a list containing one or more strings (the custom circuits), these strings will first be converted to the encoding used by the algorithm, after which the initial circuit population is generated by creating variants and copies of the provided circuits until the population size is reached. You can also provide the custom circuits' initial parameters. In this case, the initial_population argument should be a list of tuples with the circuit string as the first value and the corresponding parameters as the second value.

Regards,

Maxime