# Power Battery Scheduling Optimization Based on Double DQN Algorithm with Constraints
## 4 Methodology
### Principal Component Analysis Algorithm  
Although deep reinforcement learning has the apparent advantage of avoiding the Bellman dimension curse, it has also been found, in various studies, that appropriate feature selection procedures can distinctly improve performance. Hence, it is necessary to downscale the dimensionality of the high\(-\)dimensional continuous state space with principal component analysis (PCA), and transform it into a simplified observation space.  
Suppose that our time series data have m rows of samples with a number of features n, denoted as the matrix \(A_{m\times n}\). The original data are averaged and decentered to obtain the matrix \(DataAdjust_{m\times n}\). Then, calculate the \(DataAdjust_{m\times n}\) covariance matrix among multiple variables.  
\[C=\left(\begin{array}{ccc}cov(x_{1},x_{1})&cov(x_{1},x_{2})&cov(x_{1},x_{3}) \ldots cov(x_{1},x_{15})\\ cov(x_{2},x_{1})&cov(x_{2},x_{2})&cov(x_{2},x_{3})\ldots cov(x_{2},x_{15})\\ cov(x_{3},x_{1})&cov(x_{3},x_{2})&cov(x_{3},x_{3})\ldots cov(x_{3},x_{15})\\ &\ldots\\ cov(x_{15},x_{1})&cov(x_{15},x_{2})&cov(x_{15},x_{3})\ldots cov(x_{15},x_{15}) \end{array}\right) \tag{23}\]  
where \(cov(X,Y)=EXY-EX*EY\), and \(EX\) and \(EY\) refer to the expectation of \(X\) and \(Y\), respectively.  
Solve the eigenvalues and eigenvectors of the covariance matrix, arrange and output the eigenvalues in descending order, and obtain the number of principal components to be extracted by calculating the contribution degree and cumulative contribution degree of the eigenvalues:  
\[|\lambda E-C|=0 \tag{24}\]  
\[\mu_{i}=\frac{\lambda_{i}}{\sum_{i=1}^{n}\lambda_{i}} \tag{25}\]  
where \(E\) is the unit matrix, \(\mu_{i}(i=1,2,\ldots,n)\) is the contribution degree, and \(\lambda_{i}(i=1,2,\ldots,n)\) is the non\(-\)negative eigenvalue of the covariance matrix \(\mathbb{C}_{m\times n}\). The calculated contribution degree and cumulative contribution degree are shown in Figure 8. The incremental contribution degree of the first three principal components exceeds 80% (84.28%), so it can be considered that the first three principal components contain more than 80% of the original data information. The multiple characteristic parameters can be replaced by eliminating correlation [37].  
PCA has the benefit of reducing the input size of the policy network in the double DQN algorithm, which can accelerate the training process. It is clear that some of the constraints associated with aging, such as resistance variation, may not be held in the model since the factor varies with too little accuracy throughout the cycle for the computational performance to reach that level [38]. Figure 8 depicts the results of the principal component analysis on the battery model, where the general state evolution can be compressed into three main components that explain 84.28% of the state information. In the overall results graph of the principal component model on the right, the elliptical confidence interval indicates the PCA score plot, which shows that the closer the sample points, the higher the similarity; the arrows correspond to the PCA loadings diagram, and the values of  
Figure 7: Double DQN neural network structure.  
the original variables, corresponding to the arrows in the direction of projection to the corresponding axes, can reflect the correlation between the variable and PC1, PC2, and PC3, respectively. For example, the current enormously contributes to PC2, while dV/dt positively correlates with PC3.