RC参数可以通过代码进行辨识,具有较高的方便性,接下来,我们就通过几段代码进行1阶RC参数的辨识
首先是编写仿真端电压的函数,这是一个有两个函数组成的函数功能
function [vModel] = RC1_fitting_model(ECM_parameters, input, ocvVoltage, xNew)
time = input(:,1);
current = input(:,2);
vModel = zeros(length(current),1);
vModel(1) = ocvVoltage(1);
function [vModel,XTimUp] = Model_1RC (current, tSample, xPrev, ocvVoltage, ECM_Parameters)
r0 = ECM_Parameters(1);
r1 = ECM_Parameters(2);
c1 = ECM_Parameters(3);
tau1 = r1*c1;
XTimUp = exp(-tSample/(tau1))*xPrev + r1*(1-exp(-tSample/tau1))*current;
vModel = ocvVoltage-XTimUp-r0*current;
end
end
其次通过一段代码实现RC参数的辨识过程,其中包括nlinfit函数的使用
currentLimit = 0.5;
iniPar = [0.06;0.03;1000];
xIni = 0;
[m,n] = size(dataHPPC{1});
outputPar = zeros(3,n);
modelError = zeros(m,n);
vModel = zeros(m,n);
for i = 1:n
time = dataHPPC{1}(:,i);
current = dataHPPC{2}(:,i);
vExp = dataHPPC{3}(:,i);
index = find(current>currentLimit);
ocvVoltage = vExp(index(1)-1);
fun = @(beta,x)RC1_fitting_model(beta,x,ocvVoltage,xIni);
outputPar(:,i) = nlinfit([time,current],vExp,fun,iniPar);
vModel(:,i) = RC1_fitting_model(outputPar(:,i),[time,current],ocvVoltage,xIni);
modelError(:,i) = abs((vModel(:,i) - vExp)./vExp)*100;
figure
plot(vModel(:,i))
hold on
plot(vExp)
end
最后我们可以查看仿真结果和实测数据对比,同时获得RC参数表
也可以使用相同的二阶RC参数表的获得