Skip to content

Error? #291

@G-Missaka

Description

@G-Missaka

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions