impedance.py icon indicating copy to clipboard operation
impedance.py copied to clipboard

Using bounds

Open fatmaoza opened this issue 3 years ago • 1 comments

Hi,

currently I'm trying to figure out, how I can define bounds when fitting my model to a circuit. I tried e.g. the following:

circuit.fit(frequencies, Z, bounds=[(0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5),(1,1,1,1,1,1,1,1,1)])

However, I always get error messages. Is there a possibility to upload an example in the documentation?

fatmaoza avatar Jan 15 '22 01:01 fatmaoza

Hi @fatmaoza. bounds takes a tuple, not a list. Try replacing your [ ] with ( ), like this:

circuit.fit(frequencies, Z, bounds=((0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5),(1,1,1,1,1,1,1,1,1)))

FTHuld avatar Jan 25 '22 14:01 FTHuld

Thanks for the answer @FTHuld! Hopefully, that solves your issue @fatmaoza, but feel free to re-open or create a new issue if you still have any questions

mdmurbach avatar Sep 18 '22 19:09 mdmurbach