从HPPC 抽出 电池参数的mat lab code
前面发过一些拟合eis以便得到欧姆电阻,电容,反应电阻的code:)
有童鞋说没有能测eis的仪器,但是又想知道以上几个参数怎么办吖?其实是有替代办法的。比如,只要跑一下充电或放电的pulse(就是hppc那种),也可以用电池模型(非物理模型)拟合出来的啦。这里我就写了一个等效电路一阶模型,用于拟合电流pulse得到上面三个参数。当然,如果是二阶的,也并没有本质上的复杂,只是多两个参数。
这个方法比eis麻烦一些,但是对仪器要求比较低。所要的数据是三列矩阵,分别为时间,电流,电压。
还有是就是要事先获得soc-ocv关系,这个做个gitt也就有了。
好啦, good luck!!!
ps: 小木虫需要部分重写了,adobe 已经不再支持flash player。现在没有办法上图:( 泪目!!!!!
小木虫,前向きに行ってみよう!
以下是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
返回小木虫查看更多
京公网安备 11010802022153号
谢谢楼主的分享
好久不见(虽然看不懂内容)
安卓毫无压力。。。
终于知道楼主的专业了
,