Recently, I made a python code to fit the impedance data of perovskite solar cell I have gathered with a certain model of equivalent circuit. I used Nelder-Mead optimization but I think I need some tweaking in order to reduce errors. Anybody has idea why some EIS data could fit into the chosen circuit or not?