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

circuitevolution(..., terminals="RCL") includes P but not L #14

Closed StefanPofahl closed 1 year ago

StefanPofahl commented 1 year ago

Function "circuitevolution()": Optional parameter terminals does not work properly, if I specify: terminals="RCL" also solutions with P-elements are found.

StefanPofahl commented 1 year ago

strange, today I cloned your repository by means of the Pkg-Command dev: pkg> dev EquivalentCircuits now I have two versions on my hard drive: old: C:\Users\[...]\.julia\packages\EquivalentCircuits\6sREk\src\OptimizeParameters.jl

function get_parameter_upper_bound(tree)
    ranges = Dict('R'=>1.0e9,'C'=>10,'L'=>5,'P'=>[1.0e9,1],'+'=>0,'-'=>0) #Dict('R'=>5000,'C'=>0.001,0.01'L'=>1,'P'=>[100,1],'+'=>0,'-'=>0) , Dict('R'=>1.0e9,'C'=>0.01,'L'=>5,'P'=>[1.0e9,1],'+'=>0,'-'=>0)
    return [ranges[node.Type] for node in tree]
end

new:

function get_parameter_upper_bound(tree)
    ranges = Dict('R'=>1.0e9,'C'=>10,'L'=>5,'P'=>[1.0e9,1],'W'=>1.0e9,'+'=>0,'-'=>0) 
    return [ranges[node.Type] for node in tree]
end
StefanPofahl commented 1 year ago

I do not know why, but I managed to install an old version of EquivalentCircuit.jl EquivalentCircuits_old_version

MaximeVH commented 1 year ago

Have you encountered this issue with the newest version of the package too? I've run the function several times on the example measurement data with different values for the terminals argument, and it seems to work fine so far.

StefanPofahl commented 1 year ago

I was not able to reproduce this strange situation.