|
@@ -86,6 +86,9 @@ def cal_LFPLeakCurrent(sn, end_time, start_time):
|
|
|
break
|
|
|
|
|
|
if ChgStartValid:
|
|
|
+ df_DetaTime=pd.DataFrame()
|
|
|
+ df_DetaTime1=pd.DataFrame()
|
|
|
+ df_detatime=pd.DataFrame()
|
|
|
for i in range(len(ChgStartValid)):
|
|
|
DetaSoc1=[]
|
|
|
DetaSoc2 = []
|
|
@@ -123,8 +126,7 @@ def cal_LFPLeakCurrent(sn, end_time, start_time):
|
|
|
Socmean2=(sum(DetaSoc2)-max(DetaSoc2)-min(DetaSoc2))/(len(DetaSoc2)-2)
|
|
|
|
|
|
#计算每个电芯的Soc差
|
|
|
- df_DetaTime=pd.DataFrame()
|
|
|
- df_detatime=pd.DataFrame()
|
|
|
+
|
|
|
DetaSoc3=DetaSoc1+DetaSoc2
|
|
|
for j in range(len(DetaSoc3)):
|
|
|
if j<10:
|
|
@@ -134,7 +136,6 @@ def cal_LFPLeakCurrent(sn, end_time, start_time):
|
|
|
DetaSoc.append(DetaSoc3[j]-Socmean)
|
|
|
# DetaSoc.append((DetaT[j]-Tmean)*9.5/(Capacity*3600))
|
|
|
df_DetaTime[time[ChgStartValid[i]]]=DetaSoc
|
|
|
-
|
|
|
#漏电流计算
|
|
|
column=[]
|
|
|
time1=[]
|
|
@@ -144,16 +145,16 @@ def cal_LFPLeakCurrent(sn, end_time, start_time):
|
|
|
column.append(index) #提取列名称
|
|
|
|
|
|
for i in range(1,len(column)):#计算漏电流值
|
|
|
- df_DetaTime[column[i]] = df_DetaTime.apply(lambda x: (x[column[i-1]] - x[column[i]])*1000*Capacity*3600/((column[i]-column[i-1]).total_seconds()), axis=1)
|
|
|
+ df_DetaTime1[column[i]] = df_DetaTime.apply(lambda x: (x[column[i-1]] - x[column[i]])*1000*Capacity*3600/((column[i]-column[i-1]).total_seconds()), axis=1)
|
|
|
time1.append(column[i])
|
|
|
sn1.append(sn)
|
|
|
df_detatime['time']=time1
|
|
|
df_detatime['sn']=sn1
|
|
|
|
|
|
- for i in range(len(CellVoltNums)):
|
|
|
+ for i in range(CellVoltNums):
|
|
|
cell=[]
|
|
|
for j in range(1,len(column)):
|
|
|
- cell.append(df_DetaTime[1,column[j]])
|
|
|
+ cell.append(df_DetaTime1[column[j]][i])
|
|
|
df_detatime['cell'+str(i+1)]=cell
|
|
|
return df_detatime
|
|
|
return pd.DataFrame()
|