Main Content

extract

Extract selected battery features from parsed and segmented battery test data

Since R2024b

Description

featureTable = extract(extractor,bdp) returns the feature table featureTable by extracting battery features from the parsed battery data in the batteryTestDataParser object bdp. extractor is a batteryTestFeatureExtractor object that contains the option settings for which features to extract.

When extractor specifies options requiring differential analysis (one or more of incremental capacity, differential voltage, and differential temperature), extract first calls computeDifferentialCurves and then extracts features from the resulting curves.

example

Examples

collapse all

Load the data cleanData10, which contains cleaned battery data through the tenth test cycle. It is known that Cycle 0 contains incorrectly collected data. Display the first five lines.

This example data represents only a small portion of battery life, at the beginning of the cycling test.

load clean_bat_data cleanData10
head(cleanData10,5)
    Data_Point          DateTime          Step_Index    Cycle_Index    Current    Voltage    Charge_Capacity    Discharge_Capacity    Charge_Energy    Discharge_Energy       dV/dt       Internal_Resistance    Temperature
    __________    ____________________    __________    ___________    _______    _______    _______________    __________________    _____________    ________________    ___________    ___________________    ___________

        1         13-May-2017 03:21:40        0              0            0       3.3018            0                   0                   0                 0            -1.5259e-05         0.022012            30.457   
        2         13-May-2017 03:21:40        0              0            0       3.3018            0                   0                   0                 0            -1.5259e-05         0.022012            30.457   
        3         13-May-2017 03:21:50        0              0            0       3.3018            0                   0                   0                 0            -2.6703e-05         0.022012            30.445   
        4         13-May-2017 03:22:00        0              0            0       3.3018            0                   0                   0                 0            -1.5259e-05         0.022012            30.501   
        5         13-May-2017 03:22:10        0              0            0       3.3018            0                   0                   0                 0            -8.5831e-06         0.022012            30.501   

The table includes current, voltage, and temperature measurements, as well as indices for step and cycle index. The table also includes other measurements, such as Internal_Resistance.

Create Battery Test Data Parser

Create the batteryTestDataParser object bdp. Use dot notation to assign variable names in the table to properties. In this example, the battery cycle is temperature controlled to a roughly constant value, and can be excluded from the analysis. Therefore, do not set the TemperatureVariable property name.

bdp = batteryTestDataParser(cleanData10);

bdp.CurrentVariable = "Current";
bdp.VoltageVariable = "Voltage";
bdp.TimeVariable = "DateTime";
bdp.CycleIndexVariable = "Cycle_Index";
bdp.StepIndexVariable = "Step_Index"
bdp = 
  BatteryTestDataParser with properties:

           CurrentVariable: "Current"
           VoltageVariable: "Voltage"
              TimeVariable: "DateTime"
        CycleIndexVariable: "Cycle_Index"
         StepIndexVariable: "Step_Index"
       TemperatureVariable: ""
            ExcludedCycles: [1×0 double]
                 Tolerance: 5.0000e-05
     NumInterpolatedPoints: 1000
                WindowSize: 10
               IsSegmented: 0
    IsTemperatureAvailable: 0

bdp contains the properties that you set, and ignores other table columns.

Exclude Known Erroneous Cycle Data

Exclude Cycle-0 data from processing by setting the ExcludedCycles property to 0.

bdp.ExcludedCycles = 0;

Segment Data

Segment the data so that it can be analyzed by cycle and step.

bdpseg = segmentData(bdp);
head(bdpseg,5)
    Data_Point          DateTime          Step_Index    Cycle_Index    Current    Voltage    Charge_Capacity    Discharge_Capacity    Charge_Energy    Discharge_Energy       dV/dt       Internal_Resistance    Temperature    CyclingModes    CyclingPhases    IsValid
    __________    ____________________    __________    ___________    _______    _______    _______________    __________________    _____________    ________________    ___________    ___________________    ___________    ____________    _____________    _______

        1         13-May-2017 03:21:40        0              0            0       3.3018            0                   0                   0                 0            -1.5259e-05         0.022012            30.457        Undefined        Undefined       false 
        2         13-May-2017 03:21:40        0              0            0       3.3018            0                   0                   0                 0            -1.5259e-05         0.022012            30.457        Undefined        Undefined       false 
        3         13-May-2017 03:21:50        0              0            0       3.3018            0                   0                   0                 0            -2.6703e-05         0.022012            30.445        Undefined        Undefined       false 
        4         13-May-2017 03:22:00        0              0            0       3.3018            0                   0                   0                 0            -1.5259e-05         0.022012            30.501        Undefined        Undefined       false 
        5         13-May-2017 03:22:10        0              0            0       3.3018            0                   0                   0                 0            -8.5831e-06         0.022012            30.501        Undefined        Undefined       false 

The software adds columns for Step_Index, Cycle_Index, and IsValid. Because the data begins with Cycle 0 and you are excluding this cycle, IsValid is set to false for this data. The data table encapsulated by bdp also contains these new columns.

Create Battery Test Feature Extractor

Create a batteryTestFeatureExtractor object bft.

bft = batteryTestFeatureExtractor()
bft = 
  BatteryTestFeatureExtractor with properties:

       CyclingPhase: "Charge"
         Statistics: 1
    CycleCumulative: 1
                 CC: 1
                 CV: 1
               CCCV: 1
                 IC: 1
                 DV: 0
                 DT: 0

Using dot notation, specify that both charge and discharge cycles be used for features. Accept the default settings for the feature set selections.

bft.CyclingPhase = "Both";

Extract Features

Use extract to extract the specified features into the feature table ft.

ft = extract(bft,bdp);

Display the first five rows of ft.

head(ft,5)
    Cycle_Index    Charge_cumulativeCapacity    Charge_cumulativeEnergy    Charge_duration    Charge_startVoltage    Charge_Voltage_max    Charge_Voltage_min    Charge_Voltage_mean    Charge_Voltage_std    Charge_Voltage_skewness    Charge_Voltage_kurtosis    Charge_Current_max    Charge_Current_min    Charge_Current_mean    Charge_Current_std    Charge_Current_skewness    Charge_Current_kurtosis    Charge_Step5_IC_peak    Charge_Step5_IC_peakWidth    Charge_Step5_IC_peakLocation    Charge_Step5_IC_peakProminence    Charge_Step5_IC_peaksArea    Charge_Step5_IC_peakLeftSlope    Charge_Step5_IC_peakRightSlope    Charge_Step5_IC_area    Charge_Step5_IC__max    Charge_Step5_IC__min    Charge_Step5_IC__mean    Charge_Step5_IC__std    Charge_Step5_IC__skewness    Charge_Step5_IC__kurtosis    Charge_Step5_CC_duration    Charge_Step5_CC_currentMedian    Charge_Step5_CC_slope    Charge_Step5_CC_energy    Charge_Step5_CC_skewness    Charge_Step5_CC_kurtosis    Charge_Step6_IC_peak    Charge_Step6_IC_peakWidth    Charge_Step6_IC_peakLocation    Charge_Step6_IC_peakProminence    Charge_Step6_IC_peaksArea    Charge_Step6_IC_peakLeftSlope    Charge_Step6_IC_peakRightSlope    Charge_Step6_IC_area    Charge_Step6_IC__max    Charge_Step6_IC__min    Charge_Step6_IC__mean    Charge_Step6_IC__std    Charge_Step6_IC__skewness    Charge_Step6_IC__kurtosis    Charge_Step6_CC_duration    Charge_Step6_CC_currentMedian    Charge_Step6_CC_energy    Charge_Step6_CC_skewness    Charge_Step6_CC_kurtosis    Charge_Step9_IC_peak    Charge_Step9_IC_peakWidth    Charge_Step9_IC_peakLocation    Charge_Step9_IC_peakProminence    Charge_Step9_IC_peaksArea    Charge_Step9_IC_peakLeftSlope    Charge_Step9_IC_peakRightSlope    Charge_Step9_IC_area    Charge_Step9_IC__max    Charge_Step9_IC__min    Charge_Step9_IC__mean    Charge_Step9_IC__std    Charge_Step9_IC__skewness    Charge_Step9_IC__kurtosis    Charge_Step9_CC_duration    Charge_Step9_CC_currentMedian    Charge_Step9_CC_energy    Charge_Step9_CC_skewness    Charge_Step9_CC_kurtosis    Charge_Step9_CV_duration    Charge_Step9_CV_voltageMedian    Charge_Step9_CV_slope    Charge_Step9_CV_energy    Charge_Step9_CV_skewness    Charge_Step9_CV_kurtosis    Charge_Step9_CCCV_energyRatio    Charge_Step9_CCCV_energyDifference    Charge_Step5_CC_tInv    Discharge_cumulativeCapacity    Discharge_cumulativeEnergy    Discharge_duration    Discharge_startVoltage    Discharge_Voltage_max    Discharge_Voltage_min    Discharge_Voltage_mean    Discharge_Voltage_std    Discharge_Voltage_skewness    Discharge_Voltage_kurtosis    Discharge_Current_max    Discharge_Current_min    Discharge_Current_mean    Discharge_Current_std    Discharge_Current_skewness    Discharge_Current_kurtosis    Discharge_Step10_IC_peak    Discharge_Step10_IC_peakWidth    Discharge_Step10_IC_peakLocation    Discharge_Step10_IC_peakProminence    Discharge_Step10_IC_peaksArea    Discharge_Step10_IC_peakLeftSlope    Discharge_Step10_IC_peakRightSlope    Discharge_Step10_IC_area    Discharge_Step10_IC__max    Discharge_Step10_IC__min    Discharge_Step10_IC__mean    Discharge_Step10_IC__std    Discharge_Step10_IC__skewness    Discharge_Step10_IC__kurtosis    Discharge_Step10_CC_duration    Discharge_Step10_CC_currentMedian    Discharge_Step10_CC_slope    Discharge_Step10_CC_energy    Discharge_Step10_CC_skewness    Discharge_Step10_CC_kurtosis    Discharge_Step10_CC_tInv    Discharge_Step10_CV_duration    Discharge_Step10_CV_voltageMedian    Discharge_Step10_CV_slope    Discharge_Step10_CV_energy    Discharge_Step10_CV_skewness    Discharge_Step10_CV_kurtosis    Discharge_Step10_CCCV_energyRatio    Discharge_Step10_CCCV_energyDifference    ___________    _________________________    _______________________    _______________    ___________________    __________________    __________________    ___________________    __________________    _______________________    _______________________    __________________    __________________    ___________________    __________________    _______________________    _______________________    ____________________    _________________________    ____________________________    ______________________________    _________________________    _____________________________    ______________________________    ____________________    ____________________    ____________________    _____________________    ____________________    _________________________    _________________________    ________________________    _____________________________    _____________________    ______________________    ________________________    ________________________    ____________________    _________________________    ____________________________    ______________________________    _________________________    _____________________________    ______________________________    ____________________    ____________________    ____________________    _____________________    ____________________    _________________________    _________________________    ________________________    _____________________________    ______________________    ________________________    ________________________    ____________________    _________________________    ____________________________    ______________________________    _________________________    _____________________________    ______________________________    ____________________    ____________________    ____________________    _____________________    ____________________    _________________________    _________________________    ________________________    _____________________________    ______________________    ________________________    ________________________    ________________________    _____________________________    _____________________    ______________________    ________________________    ________________________    _____________________________    __________________________________    ____________________    ____________________________    __________________________    __________________    ______________________    _____________________    _____________________    ______________________    _____________________    __________________________    __________________________    _____________________    _____________________    ______________________    _____________________    __________________________    __________________________    ________________________    _____________________________    ________________________________    __________________________________    _____________________________    _________________________________    __________________________________    ________________________    ________________________    ________________________    _________________________    ________________________    _____________________________    _____________________________    ____________________________    _________________________________    _________________________    __________________________    ____________________________    ____________________________    ________________________    ____________________________    _________________________________    _________________________    __________________________    ____________________________    ____________________________    _________________________________    ______________________________________
         1                  1.0912                      3.8091                 1837.2               3.2889                 3.6004                3.2889                3.5127                0.076284                -0.26567                    2.0059                   6.6013               0.064569               2.1754                 2.3511                  0.94798                    2.3503                    5.7922                   0.0035305                       3.5354                           1.0442                        0.017545                        455.73                            -156.9                      0.47685                  5.7922                  0.20359                 1.8285                   1.8935                    0.92129                      2.2916                       260.48                        6.5999                           NaN                   1.6668                     -1.1606                     3.3064                    205.55                  0.00032391                       3.4848                           202.29                         0.05434                      5.7674e+05                       -6.4963e+05                    0.29419                  205.55                 -155.16                  5.5596                   23.701                    1.2326                       34.729                       289.56                         3.96                         1.1145                    0.23118                      1.8814                     2.995                   0.038488                        3.4137                           2.5201                        0.086013                        114.72                           -27.805                      0.17715                   2.995                 0.14983                  0.83697                 0.83355                    1.2133                       3.0573                       579.99                          1.1                        0.61058                      1.401                      4.4162                      610.01                        3.6002                     -0.00073938                 0.11516                    1.8343                       5.892                        5.3022                             0.49542                            NaN                      1.0858                         3.3053                    1186.2                  3.3297                   3.3297                   1.9996                    2.7518                   0.46306                    -0.69494                       1.7957                    -0.021996                 -4.4004                  -3.6203                   1.6577                      1.6544                         3.741                       6.7938                        0.11998                            3.1504                               6.6838                             0.53179                            39.956                               -124.97                           1.0703                      6.7938                     -0.014509                    0.80702                      1.5432                        2.3837                            7.765                            875.8                             -4.4                          0.00030465                      3.2745                         -1.363                          3.6784                        760.95                        300.43                            1.9999                         0.00093293                     0.016935                       -2.3131                          9.8519                            193.36                                  3.2575                
         2                  1.1011                      3.8354                 1846.4               3.1837                 3.6004                3.1837                3.5029                0.088036                -0.73117                    3.6177                   6.6015                0.05476               2.2175                 2.3674                  0.90434                    2.2705                     5.836                   0.0030023                       3.5316                          0.68589                        0.016269                        213.15                           -250.16                      0.44404                   5.836                  0.13184                 1.2512                   1.6785                      1.544                      3.9793                       242.78                        6.6003                      0.013906                   1.5463                    -0.96454                     2.5803                    246.89                  0.00025026                       3.4836                           243.78                        0.044018                      7.4402e+05                       -9.5271e+05                    0.29516                  246.89                 -171.99                   5.735                   24.116                    1.8446                       43.434                        289.6                         3.96                         1.1142                     0.3299                      1.9009                    3.2962                   0.035999                        3.4169                           2.8106                        0.092468                        74.392                           -44.561                      0.18327                  3.2962                 0.14598                   0.8614                 0.89265                    1.2528                       3.1663                          600                          1.1                         0.6313                     1.5064                      4.9068                         590                        3.6002                     -0.00069836                 0.10311                    2.1156                      7.6634                        6.1227                             0.52819                         0.7253                      1.0876                         3.3111                    1191.7                  3.3199                   3.3199                   1.9996                    2.7293                   0.46952                    -0.62182                        1.679                    -0.022033                 -4.4006                  -3.5379                   1.7243                      1.4985                         3.249                       6.7992                        0.11954                            3.1471                               6.6772                             0.54781                            38.502                               -127.78                           1.0721                      6.7992                     -0.019529                    0.81345                      1.5523                        2.3741                           7.7121                           877.32                             -4.4                          0.00030269                      3.2804                        -1.3602                          3.6885                        761.05                        304.33                            1.9999                         0.00088585                     0.016846                       -2.3857                          10.332                            194.73                                  3.2635                
         3                  1.1268                      3.9237                 1851.9               3.0906                 3.6004                3.0906                3.4951                0.099424                  -1.171                    5.1736                   6.6013               0.051631               2.3933                 2.4829                  0.78503                    1.9785                    5.6697                    0.016443                       3.5325                          0.78925                        0.085603                        26.599                           -25.654                      0.52629                  5.6697                 0.091083                 1.1412                   1.7003                     1.6585                      4.2436                       287.82                        6.5999                      0.016691                   1.8347                     -1.0243                     2.7645                    267.61                  0.00023141                       3.4833                           264.23                        0.045419                      1.6242e+06                        -6.446e+05                     0.2942                  267.61                 -123.61                  5.7734                   24.827                     3.291                       46.434                       289.61                         3.96                         1.1141                     0.3022                      1.9029                    3.2141                     0.0366                         3.415                           2.7198                        0.094457                        94.884                            -39.55                      0.18629                  3.2141                 0.13535                  0.87375                 0.91302                    1.2725                       3.2106                       609.99                          1.1                        0.64142                     1.6531                      5.6046                         580                        3.6002                     -0.00073569                0.097314                    1.6633                      5.2229                        6.5913                             0.54411                         6.0581                      1.0972                         3.3433                    1198.5                  3.4424                   3.4424                   1.9996                    2.7497                   0.47889                     -0.6258                       1.7303                    -0.022201                 -4.4005                  -3.5499                   1.7126                      1.5172                        3.3065                        6.784                        0.12162                            3.1536                               6.7494                             0.53094                            40.957                               -120.68                           1.0818                       6.784                     -0.021832                    0.75001                      1.5018                        2.5311                           8.5466                           885.19                             -4.4                          0.00030422                      3.3127                        -1.3307                          3.7906                        760.88                        303.26                            1.9999                         0.00094755                     0.016758                       -2.4133                          9.9184                            197.68                                   3.296                
         4                  1.1285                      3.9265                   1854               3.0425                 3.6004                3.0425                3.4886                 0.10833                 -1.4374                    6.0532                   6.6018               0.053802               2.4518                 2.4836                  0.73677                    1.9175                    5.7409                    0.009714                        3.526                          0.75229                        0.050046                        78.213                           -36.467                      0.51466                  5.7409                 0.077484                 1.0179                   1.6221                     1.8547                      4.9973                       281.47                           6.6                      0.017771                   1.7912                     -0.8937                     2.4507                    284.71                   0.0002261                        3.483                           281.22                        0.048138                      1.1692e+06                       -1.2026e+06                    0.29395                  284.71                 -102.46                  5.8213                   24.828                    3.8645                       49.474                       289.63                         3.96                          1.114                    0.43977                      1.9856                    3.3632                   0.038079                        3.4125                           2.8494                        0.095633                        120.64                           -33.348                      0.18632                  3.3632                 0.13527                  0.88511                 0.93232                    1.2628                       3.1856                          610                          1.1                        0.64157                     1.5256                      4.9396                      575.01                        3.6002                     -0.00071665                0.094806                    1.8886                      6.4618                        6.7672                             0.54677                         8.4167                       1.097                         3.3423                    1197.7                  3.4182                   3.4182                   1.9996                     2.735                     0.481                    -0.57359                       1.6517                    -0.022873                 -4.4004                  -3.5176                    1.739                      1.4618                        3.1404                       6.7845                        0.12091                            3.1502                               6.7385                             0.54007                            40.191                               -127.15                           1.0815                      6.7845                    -0.0079904                    0.76353                      1.5115                        2.4977                            8.364                           884.95                             -4.4                          0.00029715                      3.3115                        -1.2773                          3.5595                        765.91                        302.74                                 2                         0.00085562                     0.016897                       -2.5036                          11.241                            195.99                                  3.2946                
         5                  1.1089                      3.8666                 1840.9               3.2517                 3.6004                3.2517                3.5057                0.080206                -0.28465                    2.2471                   6.6012               0.054041               2.2484                 2.3956                  0.88864                    2.2173                    5.8282                   0.0027343                       3.5326                          0.87356                        0.013627                        462.29                           -321.82                      0.51181                  5.8282                  0.17263                 1.6991                   1.9009                     1.0239                      2.4585                       279.64                           6.6                           NaN                   1.7887                     -1.0714                     3.0945                    266.87                  0.00025179                       3.4829                            263.3                        0.046322                      1.4141e+06                       -5.3883e+05                    0.29153                  266.87                 -99.447                  5.7487                    25.36                    3.6798                       43.967                        289.6                         3.96                         1.1139                    0.31689                      1.8507                    3.3702                   0.036075                        3.4174                           2.8835                        0.097699                        65.705                           -57.197                      0.18785                  3.3702                 0.14183                  0.87871                 0.93491                    1.2898                       3.2579                          615                          1.1                        0.64671                     1.6549                      5.3183                      575.01                        3.6002                     -0.00070527                 0.09545                    2.0023                      7.0948                        6.7754                             0.55126                            NaN                      1.0899                         3.3189                    1191.5                   3.319                    3.319                   1.9957                    2.7191                   0.47534                    -0.57212                       1.6031                    -0.022711                 -4.4004                  -3.5032                   1.7484                      1.4358                        3.0653                       6.7791                        0.12181                            3.1534                               6.6528                             0.53007                            40.813                               -124.92                           1.0744                      6.7791                     -0.013775                    0.81196                      1.5549                        2.3807                           7.7342                           879.13                             -4.4                          0.00030022                      3.2881                        -1.3286                          3.5449                        760.85                        302.39                            1.9999                         0.00089706                     0.017049                        -2.309                          9.7528                            192.86                                   3.271                

The feature table starts at Cycle 1.

Plot the charge voltage kurtosis.

plot(ft.Cycle_Index,ft.Charge_Voltage_kurtosis)
title("Charge Voltage Kurtosis by Cycle")

Figure contains an axes object. The axes object with title Charge Voltage Kurtosis by Cycle contains an object of type line.

Input Arguments

collapse all

Feature extraction options, specified as a batteryTestFeatureExtractor object. The options are specified by the properties in extractor.

Segmented and parsed battery test data, specified as a batteryTestDataParser object.

Output Arguments

collapse all

Feature table, returned as a table. The feature table contains the features specified in extractor. For more information about the features that you can extract, see the Properties section in batteryTestFeatureExtractor.

Version History

Introduced in R2024b