## 2 Mathematical Model
### Mathematical Model of USV  
The motion equation with three degrees of freedom (3-DOF) is established based on [PERSON]'s second law. In this paper, the berthing task assumed performing in the calm water, the disturbances from environments such as waves and wind in the port area are ignored due to the simplicity of the equation of motion. Thus, the heave, roll, and pitch motion are relatively small and not significantly affected in the equation of motion; thus, it can be neglected from the equation of motion. Furthermore, the low-speed condition made the 3-DOF motions sufficient to simulate the motion of the vehicle. Additionally, the main purpose of this paper is to focus on the path planning algorithm to generate the feasible path for the berthing task based on the maneuvering simulation. The application of the 3-DOF motion equations causes simplicity but retains characteristics of the system. The MMG model for the 3-DOF equation of motion suggested in [17] that the total ship force and moment can be divided into sub-components: the hull, thruster, and steering system. Thus, the 3-DOF motion equation is expressed as  
\[ \begin{array}{l}m\big{(}\dot{u}-vr-x_{b_{G}}r^{2}\big{)}=X_{H}+X_{P}+X_{R}\\ m\big{(}\dot{v}+ur+x_{b_{G}}\dot{r}\big{)}=Y_{H}+Y_{P}+Y_{R}\\ I_{zz}\dot{r}+mx_{G}\big{(}\dot{v}+ur\big{)}=N_{H}+N_{P}+N_{R}\end{array}  \tag{1}\]  
where \(m\) is the mass of the ship; \(x_{b_{G}}\) is the longitudinal position of the center of gravity of the ship; \(u,~{}v,~{}r\) denote the surge, sway, and yaw velocities, respectively; the symbol \"\(\cdot\)\" in the head of the variable denotes the derivative of the variable with respect to time; \(I_{zz}\) is the moment representing the mass moment of inertia with respect to the z-axis; \(X,~{}Y,\) and \(N\) represent the surge force, lateral force, and yaw moments, respectively, at the midship; and the subscripts \(H,~{}P,\) and \(R\) denote the hull, rudder, and propeller, respectively. Due to the operation conditions in the berthing phase, the hydrodynamic forces and moments around the midship acting on the ship hull were investigated at a low speed with a wide range of drift angles [2]. Thus, the equation of motion considers some of the high-order hydrodynamic coefficients and the hydrodynamic forces and moments caused by the hull, which are expressed as follows:  
\[ \begin{array}{l}X_{H}=X_{i}\dot{u}+X_{u|u|}u\big{|}+X_{vvv}v^{2}+X_{rr}r^{2} +X_{vr}vr\\ Y_{H}=Y_{\dot{v}}\dot{v}+Y_{j}\dot{r}+Y_{v}v+Y_{vvvv}v^{3}+Y_{vvvvvv}v^{5}+Y_{ r}r+Y_{r|r|}r\big{|}r\big{|}+Y_{vvvv}v^{2}r+Y_{vr}vr^{2}\\ N_{H}=N_{\dot{v}}\dot{v}+N_{\dot{r}}\dot{r}+N_{v}v+N_{uv}uv+N_{vvvv}v^{3}+N_{ uvvv}u\alpha^{3}+N_{r}r+N_{r|r|}r\big{|}+N_{vvvv}v^{2}r+N_{vr}vr^{2}\end{array}  \tag{2}\]  
The hydrodynamic coefficients were described under the Taylor series expansion in terms of surge velocity, sway velocity, and yaw rate. The ship model was equipped with twin-propeller and twin-rudder systems [18]. The thruster model is expressed as follows:  
\[ \begin{array}{l}X_{P}=(1-t)\rho D^{4}\Big{[}\big{(}n^{P}\big{)}^{2}K_{T}^{P} l_{P}^{P}+\big{(}n^{S}\big{)}^{2}K_{T}^{S}l_{P}^{S}\Big{]}\\ Y_{P}=0\\ N_{P}=y_{P}(1-t)\rho D_{P}^{4}\Big{[}\big{(}n^{P}\big{)}^{2}K_{T}^{P}l_{P}^{P}- \big{(}n^{S}\big{)}^{2}K_{T}^{S}l_{P}^{S}\Big{]}\end{array}  \tag{3}\]  
where \(D\) is the propeller diameter; \(n\) is the propeller revolutions per minute; \(t\) denotes the thrust deduction factor; \(y_{P}\) is the lateral position of the propeller from the centerline; and the superscripts \(S\) and \(P\) denote the side of the propeller (port and starboard).