# Impacts of GPS Spoofing on Path Planning of Unmanned Surface Ships
## 2 Artificial Potential Field  
### Traditional Artificial Potential Field  
The artificial Potential Field (APF) method is a virtual force method proposed by [PERSON] in 1986 [27]. In ship domain [28], let own ship (OS) denote the ship, which needs to use the APF method for path planning, and let TSs (target ships) denote the ships which are dynamic ships around the OS to be avoided. In the virtual potential field for ship path planning, obstacles are surrounded by repulsive potential fields to force the ship away, and attractive potential fields surround the goal to attract the ship, shown in Figure 1. Obstacles include dynamic TSs and static obstacles (i.e., island, rocky outcroppings, and shoals). The combined force on the ship is equal to the negative gradient of the total potential field. Under the combined force, the ship sails from a high potential field to a low potential field along the negative gradient direction, shown in Figure 2. \(F_{att}\), \(F_{rep}\), and \(F\) is an attractive force from the goal, a repulsive force function from the obstacle, and the combined force of attraction and repulsion, respectively. Therefore, the traditional APF method can effectively implement obstacle avoidance and path planning of ships. The core idea of the APF method is to find the potential functions under the combined potential of attraction and repulsion. These functions can be represented by the following Equations (1)-(10), based on [27]:  
\[U(X)=U_{att}(X)+U_{rep}(X),\]  
Figure 1: Diagram of traditional artificial potential field method [27]. Figure 2: The force diagram of the OS In traditional artificial potential field [27]. where \(U(X)\), \(U_{att}(X)\), and \(U_{rep}(X)\) represent the artificial potential field, the attractive potential field, and the repulsive potential field, respectively; and \(X\) is the position of the OS. In addition, the attractive potential field \(U_{att}(X)\) is written as  
\[U_{att}(X)=\frac{1}{2}\xi\rho^{2}(X,X_{g}), \tag{2}\]  
where \(\xi\) is a positive scaling factor for the attractive potential and \(X_{g}\) is the position of the goal; \(\rho(X,X_{g})\) is the distance of the two locations where \(\rho(X,X_{g})=\|X-X_{g}\|=\sqrt{(x-x_{g})^{2}+(y-y_{g})^{2}}\), \(X=(x,y)\), and \(X_{g}=(x_{g},y_{g})\). We assume that there are \(N(N\geq j)\) obstacles around the OS. Furthermore, the repulsive potential field of the \(j\)th obstacle (\(o_{j}\)) can be written as:  
\[U_{rep_{j}}(X)=\left\{ \begin{aligned} \frac{1}{2}\eta\left[ \frac{1}{\rho(X,X_{o_{j}})}-\frac{1}{\rho_{0}}\right]^{2}&\rho(X,X_{o_{j}})\leq\rho_{0}\\ 0&\rho(X,X_{o_{j}})>\rho_{0}\end{aligned} ,\right. \tag{3}\]  
where \(\eta\) is a positive scaling factor for repulsive potential, \(\rho_{0}\) is the distance threshold for an obstacle to create a repulsion effect on the OS. The selection of the distance \(\rho_{0}\geq V_{max}/2D_{max}\) will depend on the maximum speed (\(V_{max}\)) and the maximum deceleration ability of the OS (\(D_{max}\)). In a two-dimensional space, \(X=(x\),\(y)\) is the coordinate of the OS, \(X_{o_{j}}=(x_{o_{j}},y_{o_{j}})\) is the coordinate of the \(j\)th obstacle, and \(\rho(X,X_{o_{j}})=\|X_{o_{j}}-X\|=\sqrt{(x-x_{o_{j}})^{2}+(y-y_{o_{j}})^{2}}\) is the Euclidean distance between the OS and the \(j\)th obstacle. The total repulsive potential field of obstacles is the sum of the repulsive potential fields produced by all obstacles to OS, written as:  
\[U_{rep}=\sum_{j=1}^{N}U_{rep_{j}}(X), \tag{4}\]  
where \(N\) is the total number of all obstacles. The goal puts an attraction on the OS, attracts OS to approach gradually, and finally arrives. The obstacles repulse OS to avoid collisions. The derivatives of the attractive potential function and the repulsive potential functions are an attractive force function and the repulsive force functions, respectively, written as  
\[F_{att}(X)=-\
abla U_{att}(X), \tag{5}\] \[\
abla U_{att}(X)=\xi(X-X_{g}),\] (6) \[F_{rep_{j}}(X)=-\
abla U_{rep_{j}}(X), \tag{7}\]  
\[\
abla U_{rep_{j}}(X)=\left\{