Closed Matheus-gif closed 3 months ago
My bad,
I wasn't setting the initial params correctly, but it seems I'm still not able to set a CPE element in my initial_population argument
guess = Vector{Tuple{String, Vector{Float64}}}([
("R1-[P2,R3-[C4,R5]]", [10., [1e-6, 0.9], 10., 1e-6, 10.]),
])
#circuit_library = loadpopulation("Circuitlibrary.csv")
@time circuit_evolution(
measurements, frequencies,
initial_population = guess,
generations = 20,
population_size = 10,
terminals = "RC",
convergence_threshold=5e-4,
)
MethodError: Cannot convert
an object of type Vector{Float64} to an object of type Float64
The issue is that the circuit needs to be encoded properly in order to include a custom library. A library should also include more than one circuit. A possible way to implement what you're requesting is as follows (make sure there is not already a file called ""CircuitLibrary.csv" in your current directory):
using EquivalentCiruciuts
EquivalentCircuits.initialize_circuitlibrary("R1-[P2,R3-[C4,R5]]",[10., [1e-6, 0.9], 10., 1e-6, 10.])
EquivalentCircuits.add_to_circuitlibrary("R1-[P2,R3-[C4,R5]]",[10., [1e-6, 0.9], 10., 1e-6, 10.])
guess = loadpopulation("CircuitLibrary.csv")
@time circuit_evolution(
measurements, frequencies,
initial_population = guess,
generations = 20,
population_size = 10,
terminals = "RC",
convergence_threshold=5e-4,
)
Greetings everyone,
I understand we can use the file Circuitlibrary.csv as an argument for the circuit_evolution() function. Instead, I'm now trying to use a custom circuit to generate the upcoming circuit tree. Here's my attempt:
The error is: BoundsError: attempt to access 5-element Vector{Float64} at index [6]
How do I proceed? Thank you everyone in advance.
Environment: Julia version: v1.9.2
Steps to Reproduce:
Define the initial population as shown above. Execute the circuit_evolution() function with the specified parameters.