Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circuit Element Unit scalable feature #288

Open
AvMedic opened this issue Feb 2, 2024 · 1 comment
Open

Circuit Element Unit scalable feature #288

AvMedic opened this issue Feb 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@AvMedic
Copy link

AvMedic commented Feb 2, 2024

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.

@AvMedic AvMedic added the enhancement New feature or request label Feb 2, 2024
@adrianusler
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants