# An Indirect Identification Method for Train Basic Resistance Parameters
## 3 Algorithm
### Newton's Method  
The [PERSON]'s method is an algorithm that uses a derivative to calculate the fastest descent direction of the function value. The updated formula for the [PERSON]'s method is:  
\[\theta_{n+1}=\theta_{n}-\left[\
abla^{2}f(\theta_{n})\right]^{-1}\
abla f( \theta_{n})=\theta_{n}-{H_{n}}^{-1}\
abla f(\theta_{n}) \tag{10}\]  
where \(\theta_{n}\) and \(\theta_{n+1}\) are the parameters of the \(n\)-th and (\(n\)+1)-th iteration period. \(H_{n}=\
abla^{2}f(\theta_{n})\) is the Hessian matrix of the \(f(\theta)\). \(\
abla f(\theta_{n})\) is the gradient of the \(f(\theta)\).  
Derive the composition of \(\
abla f(\theta_{n})\) and \(H_{n}\):  
Calculate the derivative of Equation (8):  
\[\
abla f(\theta_{n})=2(v_{n}-\  
where \(c_{1}\) and \(c_{2}\) are constants, and \(0<c_{1}<c_{2}<1\). Starting from \(\alpha=1\), we search for \(\alpha\) that satisfies Equation (24) and \(\theta_{n}-\alpha\mathbf{H}_{n}{}^{-1}\
abla f(\theta_{n})\in\Theta\). The parameters update formula in this iteration period is \(\theta_{n+1}=\theta_{n}-\alpha\mathbf{H}_{n}{}^{-1}\
abla f(\theta_{n})\). Wolfe criterion preserves the descent direction of the optimal gradient and makes function value drop sufficiently under the constraint conditions.  
The ending criterion of this algorithm is:  
\[f(\theta_{n+1})<\varepsilon_{1} \tag{25}\]  
where \(\varepsilon_{1}\) is maximum acceptable deviation, as the stop condition for this algorithm.  
For non-convex problem, \(\
abla f(\theta_{n})=0\) does not mean that the optimal solution has been found. Therefore, when \(\theta_{n+1}-\theta_{n}<\Delta\theta_{T}\) and Equation (25) is not satisfied, it means falling into local optima. Where \(\Delta\theta_{T}\) means the minimum acceptable update distance in one iteration period. We expect the algorithm to jump out of the local solution and start searching again now. At this time, a parameter random updated method is used to search for a parameter that satisfies \(\theta_{n+1}\in\Theta,\theta_{n+1}-\theta_{n}>\Delta\ \hat{\mathbf{\theta}}\), where \(\Delta\ \hat{\mathbf{\theta}}\) is a parameter limitation, reducing the possibility of re-entering local solutions.  
In summary, the proposed basic resistance parameter identification based on the [PERSON]'s method is shown as Algorithm 1:  
```
1. Initialize train formation information, including number of vehicles \(J\), length \(l_{j}\), and weight \(m_{j}\) of each vehicle.
2. Set train operation data, including control force \(\bar{\mathbf{F}}\) and actual speed \(\widehat{v}\) and position \(\widehat{s}\).
3. Initialize line information, including gradient \(i\)(s) and curve \(r\)(s) at each position \(s\).
4. Initialize basic resistance parameters \(\theta_{1}\) and calculate \(f(\theta_{1})\).
5. for episode = 1,...\(n_{r}\)...\(N\)do
6. Use \(\theta_{n}\) to calculate the calculated speed \(v_{n}\).
7. Calculate the coefficient \(\mathbf{k}_{n}\), \(\mathbf{p}_{n}\), \(\mathbf{q}_{n}\), \(\mathbf{u}_{n}\).
8. Calculate the gradient \(\
abla v_{n}\) and \(\
abla f(\theta_{n})\).
9. Calculate the Hessian matrix \(\
abla^{2}\
u_{n}\) and \(\mathbf{H}_{n}\).
10. Determine if \(\theta_{n}-\mathbf{H}_{n}{}^{-1}\
abla f(\theta_{n})\in\Theta\). If so, update parameters as Equation (10). If not, find \(\alpha\) based on the Wolfe criterion and update parameters as \(\theta_{n+1}=\theta_{n}-\alpha\mathbf{H}_{n}{}^{-1}\
abla f(\theta_{n})\).
11. Calculate \(f(\theta_{n+1})\) and determine if \(f(\theta_{n+1})<\varepsilon_{1}\). If so, end for. If not, randomly search for a set of parameters \(\theta_{n+1}\) that satisfies \(\theta_{n+1}\in\Theta,\theta_{n+1}-\theta_{n}>\Delta\ \hat{\mathbf{\theta}}\).
12. End for
```  
**Algorithm 1**Basic resistance parameter identification based on the [PERSON]'s method