1 Introduction

Traffic problems have attracted considerable attentions especially traffic jams in recent decades. To investigate the properties of traffic jams, various traffic flow models including car-following models, cellular automation models, hydrodynamics models, and gas kinetics models were proposed by many scholars with different backgrounds [134].

The car-following models explain many complex physical phenomena in traffic flow. Bando et al. [2] proposed an optimal velocity model (OVM) to describe the dynamical behaviors of vehicles on a highway under a high-density condition. But the comparison with field data showed that high acceleration and unrealistic deceleration appear in OVM. To overcome this shortage, Helbing and Tilch [3] developed a generalized force model (GFM) with a velocity difference term added into the OVM. Jiang et al. [4, 5] proposed a full velocity difference model (FVDM) which considers more aspects in the car-following process than the OVM and the GFM. Xue et al. [6] extended the OVM to take the effects of the relative velocity into account. Recently, Peng et al. [7] proposed an optimal velocity difference model (OVDM) to study the effect of the optimal velocity difference.

The nonlinear waves in traffic flow have been investigated by using nonlinear analysis. Kerner et al. [8] had found the single pulse density waves in the numerical simulation with the hydrodynamic model. Kurtze and Hong [9] had shown that the single pulse density wave is a soliton. Komatsu and Sasa [10] derived modified Korteweg-de Vries (MKdV) equation from OVM to describe the traffic jams in terms of the kink density waves. Nagatani [11] improved OVM by taking the effect of the next-nearest-neighbor interaction into account and found that triangular shockwave, soliton wave, and kink-antikink wave appear. Xue [13] extended OVM based on Jiang’s full velocity difference model and discussed its stability and density waves analytically and numerically. Ge et al. [14] proposed an extended model by incorporating intelligent transportation applications and analyzed it by using linear stability theory and nonlinear analysis. The kink-antikink solutions were obtained near the critical point in the unstable region.

All the above works are based on the highway with no slope. But in real traffic, the road may not be flat. Li et al. [17] investigated the effect of the slope in a single-lane highway on the traffic flow with an extended optimal velocity model. Komada et al. [18] considered the effect of gravitational force upon traffic flow on a highway with sags, uphill, and downhill. The gravitational force was considered as an external force acting on vehicles. They investigated the traffic states and jamming transitions induced by the slope of the highway and derived the fundamental diagram for the traffic flow on the sag. Zhu et al. [20] investigated the stability and density waves of the traffic flow on a gradient highway with different slopes. But these work did not consider the effect of the relative velocity. In real traffic, the vehicle will not brake if the preceding cars are faster, even if the headway is smaller than the safe distance.

The paper is organized as follows. In Sect. 2, the model is formulated, and the stability analysis is obtained. We can see the stability condition varies with the slope and the coefficient of the relative velocity. In Sect. 3, the Burgers, KdV, and MKdV equations are derived in three types of traffic flow regions by using nonlinear analysis. The numerical simulations are given in Sect. 4.

2 Model and linear stability

We consider a situation such that many same vehicles move ahead on a single-lane highway. A gradient is positioned on the single-lane highway. Traffic flow is under a periodic boundary condition. The gravitational force acts upon vehicles on the slope of the gradient. Figure 1 shows the illustration of gravitational force acting upon a vehicle on an uphill and downhill highway, respectively [20]. The slope of the gradient is represented by \(\theta \), the gravity is \(g\), and the mass of a vehicle is \(m\). Then, the external force \(mg\sin \theta \) acts on the vehicle in a horizontal direction when a driver does not operate the brake. If a driver operates the brake, the gravitational force is reduced by the brake control.

Fig. 1
figure 1

Illustration of the gravitational force acting upon a vehicle on a gradient: uphill and downhill

The equation of motion for vehicle \(n\) is described by

$$\begin{aligned} \begin{aligned} m{\frac{\mathrm{d}^{2}x_{n}(t)}{\mathrm{d}t^{2}}}=&F(\Delta x_{n}(t),\Delta v_{n}(t)) -\mu {\frac{\mathrm{d}x_{n}(t)}{\mathrm{d}t}} \\&-mg\sin \theta B(\Delta x_{n}(t)), \end{aligned} \end{aligned}$$
(1)

where \(x_{n}(t)\) is the position of vehicle \(n\) at time \(t\), \(\Delta x_{n}(t)= x_{n+1}(t)-x_{n}(t) \) and \(\Delta v_{n}(t) = v_{n+1}(t)-v_{n}(t)\) are the headway and the velocity difference between preceding vehicle \(n+1\) and the following vehicle \(n\), respectively, \(F(\Delta x_{n}(t),\Delta v_{n}(t))\) is the driving force, \(\mu \) is the friction coefficient, and \(B(\Delta x_{n}(t))\) is the brake-control function. Here, we assume that the driving force is the function of the headway \(\Delta x_{n}(t)\) and the relative velocity \(\Delta v_{n}(t)\), because the driving force is given by drivers, and drivers adjust the driving force by considering not only the headway but also the relative velocity. The brake-control function \(B(\Delta x_{n}(t))\) is the function of the headway \(\Delta x_{n}(t)\), it represents the effect when a driver operates the brake when the headway varies [18], when \(\Delta x_{n}(t)\rightarrow 0\), the vehicle should stop to avoid collision, we assume \(B(\Delta x_{n}(t))\rightarrow 0\) for \(\Delta x_{n}(t)\rightarrow 0\). When the headway is sufficient large \((\Delta x_{n}(t)\rightarrow \infty )\), the vehicle will never brake, and the gravitational force acting on the vehicle is \(mg\sin \theta \), that means \(B(\Delta x_{n}(t))\rightarrow 1\) for \(\Delta x_{n}(t)\rightarrow \infty \). Here we consider \(F(\Delta x_{n}(t),\Delta v_{n}(t))\) is the linear function of \(\Delta x_{n}(t)\) and \(\Delta v_{n}(t)\), that is

$$\begin{aligned} F(\Delta x_{n}(t),\Delta v_{n}(t))=\alpha F(\Delta x_{n}(t))+ \beta F(\Delta v_{n}(t)). \end{aligned}$$

Then, Eq. (1) is rewritten as

$$\begin{aligned} \frac{\mathrm{d}^{2}x_{n}(t)}{\mathrm{d}t^{2}}&= \frac{\mu }{m} \left[ \frac{\alpha F(\Delta x_{n}(t))}{\mu }-\frac{mg\sin \theta B(\Delta x_{n}(t))}{\mu }\right. \nonumber \\&\left. -\,\frac{\mathrm{d} x_{n}(t)}{\mathrm{d}t}\right] +\frac{\beta }{m}F(\Delta v_{n}(t)), \end{aligned}$$
(2)

we compare Eq. (2) with the conventional FVDM. It is described by [4]

$$\begin{aligned} \frac{\mathrm{d}^{2}x_{n}(t)}{\mathrm{d}t^{2}}=a \left[ V(\Delta x_{n}(t))-\frac{\mathrm{d} x_{n}(t)}{\mathrm{d}t}\right] +\lambda a\Delta v_{n}(t). \end{aligned}$$
(3)

with

$$\begin{aligned} V(\Delta x_{n}(t)) =\frac{v_{f,\max }}{2}[\tanh (\Delta x_{n}(t)-h_{c})+ \tanh (h_{c})], \end{aligned}$$
(4)

where \(v_{f, \max }\) is the maximal velocity without any slope. When \(\theta =0\) in Eq. (2), it should reduce to Eq. (3). Therefore, we set

$$\begin{aligned}&\!\!\!\frac{\mu }{m}=a,\qquad \lambda =\frac{\beta }{\mu },\end{aligned}$$
(5)
$$\begin{aligned}&\!\!\!\frac{\alpha F(\Delta x_{n}(t))}{\mu }=\frac{v_{f,\max } }{2}[\tanh (\Delta x_{n}(t)-h_{c})\nonumber \\&\qquad \qquad \qquad \qquad +\tanh (h_{c})],\end{aligned}$$
(6)
$$\begin{aligned}&\!\!\!\frac{\beta }{m}F(\Delta v_{n}(t))=\lambda a\Delta v_{n}(t). \end{aligned}$$
(7)

In Ref. [18], the term \(\frac{mg\sin \theta B(\Delta x_{n}(t))}{\mu }\) in Eq. (2) is given by

$$\begin{aligned} \frac{mg\sin \theta B(\Delta x_{n})}{\mu }&= V_{g}(\Delta x_{n})\\&= \frac{v_{g,\max } }{2}[\tanh (\Delta x_{n}-h_{b})\nonumber \\&+\tanh (h_{b})]\nonumber \end{aligned}$$
(8)

where \(v_{g,\max }=\frac{mg\sin \theta }{\mu }\). The turning point \(h_{b}\) is the brake distance. \(v_{g,\max }\) is proportional to slope \(\sin \theta \). Thus, the effect of the slope is taken into account in \(v_{g,\max }\) of Eq. (8). And the extended optimal velocity \(V(\Delta x_{n})\) is given by [18]

$$\begin{aligned} V(\Delta x_{n}) =\frac{v_{f,\max } }{2}[\tanh (\Delta x_{n}-h_{c})+\tanh (h_{c})], \end{aligned}$$
(9)

for a highway without slope,

$$\begin{aligned} \begin{aligned} V(\Delta x_{n})=&\frac{v_{f,\max } }{2}[\tanh (\Delta x_{n}-h_{c})+\tanh (h_{c})] \\ {}&-\frac{v_{g,u,\max } }{2}[\tanh (\Delta x_{n}-h_{b,u})\\&+\tanh (h_{b,u})], \end{aligned} \end{aligned}$$
(10)

for an uphill gradient highway, and

$$\begin{aligned} V(\Delta x_{n})&= \frac{v_{f,\max } }{2}[\tanh (\Delta x_{n}-h_{c})+\tanh (h_{c})]\nonumber \\&+\,\frac{v_{g,d,\max } }{2}[\tanh (\Delta x_{n}-h_{b,d})\nonumber \\&+\,\tanh (h_{b,d})], \end{aligned}$$
(11)

for a downhill gradient highway. But the term \(h_{c}\) in Eqs. (10) and (11) is not taken the slope effect into account, and we think \(h_{c}\) should be influence by the slope. So we let the \(h_{c}\) be rewritten as \(h_{c,\theta }\), and \(h_{c,\theta }=h_{c}(1-\xi \sin \theta )\) for uphill and \(h_{c,\theta }=h_{c}(1+\eta \sin \theta )\) for downhill [20], when \(\theta =0\), \(h_{c,\theta }\) reduce to \(h_{c}\). For simplicity, here we set \(\xi =\eta =1\). \(v_{g,u,\max }\) and \(v_{g,d,\max }\) are the maximal reduced and enhanced velocity on uphill and downhill gradients which are formulated as \(v_{g,u,\max }=v_{g,d,\max }=v_{g,\max }\), when \(\theta =0\), \(v_{g,\max }=0\).

Thus, the extended full velocity difference model is obtained

$$\begin{aligned} \frac{\mathrm{d}^{2}x_{n}(t)}{\mathrm{d}t^{2}}= a \left[ V(\Delta x_{n}(t))-\frac{\mathrm{d} x_{n}(t)}{\mathrm{d}t}\right] +\lambda a\Delta v_{n}(t), \end{aligned}$$
(12)

with the extended optimal velocity

$$\begin{aligned} V(\Delta x_{n})&= \frac{v_{f,\max }\mp v_{g,\max } }{2}[\tanh (\Delta x_{n}-h_{c,\theta })\nonumber \\&+\tanh (h_{c,\theta })]. \end{aligned}$$
(13)

The sign \('-'\) represents uphill, and the sign \('+'\) represents downhill. \(h_{c,\theta }=h_{c}(1\mp \sin \theta )\) is the safety distance, the sign \('-'\) also represents uphill, and the sign \('+'\) represents downhill. When \(\theta =0\), the extended FVDM and optimal velocity are the conventional FVDM and optimal velocity.

Now we deduce the stability condition of the extended FVDM. Here we select \( v_{f,\max }=4, \frac{mg}{\mu }=1,v_{g,\max }=\sin \theta \). In order to investigate the stability of the traffic flow on an uphill/downhill highway we assume that \(N\) vehicles move homogeneously on a circular lane with length \(L\) and slope \(\theta \). The slope \(\theta \) is between \( 0^{\circ }\) and \(6^{\circ }\) according to the real highway situation. Assume

$$\begin{aligned} V_{0}(\Delta x_{n}) =\tanh (\Delta x_{n}-h_{c,\theta })+\tanh (h_{c,\theta }). \end{aligned}$$
(14)

The Eq. (13) has the following formation

$$\begin{aligned} V(\Delta x_{n}) =\frac{4\mp \sin \theta }{2}V_{0}(\Delta x_{n}). \end{aligned}$$
(15)

Then Eq. (12) can be rewritten as

$$\begin{aligned} \frac{\mathrm{d}^{2}x_{n}}{\mathrm{d}t^{2}}= a \left[ \frac{4\mp \sin \theta }{2}V_{0}(\Delta x_{n})-\frac{\mathrm{d} x_{n}}{\mathrm{d}t}\right] +\lambda a\Delta v_{n}. \end{aligned}$$
(16)

We apply the linear stability theory to analyze the traffic model described by Eq. (16). Supposing the vehicles running with the uniform headway \(h\) and optimal velocity \(V(h)\), then we get the uniform steady state solution \(x^{(0)}_{n}(t)\) for Eq. (16)

$$\begin{aligned} x^{(0)}_{n} (t) = hn +\frac{4\mp \sin \theta }{2}V_{0}(h)t. \end{aligned}$$
(17)

Assuming \(x_{n}(t)\) be a small deviation from the uniform steady state \(x^{(0)}_{n} (t): x_{n}(t) = x^{(0)}_{n} (t)+y_{n}(t)\) where \(y_{n}(t)\) is the small deviation. Inserting it and Eq. (17) into Eq. (16), then the linearized equation for \(y_{n}(t)\) is obtained from Eq. (16)

$$\begin{aligned} \begin{aligned} \frac{\mathrm{d}^{2}y_{n}}{\mathrm{d}t^{2}}=a\left[ \frac{4\mp \sin \theta }{2}V'_{0}(h)\Delta y_{n} - \frac{\mathrm{d}y_{n}}{\mathrm{d}t}\right] +\lambda a\frac{\mathrm{d}\Delta y_{n}}{\mathrm{d}t} \end{aligned} \end{aligned}$$
(18)

where \(\Delta y_{n} = y_{n+1}(t) - y_{n}(t)\), and \(V'_{0}(h)\) is the derivative of optimal velocity function \(V_{0}(h)\) at point \(\Delta x_{n}(t) = h \).

The stability condition is obtained by the same method in Ref. [6]

$$\begin{aligned} V_{0}'(h)< a\frac{1+2\lambda }{4\mp \sin \theta }. \end{aligned}$$
(19)

Then the neutral stability condition is given by

$$\begin{aligned} a_{s}=\frac{4\mp \sin \theta }{1+2\lambda }V_{0}'(h). \end{aligned}$$
(20)

The spinodal stability curves for different slopes of the gradient highway are shown in Fig. 2. Here we select \(\lambda =0.2\). From Fig. 2 we can see that the dotted lines are the spinodal stability curves, and the solid lines are coexisting curves. The areas below the spinodal stability curves are unstable regions, and the areas above the coexisting curves are stable regions. The areas between the spinodal stability curves and coexisting curves are metastable regions. Figure 2 shows the spinodal stability curves and coexisting curves for uphill and downhill on highways, respectively. In the downhill situations the stable region increases with the decrease of the slope, while in the uphill situations the stable region increases with the increase of the slope. So the stability of the traffic flow varies with the slopes of the gradient. In addition one can see that the apexes of the spinodal stability curves are the critical points \((h_{c},a_{c})\) which are corresponding to different slope \(\theta \). Obviously safety distances \(h_{c} = 4, 3.86, 3.72, 3.58\) in uphill situations and \(h_{c} = 4, 4.14, 4.28, 4.42\) in downhill situations are corresponding to slopes \(\theta = 0^{\circ },2^{\circ },4^{\circ },6^{\circ }\), respectively. The results agree with ones in Ref. [20].

Fig. 2
figure 2

Illustration of the phase diagram of the model with different \(\theta \) on a gradient uphill and downhill

Figures 3 and 4 show the phase diagram with different values of \(\lambda \) on uphill and downhill situation, respectively. Here we select \(\theta =0^{\circ },6^{\circ }\). From Figs. 3 and 4, we can see that the critical points rise with decreasing \(\lambda \). The traffic flow is more stable with the increase of \(\lambda \). In Sect. 4, we perform numerical simulations to study the impact of small perturbations to the whole traffic flow with different \(\lambda \).

Fig. 3
figure 3

Illustration of the phase diagram of the model with different \(\lambda \) on a gradient uphill

Fig. 4
figure 4

Illustration of the phase diagram of the model with different \(\lambda \) on a gradient downhill

3 Nonlinear analysis

In this section, by using the reductive perturbation method introduced in Ref. [10], we derive the Burgers, KdV, and MKdV equations in the stable, metastable, and unstable regions, respectively. For later convenience, Eq. (16) can be rewritten as

$$\begin{aligned}&\!\!\!\frac{\mathrm{d}^{2}\Delta x_{n}(t)}{\mathrm{d}t^{2}}\nonumber \\&\quad =a\Big \{\Big [\frac{4\mp \sin \theta }{2}V_{0}(\Delta x_{n+1}(t))-V_{0}(\Delta x_{n}(t))\Big ]\nonumber \\&\qquad -\,\frac{\mathrm{d}\Delta x_{n}(t)}{\mathrm{d}t}\Big \}\!+\!a\lambda \left[ \frac{\mathrm{d}\Delta x_{n+1}(t)}{\mathrm{d}t}\!-\!\frac{\mathrm{d}\Delta x_{n}(t)}{\mathrm{d}t}\right] .\nonumber \\ \end{aligned}$$
(21)

We introduce slow scales for space variable \(n\) and time variable \(t\) and define low variables \(X\) and \(T\) for \( 0 <\varepsilon \ll 1\) [21]

$$\begin{aligned} X =\varepsilon (n+bt),\qquad T =\varepsilon ^{m}t \end{aligned}$$
(22)

where \(b\) is a constant to be determined. Assuming

$$\begin{aligned} \Delta x_{n}(t) = h +\varepsilon ^{l} R(X,T). \end{aligned}$$
(23)

The values of the index \(m,l\) represent different phases of the traffic flow. Three groups of values \(m = 2,l = 1\); \(m = 3,l = 2\); \(m = 3,l = 1\) are corresponding to the stable traffic flow region, metastable traffic flow region, and unstable traffic flow region, respectively.

By Substituting Eqs. (22)-(23) into Eq. (21) and expanding to the \(m+l+1\) order of \(\varepsilon \), we obtain the following nonlinear partial differential equation:

$$\begin{aligned}&a\varepsilon ^{l+1}\Big (b-kV'_{0}(h)\Big )\partial _{X}R\nonumber \\&\quad +\,\varepsilon ^{l+2}\Big (b^{2}-\frac{ak}{2}V'_{0}(h)-ab\lambda \Big )\partial _{X}^{2}R\nonumber \\&\quad +\,\varepsilon ^{l+3}\Big (-\frac{ak}{6}V'_{0}(h)-\frac{ab\lambda }{2}\Big )\partial _{X}^{3}R\nonumber \\&\quad +\,\varepsilon ^{l+4}\Big (-\frac{ak}{24}V'_{0}(h)-\frac{ab\lambda }{6}\Big )\partial _{X}^{4}R\nonumber \\&\quad +\,\varepsilon ^{2l+1}\Big (-\frac{ak}{2}V''_{0}(h)\Big )\partial _{X}R^{2}\nonumber \\&\quad +\,\varepsilon ^{2l+2}\Big (-\frac{ak}{4}V''_{0}(h)\Big )\partial _{X}^{2}R^{2}\nonumber \\&\quad +\,\varepsilon ^{3l+1}\Big (-\frac{ak}{6}V'''_{0}(h)\Big )\partial _{X}R^{3}\nonumber \\&\quad +\,\varepsilon ^{3l+2}\Big (-\frac{ak}{12}V'''_{0}(h)\Big )\partial _{X}^{2}R^{3}\nonumber \\&\quad +\,\varepsilon ^{m+l}a\partial _{T}R+\varepsilon ^{m+l+1}(2b-\lambda a)\partial _{X}\partial _{T}R=0 \end{aligned}$$
(24)

where \(k=\frac{4\mp \sin \theta }{2}\).

First, we discuss the triangular shock waves of the traffic flow in the stable region. The nonlinear partial differential equation is obtained from Eq. (24) for \(m = 2,l = 1\).

$$\begin{aligned} \begin{aligned}&\varepsilon ^{2}a\Big (b-kV'_{0}(h)\Big )\partial _{X}R +\varepsilon ^{3}\bigg [a\partial _{T}R-\frac{ak}{2}V''_{0}(h)\partial _{X}R^{2}\\&\quad +\Big (b^{2}-\frac{ak}{2}V'_{0}(h)-ab\lambda \Big )\partial ^{2}_{X}R\bigg ]=0 \end{aligned} \end{aligned}$$
(25)

Taking \(b = kV'_{0}(h)\), the second-order terms of \(\varepsilon \) is eliminated in Eq. (25). We obtain the following partial differential equation:

$$\begin{aligned}&\partial _{T}R-kV''_{0}(h)R\partial _{X}R\nonumber \\&\quad = \left( \frac{1+2\lambda }{2}-\frac{kV'_{0}(h)}{a}\right) kV'_{0}(h)\partial ^{2}_{X}R \end{aligned}$$
(26)

In accordance with criterion Eq. (19), the coefficient of the second derivative of Eq. (26) is positive in the stable region. Therefore, in the stable region, Eq. (26) is just the Burgers equation. If \(R(X,0)\) is of compact support, then the solution \(R(X,T)\) of Eq. (26) is

$$\begin{aligned} R(X,T)&= \frac{1}{|kV''_{0}(h)|T}\left[ X-\frac{\eta _{n+1}+\eta _{n}}{2}\right] \nonumber \\&-\,\frac{\eta _{n+1}-\eta _{n}}{2|kV''_{0}(h)|T} \tanh \left[ \left( \frac{1+2\lambda }{2}\right. \right. \nonumber \\&\left. \left. \!-\,\frac{kV'_{0}(h)}{a}\right) kV'_{0}(h)\frac{(\eta _{n+1}\!-\!\eta _{n})(X\!-\xi _{n})}{4|kV''_{0}(h)|T}\right] \nonumber \\ \end{aligned}$$
(27)

where \(\xi _{n}\) are the coordinates of the shock fronts, and \(\eta _{n}\) are the coordinates of the intersections of the slopes with the \(x\)-axis \((n = 1,2,...,N)\). As \(O(\frac{1 }{T})\), \(R(X,T)\) decays to \(0\) when \(T\rightarrow +\infty \). That means any shock wave expressed by Eq. (27) in stable traffic flow region will evolve to a uniform flow when time is sufficient large. We see this phenomenon when \(\lambda = 0.2\) in Figs. 5, 6, and 7 of Sect. 4.

Fig. 5
figure 5

Space–time evolution after \(t=10,000\) and corresponding headway at \(t=10,080\) of the density wave with no slope

Fig. 6
figure 6

Space–time evolution after \(t=10,000\) and corresponding headway at \(t=10,080\) of the density wave on a uphill slope \(6^{\circ }\)

Fig. 7
figure 7

Space–time evolution after \(t=10,000\) and corresponding headway at \(t=10,080\) of the density wave on a downhill slope \(6^{\circ }\)

Second, we discuss the soliton waves of the traffic flow in the metastable region. The nonlinear partial differential equation is obtained from Eq. (24) for \(m = 3,l = 2\).

$$\begin{aligned}&\!\!\!\varepsilon ^{3}a\Big (b-kV'_{0}(h)\Big )\partial _{X}R\nonumber \\&+ \,\varepsilon ^{4}\Big (b^{2}-\frac{aV'_{0}(h)k}{2}-\lambda ab\Big )\partial ^{2}_{X}R\nonumber \\&+\,\varepsilon ^{5}a\bigg [\partial _{T}R-\left( \frac{V'_{0}(h)k}{6}+\frac{\lambda b}{2}\right) \partial ^{3}_{X}R\nonumber \\&-\,\frac{V''_{0}(h)k}{2}\partial _{X}R^{2}\bigg ]\varepsilon ^{6}\bigg [(2b-a\lambda )\partial _{X}\partial _{T}R\nonumber \\&-\,\left( \frac{a V'_{0}(h)k}{24}+\frac{\lambda ab}{6}\right) \partial ^{4}_{X}R-\frac{a V''_{0}(h)k}{4}\partial ^{2}_{X}R^{2}\bigg ]=0.\nonumber \\ \end{aligned}$$
(28)

Near the neutral stability line in the unstable region, let

$$\begin{aligned} \frac{a_{s}}{a}=1+\varepsilon ^{2} \end{aligned}$$
(29)

where \(a_{s}\) is given by Eq. (20). By taking \(b = kV'_{0}(h)\), the third- and fourth-order terms of \(\varepsilon \) are eliminated from Eq. (28), and Eq. (28) can be rewritten as

$$\begin{aligned} \begin{aligned}&\varepsilon ^{5}\left[ \partial _{T}R-f_{1}\partial ^{3}_{X}R-f_{2}R\partial _{X}R\right] \\ {}&+\varepsilon ^{6}\left[ -f_{3}\partial ^{2}_{X}R+f_{4}\partial ^{2}_{X}R^{2}+f_{5}\partial ^{4}_{X}R\right] =0 \end{aligned} \end{aligned}$$
(30)

where

$$\begin{aligned} f_{1}&= \frac{1+3\lambda }{6}kV'_{0}(h),\qquad f_{2}=kV''_{0}(h),\\ f_{3}&= -\frac{1+2\lambda }{2}kV'_{0}(h),\\ f_{4}&= \left( \frac{kV'_{0}(h)}{a}-\frac{1+2\lambda }{4}\right) kV''_{0}(h),\\ f_{5}&= kV'_{0}(h)[2kV'_{0}(h)-a\lambda ] \frac{1+3\lambda }{6a}-kV'_{0}(h)\frac{1+4\lambda }{24}. \end{aligned}$$

In order to derive the standard KdV equation with higher-order correction, we make the following transformation in Eq. (30)

$$\begin{aligned} T = \sqrt{f_{1}}T_{k}, \qquad X = - \sqrt{f_{1}}X_{k},\qquad R = \frac{1}{f_{2}} R_{k}. \end{aligned}$$
(31)

By using of Eq. (31), we obtain the standard KdV equation with higher-order correction term

$$\begin{aligned} \begin{aligned}&\partial _{T_{k}}R_{k}+\partial ^{3}_{X_{k}}R_{k}+R_{k}\partial _{X_{k}}R_{k} \\ {}&+\frac{\varepsilon }{\sqrt{f_{1}}}\left[ -f_{3}\partial ^{2}_{X_{k}}R_{k}+\frac{f_{4}}{f_{2}}\partial ^{2}_{X_{k}}R_{k}^{2}+\frac{f_{5}}{f_{1}}\partial ^{4}_{X_{k}}R_{k}\right] =0. \end{aligned} \end{aligned}$$
(32)

Next, we assume that \(R_{k}(X_{k},T_{k}) = R_{0}(X_{k},T_{k})+\varepsilon R_{1}(X_{k},T_{k})\) to consider the \(O(\varepsilon )\) correction in Eq. (32). If we ignore the \(O(\varepsilon )\) term in Eq. (32), it is just the KdV equation with the soliton solution

$$\begin{aligned} R_{0}(X_{k},T_{k}) = A \mathrm{sech }^{2} \left[ \sqrt{\frac{A}{12}}\left( X_{k} - \frac{A}{3}T_{k}\right) \right] \end{aligned}$$
(33)

where \(A\) is a free parameter. It is the amplitude of soliton solutions of the KdV equation. The perturbation term in Eq. (32) gives the condition of selecting a unique member from the continuous family of KdV solitons. In order to obtain the value of \(A\), the solvability condition is

$$\begin{aligned} (R_{0},M[R_{0}])\equiv \int \limits ^{\infty } _{-\infty }\mathrm{d}X_{k}R_{0}M[R_{0}]= 0 \end{aligned}$$
(34)

must be satisfied, here \(M[R_{0}]\) is the \(O(\varepsilon )\) term in Eq. (32). By computing the integration in Eq. (34), we obtain the value of amplitude \(A\)

$$\begin{aligned} A = \frac{21f_{1}f_{2}f_{3}}{24f_{1}f_{4} -5f_{2}f_{5}}. \end{aligned}$$
(35)

Substituting the values of \(f_{1}\)\(f_{5}\) into Eq. (35), we get the value of \(A\). Substituting each variable by the original one, we obtain the soliton solution of the headway

$$\begin{aligned} \Delta x_{n}(t)&= h +\frac{A}{f_{2}}\left( \frac{a_{s}}{a}-1\right) \nonumber \\&\mathrm{sech }^{2} \left[ \sqrt{\frac{A}{12f_{1}}\left( \frac{a_{s}}{a}-1\right) }\left( n+c_{1}t\right. \right. \nonumber \\&\left. \left. +\,\frac{A}{3}\left( \frac{a_{s}}{a}-1\right) t\right) \right] . \end{aligned}$$
(36)

Now, we have derived the soliton density wave described by the KdV equation near the neutral stability line.

Finally, we discuss the kink-antikink waves of the traffic flow in the unstable region. The critical point in Figs. 3 and 4 is the turning point where \(V''_{0}(h_{c}) = 0\). The nonlinear partial differential equation is obtained from Eq. (24) for \(m = 3,l = 1\).

$$\begin{aligned}&\varepsilon ^{2}a\Big (b-kV'_{0}(h)\Big )\partial _{X}R\nonumber \\&\quad +\,\varepsilon ^{3}\Big (b^{2}-\frac{ak V'_{0}(h)}{2}-\lambda ab\Big )\partial ^{2}_{X}R\nonumber \\&\quad +\,\varepsilon ^{4}a\left[ \partial _{T}R-\left( \frac{k V'_{0}(h)}{6}+\frac{\lambda b}{2}\right) \partial ^{3}_{X}R\right. \nonumber \\&\quad \left. -\,\frac{k V'''_{0}(h)}{3}\partial _{X}R^{3}\right] \nonumber \\&\quad +\,\varepsilon ^{5}\bigg [(2b-a\lambda )\partial _{X}\partial _{T}R-\frac{ak V'_{0}(h)+4\lambda ab}{24}\partial ^{4}_{X}R\nonumber \\&\quad -\,\frac{ak V'''_{0}(h)}{6}\partial ^{2}_{X}R^{3}\bigg ]=0. \end{aligned}$$
(37)

Supposing

$$\begin{aligned} \frac{a_{c}}{a}=1+\varepsilon ^{2} \end{aligned}$$
(38)

for \(a\) near the critical point \((h_{c},a_{c})\), where \(a_{c}=\frac{4\mp \sin \theta }{1+2\lambda }\). Let \(b = \frac{4\mp \sin \theta }{2}V'_{0}(h)\), the second- and third-order terms of \(\varepsilon \) can be eliminated from Eq. (37). Then Eq. (37) can be rewritten as

$$\begin{aligned} \begin{aligned}&\varepsilon ^{4}\left[ \partial _{T}R-g_{1}\partial ^{3}_{X}R+g_{2}\partial _{X}R^{3}\right] \\&+\varepsilon ^{5}\left[ g_{3}\partial ^{2}_{X}R+g_{4}\partial ^{2}_{X}R^{3}+g_{5}\partial ^{4}_{X}R\right] =0 \end{aligned} \end{aligned}$$
(39)

where

$$\begin{aligned} g_{1}&= \frac{1+3\lambda }{6}kV'_{0}(h),\qquad g_{2}=-\frac{k V'''_{0}(h)}{6},\\ g_{3}&= \frac{1+2\lambda }{2}kV'_{0}(h),\\ g_{4}&= \left( \frac{kV'_{0}(h)}{3a}-\frac{1+2\lambda }{12}\right) kV'''_{0}(h),\\ g_{5}&= \frac{1+3\lambda }{6a}kV'_{0}(h)[2kV'_{0}(h)-a\lambda ]-\frac{1+4\lambda }{24}kV'_{0}(h). \end{aligned}$$

In order to derive the standard mKdV equation with higher-order correction, we make the following transformation in Eq. (39)

$$\begin{aligned} T = \frac{1}{g_{1}}T_{m}, \qquad R = \sqrt{\frac{g_{1}}{g_{2}}} R_{m}. \end{aligned}$$
(40)

Then we obtain the standard MKdV equation with higher-order correction term

$$\begin{aligned} \begin{aligned}&\partial _{T_{m}}R_{m}-\partial ^{3}_{X}R_{m}+\partial _{X}R_{m}^{3} \\&+\frac{\varepsilon }{g_{1}}\left[ g_{3}\partial ^{2}_{X}R_{m}+\frac{g_{1}g_{4}}{g_{2}}\partial ^{2}_{X}R_{m}^{3}+g_{5}\partial ^{4}_{X}R_{m}\right] =0. \end{aligned} \end{aligned}$$
(41)

If we ignore the \(O(\varepsilon )\) term in Eq. (41), it is just the MKdV equation with the kink-antikink solution

$$\begin{aligned} R_{m0}(X,T_{m}) = \sqrt{B}\tanh \sqrt{\frac{B}{2}}(X -BT_{m}). \end{aligned}$$
(42)

Similar to the process of deriving the amplitude \(A\) for KdV equation, we obtain the value of propagation velocity \(B\) for the kink-antikink solution as follows:

$$\begin{aligned} B=\frac{5g_{2}g_{3}}{2g_{2}g_{5} -3g_{1}g_{4}} \end{aligned}$$
(43)

which is the same as the one in Ref. [22]. Inserting Eq. (40) into Eq. (42), we get the solution of the MKdV equation

$$\begin{aligned} R(X,T) = \sqrt{\frac{g_{1}B}{g_{2}}}\tanh \sqrt{\frac{B}{2}}(X -Bg_{1}T). \end{aligned}$$
(44)

Then we gain the kink-antikink solution of the headway

$$\begin{aligned} \Delta x_{n}&= h + \sqrt{\frac{g_{1}B}{g_{2}}(\frac{a_{c}}{a}-1)}\nonumber \\&\tanh \bigg [\sqrt{\frac{B}{2}(\frac{a_{c}}{a}\!-\!1)}(n\!+\!c_{1}t\!-\!Bg_{1}(\frac{a_{c}}{a}\!-\!1)t)\bigg ].\nonumber \\ \end{aligned}$$
(45)

And the amplitude \(C\) of the kink-antikink solution equation (45) is given by

$$\begin{aligned} C =\sqrt{\frac{g_{1}B}{g_{2}}\left( \frac{a_{c}}{a}-1\right) }. \end{aligned}$$

The kink solution represents the coexisting phase, which consists of the freely moving phase with low density and the congested phase with high density. The headway of the freely moving phase and the jammed phase is given by \(\Delta x = h_{c} +C \) and \(\Delta x = h_{c }-C\), respectively. Therefore, we get the coexisting curve in the \((\Delta x,a)\) plane (see Figs. 2, 3, 4).

4 Numerical simulations

To check the theoretical results, we carry out numerical simulations for the second-order differential equation (12). The boundary conditions selected are periodic ones. We investigate the impact of local small disturbances to the whole system with different \(\lambda \). The uniform flow is such that the vehicles move with the constant headway \(h = 4.0\), and the initial conditions are

$$\begin{aligned}&x_{n}(0) \!=\! 4.0 (n \ne 50,51),\quad x_{n}(0) \!=\! 4.0 -0.1 (n\!=\!50), \\&x_{n}(0) = 4.0 +0.1 (n=51) \end{aligned}$$

where the total number of cars is \(N = 100\), \(h_{c} = 4.0,v_{f,\max } = 4.0\), the slope \(\theta =0^{\circ }\) for no slope, and \(\theta =6^{\circ }\) for uphill and downhill.

Figure 5 shows the typical traffic patterns after a sufficiently long time \(t = 10^{4}\) with different \(\lambda \) for \(a = 2.5\) on no slope highway. Figure 5 exhibits the time evolution of the headway and correspond headway profile obtained at \(t=10,080\) for \(\lambda = 0.0,0.1,0.2\). By using the linear stability condition (19), the traffic flow is linear unstable for \(\lambda = 0.0, 0.1\). The traffic flow is stable for \(\lambda =0.2\). So the small disturbances will be amplified, and the density waves appear for \(\lambda = 0.0, 0.1\). The small disturbances dissipate for \(\lambda =0.2\) as time goes on.

When \(\lambda = 0.0\) in Fig. 5, it exhibits the space-time evolution of the headway for the coexisting phase after a sufficiently long time. The kink-antikink density waves appear as traffic jams. From the theoretic aspect, the traffic flow of \(\lambda = 0.0\) in Fig. 5 with the given parameters is in the unstable flow region, and the kink-antikink density waves appear as traffic jam.

When \(\lambda = 0.1\) in Fig. 5, it exhibits the space-time evolution of the headway after a sufficiently long time. The soliton density waves appear as traffic jams. From the theoretic aspect, the traffic flow of \(\lambda = 0.1\) in Fig. 5 with the given parameters is near the neutral stability line and in the metastable flow region and the soliton density waves appear as traffic jam.

When \(\lambda = 0.2\) in Fig. 5, it exhibits the space-time evolution of the headway for the freely moving phase after a sufficiently long time. For \(\lambda = 0.2\), the density waves disappear, and traffic flow is uniform over the whole space.

Figure 6 shows the typical traffic patterns after a sufficiently long time \(t = 10^{4}\) with different \(\lambda \) for \(a = 2.4\) on uphill highway with slope \(\theta =6^{\circ }\). Figure 6 exhibits the time evolution of the headway and correspond headway profile obtained at \(t=10,080\) for \(\lambda = 0.0,0.1,0.2\). By using the linear stability condition (19), the traffic flow is linear unstable for \(\lambda = 0.0, 0.1\). The traffic flow is stable for \(\lambda =0.2\). So the small disturbances will be amplified, and the density waves appear for \(\lambda = 0.0, 0.1\). The small disturbances dissipate for \(\lambda =0.2\) as time goes on.

When \(\lambda = 0.0\) in Fig. 6, it exhibits the space-time evolution of the headway for the coexisting phase after a sufficiently long time. The kink-antikink density waves appear as traffic jams. From the theoretic aspect, the traffic flow of \(\lambda = 0.0\) in Fig. 6 with the given parameters is in the unstable flow region, and the kink-antikink density waves appear as traffic jam.

When \(\lambda = 0.1\) in Fig. 6, it exhibits the space-time evolution of the headway after a sufficiently long time. The soliton density waves appear as traffic jams. From the theoretic aspect, the traffic flow of \(\lambda = 0.1\) in Fig. 6 with the given parameters is near the neutral stability line and in the metastable flow region, and the soliton density waves appear as traffic jam.

When \(\lambda = 0.2\) in Fig. 6, it exhibits the space-time evolution of the headway for the freely moving phase after a sufficiently long time. For \(\lambda = 0.2\), the density waves disappear, and traffic flow is uniform over the whole space.

Figure 7 shows the typical traffic patterns after a sufficiently long time \(t = 10^{4}\) with different \(\lambda \) for \(a = 2.52\) on downhill highway with slope \(\theta =6^{\circ }\). Figure 7 exhibits the time evolution of the headway and corresponds headway profile obtained at \(t=10,080\) for \(\lambda = 0.0,0.1,0.2\). By using the linear stability condition (19), the traffic flow is linear unstable for \(\lambda = 0.0, 0.1\). The traffic flow is stable for \(\lambda =0.2\). So the small disturbances will be amplified, and the density waves appear for \(\lambda = 0.0, 0.1\). The small disturbances dissipate for \(\lambda =0.2\) as time goes on. From Fig. 7, we can obtain the similar conclusions, that is, when \(\lambda = 0.0\) in Fig. 7, the traffic flow is unstable, and the kink-antikink density waves appear as traffic jam; when \(\lambda = 0.1\) in Fig. 7, the traffic flow is metastable, and the soliton density waves appear as traffic jam; for \(\lambda = 0.2\), the density waves disappear, and traffic flow is uniform over the whole space.

From Figs. 5, 6, and 7, we can see that by introducing the relative velocity which leads to the stabilization of the traffic flow.

Figure 8 shows the typical traffic patterns in the unstable region after a sufficiently long time \(t = 10^{4}\) with different \(\lambda \) for \(a = 1.5\) on uphill highway with slope \(\theta =6^{\circ }\). Figure 8 exhibits the time evolution of the headway for \(\lambda = 0.0, 0.1, 0,2, 0.3\). As same as in Fig. 5, because the linear stability condition (19) is not satisfied, the traffic flow is linear unstable. But we find that the amplitude of the density wave decreases as \(\lambda \) increases. Figure 9 shows the headway profile obtained at \(t = 10,080\) corresponding to Fig. 8, respectively. From Figs. 8 and 9, we find that in the unstable region the kink-antikink waves appear as traffic jams, and they propagate backwards.

Fig. 8
figure 8

Space–time evolution of the headway after \(t=10,000\) on a uphill slope \(6^{\circ }\)

Fig. 9
figure 9

Headway profile of the density wave at \(t=10,080\) correspond to Fig. 8 respectively

Figure 10 shows the typical traffic patterns in the unstable region after a sufficiently long time \(t = 10^{4}\) with different \(\lambda \) for \(a = 1.5\) on downhill highway with slope \(\theta =6^{\circ }\). Figure 10 exhibits the time evolution of the headway for \(\lambda = 0.0, 0.1, 0,2, 0.3\). The traffic flow is linear unstable, but we also find that the amplitude of the density wave decreases as \(\lambda \) increases. Figure 11 shows the headway profile obtained at \(t = 10,080\) corresponding to Fig. 10, respectively. From Figs. 10 and 11, we see that the kink-antikink waves appear as traffic jams, and they propagate backwards in the unstable region.

Fig. 10
figure 10

Space–time evolution of the headway after \(t=10,000\) on a downhill slope \(6^{\circ }\)

Fig. 11
figure 11

Headway profile of the density wave at \(t=10,080\) correspond to Fig. 10, respectively

5 Summary

We have investigated the effect of relative velocity upon traffic flow on a highway with uphill and downhill; we extend the model proposed by Komada et al. through taking the relative velocity into account. We obtain the stability condition of the extended FVDM by using linear stability theory. The stability condition shows that the slope and the relative velocity play an important role in influencing the stability of the traffic flow. The Burgers, KdV, and MKdV equations are obtained to describe the traffic behavior in the stable, metastable, and unstable flow region, respectively. The results show that the stability of traffic flow varies with different slopes, and the increase of \(\lambda \) leads to the stabilization of the traffic flow. When \(\lambda =0\), the results are consistent with those in previous work. The simulation results are consistent with the analytical ones.

The road visibility and mixed traffic may influence the driver’s action in real traffic. In the Ref. [33, 34], based on the optimal velocity model and FVDM, the authors considered the mixed traffic flow and visual information of the follower’s driver and proposed corresponding models. Thus, the model proposed in the paper can be developed by taking these factors into account, since the methods applied in the paper may also work in that case. However, it will be more complicated and the focus of the paper in considering the effect of relative velocity upon the traffic flow on a gradient highway. But taking visual information and mixed traffic into account will make the car-following model more realistic, so the visual information and mixed traffic in the gradient highway need to be investigated in the future.