# Multivariable Adaptive Super-Twisting Guidance Law Based on Barrier Function
## 4 Simulation
### Simulation Based on Monte Carlo Method  
To demonstrate the robustness of the proposed guidance law, a Monte Carlo simulation example with 1000 runs is performed. Considering the uncertainty of the initial relative velocity and the measurement errors of LOS angles, set up the Monte Carlo simulation parameters as: \(\dot{r}_{0}=[-825\;\text{m/s},\;-775\;\text{m/s}]\), \(\theta_{0}=[25^{\circ},35^{\circ}]\), \(\phi_{0}=[5^{\circ},15^{\circ}]\). The general dynamical environment is the same as that introduced in Section 4.1. Thus, other initial conditions and parameters remain the same as in Section 4.1. In every run of this Monte Carlo simulation, the simulation parameters \(\dot{r}_{0}\), \(\theta_{0}\) and \(\phi_{0}\) are selected randomly from the given interval by the random function of MATLAB.  
The results of the Monte Carlo simulation example are shown in Figure 5. Figure 5a,b illustrate the output acceleration commands along LOS coordinate axes \(\theta\) and \(\phi\), respectively. The acceleration curves have a stable range and trend, which implies that the proposed guidance law could address uncertainty problems and have nice robustness. Remarkably, some curves have distinct leaps around 3 s in Figure 5a,b. The reason for this phenomenon is that most runs of the Monte Carlo simulation reach the switch points of the super-twisting gains around 2 s, then the changings of the gains lead to dramatic outputs of accelerations in some runs. Figure 5c is the scatter diagram of zero-effort miss (ZEM) distance with respect to flight time. Moreover, Figure 5d depicts the cumulative distribution function curves of ZEM and flight time, respectively. In addition, the bar graphs of the numbers of Monte Carlo runs with respect to ZEM and flight time is illustrated in Figure 5e,f, respectively. In this example, we find that the ZEMs are smaller than 0.7 m; and the range of flight time is [11.2 s, 13.2 s]. Moreover, the distributions of ZEM and flight time are similar to uniform distribution and normal distribution, respectively.  
Figure 3: The simulation results under various desired terminal elevation angles: (**a**) Relative distance trajectories between missile and target; (**b**) Elevation angles; (**c**) Elevation angular rates; (**d**) Azimuth angles and azimuth angular rates; (**e**) Output accelerations; and (**f**) The adaptive gains of the barrier function-based super-twisting guidance law.  
Figure 4: The simulation results under various desired terminal azimuth angles: (**a**) Relative distance trajectories between missile and target; (**b**) Azimuth angles; (**c**) Azimuth angular rates; and (**d**) Elevation angles and elevation angular rates (**e**) Output accelerations; and (**f**) The adaptive gains of the barrier function-based super-twisting guidance law.  
Figure 5: The Monte Carlo simulation results: (**a**) Missile accelerations along \(\theta\) axis; (**b**) Missile accelerations along \(\phi\) axis; (**c**) The flight time and ZEM of the 1000-run simulation; (**d**) The cumulative distribution function of ZEM and flight time; (**e**) The ZEM distribution in the 1000 runs; and (**f**) The Flight time distribution in the 1000 runs.