## 3 Modeling Methodology
### MPC-Based CLC Control Strategy by Considering Preceding Vehicle Switching
#### 3.2.3 Objective Functions with Preceding Vehicle Switching of CLC Control Strategy
Figure 5:1  
Figure 5:2Similar to the longitudinal distance tracking errors associated with vehicles M and A, the condition of the preceding vehicles switching should be considered in longitudinal speed tracking errors as presented in (35) and (36). Figure 5:3  
Figure 5:4  
where \(\tilde{ev}_{M}(k)\) and \(\tilde{ev}_{A}(k)\) represent the improved longitudinal speed tracking errors of vehicles M and B, C, and vehicles A and B, M, respectively. (3) Comfort  
Acceleration is an important indicator of driving comfort. An acceleration with small fluctuations leads to a better driving experience. Thus, considering the comfort of the vehicles, we need to constraint the control quantities like \(a_{M}(k)\) and \(a_{A}(k)\). Furthermore, jerk is another important factor that influences ride comfort. In order to improve the ride comfort, the jerk values of all the vehicles should be as small as possible [43]. All jerk values in this work are expressed based on the variations of the control quantities within a single step and are mathematically expressed in (37) and (38). Figure 5:5  
\[j_{A}(k)=[a_{A}(k+1)-a_{A}(k)]/dt,\;k=1,2,\ldots,N-2  
All the constraints of the optimization model are summarized as follows:  
\[\left\{ \begin{array}{l}x_{M}(s+k+1)=x_{M}(s+k)+v_{M}(s+k)dt+a_{M}(s+k)dt^{2}/2,k =1,2,\ldots,N-1\\ v_{M}(s+k+1)=v_{M}(s+k)+a_{M}(s+k)dt,k=1,2,\ldots,N-1\\ x_{A}(s+k+1)=x_{A}(s+k)+v_{A}(s+k)dt+a_{A}(s+k)dt^{2}/2,k=1,2,\ldots,N-1\\ v_{A}(s+k+1)=v_{A}(s+k)+a_{A}(s+k)dt,k=1,2,\ldots,N-1\\ S_{CM}(s+k)\geq S_{\text{sdf},CM}(s+k)LPFA(s+k),k=1,2,\ldots,N\\ S_{BM}(s+k)\geq S_{\text{sdf},BM}(s+k)LPFB(s+k),k=1,2,\ldots,N\\ S_{BA}(s+k)\geq S_{\text{sdf},BA}(s+k)LPFA(s+k),k=1,2,\ldots,N\\ S_{MA}(s+k)\geq S_{\text{sdf},MA}(s+k)LPFB(s+k),k=1,2,\ldots,N\\ 0<v_{M}(s+k)\leq\left\{\begin{array}{l}v_{\text{Omax}}\quad\text{if}\ \ 0\leq y_{M}(s+k)\leq d/2\\ v_{\text{Tmax}}\qquad\text{otherwise}\end{array}\right.,k=1,2,\ldots,N\\ 0<v_{A}(s+k)\leq v_{Tmax},k=1,2,\ldots,N\\ a_{\text{min}}\leq a_{M}(s+k)\leq a_{max},k=1,2,\ldots,N-1\\ a_{\text{min}}\leq a_{A}(s+k)\leq a_{max},k=1,2,\ldots,N-1\\ \end{array} \right. \tag{40}\]  
Since the vehicle motion state prediction model used in this study is a classical linear vehicle kinematic model, the online optimization problem of the MPC controller based on this model is a nonlinear, convex optimization problem (its constraint function is also composed of a series of linear expressions). Therefore, a suitable rolling time domain optimization tool can be used to optimize and iterate the deviation amount within a finite rolling time interval. Here, the discrete nonlinear optimization problem presented in (39) and (40) in the receding horizon can be solved with the help of the advanced optimization solver pyomo in Python [44]. The state quantities at time \(s\) are used as the state values of the first step for performing N-step prediction, i.e., \({}^{*}\)(\(s+1\)) equals \({}^{*}\)(\(s\)). By solving this model predictive optimization problem, the desired control inputs of the two vehicles in each control period are obtained and active cooperation can be implemented according to the desired control inputs. Please note that a control sequence containing N-1 control variables can be gained by solving the model predictive optimization problem. However, only the first element of the control sequence is selected as the final desired control input.