# Control for Ship Course-Keeping Using Optimized Support Vector Machines
## 2 Problem Formulation  
### Mathematical Model of Ship Steering  
A general six-degree-of-freedom (6 DOF) model of ship motion can be described as [29]  
\[\left.\begin{array}{l}\dot{\eta}=J(\eta)\mathbf{v}\\ M_{RB}\mathbf{v}+C_{RB}(\mathbf{v})\mathbf{v}=\mathbf{\tau}\end{array}\right\} \tag{1}\]where \(\eta\) is the generalized position vector with \(\eta=\left[x,y,z,\phi,\theta,\psi\right]^{\mathrm{T}}\), defined in the North-East-Down geographical reference frame; \(\mathbf{v}\) is the generalized velocity vector with \(\mathbf{v}=\left[u,v,w,p,q,r\right]^{\mathrm{T}}\), defined in the body-fixed reference frame; \(J(\eta)\) is the kinematic transformation matrix between the body-fixed reference frame and the North-East-Down geographical reference frame; \(M_{RB}\) is the rigid-body mass matrix; \(C_{RB}(\mathbf{v})\) is the Coriolis-centripetal matrix; \(\tau\) denotes a generalized force vector.  
System (1) gives a general description of the motion of a marine vessel, a surface ship or an underwater vehicle. In practical applications to ship motion control, this complicated model is often simplified to a model with less than 6 DOF. Such a simplified model can be called as a control-design model in which the essential behavior of a dynamic system is captured [1]. More often than not, to study the yaw dynamics and control, a 1 DOF model can be adopted. This model is usually named as the response model (sometimes named as Nomoto model or _K-T_ model). Despite simplicity, this model reflects the important response characteristics of the yaw dynamics, from the control input (i.e., the rudder angle) to the system output (i.e., the yaw rate or the heading angle). Practically, this kind of model is commonly preferred in the studies on ship motion control. A first-order nonlinear response model has the form as  
\[\left.\begin{array}{l}\dot{\psi}=r\\ T\dot{r}+r+\alpha r^{3}=K\delta\end{array}\right\} \tag{2}\]  
where \(K\), \(T\) are manoeuvring indices; \(\psi\) the heading angle; \(r\) the yaw rate; \(\alpha\) the coefficient of nonlinear term; \(\delta\) the rudder angle. If uncertainties are taken into account, the second subsystem of (2) can be written as  
\[T\ddot{\psi}+\dot{\psi}+\alpha\dot{\psi}^{3}+\Delta(\psi,\dot{\psi})+w=K\delta \tag{3}\]  
where \(\Delta(\psi,\dot{\psi})\) is the modeling error, \(w\) is the external disturbance.  
In many researches on ship course-keeping control, the actuator dynamics were ignored. It should be noted that if the time constant of the actuator is not much smaller than that of the ship, ignoring the actuator dynamics would result in degradation of the controller performance. Generally, the rudder actuator dynamics can be expressed as  
\[T_{E}\dot{\delta}=\delta_{c}-\delta \tag{4}\]  
where \(T_{E}\) is the time constant of rudder; \(\delta_{c}\) the demand or execution rudder angle. Combining (3) and (4) through an integrator, a cascaded system is derived as follows, in which \(\delta_{c}\) is the system control input; while the rudder angle \(\delta\) is an interim state variable and the heading angle \(\psi\) is the system output.  
\[\left.\begin{array}{l}T\ddot{\psi}+\dot{\psi}+\alpha\dot{\psi}^{3}+\Delta( \psi,\dot{\psi})+w=K\delta\\ T_{E}\dot{\delta}=\delta_{c}-\delta\end{array}\right\} \tag{5}\]