Comments (9)
Thanks for pointing me to those packages @richinex. I will definitely give them a go. I feel like this will end up with me integrating all four.
from equivalentcircuits.jl.
It took a while to figure out, how to simulate the impedance, based on the equivalent circuit model and it its parameters.
To help others here are the necessary code lines:
circuit_model = "R1-[C2,R3-[C4,R5]]"
circuit_params = parameteroptimisation(circuit_model, file_name_impedance_measurement)
circfunc = EquivalentCircuits.circuitfunction(circuit_model)
impedance_simulated = EquivalentCircuits.simulateimpedance_noiseless(circfunc, circuit_params, frequency_values)
from equivalentcircuits.jl.
Thank you for your feedback. An advantage of the optimization methods used in this module is that they should work regardless of initial guesses. I could include an optional argument to allow users to provide initial component parameter guesses. There are also some opportunities to leverage Julia's speed advantage for this package, which I'm considering to implement at a later stage.
from equivalentcircuits.jl.
Thanks for the reply! I will be familiarizing myself with the code and see if I can spot some performance traps :)
I think an optional argument for initial guess would be a great addition.
from equivalentcircuits.jl.
Definitely the parameter estimation that takes time. BlackBoxOptim.jl dominating the execution time.
I tried it with adding an optional initial guess x0
. Just modifying the last unit test to take on two different guesses. The last one is the output from the parameter optimization without passing the optional argument.
It does not improve by orders of magnitude, but comes a little bit closer to Impedance.py.
Reducing MaxSteps from 170000 to 70000 linearly decreases execution time, without loss in accuracy for the example data in runtests.jl
.
So I guess this optimization method does not tremendously benefit from the initial guess. I also tried modifying the SearchRange algorithm, but it did not change anything :)
I am curious as to what speed optimizations you were considering?
from equivalentcircuits.jl.
It is interesting to stumble across this great package. I am definitely gonna try library out since I have just started working with Julia . Meanwhile @sindresops I have built two python packages for multidimensional fitting of impedance spectra (pymultieis and pymultipleis - written in PyTorch and Jax respectively). You might wanna try it out. I also described in the examples how to use it to fit a single spectra.
I had to convert some of my codebase into Julia and noticed some of the concerns you raised. My take is that the optimization libraries in Julia are maybe not as optimized as they should be. I raised this same issue in Julia discourse and worked with some people to optimize my objective function as best as possible. Yet my python code still seems a little faster especially the one written in JAX (we could say that the python is just a wrapper anyway)
Concerning why impedancepy sometimes fail to fit when the initial values are far from optimal, i guess its because Levenberg Macquardt algorithm is sensitive to initial values. Also impedancepy uses scipy curve fit which employs numerical finite differencies. I implemented autodifferentiation and can see that my algorithm fits where impedancepy fails even when you use same initial values for both.
from equivalentcircuits.jl.
Thank you for your feedback. An advantage of the optimization methods used in this module is that they should work regardless of initial guesses. I could include an optional argument to allow users to provide initial component parameter guesses. There are also some opportunities to leverage Julia's speed advantage for this package, which I'm considering to implement at a later stage.
PR generated: #13
It seems to be quite a lot faster if you do a perfect guess (10X). I am sure that might come in handy
from equivalentcircuits.jl.
[...] There are also some opportunities to leverage Julia's speed advantage for this package, which I'm considering to implement at a later stage.
You mention speed advantages. If you were to point me in a direction, where would you be looking to optimize first?
from equivalentcircuits.jl.
The package's circuit_evolution()
function uses some string processing (the manipulation and generation of strings), which has been reported as not being a strength of Julia. Suitable alternatives or improvements to this string processing could increase speed, though maybe not by a lot, as the optimization algorithms are the rate-limiting step.
As for the parameter optimization, a new option has been added in this repo (not registered yet) where you can input other optimization algorithms from the BlaxBoxOptim package. You could experiment with different optimization algorithms for the circuits you're fitting and see which trade-off between speed and performance is most suitable.
from equivalentcircuits.jl.
Related Issues (20)
- Algorithm fails to find optimal parameters for a given equivalent circuit model HOT 4
- Use Optimization.OptimizationProblem() to find optimal fit of parameters HOT 2
- Compiled App including EquivalentCircuits craches on other computers HOT 4
- Add support for Warburg element in circuit_evolution() HOT 4
- Proposal: Optional input parameter Low-Frequency resistance HOT 3
- Just a question ... HOT 1
- The output parameters are too small and add user customized threshold? HOT 3
- Example circuit is not visible when using dark mode HOT 1
- Non-deterministic behavior HOT 1
- Bug in Circuit Library Generation HOT 8
- Use logging instead of `println` HOT 3
- Hardcoded literal "3" in `circuit_evolution`'s `removeredundancy` HOT 2
- Add `maxiter` to avoid infinite jobs when `convergence_threshold` can't be met
- Paper citation HOT 1
- How do I add a custom circuit with a CPE element to circuit_evolution() method? HOT 2
- Inconsistent boundary setting within the evolution process and out of the evolution process HOT 1
- Extract the estimated circuit parameters directly from the evolution elite HOT 2
- Implement O(Z)-independent `convergence_threshold` HOT 1
- Add `verbose` argument to show progress during circuit evolution HOT 1
- Profile for memory allocation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from equivalentcircuits.jl.