## 4 Controller Design
### RBFNN Adaptive Terminal Sliding Mode Controller  
The additional resistance interference caused by the route section in the actual operation process of the train is likely to be large, especially under the route conditions of large slope and curve, which will cause inaccurate train control and other problems. Therefore, RBFNN is used to learn and evaluate the additional resistance interference to solve the problem of large switching gain caused by uncertain factors such as environment effect,modeling error, and model simplification so as to enhance the anti-interference ability of the system. RBFNN is an efficient and locally convergent forward network, so it has a fast convergence speed. It has been proved theoretically that it can approximate smooth nonlinear functions with any accuracy and can be regarded as a universal approximator [31, 32]. The structure of RBFNN is shown in Figure 2, which is composed of a three layers forward network, including input layer, hidden layer, and output layer. The mapping from input to output is nonlinear, while the mapping from hidden layer to output space is linear, which speeds up the learning speed and effectively avoids the local minimum problem where \(\mathbf{x}=\left[x_{1},x_{2},\cdots,x_{n}\right]^{\mathrm{T}}\subset R^{n}\) is network input, \(n\) is the dimension of the input vector, \(\mathbf{W}=\left[w_{1},w_{2},\cdots,w_{m}\right]^{\mathrm{T}}\) is an adjustable weight parameter vector, \(m\) is the number of neurons in the hidden layer, \(\mathbf{h}(\mathbf{x})=\left[h_{1}(x),h_{2}(x),\cdots,h_{m}(x)\right]^{\mathrm{T}}\) is the output vector of Gaussian function for the hidden layer, and \(h_{j}(\mathbf{x})\) is the output of the jth neuron in the hidden layer can be expressed as follows:  
\[h_{j}(\mathbf{x})=\exp\left(-\frac{\left\|\mathbf{x}-\mathbf{c}_{j}\right\|^{2}}{2b_{j}^{ 2}}\right)\qquad j=1,2,\cdots,m \tag{24}\]  
where \(\|\cdot\|\)is a Euclidean norm, \(\mathbf{c}_{j}\)and \(b_{j}\) are the center parameter vector and width parameter of Gaussian function of the jth neuron in the hidden layer, and \(b_{j}\) is a number greater than zero. The output of the RBFNN output layer is as follows:  
\[f(\mathbf{x})=\mathbf{W}^{\mathrm{n}}\mathbf{h}(\mathbf{x})+\varepsilon(\mathbf{x}) \tag{25}\]  
where \(\mathbf{W}^{\prime}\) is the 'optimal' weight vector that minimizes \(\mathbf{W}^{\prime}\) among all the estimated values of the weight vector \(\mathbf{W}\), in which  
\[\mathbf{W}^{\prime}=\arg\min_{W\in R^{n}}\left\{\sup_{x\in\Theta_{x}}\left|f(\mathbf{ x})-\mathbf{W}^{T}\mathbf{h}(\mathbf{x})\right|\right\} \tag{26}\]  
where \(\varepsilon(\mathbf{x})\) is a bounded approximation error; that is, there is a small normal number \(\varepsilon^{*}\) satisfying inequality \(\left|\varepsilon(\mathbf{x})\right|\leq\varepsilon^{*}\). The performance index of the RBFNN output layer is as follows:  
\[E=0.5[f(\mathbf{x})-f_{d}(\mathbf{x})]^{2} \tag{27}\]  
Figure 2: Structure of RBFNN. where \(f_{d}(\mathbf{x})\) is desired output. In RBFNN structure, reasonable selection of hidden layer node center, basis function width, and weight parameters can improve convergence speed and approximation accuracy. According to the gradient descent method, the iterative algorithm of output weight, node center, and node basis function width parameters is as follows:  
\[\Delta w_{j}(t)=\chi[f(\mathbf{x})-f_{d}(\mathbf{x})]h_{j} \tag{28}\]  
\[w_{j}(t)=w_{j}(t-1)+\Delta w_{j}(t)+\alpha\big{[}w_{j}(t-1)-w_{j}(t-2)\big{]} \tag{29}\]  
\[\Delta b_{j}=\chi[f(\mathbf{x})-f_{d}(\mathbf{x})]w_{j}\frac{\big{\|}\mathbf{x}-\mathbf{c}_{j} \big{\|}^{2}}{b_{j}^{3}} \tag{30}\]  
\[b_{j}(t)=b_{j}(t-1)+\Delta b_{j}+\alpha\big{[}b_{j}(t-1)-b_{j}(t-2)\big{]} \tag{31}\]  
\[\Delta c_{ji}=\chi[f(\mathbf{x})-f_{d}(\mathbf{x})]w_{j}h_{j}\frac{x_{i}-c_{ji}}{b_{j} ^{2}} \tag{32}\]  
\[f(\mathbf{x})=\mathbf{W}^{\mathrm{n}}\mathbf{h}(\mathbf{x})+\varepsilon(\mathbf{x}) \tag{25}\]0  
where \(\chi\in(0,1)\) is the learning rate, and \(\alpha\in(0,1)\) is the momentum factor. RBFNN input is \(x=\big{[}