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

Very confused about fitting #276

Open
Alt1139 opened this issue Aug 8, 2023 · 3 comments
Open

Very confused about fitting #276

Alt1139 opened this issue Aug 8, 2023 · 3 comments

Comments

@Alt1139
Copy link

Alt1139 commented Aug 8, 2023

So I am trying to fit the nyquist plot to the model R0-p(L1,R2)-p(R1,C1). I need these values to confirm similar model used in another plot. Even if i trim the data for 1st quadrant the result is the same.

frequencies, Z = preprocessing.readCSV('filei.csv')
frequencies = frequencies[1:35]
Z = Z[1:35]
circuit = 'R0-p(L1,R2)-p(R1,C1)'
initial_guess = [12e-3, 2e-7, 1e-3, 1.23e-3, 0.2e-1]
circuit = CustomCircuit(initial_guess=initial_guess, circuit=circuit)
circuit.fit(frequencies, Z)
Z_fit = circuit.predict(frequencies)

image

image

@Yugal0
Copy link

Yugal0 commented Aug 9, 2023

Where do you obtain this data (filei.csv') from?

  1. Is it from some experiments?
  2. Or, it is some synthetic data, that you, yourself have generated by simulating the exact same circuit (that you are trying to fit to the data (R0-p(L1,R2)-p(R1,C1))) or by simulating any other similar circuit.?

Please answer these, I may be able to help, after knowing this.

I think maybe the possible problems can be,
1.If your data is coming from an experiment, then the circuit you have proposed is not sufficient to represent the
experimental data.
2. Sometimes the fitting process is very much influenced by the initial guess that you provide, so you should also check the initial guess values (If your data is coming from the simulation of another circuit, for which you obviously know the value of these parameters). Try putting those exact values as the initial guess.

Let me know if there is any progress or further problems. I will be happy to help.

@Alt1139
Copy link
Author

Alt1139 commented Aug 16, 2023

The data is from an experiment of a Normal NMC LIB. I was reading a lot of literature in which it mentions that the semicircle part of the plot mainly represents the -p(R1,C1) and I am very much interested in this value. For reference:
image

I even tried to only fit the semi circle area and no luck. I also read that ZARC Frequency Domain Fitting is required to fit this region of the battery.

@Yugal0
Copy link

Yugal0 commented Aug 19, 2023

You are more interested in the semicircle part (that forms because of the p(R2,C1) part of the total circuit), I don't have any idea at the moment about how you can just get R2 and C1 values by fitting just the semicircle region of the experimental EIS data, because when you will try to take only the semicircle like-looking region for fitting, you may expect only R2 and C1 be the only two parameters the reason for the semicircle, but as in the overall circuit there are other elements as well, what you will get as the value of R2 and C1, will not be the true value of R2 and C1 in the actual circuit, but rather it will have influences from the other elements like W1, L1, R1 as well.

But if you want to fit a circuit to the complete experimental data that is there in your paper, I can give some suggestions.

  1. you should not take resistance in parallel with the inductor (you have done this in your code (above))
  2. and also replace the capacitor with a Constant Phase Element (CPE) (say with alpha=0.9)
  3. and try taking a CPE instead of the Warburg element (that is there in the Paper), we also recently faced this problem with the Warburg element, the CPE can approximate the Warburg element at least in some frequency range.

also you can send me the EIS data of the paper in a csv file containing (freq, Zreal, Zimag)

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

No branches or pull requests

2 participants