從HPPC 抽出 電池參數(shù)的mat lab code
前面發(fā)過一些擬合eis以便得到歐姆電阻,電容,反應(yīng)電阻的code:)
有童鞋說沒有能測eis的儀器,但是又想知道以上幾個參數(shù)怎么辦吖?其實是有替代辦法的。比如,只要跑一下充電或放電的pulse(就是hppc那種),也可以用電池模型(非物理模型)擬合出來的啦。這里我就寫了一個等效電路一階模型,用于擬合電流pulse得到上面三個參數(shù)。當(dāng)然,如果是二階的,也并沒有本質(zhì)上的復(fù)雜,只是多兩個參數(shù)。
這個方法比eis麻煩一些,但是對儀器要求比較低。所要的數(shù)據(jù)是三列矩陣,分別為時間,電流,電壓。
還有是就是要事先獲得soc-ocv關(guān)系,這個做個gitt也就有了。
好啦, good luck。!
ps: 小木蟲需要部分重寫了,adobe 已經(jīng)不再支持flash player,F(xiàn)在沒有辦法上圖:( 淚目。。。!
小木蟲,前向きに行ってみよう!
以下是code:
function [pbest]=rc1fit1(p0,data)
% p0 in the sequence of r0,r1,c1
ydata= data(:,3) % voltage
pbest=nlinfit(data,ydata,@rc1_v,p0) % use nlinfit() to fit
plot(data(:,1),data(:,3),'o',data(:,1),rc1_v(pbest,data)) % plot
xlabel('s')
ylabel('v')
legend('experiment','fit')
end
function ycal = rc1_v(p0,data)
% the function returns terminal voltage (ycal) at time 't'
load('sococveve') % soc_ocv relation
soc=sococveve(:,1) % needs to specify for other cells
ocv=sococveve(:,2) % needs to specify for other cells
dt=diff(data(:,1))
i=data(:,2)
capa=5 % need to be modified accordingly
r0=p0(1)
r1=p0(2)
c1=p0(3)
% this function assume r1 and c1 and r0 constant
ocv(1)=data(1,3) % when t=0
soc(1)=interp1(ocv,soc,ocv(1))% return soc(1) at t=0
ycal(1)=ocv(1) % when t=0
ir1(1)=0 % when t=0, instantaneous current through paralleled r1 is 0
for ii=1:length(data(:,1))-1
ir1(ii+1)=exp(-dt(ii)/(r1*c1))*ir1(ii)+(1-exp(-dt(ii)/(r1*c1)))*i(ii) % dominant function
soc(ii+1)=interp1(ocv,soc,ocv(ii))+dt(ii)*i(ii+1)/3600/capa
ocv(ii+1)=interp1(soc,ocv,soc(ii+1))
ycal(ii+1)=ocv(ii+1)+ r0*i(ii+1)+ r1*ir1(ii+1)
end
ycal=ycal'
end
返回小木蟲查看更多
京公網(wǎng)安備 11010802022153號
謝謝樓主的分享
好久不見(雖然看不懂內(nèi)容)
安卓毫無壓力。。。
終于知道樓主的專業(yè)了
,