SoC estimation using the equation in attached image
4 次查看(过去 30 天)
显示 更早的评论
Hi ,I have done this code in order to estimate the battery state of chaege (SoC) by using nasa data-set for battery charging and discharging , the data-sets are taking from this website https://ti.arc.nasa.gov/tech/dash/groups/pcoe/prognostic-data-repository/, part no 5 (Battery Data Set) BatteryAgingARC_53_54_55_56
in specific file named B0056.mat
sorry i could not upload it here due to the size of the file
my code as below
clc
clear all
A=load('B0056.mat');
load('B0056.mat');
for i=1:252![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/636355/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/636355/image.png)
Type=B0056.cycle(i).type;
if strcmp(Type,'discharge')==1
Voltage_measured=B0056.cycle(i).data.Voltage_measured;
Current_measured=B0056.cycle(i).data.Current_measured;
Temperature_measured=B0056.cycle(i).data.Temperature_measured;
% Current_charge=B0056.cycle(i).data.Current_load;
% Voltage_charge=B0056.cycle(i).data.Voltage_load;
Current_charge=B0056.cycle(i).data.Current_charge;
Voltage_charge=B0056.cycle(i).data.Voltage_charge;
Time=B0056.cycle(i).data.Time/3600;
Capacity=B0056.cycle(i).data.Capacity;
for j=1:length(Current_charge)
if (j == 1)
SOC0 = 0;
else
State =(SOC0 -(-(Current_charge(j)*(Time(j)-Time(j-1)))./Capacity)*100);
end
end
end
end
SOC=State;
A=[ Voltage_measured', Current_measured',Temperature_measured',Current_charge',Voltage_charge',Time'];
A(1:end,end+1)=SOC;
a=strcat('B0006.cycle(', num2str(i),').charge.xlsx');
xlswrite(a,A);
data = readtable('B0006.cycle(252).charge.xlsx'); % read Excel file as table
data.Properties.VariableNames = {'Voltage Measured','Current Measured','Temp Measured','Current Charge','Voltage Charge','Time','SoC'}
writetable(data,'B0006.cycle(252).charge.xlsx') % write back modified data to excel file
[num,txt,raw] = xlsread('B0006.cycle(252).charge.xlsx');
[v,T,vT]=xlsread('B0006.cycle(252).charge.xlsx');
t=v(:,6);y=v(:,7);
plot(t,y)
xlabel('time')
ylabel('soc')
it does not show error but it does not show the required results as SoC during discharge should decrease from 100 to some points
I also want to get the recharge cycle when SOC=0 but it shows error in SOC=State;
please help me with that
note: the attach image is for the equation of SOC estimation
1 个评论
回答(1 个)
Joel Van Sickel
2021-8-3
Hello Mustafa,
the link to your data set does not work and you did not include the relevant .mat file so it would be particularly hard for anyone to help answer this question.
However, here: State =(SOC0 -(-(Current_charge(j)*(Time(j)-Time(j-1)))./Capacity)*100);
you are not correctly implementing the equation for an integral so this is probably at least part of the problem. Please see: https://www.mathworks.com/help/matlab/ref/integral.html
Regards,
Joel
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Propulsion and Power Systems 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!