# Ecological Dynamics and Evolution of Cooperation in Vehicular Ad Hoc Networks
## 4 Dynamical Analysis  
Equilibrium points in replicator Equation (8) are obtained by setting them to zero. In our system, this corresponds to an internal steady state between cooperators and defectors if system works infinity. In this section, we investigate the stability of the equilibrium points in parametric form and represent individuals behavior by several scenarios under different conditions. Some of these scenarios represent normal behavior and others indicate rare cases that theoretically can take place. **Scenario (i)** Consider a system without any cooperators. In such situation (\(x=0\)), according to Equation (6), the average payoff of the defector will be \(\Pi_{D}=0\), hence the rate of change of defector frequencies is \(y(t)<0\). This results in decreasing defector frequency in the population and, consequently, it goes extinct. **Scenario (ii)** In the absence of defectors in the population (\(y=0\)), according to Equation (6), the average payoff of cooperators is given by:  
\[\Pi_{\text{C}}=(1-cr)(1-x)^{n-1}+c(r-1) \tag{10}\]  
By setting \(\Pi_{\text{C}}\) in equation \(\dot{x}(t)=x(t)(z(\pi_{\text{C}}+b)-d)\) and based on the maximum value of the function \(z(\pi_{\text{C}}+b)-d)\) three equilibria can be readily observed in the system. The maximum of the function \(z(\pi_{\text{C}}+b)\) is actually attained at the point \(x=1-\left(\frac{\frac{b}{c(r-1)}+1}{n}\right)^{\frac{1}{n-1}}\) and is given by:  
\[\max z(\pi_{\text{C}}+b)=\left(\frac{\frac{b}{c(r-1)}+1}{n}\right)^{\frac{1}{ n-1}}\left(b-c(r-1)\left(\frac{\frac{b}{c(r-1)}+1}{n}-1\right)\right) \tag{11}\]  
If \(d>\{\max z(\pi_{\text{C}}+b)\}\) then population goes to extinct (i.e., \(x=0\), \(y=0\), and \(z=1\)), while for \(d<\{\max z(\pi_{\text{C}}+b)\}\) a bifurcation arise in the system (Figure 1) that results in one stable and one unstable interior equilibrium at higher and lower \(x\), respectively. However, another equilibrium emerged exactly at the maximum point \(x=1-\left(\frac{\frac{b}{c(r-1)}+1}{n}\right)^{\frac{1}{n-1}}\) that represents an unstable point. Figure 2 shows population dynamics in the absence of defectors for others parameters. Figure 1: Bifurcation diagram for population dynamics of the vehicles in the absence of the defectors. Darker (brighter) region indicates points that it can be moves into the basin of attraction of the unstable (stable) point \(x=0\) (\(x=1\)). The dynamics has been illustrated for \(N=8\), \(r=3\), and \(c=1\). **Scenario (iii)** The system can enable cooperators to survive even when defectors free-ride on contributions of the cooperators. In order to investigate this scenario, a new variable \(\omega=\frac{x}{x+y}\) is introduced. By using Equation (8), the changing rate of \(\omega\) and \(z\) are given by:  
\[\dot{\omega}=\frac{\dot{x}y-\dot{y}x}{(x+y)^{2}}=z\omega(1-\omega)\bigg{(}\frac {rc(1-z^{N})}{N(1-z)}-(rc-1)z^{N-1}-c\bigg{)} \tag{12}\]  
and  
\[\dot{z}=-(1-z)\bigg{(}z\big{(}c\omega(r-1)(1-z^{n-1})+b\big{)}-d\bigg{)} \tag{13}\]  
By introducing variable \(\omega\) the dynamic system in Equation (8) which represented by a 3-simplex reduced to a dynamics that shown in a rectangle determined by \(\omega\in[0\,\ 1]\) and \(z\in[0\,\ 1]\). This sheds some new light on the vehicle dynamic from viewpoint of the evolutionary game theory. Figure 3 shows an example of vehicles dynamics for such system. As shown in this figure, natural selection favors cooperator vehicles and, eventually, all populations select this strategy. The red rectangle in this figure represents the valid region of the population dynamics induced by Equations (12) and (13). It is worth pointing out that the dynamics on the rectangle boundaries can be analyzed clearly. The boundaries \(\omega=0\) and \(\omega=1\) represent the scenarios \(i\) and \(ii\), respectively. Definitely, on the boundary of \(\omega=0\), z will be equal to 1.