SoC estimation using the equation in attached image
조회 수: 7 (최근 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!