We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
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:
The text was updated successfully, but these errors were encountered: