|
@@ -86,7 +86,8 @@ class BatInterShort():
|
|
|
time_last=time_now-datetime.timedelta(seconds=1800)
|
|
|
df_volt=self.df_bms[(self.df_bms['time']>=time_last) & (self.df_bms['time']<=time_now)]
|
|
|
df_volt=df_volt[self.cellvolt_name]
|
|
|
- if len(df_volt)>2:
|
|
|
+ cellvolt_std=df_volt.std(axis=0)
|
|
|
+ if len(df_volt)>2 and max(cellvolt_std)<1.5:
|
|
|
cellvolt_sum=df_volt.sum(0)-df_volt.max(0)-df_volt.min(0)
|
|
|
cellvolt_mean=cellvolt_sum/(len(df_volt)-2)
|
|
|
cellvolt=cellvolt_mean/1000
|
|
@@ -96,8 +97,10 @@ class BatInterShort():
|
|
|
cellvolt=df_volt.mean(0)/1000
|
|
|
else:
|
|
|
cellvolt=pd.DataFrame()
|
|
|
+ elif len(df_volt)==1:
|
|
|
+ cellvolt=df_volt.iloc[0]/1000
|
|
|
else:
|
|
|
- cellvolt=df_volt.iloc[0]
|
|
|
+ cellvolt=pd.DataFrame()
|
|
|
return cellvolt
|
|
|
|
|
|
#获取当前行所有电压数据........................................................................................
|
|
@@ -314,49 +317,53 @@ class BatInterShort():
|
|
|
if standingtime>self.StandardStandingTime*2: #静置时间满足要求
|
|
|
standingtime=0
|
|
|
cellvolt_now=self._avgvolt_get(i)
|
|
|
+ if not cellvolt_now.empty:
|
|
|
+ cellvolt_min=min(cellvolt_now)
|
|
|
+ cellvolt_max=max(cellvolt_now)
|
|
|
+ # cellvolt_last=self._avgvolt_get(i-1)
|
|
|
+ # deltvolt=max(abs(cellvolt_now-cellvolt_last))
|
|
|
+ cellsoc_max=np.interp(cellvolt_max,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
+ cellsoc_min=np.interp(cellvolt_min,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
+
|
|
|
+ if 2<cellvolt_min<4.5 and 2<cellvolt_max<4.5 and (45<cellsoc_max or cellsoc_max<30) and (45<cellsoc_min or cellsoc_min<30):
|
|
|
+ dict_baltime={} #获取每个电芯的均衡时间
|
|
|
+ deltsoc_last, cellsoc_last=self._celldeltsoc_get(i,dict_baltime,capacity)
|
|
|
+ time_last=self.bmstime[i]
|
|
|
+ firsttime=0
|
|
|
+ df_ram_last.loc[0]=[self.sn,time_last,deltsoc_last,cellsoc_last] #更新RAM信息
|
|
|
+ else:
|
|
|
+ pass
|
|
|
+ elif standingtime>3600*12:
|
|
|
+ standingtime=0
|
|
|
+ cellvolt_now=self._avgvolt_get(i)
|
|
|
+ if not cellvolt_now.empty:
|
|
|
cellvolt_min=min(cellvolt_now)
|
|
|
cellvolt_max=max(cellvolt_now)
|
|
|
# cellvolt_last=self._avgvolt_get(i-1)
|
|
|
# deltvolt=max(abs(cellvolt_now-cellvolt_last))
|
|
|
cellsoc_max=np.interp(cellvolt_max,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
cellsoc_min=np.interp(cellvolt_min,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
-
|
|
|
- if (not cellvolt_now.empty) and 2<cellvolt_min<4.5 and 2<cellvolt_max<4.5 and (45<cellsoc_max or cellsoc_max<30) and (45<cellsoc_min or cellsoc_min<30):
|
|
|
- dict_baltime={} #获取每个电芯的均衡时间
|
|
|
- deltsoc_last, cellsoc_last=self._celldeltsoc_get(i,dict_baltime,capacity)
|
|
|
- time_last=self.bmstime[i]
|
|
|
- firsttime=0
|
|
|
- df_ram_last.loc[0]=[self.sn,time_last,deltsoc_last,cellsoc_last] #更新RAM信息
|
|
|
- else:
|
|
|
- pass
|
|
|
- elif standingtime>3600*12:
|
|
|
- standingtime=0
|
|
|
- cellvolt_now=self._avgvolt_get(i)
|
|
|
- cellvolt_min=min(cellvolt_now)
|
|
|
- cellvolt_max=max(cellvolt_now)
|
|
|
- # cellvolt_last=self._avgvolt_get(i-1)
|
|
|
- # deltvolt=max(abs(cellvolt_now-cellvolt_last))
|
|
|
-
|
|
|
- if (not cellvolt_now.empty) and 2<cellvolt_min<4.5 and 2<cellvolt_max<4.5:
|
|
|
- dict_baltime=self._bal_time(dict_bal) #获取每个电芯的均衡时间
|
|
|
- deltsoc_now, cellsoc_now=self._celldeltsoc_get(i,dict_baltime,capacity)
|
|
|
- time_now=self.bmstime[i]
|
|
|
- if -5<max(cellsoc_now-cellsoc_last)<5:
|
|
|
- df_ram_last.loc[0]=[self.sn,time_now,deltsoc_now,cellsoc_now] #更新RAM信息
|
|
|
-
|
|
|
- list_sub=deltsoc_now-deltsoc_last
|
|
|
- list_pud=(0.01*capacity*3600*1000)/(time_now-time_last).total_seconds()
|
|
|
- leak_current=list_sub*list_pud
|
|
|
- # leak_current=np.array(leak_current)
|
|
|
- leak_current=np.round(leak_current,3)
|
|
|
- leak_current=list(leak_current)
|
|
|
-
|
|
|
- df_res.loc[len(df_res)]=[time_last,time_now,self.sn,1,str(leak_current),str(dict_baltime)] #计算结果存入Dataframe
|
|
|
- time_last=time_now #更新时间
|
|
|
- deltsoc_last=deltsoc_now #更新soc差
|
|
|
- dict_bal={}
|
|
|
- else:
|
|
|
- firsttime=1
|
|
|
+
|
|
|
+ if 2<cellvolt_min<4.5 and 2<cellvolt_max<4.5 and (45<cellsoc_max or cellsoc_max<30) and (45<cellsoc_min or cellsoc_min<30):
|
|
|
+ dict_baltime=self._bal_time(dict_bal) #获取每个电芯的均衡时间
|
|
|
+ deltsoc_now, cellsoc_now=self._celldeltsoc_get(i,dict_baltime,capacity)
|
|
|
+ time_now=self.bmstime[i]
|
|
|
+ if -5<max(cellsoc_now-cellsoc_last)<5:
|
|
|
+ df_ram_last.loc[0]=[self.sn,time_now,deltsoc_now,cellsoc_now] #更新RAM信息
|
|
|
+
|
|
|
+ list_sub=deltsoc_now-deltsoc_last
|
|
|
+ list_pud=(0.01*capacity*3600*1000)/(time_now-time_last).total_seconds()
|
|
|
+ leak_current=list_sub*list_pud
|
|
|
+ # leak_current=np.array(leak_current)
|
|
|
+ leak_current=np.round(leak_current,3)
|
|
|
+ leak_current=list(leak_current)
|
|
|
+
|
|
|
+ df_res.loc[len(df_res)]=[time_last,time_now,self.sn,1,str(leak_current),str(dict_baltime)] #计算结果存入Dataframe
|
|
|
+ time_last=time_now #更新时间
|
|
|
+ deltsoc_last=deltsoc_now #更新soc差
|
|
|
+ dict_bal={}
|
|
|
+ else:
|
|
|
+ firsttime=1
|
|
|
else:
|
|
|
try:
|
|
|
balstat=int(self.df_bms.loc[i,'单体均衡状态'])
|
|
@@ -376,39 +383,40 @@ class BatInterShort():
|
|
|
if self.StandardStandingTime<standingtime1:
|
|
|
standingtime1=0
|
|
|
cellvolt_now1=self._avgvolt_get(i)
|
|
|
- cellvolt_max1=max(cellvolt_now1)
|
|
|
- cellvolt_min1=min(cellvolt_now1)
|
|
|
- # cellvolt_last1=self._avgvolt_get(i-1)
|
|
|
- # deltvolt1=max(abs(cellvolt_now1-cellvolt_last1))
|
|
|
- cellsoc_now1=np.interp(cellvolt_max1,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
-
|
|
|
- if (not cellvolt_now1.empty) and cellsoc_now1>=self.param.FullChrgSoc-10 and 2<cellvolt_min1<4.5 and 2<cellvolt_max1<4.5:
|
|
|
- if firsttime1==1:
|
|
|
- dict_baltime1={} #获取每个电芯的均衡时间
|
|
|
- deltsoc_last1, cellsoc_last1=self._celldeltsoc_get(i,dict_baltime1,capacity)
|
|
|
- time_last1=self.bmstime[i]
|
|
|
- firsttime1=0
|
|
|
- df_ram_last1.loc[0]=[self.sn,time_last1,deltsoc_last1] #更新RAM信息
|
|
|
- else:
|
|
|
- dict_baltime1=self._bal_time(dict_bal1) #获取每个电芯的均衡时间
|
|
|
- time_now1=self.bmstime[i]
|
|
|
- if (time_now1-time_last1).total_seconds()>3600*20:
|
|
|
- deltsoc_now1, cellsoc_now1=self._celldeltsoc_get(i,dict_baltime1,capacity)
|
|
|
- df_ram_last1.loc[0]=[self.sn,time_now1,deltsoc_now1] #更新RAM信息
|
|
|
-
|
|
|
- list_sub1=deltsoc_now1-deltsoc_last1
|
|
|
- list_pud1=(0.01*capacity*3600*1000)/(time_now1-time_last1).total_seconds()
|
|
|
- leak_current1=list_sub1*list_pud1
|
|
|
- # leak_current1=np.array(leak_current1)
|
|
|
- leak_current1=np.round(leak_current1,3)
|
|
|
- leak_current1=list(leak_current1)
|
|
|
-
|
|
|
- df_res.loc[len(df_res)]=[time_last1,time_now1,self.sn,2,str(leak_current1),str(dict_baltime1)] #计算结果存入Dataframe
|
|
|
- time_last1=time_now1 #更新时间
|
|
|
- deltsoc_last1=deltsoc_now1 #更新soc差
|
|
|
- dict_bal1={}
|
|
|
+ if not cellvolt_now1.empty:
|
|
|
+ cellvolt_max1=max(cellvolt_now1)
|
|
|
+ cellvolt_min1=min(cellvolt_now1)
|
|
|
+ # cellvolt_last1=self._avgvolt_get(i-1)
|
|
|
+ # deltvolt1=max(abs(cellvolt_now1-cellvolt_last1))
|
|
|
+ cellsoc_now1=np.interp(cellvolt_max1,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
+
|
|
|
+ if cellsoc_now1>=self.param.FullChrgSoc-10 and 2<cellvolt_min1<4.5 and 2<cellvolt_max1<4.5:
|
|
|
+ if firsttime1==1:
|
|
|
+ dict_baltime1={} #获取每个电芯的均衡时间
|
|
|
+ deltsoc_last1, cellsoc_last1=self._celldeltsoc_get(i,dict_baltime1,capacity)
|
|
|
+ time_last1=self.bmstime[i]
|
|
|
+ firsttime1=0
|
|
|
+ df_ram_last1.loc[0]=[self.sn,time_last1,deltsoc_last1] #更新RAM信息
|
|
|
else:
|
|
|
- pass
|
|
|
+ dict_baltime1=self._bal_time(dict_bal1) #获取每个电芯的均衡时间
|
|
|
+ time_now1=self.bmstime[i]
|
|
|
+ if (time_now1-time_last1).total_seconds()>3600*20:
|
|
|
+ deltsoc_now1, cellsoc_now1=self._celldeltsoc_get(i,dict_baltime1,capacity)
|
|
|
+ df_ram_last1.loc[0]=[self.sn,time_now1,deltsoc_now1] #更新RAM信息
|
|
|
+
|
|
|
+ list_sub1=deltsoc_now1-deltsoc_last1
|
|
|
+ list_pud1=(0.01*capacity*3600*1000)/(time_now1-time_last1).total_seconds()
|
|
|
+ leak_current1=list_sub1*list_pud1
|
|
|
+ # leak_current1=np.array(leak_current1)
|
|
|
+ leak_current1=np.round(leak_current1,3)
|
|
|
+ leak_current1=list(leak_current1)
|
|
|
+
|
|
|
+ df_res.loc[len(df_res)]=[time_last1,time_now1,self.sn,2,str(leak_current1),str(dict_baltime1)] #计算结果存入Dataframe
|
|
|
+ time_last1=time_now1 #更新时间
|
|
|
+ deltsoc_last1=deltsoc_now1 #更新soc差
|
|
|
+ dict_bal1={}
|
|
|
+ else:
|
|
|
+ pass
|
|
|
else:
|
|
|
pass
|
|
|
else:
|
|
@@ -522,55 +530,57 @@ class BatInterShort():
|
|
|
if standingtime>self.StandardStandingTime: #静置时间满足要求
|
|
|
standingtime=0
|
|
|
cellvolt_now=self._avgvolt_get(i)
|
|
|
+ if not cellvolt_now.empty:
|
|
|
+ cellvolt_min=min(cellvolt_now)
|
|
|
+ cellvolt_max=max(cellvolt_now)
|
|
|
+ # cellvolt_last=self._avgvolt_get(i-1)
|
|
|
+ # deltvolt=max(abs(cellvolt_now-cellvolt_last))
|
|
|
+ cellsoc_max=np.interp(cellvolt_max,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
+ cellsoc_min=np.interp(cellvolt_min,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
+
|
|
|
+ if cellsoc_max<self.param.SocInflexion1-2 and 12<cellsoc_min:
|
|
|
+ dict_baltime={} #获取每个电芯的均衡时间
|
|
|
+ deltsoc_last, cellsoc_last=self._celldeltsoc_get(i,dict_baltime,capacity)
|
|
|
+ time_last=self.bmstime[i]
|
|
|
+ firsttime=0
|
|
|
+ df_ram_last.loc[0]=[self.sn,time_last,deltsoc_last,cellsoc_last] #更新RAM信息
|
|
|
+ else:
|
|
|
+ pass
|
|
|
+ else:
|
|
|
+ pass
|
|
|
+ elif standingtime>3600*12:
|
|
|
+ standingtime=0
|
|
|
+ cellvolt_now=np.array(self._avgvolt_get(i))
|
|
|
+ if not cellvolt_now.empty:
|
|
|
cellvolt_min=min(cellvolt_now)
|
|
|
cellvolt_max=max(cellvolt_now)
|
|
|
- # cellvolt_last=self._avgvolt_get(i-1)
|
|
|
+ # cellvolt_last=np.array(self._avgvolt_get(i-1))
|
|
|
# deltvolt=max(abs(cellvolt_now-cellvolt_last))
|
|
|
cellsoc_max=np.interp(cellvolt_max,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
cellsoc_min=np.interp(cellvolt_min,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
|
|
|
- if (not cellvolt_now.empty) and cellsoc_max<self.param.SocInflexion1-2 and 12<cellsoc_min:
|
|
|
- dict_baltime={} #获取每个电芯的均衡时间
|
|
|
- deltsoc_last, cellsoc_last=self._celldeltsoc_get(i,dict_baltime,capacity)
|
|
|
- time_last=self.bmstime[i]
|
|
|
- firsttime=0
|
|
|
- df_ram_last.loc[0]=[self.sn,time_last,deltsoc_last,cellsoc_last] #更新RAM信息
|
|
|
+ if cellsoc_max<self.param.SocInflexion1-2 and 12<cellsoc_min:
|
|
|
+ dict_baltime=self._bal_time(dict_bal) #获取每个电芯的均衡时间
|
|
|
+ deltsoc_now, cellsoc_now=self._celldeltsoc_get(i, dict_baltime,capacity) #获取每个电芯的SOC差
|
|
|
+ time_now=self.bmstime[i]
|
|
|
+ if -5<max(cellsoc_now-cellsoc_last)<5:
|
|
|
+ df_ram_last.loc[0]=[self.sn,time_now,deltsoc_now,cellsoc_now] #更新RAM信息
|
|
|
+
|
|
|
+ list_sub=deltsoc_now-deltsoc_last
|
|
|
+ list_pud=(0.01*capacity*3600*1000)/(time_now-time_last).total_seconds()
|
|
|
+ leak_current=list_sub*list_pud
|
|
|
+ # leak_current=np.array(leak_current)
|
|
|
+ leak_current=np.round(leak_current,3)
|
|
|
+ leak_current=list(leak_current)
|
|
|
+
|
|
|
+ df_res.loc[len(df_res)]=[time_last,time_now,self.sn,1,str(leak_current),str(dict_baltime)] #计算结果存入Dataframe
|
|
|
+ time_last=time_now #更新时间
|
|
|
+ deltsoc_last=deltsoc_now #更新soc差
|
|
|
+ dict_bal={}
|
|
|
+ else:
|
|
|
+ firsttime=1
|
|
|
else:
|
|
|
pass
|
|
|
- else:
|
|
|
- pass
|
|
|
- elif standingtime>3600*12:
|
|
|
- standingtime=0
|
|
|
- cellvolt_now=np.array(self._avgvolt_get(i))
|
|
|
- cellvolt_min=min(cellvolt_now)
|
|
|
- cellvolt_max=max(cellvolt_now)
|
|
|
- # cellvolt_last=np.array(self._avgvolt_get(i-1))
|
|
|
- # deltvolt=max(abs(cellvolt_now-cellvolt_last))
|
|
|
- cellsoc_max=np.interp(cellvolt_max,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
- cellsoc_min=np.interp(cellvolt_min,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
-
|
|
|
- if (not cellvolt_now.empty) and cellsoc_max<self.param.SocInflexion1-2 and 12<cellsoc_min:
|
|
|
- dict_baltime=self._bal_time(dict_bal) #获取每个电芯的均衡时间
|
|
|
- deltsoc_now, cellsoc_now=self._celldeltsoc_get(i, dict_baltime,capacity) #获取每个电芯的SOC差
|
|
|
- time_now=self.bmstime[i]
|
|
|
- if -5<max(cellsoc_now-cellsoc_last)<5:
|
|
|
- df_ram_last.loc[0]=[self.sn,time_now,deltsoc_now,cellsoc_now] #更新RAM信息
|
|
|
-
|
|
|
- list_sub=deltsoc_now-deltsoc_last
|
|
|
- list_pud=(0.01*capacity*3600*1000)/(time_now-time_last).total_seconds()
|
|
|
- leak_current=list_sub*list_pud
|
|
|
- # leak_current=np.array(leak_current)
|
|
|
- leak_current=np.round(leak_current,3)
|
|
|
- leak_current=list(leak_current)
|
|
|
-
|
|
|
- df_res.loc[len(df_res)]=[time_last,time_now,self.sn,1,str(leak_current),str(dict_baltime)] #计算结果存入Dataframe
|
|
|
- time_last=time_now #更新时间
|
|
|
- deltsoc_last=deltsoc_now #更新soc差
|
|
|
- dict_bal={}
|
|
|
- else:
|
|
|
- firsttime=1
|
|
|
- else:
|
|
|
- pass
|
|
|
else:
|
|
|
try:
|
|
|
balstat=int(self.df_bms.loc[i,'单体均衡状态'])
|
|
@@ -590,42 +600,43 @@ class BatInterShort():
|
|
|
if standingtime1>self.StandardStandingTime:
|
|
|
standingtime1=0
|
|
|
cellvolt_now1=self._avgvolt_get(i)
|
|
|
- cellvolt_max1=max(cellvolt_now1)
|
|
|
- cellvolt_min1=min(cellvolt_now1)
|
|
|
- # cellvolt_last1=self._avgvolt_get(i-1)
|
|
|
- # deltvolt1=max(abs(cellvolt_now1-cellvolt_last1))
|
|
|
- cellsoc_max1=np.interp(cellvolt_max1,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
- cellsoc_min1=np.interp(cellvolt_min1,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
-
|
|
|
- if (not cellvolt_now1.empty) and cellsoc_max1<self.param.SocInflexion1-2 and 12<cellsoc_min1:
|
|
|
- if firsttime1==1:
|
|
|
- dict_baltime1=self._bal_time(dict_bal1) #获取每个电芯的均衡时间
|
|
|
- deltsoc_last1, cellsoc_last1=self._celldeltsoc_get(i,dict_baltime1,capacity)
|
|
|
- time_last1=self.bmstime[i]
|
|
|
- firsttime1=0
|
|
|
- df_ram_last1.loc[0]=[self.sn,time_last1,deltsoc_last1] #更新RAM信息
|
|
|
- else:
|
|
|
- dict_baltime1=self._bal_time(dict_bal1) #获取每个电芯的均衡时间
|
|
|
- deltsoc_now1, cellsoc_now1=self._celldeltsoc_get(i,dict_baltime1,capacity)
|
|
|
- time_now1=self.bmstime[i]
|
|
|
- df_ram_last1.loc[0]=[self.sn,time_now1,deltsoc_now1] #更新RAM信息
|
|
|
-
|
|
|
- if (time_now1-time_last1).total_seconds()>3600*24:
|
|
|
- list_sub1=deltsoc_now1-deltsoc_last1
|
|
|
- list_pud1=(0.01*capacity*3600*1000)/(time_now1-time_last1).total_seconds()
|
|
|
- leak_current1=list_sub1*list_pud1
|
|
|
- # leak_current1=np.array(leak_current1)
|
|
|
- leak_current1=np.round(leak_current1,3)
|
|
|
- leak_current1=list(leak_current1)
|
|
|
-
|
|
|
- df_res.loc[len(df_res)]=[time_last1,time_now1,self.sn,2,str(leak_current1),str(dict_baltime1)] #计算结果存入Dataframe
|
|
|
- time_last1=time_now1 #更新时间
|
|
|
- deltsoc_last1=deltsoc_now1 #更新soc差
|
|
|
- dict_bal1={}
|
|
|
+ if not cellvolt_now1.empty:
|
|
|
+ cellvolt_max1=max(cellvolt_now1)
|
|
|
+ cellvolt_min1=min(cellvolt_now1)
|
|
|
+ # cellvolt_last1=self._avgvolt_get(i-1)
|
|
|
+ # deltvolt1=max(abs(cellvolt_now1-cellvolt_last1))
|
|
|
+ cellsoc_max1=np.interp(cellvolt_max1,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
+ cellsoc_min1=np.interp(cellvolt_min1,self.param.LookTab_OCV,self.param.LookTab_SOC)
|
|
|
+
|
|
|
+ if cellsoc_max1<self.param.SocInflexion1-2 and 12<cellsoc_min1:
|
|
|
+ if firsttime1==1:
|
|
|
+ dict_baltime1=self._bal_time(dict_bal1) #获取每个电芯的均衡时间
|
|
|
+ deltsoc_last1, cellsoc_last1=self._celldeltsoc_get(i,dict_baltime1,capacity)
|
|
|
+ time_last1=self.bmstime[i]
|
|
|
+ firsttime1=0
|
|
|
+ df_ram_last1.loc[0]=[self.sn,time_last1,deltsoc_last1] #更新RAM信息
|
|
|
else:
|
|
|
- pass
|
|
|
- else:
|
|
|
- pass
|
|
|
+ dict_baltime1=self._bal_time(dict_bal1) #获取每个电芯的均衡时间
|
|
|
+ deltsoc_now1, cellsoc_now1=self._celldeltsoc_get(i,dict_baltime1,capacity)
|
|
|
+ time_now1=self.bmstime[i]
|
|
|
+ df_ram_last1.loc[0]=[self.sn,time_now1,deltsoc_now1] #更新RAM信息
|
|
|
+
|
|
|
+ if (time_now1-time_last1).total_seconds()>3600*24:
|
|
|
+ list_sub1=deltsoc_now1-deltsoc_last1
|
|
|
+ list_pud1=(0.01*capacity*3600*1000)/(time_now1-time_last1).total_seconds()
|
|
|
+ leak_current1=list_sub1*list_pud1
|
|
|
+ # leak_current1=np.array(leak_current1)
|
|
|
+ leak_current1=np.round(leak_current1,3)
|
|
|
+ leak_current1=list(leak_current1)
|
|
|
+
|
|
|
+ df_res.loc[len(df_res)]=[time_last1,time_now1,self.sn,2,str(leak_current1),str(dict_baltime1)] #计算结果存入Dataframe
|
|
|
+ time_last1=time_now1 #更新时间
|
|
|
+ deltsoc_last1=deltsoc_now1 #更新soc差
|
|
|
+ dict_bal1={}
|
|
|
+ else:
|
|
|
+ pass
|
|
|
+ else:
|
|
|
+ pass
|
|
|
else:
|
|
|
pass
|
|
|
|