Comments (12)
from impedance.py.
Yeah, that is the main problem. I will let you know here, If I get any solutions for this.
But totally thank you for replying me! If I find any solutions, I will post here
from impedance.py.
Although I will give it a try myself tomorrow, but for now I think you can try increasing the value of inductance in the initial guess.
from impedance.py.
Although I will give it a try myself tomorrow, but for now I think you can try increasing the value of inductance in the initial guess.
thank you for the suggestion. I have tried to increase the value of inductor, but still can not get the the fitting of positive Zimag. the csv i use is from the exampleData.csv.
from impedance.py.
Although I will give it a try myself tomorrow, but for now I think you can try increasing the value of inductance in the initial guess.
thank you for the suggestion. I have tried to increase the value of inductor, but still can not get the the fitting of positive Zimag. the csv i use is from the exampleData.csv.
Ok I will try fitting myself.(tommorow)
from impedance.py.
What I got in the first try:
from impedance.models.circuits import CustomCircuit
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
initial_guess=[0.01,0.01,100,0.01,0.05,100,1,1,0.1]
c=CustomCircuit("R0-p(R1,C1)-p(R2-Wo1,C2)-p(L1,R3)",initial_guess=initial_guess)
df=pd.read_csv("../exampleData.csv")
gthbdata=df.to_numpy()
datanew=np.transpose(gthbdata)
freq=datanew[0]
z_data=datanew[1]+1j*datanew[2]
plt.plot(np.real(z_data),-np.imag(z_data))
c.fit(frequencies=freq,impedance=z_data)
print(c)
z_fit=c.predict(frequencies=freq)
plt.plot(np.real(z_fit),-np.imag(z_fit))
plt.plot(np.real(z_data),-np.imag(z_data))
print(c.conf_)
from impedance.py.
What I got in the first try:
from impedance.models.circuits import CustomCircuit
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
initial_guess=[0.01,0.01,100,0.01,0.05,100,1,1,0.1]
c=CustomCircuit("R0-p(R1,C1)-p(R2-Wo1,C2)-p(L1,R3)",initial_guess=initial_guess)
df=pd.read_csv("../exampleData.csv")
gthbdata=df.to_numpy()
datanew=np.transpose(gthbdata)
freq=datanew[0]
z_data=datanew[1]+1j*datanew[2]
plt.plot(np.real(z_data),-np.imag(z_data))
c.fit(frequencies=freq,impedance=z_data)
print(c)
z_fit=c.predict(frequencies=freq)
plt.plot(np.real(z_fit),-np.imag(z_fit))
plt.plot(np.real(z_data),-np.imag(z_data))
![]()
thank you for your try, so as I see in the last picture, the fitting line also can not reach the positive Zimag?
from impedance.py.
What I got in the first try:
from impedance.models.circuits import CustomCircuit
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
initial_guess=[0.01,0.01,100,0.01,0.05,100,1,1,0.1]
c=CustomCircuit("R0-p(R1,C1)-p(R2-Wo1,C2)-p(L1,R3)",initial_guess=initial_guess)
df=pd.read_csv("../exampleData.csv")
gthbdata=df.to_numpy()
datanew=np.transpose(gthbdata)
freq=datanew[0]
z_data=datanew[1]+1j*datanew[2]
plt.plot(np.real(z_data),-np.imag(z_data))
c.fit(frequencies=freq,impedance=z_data)
print(c)
z_fit=c.predict(frequencies=freq)
plt.plot(np.real(z_fit),-np.imag(z_fit))
plt.plot(np.real(z_data),-np.imag(z_data))
![]()
thank you for your try, so as I see in the last picture, the fitting line also can not reach the positive Zimag?
Yes, same problem as yours happening.
But I made another mistake, the plots are not 1:1 in aspect ratio.
And also, seems like the fit you are getting and what I am getting are different, why so? what method are you using for fitting?
YOUR FIT:
MY FIT: (now its 1:1)
from impedance.py.
What I got in the first try:
from impedance.models.circuits import CustomCircuit
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
initial_guess=[0.01,0.01,100,0.01,0.05,100,1,1,0.1]
c=CustomCircuit("R0-p(R1,C1)-p(R2-Wo1,C2)-p(L1,R3)",initial_guess=initial_guess)
df=pd.read_csv("../exampleData.csv")
gthbdata=df.to_numpy()
datanew=np.transpose(gthbdata)
freq=datanew[0]
z_data=datanew[1]+1j*datanew[2]
plt.plot(np.real(z_data),-np.imag(z_data))
c.fit(frequencies=freq,impedance=z_data)
print(c)
z_fit=c.predict(frequencies=freq)
plt.plot(np.real(z_fit),-np.imag(z_fit))
plt.plot(np.real(z_data),-np.imag(z_data))
![]()
thank you for your try, so as I see in the last picture, the fitting line also can not reach the positive Zimag?
Yes, same problem as yours happening. But I made another mistake, the plots are not 1:1 in aspect ratio. And also, seems like the fit you are getting and what I am getting are different, why so? what method are you using for fitting? YOUR FIT:
MY FIT: (now its 1:1)
do you have the same initial guess of mine? Maybe i have add another (RC) component, because (RC) is responsible for semicircle part.
from impedance.py.
yes I put the exact same initial guess (and the same elements) as you showed in the code in your very first snapshot in the question.
YOUR SNAPSHOT of CODE:
Actually just now, what I found is if I take L=100 as the initial guess the I am getting a pretty good fit
MY FIT NOW:
In your snapshot it was L=1, with that I was getting not a good fit (as shown in my previous comments)
MY FIT BEFORE:
But still how you getting good fit with L=1 as initial guess?
YOUR FIT as shown in your first comment:
from impedance.py.
yes I put the exact same initial guess (and the same elements) as you showed in the code in your very first snapshot in the question. YOUR SNAPSHOT of CODE:
Actually just now, what I found is if I take L=100 as the initial guess the I am getting a pretty good fit MY FIT NOW:
In your snapshot it was L=1, with that I was getting not a good fit (as shown in my previous comments) MY FIT BEFORE:
But still how you getting good fit with L=1 as initial guess? YOUR FIT as shown in your first comment:
Maybe I have changed the value of L , but the problem still remains. The high frequency fitting can not be reached.
from impedance.py.
Yeah, that is the main problem. I will let you know here, If I get any solutions for this.
(And also, please don't quote the previous comments in the chat, every time you write a new comment, it makes the chat difficult to read sometimes)
from impedance.py.
Related Issues (20)
- [BUG] Matplotlib warnings when plotting Bode or Nyquist plot HOT 1
- Very confused about fitting HOT 3
- BaseCircuit.predict() won't take float as input
- Confusion with the word "initial_guess" used in CustomCircuit(circuit_string,initial_guess) HOT 1
- Initial_guess HOT 2
- Replace print with proper logging HOT 1
- RC components
- A worked example of .nox Metrohm file reading and pre-processing HOT 3
- Accuracy of data in .par file about VersaStudio HOT 3
- Ask for help extracting parameter values from fitted circuits HOT 1
- [BUG] error in impedance definition of La-element
- reading data from Excel files
- Circuit Element Unit scalable feature HOT 1
- Adding Distribution of relaxation times feature HOT 2
- Recommendation for dealing with noisy data?
- Error?
- Simplified transmission-line model with an RQ-element as inteface impedance (Z_pore) accodring to equation 11 of 10.1149/2.0131709jes
- circuit.parameters_ and circuit.conf_ attributes not referenced in documentation
- [BUG] NumPy 2.0 seems have broken `impedance.py`
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 impedance.py.