[charcoal treasure said] battery charge and discharge curve visualization
Release time:
2023-06-09
The material of the secondary battery or the charge and discharge performance of the battery is very important, and it is also a test method widely used in daily scientific research and technology development. However, due to the long test time and many cycles, a large amount of data is usually generated, which brings some difficulties to the in-depth analysis of the data. Although some data such as capacity, efficiency and internal resistance can be selected to plot the change with the number of cycles, the details of the charge and discharge curve are often ignored, resulting in a great waste of information. This article shares a method for quickly extracting and mapping different cycles and steps from large amounts of data.
The material of the secondary battery or the charge and discharge performance of the battery is very important, and it is also a test method widely used in daily scientific research and technology development. However, due to the long test time and many cycles, a large amount of data is usually generated, which brings some difficulties to the in-depth analysis of the data. Although some data such as capacity, efficiency and internal resistance can be selected to plot the change with the number of cycles, the details of the charge and discharge curve are often ignored, resulting in a great waste of information. This article shares a method for quickly extracting and mapping different cycles and steps from large amounts of data.
1. Data introduction
In this paper, a silicon carbon material button battery cycle data as an example to explain. Exporting the test data from the test software to excel files will produce multiple tables such as "cycle table", "work step table" and "record table". We use the data in the "record table", which is the part with the most amount of data but the most abundant information.
The amount of data is very large and manual processing is extremely difficult, but with python, it is easy.
data_rec = pd.read_excel('data.xlsx', sheet_name='记录表', index_col=0)
2. Extract the data for each cycle and plot

def draw_cycle(cycle_N):
fig = plt.figure(figsize=(5, 3))
ax1 = fig.add_subplot(111)
i = 0
for n in cycle_N:
ns = [2 (n - 1) * 3, 3 (n - 1) * 3]
data_rec[data_rec. Step number. isin(ns)].plot(x = 'specific capacity (mAh/g)',
y = 'Voltage (V)',
kind='scatter',
color='C%s'%(i+2),
s=2,
ax=ax1,
)
i = 1
ax1.set_xlabel ('specific capacity (mAh/g)')
ax1.set_ylabel('电压(V)')
plt.show()
First of all, according to the test program to determine the data of each cycle and step of the law, and then data_rec to extract the desired results, drawing and display.
draw_cycle([1,2,3])
3. Capacity accumulation curve
To more clearly see the change in capacity as the cycle progresses, a capacity accumulation curve can be plotted.

def continuous_cycle(cycle_N):
cap = []
Vol = []
color_step = 8
fig = plt.figure(figsize=(5, 4))
ax1 = fig.add_subplot(111)
i = 0
cap_start = 0
for n in cycle_N:
ns = [2 (n - 1) * 3, 3 (n - 1) * 3]
vol_dis = data_rec[data_rec.工步号 == (2 (n - 1) * 3)]['电压(V)'].values
cap_dis = cap_start data_rec[data_rec.工步号 ==
(2 (n-1) * 3)]['specific capacity (mAh/g)'].values
cap_start = cap_dis[-1]
if i > 0:
Vol_dis = np.append(link_vol, vol_d.com)
Cap_dis = np.append(link_cap, cap_dis)
vol_ch = data_rec[data_rec.工步号 == (3 (n - 1) * 3)]['电压(V)'].values
cap_ch = cap_start - data_rec[data_rec.工步号 ==
(3 (n-1) * 3)]['specific capacity (mAh/g)'].values
link_cap = cap_ch[-1]
Link_vol = vol_ch[-1]
cap_start = cap_ch[-1]
Ax1.plot (np.append(cap_dis, cap_ch),
Np. append (vol_tis, vol_ch),
color='C%s' % (i // color_step))
i = 1
ax1.set_xlabel ('specific capacity (mAh/g)')
ax1.set_ylabel('电压(V)')
plt.savefig('累积容量曲线.png', bbox_inches='tight', dpi=600)
plt.show()
Look at the effect,

continuous_cycle([i for i in range(1,80)])
Perfect!
400-992-0709