Giter Site home page Giter Site logo

Comments (12)

z1q0831 avatar z1q0831 commented on August 20, 2024 1

@Yugal0

from impedance.py.

z1q0831 avatar z1q0831 commented on August 20, 2024 1

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.

Yugal0 avatar Yugal0 commented on August 20, 2024

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.

z1q0831 avatar z1q0831 commented on August 20, 2024

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.

Yugal0 avatar Yugal0 commented on August 20, 2024

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.

Yugal0 avatar Yugal0 commented on August 20, 2024

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))
image

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_)
image
image

from impedance.py.

z1q0831 avatar z1q0831 commented on August 20, 2024

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)) image

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)) image image

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.

Yugal0 avatar Yugal0 commented on August 20, 2024

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)) image
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)) image image

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:
image
MY FIT: (now its 1:1)
image

from impedance.py.

z1q0831 avatar z1q0831 commented on August 20, 2024

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)) image
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)) image image

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: image MY FIT: (now its 1:1) image

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.

Yugal0 avatar Yugal0 commented on August 20, 2024

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:
image

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:
image
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:
image

But still how you getting good fit with L=1 as initial guess?
YOUR FIT as shown in your first comment:
image

from impedance.py.

z1q0831 avatar z1q0831 commented on August 20, 2024

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: image

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: image 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: image

But still how you getting good fit with L=1 as initial guess? YOUR FIT as shown in your first comment: image

Maybe I have changed the value of L , but the problem still remains. The high frequency fitting can not be reached.

from impedance.py.

Yugal0 avatar Yugal0 commented on August 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.