You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found that the circuit.fit() will call scipy.opitimize for fitting purpose and the step size is 1e-10 limited by default.
Since impedance.py uses F and H as unit, a high frequency range problem will easily go to pF and nH level, and the step size will be a problem for fitting.
[Example]My example is a RLC circuit resonant point at around 8MHz. circuit = 'p(R1-C1-L1,C0)' initial_guess = [4.56, 80e-12, 4.83e-6, 780e-12]
I actually built an accurate csv data file based on initial_guess for a try and ensured this issue. The solver will revise 80pF capacitor to 1e-10F and fit a bad curve.
[Fitting Options] I tried to revise fitting options, however I see that some methods don't support adjusting step size, some support but don't support complex number, and some options don't work. (I'm no expert in fitting functions.)
[Workaround] I directly revised elements.py to pF and pH. And good fitting result shows.
[Potential Enhancement] Add unit options for varias usercase.
The text was updated successfully, but these errors were encountered:
I also had this problem and submitted an issue to the scipy repo: scipy/scipy#18793 (comment)
I think this problem with scipy has been solved by now, so upgrading scipy should fix that problem.
I found that the circuit.fit() will call scipy.opitimize for fitting purpose and the step size is 1e-10 limited by default.
Since impedance.py uses F and H as unit, a high frequency range problem will easily go to pF and nH level, and the step size will be a problem for fitting.
[Example]My example is a RLC circuit resonant point at around 8MHz.
circuit = 'p(R1-C1-L1,C0)' initial_guess = [4.56, 80e-12, 4.83e-6, 780e-12]
I actually built an accurate csv data file based on initial_guess for a try and ensured this issue. The solver will revise 80pF capacitor to 1e-10F and fit a bad curve.
[Fitting Options] I tried to revise fitting options, however I see that some methods don't support adjusting step size, some support but don't support complex number, and some options don't work. (I'm no expert in fitting functions.)
[Workaround] I directly revised elements.py to pF and pH. And good fitting result shows.
[Potential Enhancement] Add unit options for varias usercase.
The text was updated successfully, but these errors were encountered: