【[Matlab]读取8个电池老化数据集,并根据论文提取相应特征】

@[Matlab]循环读取8个电池老化数据集,并根据论文提取相应特征

数据下载

牛津大学电池智能实验室电池老化公开数据集

Matlab代码

clear;close all;clc;
%% 
load('Oxford_Battery_Degradation_Dataset_1.mat');
for i=1:8
    Testdata = eval( [ 'Cell' ,num2str(i) ] );
    names = fieldnames(Testdata);
    index1 = [ 'Cell' ,num2str(i) ];
    value1 = 3.55;
    value2 = 3.75;
    value3 = 3.8;
    value4 = 4.15;
    feature1 = [];
    feature2 = [];
    lable1 = [];
    %%
    for name = 1:length(names)
        index = names(name);
        data_name_C1ch_t = strcat(index1,'.',index,'.C1ch.t');
        data_name_C1ch_v = strcat(index1,'.',index,'.C1ch.v');
        data_name_C1ch_q = strcat(index1,'.',index,'.C1ch.q');

        Data_C1ch_t = eval(data_name_C1ch_t{1});
        Data_C1ch_v = eval(data_name_C1ch_v{1});
        Data_C1ch_q = eval(data_name_C1ch_q{1});

        data = [Data_C1ch_v Data_C1ch_t];

        index2 = find(data(:,1)>=value1 & data(:,1)<=value2);
        data1 = data(index2,:);
        Seq_min = min(data1(:,2));
        Seq_max = max(data1(:,2));
        data2 = Seq_max-Seq_min;
        feature1 = [feature1;data2];
        
        index3 = find(data(:,1)>=value3 & data(:,1)<=value4);
        data3 = data(index3,:);
        Seq_min1 = min(data3(:,2));
        Seq_max1 = max(data3(:,2));
        data4 = Seq_max1-Seq_min1;
        feature2 = [feature2;data4];

        Seq_max_C1ch_q=max(Data_C1ch_q(:,1));
        lable1 =[lable1;Seq_max_C1ch_q];

    end
    %% 
     clear data data1 data2 Data_C1ch_t Data_C1ch_v Data_C1ch_q Testdata value1;
     clear data3 data4 Seq_min1 Seq_max1  value3 value4;
     clear data_name_C1ch_t data_name_C1ch_v data_name_C1ch_q  value2;
     clear Seq_max_C1ch_q Seq_min Seq_max index names name index1 index3 index2;
     s = ['cell_feature' int2str(i) '=[feature1 feature2];']; %将data数据重命名为a(i)
     eval(s); %合并字符串函数 
     s1 = ['cell_lable' int2str(i) '=lable1;']; %将data数据重命名为a(i)
     eval(s1); %合并字符串函数 
     clear feature1 feature2 lable1 ;
end
 clear i s s1 Cell1 Cell2 Cell3 Cell4 Cell5 Cell6 Cell7 Cell8;
 %% 
 

结果

【[Matlab]读取8个电池老化数据集,并根据论文提取相应特征】_第1张图片

引用文献

[]: 王萍,弓清瑞,张吉昂,程泽.一种基于数据驱动与经验模型组合的锂电池在线健康状态预测方法[J].电工技术学报,2021,36(24):5201-5212.DOI:10.19595/j.cnki.1000-6753.tces.210385.quick-reference.
[2]:Birkl C R. Diagnosis and prognosis of degradation in lithium-ion batteries[D]. Oxford: University of Oxford, 2017.

你可能感兴趣的:(matlab,开发语言,算法)