prediction of remaining useful life

2 次查看(过去 30 天)
I am doing my coding to predict the remaining useful life of the battery. I am taking NASA dataset for the predicition. Furthermore i am using charge volatge, current , temperature and capacity as input and target value to be capacity. The problem lies in the prediction of data from a particular set point on x axix. How can we predict the result from a particular point .
  2 个评论
Rik
Rik 2020-9-28
This is a methodological question, not an implementation question. Have a read here and here. It will greatly improve your chances of getting an answer.
It would also probably help if you share the data, along with a specific question.
Yerkin Serik
Yerkin Serik 2022-7-21
Hello! Sorry I can't answer to your question, But I want to ask question you. How you downloaded data of aging of battery from Nasa( because I am struggling with this) please help!

请先登录,再进行评论。

采纳的回答

Shaheer Ansari
Shaheer Ansari 2020-9-29
Sir , this is my proposed result where the no of cycles are predicted from a particular point on x axix . the graph is between cycle and capacity. Also for your reference i am attaching my code. I have used 4 battery dataset . As told earlier , input are voltage current tempertaure and capacity whereas output is capacity. i trained my nn by utilizing 2 dataset as input and testing the datset from which i wish to acquire results. But i am unable to figure out the prediction as shown in fig attached from 50, 60 and 70 cycles which i wish to perform.
clc
clear all
load B0005
load B0006
load B0007
load B0018
%% load the value of capacity from B0005 B0006 B0007 and B0018
D_cycle1={B0005.cycle.type};
D_cycle2={B0006.cycle.type};
D_cycle3={B0007.cycle.type};
D_cycle4={B0018.cycle.type};
D_cycle1=D_cycle1';
D_cycle2=D_cycle2';
D_cycle3=D_cycle3';
D_cycle4=D_cycle4';
index1 = find(ismember(D_cycle1, 'discharge'))
index2 = find(ismember(D_cycle2, 'discharge'))
index3 = find(ismember(D_cycle3, 'discharge'))
index4 = find(ismember(D_cycle4, 'discharge'))
for i=1:length(index1)
capacity1(i)=B0005.cycle(index1(i,1)).data.Capacity
end
index=[]
for i=1:length(index2)
capacity2(i)=B0006.cycle(index2(i,1)).data.Capacity
end
index2=[]
for i=1:length(index3)
capacity3(i)=B0007.cycle(index3(i,1)).data.Capacity
end
index3=[]
for i=1:length(index4)
capacity4(i)=B0018.cycle(index4(i,1)).data.Capacity
end
index4=[]
capacity1 = capacity1'
capacity2 = capacity2'
capacity3 = capacity3'
capacity4 = capacity4'
capacity = [capacity1;capacity2;capacity3;capacity4]
%% load the value of voltage current and temperature from B0005 B0006 B0007 and B0018 each cycle(10 samples per cycle)
C_cycle1={B0005.cycle.type};
C_cycle2={B0006.cycle.type};
C_cycle3={B0007.cycle.type};
C_cycle4={B0018.cycle.type};
C_cycle1= C_cycle1'; %%B0005
C_cycle2= C_cycle2'; %%B0006
C_cycle3= C_cycle3'; %%B0007
C_cycle4= C_cycle4'; %%B0018
index5= find(ismember(C_cycle1,'charge')) %%5
index6= find(ismember(C_cycle2,'charge')) %%6
index7= find(ismember(C_cycle3,'charge')) %%7
index18= find(ismember(C_cycle4,'charge')) %%18
%%B0005
cnt=0
for i=1:length(index5);
for ii=1:round(length(B0005.cycle(index5(i)).data.Voltage_measured)/10):length(B0005.cycle(index5(i)).data.Voltage_measured);
cnt=cnt+1 ;
voltage1(i,cnt)=B0005.cycle(index5(i)).data.Voltage_measured(ii);
current1(i,cnt)=B0005.cycle(index5(i)).data.Current_measured(ii);
temperature1(i,cnt)=B0005.cycle(index5(i)).data.Temperature_measured(ii);
end
cnt=0;
end
index5=[]
%%B0006
for i=1:length(index6);
for ii=1:round(length(B0006.cycle(index6(i)).data.Voltage_measured)/10):length(B0006.cycle(index6(i)).data.Voltage_measured);
cnt=cnt+1 ;
voltage2(i,cnt)=B0006.cycle(index6(i)).data.Voltage_measured(ii);
current2(i,cnt)=B0006.cycle(index6(i)).data.Current_measured(ii);
temperature2(i,cnt)=B0006.cycle(index6(i)).data.Temperature_measured(ii);
end
cnt=0;
end
index=[]
%%B0007
for i=1:length(index7);
for ii=1:round(length(B0007.cycle(index7(i)).data.Voltage_measured)/10):length(B0005.cycle(index7(i)).data.Voltage_measured);
cnt=cnt+1 ;
voltage3(i,cnt)=B0007.cycle(index7(i)).data.Voltage_measured(ii);
current3(i,cnt)=B0007.cycle(index7(i)).data.Current_measured(ii);
temperature3(i,cnt)=B0007.cycle(index7(i)).data.Temperature_measured(ii);
end
cnt=0;
end
index=[]
%%B0018
for i=1:length(index18);
for ii=1:round(length(B0018.cycle(index18(i)).data.Voltage_measured)/10):length(B0018.cycle(index18(i)).data.Voltage_measured);
cnt=cnt+1 ;
voltage4(i,cnt)=B0018.cycle(index18(i)).data.Voltage_measured(ii);
current4(i,cnt)=B0018.cycle(index18(i)).data.Current_measured(ii);
temperature4(i,cnt)=B0018.cycle(index18(i)).data.Temperature_measured(ii);
end
cnt=0;
end
index=[]
%%delete 11th column from B0005 as only 10 samples are required per cycle
voltage1(:,11)=[]
current1(:,11)=[]
temperature1(:,11)=[]
%%delete 11th column from B0006 as only 10 samples are required per cycle
voltage2(:,11)=[]
current2(:,11)=[]
temperature2(:,11)=[]
%%delete 11th column from B0007 as only 10 samples are required per cycle
voltage3(:,11)=[]
current3(:,11)=[]
temperature3(:,11)=[]
%%delete 11th column from B0018 as only 10 samples are required per cycle
voltage4(:,11)=[]
current4(:,11)=[]
temperature4(:,11)=[]
%% combine the values of voltage current temperature and capacity
%%B0005
for vk1=1:size(voltage1,1)
for i = 1 : find(voltage1(vk1,:),1,'last')
D_voltage1(vk1).voltage1(i)=voltage1(vk1,i)
D_voltage1(vk1).current1(i)=current1(vk1,i)
D_voltage1(vk1).temperature1(i)=temperature1(vk1,i)
end
if vk1<=length(capacity1)
D_voltage1(vk1).capacity1=capacity1(vk1)
else
continue
end
end
%%B0006
for vk2=1:size(voltage2,1)
for i = 1 : find(voltage2(vk2,:),1,'last')
D_voltage2(vk2).voltage2(i)=voltage2(vk2,i)
D_voltage2(vk2).current2(i)=current1(vk2,i)
D_voltage2(vk2).temperature2(i)=temperature2(vk2,i)
end
if vk2<=length(capacity2)
D_voltage2(vk2).capacity2=capacity2(vk2)
else
continue
end
end
%%B0007
for vk3=1:size(voltage3,1)
for i = 1 : find(voltage3(vk3,:),1,'last')
D_voltage3(vk3).voltage3(i)=voltage3(vk3,i)
D_voltage3(vk3).current3(i)=current3(vk3,i)
D_voltage3(vk3).temperature3(i)=temperature3(vk3,i)
end
if vk3<=length(capacity3)
D_voltage3(vk3).capacity3=capacity3(vk3)
else
continue
end
end
%% B0018
for vk4=1:size(voltage4,1)
for i = 1 : find(voltage4(vk4,:),1,'last')
D_voltage4(vk4).voltage4(i)=voltage4(vk4,i)
D_voltage4(vk4).current4(i)=current4(vk4,i)
D_voltage4(vk4).temperature4(i)=temperature4(vk4,i)
end
if vk4<=length(capacity4)
D_voltage4(vk4).capacity4=capacity4(vk4)
else
continue
end
end
%%delete 169th and 170th row as data until 168 cycle is required
D_voltage1(169:170) = [];
D_voltage2(169:170) = [];
D_voltage3(169:170) = [];
D_voltage4(133:134) = [];
%%combine the values of voltage current temperature and capacity
%%B0005
for i=1:length(D_voltage1)
input1(i,:)=[D_voltage1(i).voltage1 D_voltage1(i).current1 D_voltage1(i).temperature1 D_voltage1(i).capacity1]
end
%%B0006
for i=1:length(D_voltage2)
input2(i,:)=[D_voltage2(i).voltage2 D_voltage2(i).current2 D_voltage2(i).temperature2 D_voltage2(i).capacity2]
end
%%B0007
for i=1:length(D_voltage3)
input3(i,:)=[D_voltage3(i).voltage3 D_voltage3(i).current3 D_voltage3(i).temperature3 D_voltage3(i).capacity3]
end
%%B0018
for i=1:length(D_voltage4)
input4(i,:)=[D_voltage4(i).voltage4 D_voltage4(i).current4 D_voltage4(i).temperature4 D_voltage4(i).capacity4]
end
input = [ input1; input2; input3; input4 ] %% complete input merged to form one input
output1=capacity1; %%B0005
output2=capacity2; %%B0006
output3=capacity3; %%B0007
output4=capacity4; %%B0018
%% normalize the input
for u=1:size((input),2)
normalize(:,u) = ((input(:,u)-min(input(:,u)))./(max(input(:,u))-min(input(:,u))).*2)-1;
end
input = normalize;
target = capacity;
%% divide the data
data_2 = input(169:504,:) %% 2 denotes two batteries for training(B0006 B0007)
data_1 = input(1:168,:) %% 1 denotes one battery for testing(B0005)
% Separate to training and test data
data_train = input(169:504,:)';
data_test = input(1:168,:)';
target_train=target(169:504,:)'
target_test=target(1:168,:)
%% BPNN algorithm
for pp=1:2
tic
net=newff(minmax(data_train),[20 1],{'logsig','purelin'},'trainlm');
net.trainParam.epochs=1000;
net.trainParam.goal=1e-6;
net.trainParam.lr= 0.5;
net.performFcn = 'mse';
[net, tr] = train(net, data_train, target_train);
capacity_estimated=(sim(net, data_test))';
%
capacity_error = gsubtract(target_test,capacity_estimated);
RMSE = rms(capacity_error)*100
% MSE = mse(net,target_test,SOC_estimated)
MSE=(mean((capacity_estimated-target_test).^2))*100
MAPE=(sum(abs((capacity_estimated-target_test)./(capacity_estimated)))./length(target_test))*100
MAPE2=(sum(abs((target_test-capacity_estimated)./(capacity_estimated)))./length(target_test))*100
MAE=(sum(abs(capacity_estimated-target_test))./length(target_test))*100
SD=(std(capacity_estimated-target_test))*100
check1(pp)=RMSE;
check2(pp)=MSE;
check3(pp)=MAPE;
check4(pp)=MAE;
check5(pp)= SD
check6(pp,:)=capacity_estimated
check7(pp,:)=capacity_error
end
[RMSE_BPNN,clm]=min(check1)
MSE_BPNN=min(check2(:,clm))
MAPE_BPNN=min(check3(:,clm))
MAE_BPNN=min(check4(:,clm))
SD_BPNN=min(check5(:,clm))
capacity_estimated_BPNN = check6(clm,:)
capacity_error_BPNN= check7(clm,:)
toc
  2 个评论
Shaheer Ansari
Shaheer Ansari 2020-9-29
No Sir, i wish to get the output as attached in the fig. But how i am not understanding ??
Prediction of the capacity from 50, 60 and 70 cycles. This is problem statement for me
Please see the attcahed figure for your reference

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Weather and Atmospheric Science 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by