#### 2.1. Problem Statement

Waypoints (WPTs) are the points described by latitude and longitude values. In navigation, WPTs are connected by straight line segments. They are a natural way to determine a ship’s trajectory used by the navigator and sufficient for the helmsman when a ship is in the manual control mode. A human, due to experience and prediction ability, begins the turn before the WPT is passed and finishes it on the next trajectory segment. But for MASS this way of a trajectory description is infeasible and gives the overshoot in automatic control. Moreover, it requires the turn starting position definition in order to ensure turn finishing on the next trajectory segment.

Model Predictive Ship Control requires a reference trajectory. Providing reference as a set of WPTs leads to big prediction errors in their vicinity. So, there is a need to model a reference ship’s path with a curve instead of straight line segments. A simple, fast and reliable feasible path generator, which can predict a future trajectory consistent with dynamics of the ship, is required.

So, there is a need to connect a human-friendly description with feasible input for the trajectory tracking system. We propose Bézier curve path modeling, in which a curve order will be as low as possible. It simplifies and speeds up computations. We decided to use Bézier rational curves, because not every trajectory may be approximated by a Bézier polynomial curve. The only polynomial conic curve is a parabola, while ship’s circulation in the steady state is approximated by a circle. Moreover, the ship’s turn is an ellipse segment. Unfortunately, these curves are not accurately approximated by polynomial Bézier curves. The second reason why we decided to use rational Bézier curves is the ability to involve ship parameters in coefficients estimation. In our approach, we are able to take into account ship’s leeward tendency, velocities and dimensions. It was assumed that the maneuver is not trivial. A feasible path is modeled as composition of straight line motion, arc movement and straight line motion. Curve parametrization avoids setting control points based on optimization procedures and allows WPTs to become Bézeir curve control points.

#### 2.2. Bézier Curves

We now briefly present the notion of de Casteljau algorithm and Bézier curves to provide some information about our main geometrical tool. Let $n\in \mathbb{N}$, and let us select a finite sequence of $n+1$ different points ${P}_{0},\cdots ,{P}_{n}$ on a plane ${\mathbb{R}}^{2}$. Let l be a polygonal chain with vertices at ${P}_{0},\cdots ,{P}_{n}$. For any $t\in [0,1]$, let us divide every segment ${P}_{i}{P}_{i+1}$ of l in the proportion $t:1-t$. The resulting points we denote by ${P}_{0}^{1},\cdots ,{P}_{n-1}^{1}$.

We repeat the described process as long as only one point

$\mathit{P}\left(t\right)$ is left, which is the point of our desired curve. The above described algorithm is called the Casteljau algorithm (see

Figure 1), where the obtained points form the Bézeir curve

$\mathit{P}:[0,1]\to {\mathbb{R}}^{2}$. The points

${P}_{0},\cdots ,{P}_{n}$ are called the control points of

$\mathit{P}$, while the polygonal chain

l is called the Bézier chain or control chain

The Bézier curve $\mathit{P}:[0,1]\to {\mathbb{R}}^{2}$ is a polynomial curve, that is, if $\mathit{P}$ is described by $n+1$ control points then its coordinates are described by some polynomials of the variable t of the degree not exceeding n. Moreover, $\mathit{P}$ is contained in the convex hull of the control points ${P}_{0},\cdots ,{P}_{n}$, and $\mathit{P}$ is invariant under any affine transformation of the plane ${\mathbb{R}}^{2}$.

Let us now consider the polynomials

We also define

${B}_{i}^{n}\left(t\right)=0$ for

$i<0$ and

$i>n$.

${B}_{i}^{n}$’s are called the Bernstein polynomials (see

Figure 2).

One can observe [

19] that the control points of a Bezier curve

$\mathit{P}$ determine the coefficients of this curve in the Bernstein polynomial basis, that is

In further considerations it occurs that polynomial Bezier curves are flexible not enough for our purpose, so let us now dive into the notion of rational Bezier curves.

Let us choose points

${P}_{0},\cdots ,{P}_{n}$ in the 3-dimensional space

${\mathbb{R}}^{3}$. Every curve

$\mathit{P}:[0,1]\to {\mathbb{R}}^{3}$ can be identified with a system of three functions

$X,Y,W:[0,1]\to \mathbb{R}$, that is

Let

E denote the 2-dimensional plane in

${\mathbb{R}}^{3}$ defined by

and let

$\mathit{p}$ be the curve on

E defined by

If we change the coordinate system translating the

X and

Y axes by the vector

$[0,0,1]$, we can treat the curve

$\mathit{p}$ as a curve on a 2-dimensional plane, once again denoted by

$\mathit{p}$, defined as

Thus, if $X\left(t\right),Y\left(t\right),W\left(t\right)$ are polynomial functions, then the coordinates of $\mathit{p}\left(t\right)$ are rational.

Now, any point

$\mathit{p}=(x,y)$ of

${\mathbb{R}}^{2}$ (which we identify with

E) can be described by a vector

$[X,Y,W]\in {\mathbb{R}}^{3}$ so that

Note that this description is not unique. Multiplication of $X,Y,W$ by a positive constant gives us the same point $\mathit{p}$.

Now, let ${p}_{i}=({x}_{i},{y}_{i})$, $i=0,\cdots ,n$, be points on the 2-dimensional plane. Having weights ${W}_{0},\cdots ,{W}_{n}$, one can define points ${P}_{i}=({W}_{i}{x}_{i},{W}_{i}{y}_{i},{W}_{i})\in {\mathbb{R}}^{3}$, $i=0,\cdots ,n$, so that ${P}_{i}$ defines the rational Bézeir curve with ${p}_{i}$s as the control points via the procedure described above.

Let

${P}_{0},\cdots ,{P}_{n}\in {\mathbb{R}}^{3}$. Let us recall that every

${P}_{j}=({X}_{i},{Y}_{j},{W}_{j})$. These points define some polynomial Bézier curve in

${\mathbb{R}}^{3}$ by

Since the points

${P}_{0},\cdots ,{P}_{n}$ define some points

${p}_{i}=(\frac{{X}_{j}}{{W}_{j}},\frac{{Y}_{j}}{{W}_{j}})$, we can define a rational Bézier curve

$\mathit{p}:[0,1]\to {\mathbb{R}}^{2}$ by

Obviously [

19], rational Bézier curves generalize the notion of a polynomial Bézier curves. Moreover, similarly to the polynomial ones, rational Bézier curves are invariant under any affine transformation.

#### 2.4. Method of Rational Bézier Curve Coefficient Determination

Modeling using the rational Bézier curve requires curve order, control points’ position and values of weights estimation. We started the approximation procedure with the square rational curve due to the standard way of arc and circle modeling. WPTs were chosen as the control points, because we wanted to use the standard ship’s trajectory description, which consists of a set of consecutive WPTs. The first set of weights was selected empirically. The preliminary test results, with the empirically chosen weights, showed that it is possible to model a feasible ship’s trajectory using the second order rational Bézier curve. The whole procedure was iterative one. Initial guess weights were modified and a modeled trajectory was compared with the one registered during the real-time lake trial. After the whole procedure, it turned out that it is possible to find the coefficients of the second order rational curve, enabling accurate modeling of ship trajectories. Modeling errors were less than ship’s breadth, which is acceptable for a control purpose.

The obtained preliminary results showed that there is no need for higher order curve usage due to ship trajectory modeling potential. Our motivation was to generalize the trajectory modeling method for all ship types. So we decided to find the relationship between values of rational Bézier curve coefficients and particular ship dimensions and motion parameters. We connected them according to the procedure described below.

Curve coefficients were estimated in an experimental way, knowing that the ship’s movement is affected by parameters such as: drift, longitudinal, transversal and angular velocities, displacement and length overall. Displacement and length overall are static parameters. Drift and all three velocities (longitudinal, transversal and angular) are dynamic ones, because they change during a trajectory tracking process and depend on one another. We expected that input and output rational curve coefficients depend on her coefficient on the arc. We also expected the quadratic or square root relationship between them due to the order of a selected rational Bézier curve.

Ship’s inertia and the turning radius depend on ship’s length and displacement. The ship’s movement method during her turn may be defined by the angular and drift path. The angular path is defined by

where

r denotes angular velocity, and describes ship’s angle of turn. Combined with the circulation radius

R, it determines length of the path traveled by the ship in the longitudinal axis (in an arc) which is defined by

${S}_{\phi}$ is used for ship’s position is modeled curve prediction. Its combination with the measured longitudinal speed allows determining the current position on the approximated trajectory and predicting future ship’s position. One can predict longitudinal ship’s speed based on the past and current values of angular and transversal velocities combined with the distance traveled along a curve or a straight line.

The drift path is defined by

and it determines length of the path traveled by the ship in the transversal axis due to centrifugal force.

The coefficient on arc (

${W}_{2}$) depends on ship’s length, displacement, angular and drift path lengths. It is defined by

where:

L—length overall, ∇—displacement,

r—angular velocity,

v—transversal velocity,

c—dimensionless coefficient. The coefficient

c value is a ratio of trajectory approaching time (

${t}_{app}$) and the whole maneuver time (

${t}_{m}$)

Ship dynamics is independent of the performed motion and ship inertia does not change with changing angular velocity. So, input (

${W}_{1}$) and output (

${W}_{3}$) coefficients have the same value and they depend only on the coefficient on arc value. They are the inverse of a square root of the arc coefficient

${W}_{2}$:

It was proved by the computer simulations that these values give the best Bézier curve trajectory approximation results.

According to the methodology described above, ship’s path modeling is based on a set of known WPTs and requires two coefficient values calculation.