-
Notifications
You must be signed in to change notification settings - Fork 101
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
Error? #291
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I am trying to run the sample code and I am getting warning messages with some bad fittings:
Code:
from impedance import preprocessing
import matplotlib.pyplot as plt
from impedance.visualization import plot_nyquist
from impedance.models.circuits import Randles, CustomCircuit
import numpy as np
frequencies, Z = preprocessing.readCSV(r'C:/Users/llf1362/Downloads/exampleData (1).csv')
#frequencies, Z = preprocessing.readCSV(r'C:/Users/llf1362/Desktop/BatteryRobot/MainProject/src/main/utils/PStat/tests/GEIS.csv')
frequencies, Z = preprocessing.ignoreBelowX(frequencies, Z)
randles = Randles(initial_guess=[.01, .005, .001, 200, .1])
randles.fit(frequencies, Z, global_opt = True)
Z_fit = randles.predict(frequencies)
fig, ax = plt.subplots()
plot_nyquist(Z, fmt='o', scale=10, ax=ax)
plot_nyquist(Z_fit, fmt='-', scale=10, ax=ax)
#plt.legend(['Data', 'Fit'])
plt.show()
Message:
C:\Users\llf1362\AppData\Roaming\Python\Python37\site-packages\impedance\models\circuits\elements.py:170: RuntimeWarning: overflow encountered in tanh
Z = Z0 / (np.sqrt(1j * omega * tau) * np.tanh(np.sqrt(1j * omega * tau)))
C:\Users\llf1362\AppData\Roaming\Python\Python37\site-packages\impedance\models\circuits\elements.py:170: RuntimeWarning: divide by zero encountered in true_divide
Z = Z0 / (np.sqrt(1j * omega * tau) * np.tanh(np.sqrt(1j * omega * tau)))
C:\Users\llf1362\AppData\Roaming\Python\Python37\site-packages\impedance\models\circuits\elements.py:170: RuntimeWarning: invalid value encountered in true_divide
Z = Z0 / (np.sqrt(1j * omega * tau) * np.tanh(np.sqrt(1j * omega * tau)))
C:\Users\llf1362\AppData\Roaming\Python\Python37\site-packages\impedance\models\circuits\elements.py:81: RuntimeWarning: invalid value encountered in true_divide
z += 1 / elem
C:\Users\llf1362\AppData\Roaming\Python\Python37\site-packages\impedance\models\circuits\elements.py:82: RuntimeWarning: invalid value encountered in true_divide
return 1 / z
C:\Users\llf1362\AppData\Roaming\Python\Python37\site-packages\impedance\models\circuits\elements.py:170: RuntimeWarning: invalid value encountered in tanh
Z = Z0 / (np.sqrt(1j * omega * tau) * np.tanh(np.sqrt(1j * omega * tau)))
C:\Users\llf1362\AppData\Roaming\Python\Python37\site-packages\impedance\models\circuits\fitting.py:213: UserWarning: Failed to compute perror
warnings.warn('Failed to compute perror')
Fitting:
![Figure_1](https://private-user-images.githubusercontent.com/169402972/337451371-f7d69690-b1b9-489f-b7ee-0126b96f7184.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA0NTIwMjIsIm5iZiI6MTcyMDQ1MTcyMiwicGF0aCI6Ii8xNjk0MDI5NzIvMzM3NDUxMzcxLWY3ZDY5NjkwLWIxYjktNDg5Zi1iN2VlLTAxMjZiOTZmNzE4NC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNzA4JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDcwOFQxNTE1MjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1mYzBmMzAxNzg0NGRlMTY1MmY4ZTllOTVmMmRjMjNkZTdlYjRjY2Y0YTc5YWYxMzRmY2I3Yjc0YzdmYTFmNzRjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.PgdjlLVzv2pyMqmvz3DkzhfsCCaWGIHH4joWjjWHUAo)
The text was updated successfully, but these errors were encountered: