#### Abstract

One of the most important problems in many research fields is the development of reliable mathematical models with good predictive ability to simulate experimental systems accurately. Moreover, in some of these fields, as marine systems, these models play a key role due to the changing environmental conditions and the complexity and high cost of the infrastructure needed to carry out experimental tests. In this paper, a semiphysical modelling technique based on least-squares support vector machines (LS-SVM) is proposed to determine a nonlinear mathematical model of a surface craft. The speed and steering equations of the nonlinear model of Blanke are determined analysing the rudder angle, surge and sway speeds, and yaw rate from real experimental data measured from a zig-zag manoeuvre made by a scale ship. The predictive ability of the model is tested with different manoeuvring experimental tests to show the good performance and prediction ability of the model computed.

#### 1. Introduction

The availability of tools and methods to compute mathematical models for simulation purposes is of key importance, making the system identification field one of the highlights among the research topics in engineering and one of the most important stages in the control research area. Moreover, aspects that go from the high cost of practical implementations and tests in an open air environment to the complexity of the infrastructure needed to carry out experimental tests, and even the changing environmental conditions, call for the availability of these mathematical models with which new designs and ideas can be tested in simulation with high accuracy. In addition, the importance of the modelling stage is crucial since an inadequate model identification may yield large prediction errors. The literature on linear and nonlinear system identification is extensive and covers many areas of engineering research. For a short survey on some essential features in the identification area and a classification of methods the reader is referred to [1, 2].

Among the number of techniques and methods on system identification, semiphysical modelling presents some interesting own characteristics. In this method, the prior knowledge about the application is used to develop a good model structure to be defined with raw measurements. The model structures defined are not physically complete, but allow for very suitable models to describe the behaviour of the systems involved, [3]. There exist several tools to be applied on semiphysical modelling [4], and potential tools that can support the process of semiphysical modelling are neural networks and support vector machines (SVM). The work at hand is focused on the semiphysical modelling (based on SVM) of a surface craft to describe its dynamical behaviour in an experimental environment. The computation of the model is carried out with the least-squares support vector machines (LS-SVM) technique [5], which is one of the different types of SVM algorithms available in the literature.

One of the most popular and widely used techniques in the artificial intelligence (A.I.) field for system identification is the artificial neural networks, such as multilayer perceptron (MLP); see, for example, [6]. This kind of techniques is robust and effective in many problems in identification and control. Despite this, they present some disadvantages such as the local minima, overfitting, large computation time to converge to the solution, and so forth, to name but a few. Some of these problems can be solved effectively using SVM since it provides a larger generalisation performance, offering a more attractive alternative for the system identification problem, as it is not based on the empirical error implemented in neural networks, but on the structural risk minimization (SRM). The basic idea of SVM is Vapnik-Chervonenkis (VC) theory which defines a measure of the capacity of a learning machine [7]. The idea is to map input data into a high-dimensional feature Hilbert space using a nonlinear mapping technique, that is, the kernel dot product trick [8], and to carry out linear classification or regression in feature space. The Kernel functions replace a possibly very high-dimensional Hilbert space without explicitly increasing the feature space [9]. SVM, both for regression and classification, has the ability to simultaneously minimize the estimation error in the training data (the empirical risk) and the model complexity (the structural risk) [10]. Moreover, SVM can be designed to deal with sparse data, where we have many variables but few data. Furthermore, the solution of SVM is globally optimal. The formulation of SVM for regression, that is, support vector regression (SVR), is very similar to the formulation of SVM for classification. For a survey on SVR the reader is referred to [11] and the references therein. The formulation of SVR shows how this technique is suitable to be used as a semiphysical modelling tool to obtain the parameters of a mathematical model. In this sense, it is of practical interest to describe a nonlinear system from a finite number of input and output measurements.

Although there are not many results for system identification using SVM, we can find some interesting works such as the work in [12], where the authors make a study of the possible use of SVM for system identification, in [13] where an identification method based on SVR is proposed for linear regression models, or in [14] in which the application of SVM to time series modelling is considered by means of simulated data from an autocatalytic reactor. Other interesting works can be found in [15–18]. It is important to remark that most of the papers that study the problem of system identification using SVM deal only with simulation data. As mentioned above, among the different SVM techniques, we can find LS-SVM, [5]. This technique allows a nice simplification of the problem making it more tractable, as will be commented in higher detail in Section 2. We can also find some interesting works that deal with this problem, for example [19], where LS-SVM is used for nonlinear system identification for some simple examples of nonlinear autoregressive with exogenous input (NARX) input-output models. There also exist some other representative examples that deal with identification using LS-SVM; see, for example, [20–22].

In this paper LS-SVM is used for the semiphysical modelling of a surface marine vessel. System identification of marine vehicles starts in the 70s with the works in [23], where an adaptive autopilot with reference model was presented, and in [24], where parametric linear identification techniques were used to define the guidance dynamics of a ship using the maximum likelihood method. There exist many algorithms and tools to compute mathematical models that describe the dynamics of marine vehicles for different applications and scenarios. For instance, in [25] several parametric identification algorithms are used to design autopilots for different kinds of ships, in [26] the hydrodynamic characteristics of a ship are determined by a Kalman filter (KF), and in [27] an extended kalman filter (EKF) is used for the identification of the ship dynamics for dynamic positioning. The computation of these models usually needs a lot of time and practical tests to obtain enough information about the hydrodynamic characteristics of the vehicle and an important computational effort to define an accurate model, so it is clear that the identification task may become a complex and tedious task. Moreover, the operational conditions may affect the vehicle providing different models depending on these conditions, as studied in [28]. For some other interesting related works the reader is referred to [29–31] and the references therein.

For the above reason, in some practical situations, it is usual to employ simple vehicle models that, although they reproduce with less accuracy the dynamics of the vehicle, they show very good results and prediction ability for most of the standard operations; see, for example, [32] where the authors obtain a linear second-order Nomoto heading model with an added autoregressive moving average (ARMA) disturbance model for an autonomous in-scale physical model of a fast-ferry. They use a turning circle manoeuvre for the system identification. See also [33] where a nonlinear ship model is identified in towing tests in a marine control laboratory for automatic control purposes. Following this trend, in this paper the nonlinear Blanke model is identified [30, 34]. This model has a large prediction ability in the experimental setup for standard operations, as will be seen throughout this work, although the model is less precise than other models available in the literature, such as the Abkowitz model [35]. Furthermore, it can be obtained with semiphysical modelling techniques based on SVM in a fast manner with relatively few data.

We can find some works that employ neural networks to define the dynamics of a surface marine vehicle, such as [36–38] or [39]. We can also find some interesting works that deal with the identification of marine vehicles by using SVM, for example, [40], where an Abkowitz model for ship manoeuvring is identified by using LS-SVM, and [41], where *ϵ*-SVM is employed for the computation of the same model. These two above works search to determine the hydrodynamic coefficients of a mariner class vessel with simple training manoeuvres; however, the identification of the mathematical model is made with data obtained from simulation, and the prediction ability of the model is also tested only in simulation. These works do not deal with real data. Furthermore, as far as the authors know, most of the works that deal with system identification using some SVR technique employ simulation data and numerical examples, where the models obtained are not tested on an experimental setup. Two exceptions are the works [42], in which the steering equations of a Nomoto second-order linear model with constant surge speed are identified using LS-SVM and tested in an experimental setup with a scale ship model, and [43], in which an identification method based on SVM is proposed for modelling nonlinear dynamics of a torpedo AUV. In this reference the authors determine the hydrodynamic model with a series of captive model tests, and based on this experimental model, manoeuvring simulations are developed. Then SVM is used to identify the damping terms and Coriolis and centripetal terms by analysing the simulation data. In the work at hand, following a similar methodology to that explained in [40, 42], we seek to determine the nonlinear model of Blanke from raw data obtained from a physical scale ship and to validate the model with several experimental tests.

Therefore, the key contributions of the present paper are twofold: (i) the mathematical nonlinear Blanke model of a scale ship is computed from experimental data collected from a 20/20 degree zig-zag manoeuvre with the LS-SVM technique; (ii) the prediction ability of the mathematical model is tested on an open air environment with different manoeuvres carried out with the scale ship. These tests allow checking the connection between the mathematical model and the ship, showing how this nonlinear model predicts with large accuracy the actual behaviour of the surface vessel. In this sense, the model can be used to design control strategies to predict the ship behaviour on a simulation environment before its implementation on the real vehicle. It is important to keep in mind, for the experimental results obtained in this paper, that the analytical properties of SVM can be compromised in stochastic problems because the noise generates additional support vectors. However, if the noise ratio is good and the amplitude is limited, the SVM can solve the problem as if it was deterministic [12].

The document is organized as follows. In Section 2 LS-SVM is introduced. The nonlinear model of Blanke and the input and output data for the LS-SVM algorithm are stated in Section 3. In Section 4 the Blanke model obtained from the semiphysical modelling is explicitly defined and its prediction ability is tested with some manoeuvres, namely, evolution circles and zig-zags. Finally, the conclusions and a brief discussion of topics for further research are included in Section 5.

#### 2. Least Squares Support Vector Machines for Regression

For the sake of completeness and clarity, in this section LS-SVM is briefly introduced. The notation and concepts of this section follow the explanation in [5]. The interested reader can see also [11] for a report on support vector regression. The basic idea behind SVM is that, using nonlinear mapping techniques, the input data are mapped into a high-dimensional feature space where linear classification or regression is carried out. Consider a model in the primal weight space: where is the input data, is the output data, is a bias term for the regression model, is a matrix of weights, and is the mapping to a high-dimensional Hilbert space, where can be infinite. The optimization problem in the primal weight space for a given training set yields subject to where is the number of samples, are regression error variables, and is the regularisation parameter that determines the deviation tolerated from the desired accuracy. The parameter must be always positive. The minimization of is closely related to the use of a weight decay term in the training of neural networks, and the second term of the right-hand side of (2) controls the tradeoff between the empirical error and the model complexity.

In the above problem formulation may become infinite dimensional, and then the problem in the primal weight space cannot be solved. In this situation, the Lagrangian must be computed to derive the dual problem: where , with , are the Lagrange multipliers. Now the derivatives of (4) with respect to , , , and must be computed to define the optimality conditions: After straightforward computations, variables and are eliminated from (5), and then the kernel trick is applied. The kernel trick allows us to work in large dimensional feature spaces without explicit computations on them [8]. Thus, the problem formulation yields In (6) the term represents the kernel function, which involves an inner product between its operands. This kernel must be positive definite and must satisfy the Mercer condition [44]. The equation defined in (6) may be applied now to compute the regression model.

Equation (6) is very similar to that which would be obtained for a standard SVM formulation. The main differences between both formulations are the equality constraints in (3) and the squared error term of the second term in the right-hand side of (2), implying a significant simplification of the problem.

#### 3. Semiphysical Modelling of the Nonlinear Model of Blanke

In marine systems, the experimental tests can become costly in time and money, due to the need of deployment, calibration, and recovery of complex systems at sea. Therefore, the number of experimental tests that may be carried out are partially constrained by this reason among others, like environmental conditions, transportation of equipment, and so forth, to name but a few. In this sense, the availability of mathematical models, which describe the real systems accurately, is of utmost importance because most of these experimental tests may be carried out in simulation, predicting with high accuracy the real behaviour of the real systems and saving a number of practical tests.

There exists a wide range of different marine systems that require mathematical models. The problem arises when a detailed and trustworthy mathematical ship model is needed, since it requires the identification of a multitude of hydrodynamic parameters; see [35]. This task can become hard and complex, with the need of multiple experimental tests [30].

In many practical scenarios, it is very usual to employ simple models that predict the behaviour of real ships with large accuracy in most of the standard operations, like the Nomoto models [45]. For example, in [42] the identification of a second-order linear model of Nomoto for control purposes is defined, although this model assumes linear ship dynamics and describes only the steering equations. This kind of model may be insufficient accurate for some scenarios due to its simplicity and thus its use would be seriously limited. It is necessary to compute a more general model to be applied in a wider variety of situations and control actions, and this work tries to overcome this limitation.

Therefore, in the present work a nonlinear manoeuvring model based on second-order modulus functions is employed. The model used is the one proposed by Blanke [34], which is a simplification of the Norrbin’s nonlinear model, but with the most important terms for steering and propulsion loss assignment. This 3-degree-of-freedom (DOF) manoeuvring model is defined, following the definition in [30], as where is surge speed, is yaw rate, is sway velocity, is the rudder angle, is moment of inertia about the -axis, is mass, is the -axis coordinate of the centre of gravity, is the thrust deduction number, is propeller thrust, is resistance due to rudder deflection, and , , , , , , , , , , , , , , , , , , , , and are added inertia hydrodynamic coefficients. For more details, the reader is referred to [30].

The interest of this particular model resides in that, despite its relative simplicity, the most important nonlinear terms of the ship dynamics are taken into account. Furthermore, it is possible to compute a dynamic model for control purposes from the experimental data without the need of computing the hydrodynamic derivatives that define all the ship characteristics and its complete behaviour. Therefore, (7) may be rewritten as with . Now we can proceed with the derivation of the semiphysical model. For simplicity reasons, (8) is discretized with Euler’s stepping method using a forward-difference approximation on the derivative: where is considered to be the sampling time of the inertial measurement unit (IMU) on board the ship, and and define two successive data measurements from the IMU. We have to rearrange the terms of (9) in a similar way as (6). Doing so, (9) leads to Equation (10), following the notation introduced in [5] and in Section 2, can be rewritten in compact form as

for , where , , , and are the output training data for the sampling time and where the input training data are and with

The estimates of the elements in vectors (13) are obtained from LS-SVM regression. In fact, we are interested in the values of the vectors themselves, regardless of the values of the different hydrodynamic coefficients that appear in (13), because these vectors will define the equations of motion of the ship, and we look for a model for control purposes. However, if we want to know the values of these hydrodynamic coefficients, additional manoeuvres should be carried out to identify some of them independently, and then, together with the model obtained from LS-SVM, those remaining would be computed.

The structure of the mathematical model is known in advance, and elements in vectors (13) are linear in the parameters, so linear regression can be applied and a linear kernel may be used for the semiphysical modelling: for and . Comparing (14) with (11), after the training process we have where the bias terms must be equal to or approximately 0. The support vectors obtained allow to define the parameters of the Blanke model immediately from (13).

#### 4. Experimental Results

The data used for the training of the LS-SVM algorithm were obtained by carrying out a 20/20 degree zig-zag manoeuvre, since it is a simple manoeuvre but enough to define the main characteristics of the ship dynamics. Once the model is defined with the above zig-zag data, its prediction ability must be compared with the real behaviour of the ship for the same commanded input data, namely, surge speed and rudder angle.

The vehicle used for the experimental tests is a scale model in a scale; see Figure 1. The scale ship, hereinafter referred to as the ship, has the dimensions shown in Table 1, where the dimensions of the real ship that it represents are also shown.

##### 4.1. Semiphysical Modelling of the Surface Craft

The 20/20 degree zig-zag manoeuvre to obtain the training data is carried out with a commanded surge speed of 2 m/s, during 90 seconds. The sampling time is 0.2 seconds, so 450 samples are measured. Figure 2 shows the commanded rudder angle (dashed line) and the corresponding yaw angle (solid line) defined by the vehicle during the 20/20 degree zig-zag manoeuvre. The training data are the commanded control signals or inputs (rudder angle and surge speed) and the data measured from the IMU on board the ship or outputs (effective surge speed, sway speed, and yaw rate). For the sake of clarity on the results shown, the one sigma confidence levels of the measured data from the IMU are heading: 0.05 deg, attitude: 0.025 deg, position: 0.5 m, and velocity: 0.04 m/s.

Now the LS-SVM algorithm for regression may be trained with these input and output data to compute the vectors defined in (13). Different values of the regularisation parameter were tested, and was selected as the best candidate. Following the comments made by Blanke [34], the term is considered to be zero since it will be very small for most ships; thus the nonlinear model, after the training process, yields

Note that the term of (8) is constant in (16) since the commanded surge speed is constant for all the experiences carried out in the present work. Once the model is well defined, we must check if it fits correctly the training data; that is, it is necessary to compare the training data with the results obtained with (16) for the same input signals. In Figure 3 the comparison of the semiphysical modelling results with the experimental data for the surge speed is shown. It is important to notice that the scale used in Figure 3 has been chosen to show clearly the difference between the simulated and real surge speeds, but we can see how the maximum error between both speeds is less than 0.1 m/s, and hence, the simulation results are very similar to the real ones.

Similarly, in Figure 4 the sway speed measured from the IMU on board the ship is shown together with the sway speed obtained from the Blanke model defined in (16). Notice how the results are also very similar. Moreover, the large similarity between the real and simulated sway speeds is even more interesting because the sway speed cannot be directly controlled due to the fact that the ship studied is an underactuated vehicle; that is, we have more degrees of freedom (DOF) than control actions, the latter acting directly on the surge speed and the rudder angle.

Finally, in Figure 5 the IMU and simulated yaw rates are shown. Notice how both curves are practically the same, showing that the model has a dynamical behaviour very close to the actual one of the ship.

For comparison purposes, in Figure 6 the approximation errors for the surge speed, the sway speed, and the yaw rate are shown. It can be seen how the errors are very small and their average values are very close to zero. The standard deviation of the error in the surge speed is 0.0486 m/s and in the sway speed is 0.0171 m/s. For the yaw rate the standard deviation is 0.0066 rad/s, so it is clear that the simulation model has a behaviour very close to the real one.

##### 4.2. Predictive Ability of the Model

The predictive ability of the model must be tested with different tests and manoeuvres. For this purpose two different manoeuvres are now undertaken. These tests are some turning manoeuvres (evolution circles) and a 10/10 degree zig-zag manoeuvre. The initial values of the effective surge speed, sway speed, and yaw rate used in the simulation tests are the same as those of the real ones to show clearly the connection between the real and the simulated systems.

###### 4.2.1. Test 1: Evolution Circles

The first validation test consists in two turning manoeuvres (evolution circles) for commanded rudder angles of ±20 deg. The test was run during 240 seconds for each of the turning manoeuvres. In Figures 7(a) and 7(b) we can check the effective surge speed for the ship (solid line) and for the simulation model (dashed line) during these experimental tests for commanded rudder angles of −20 deg and +20 deg, respectively. Notice the similar behaviour of both speeds and how the simulated surge speed is smoother than the real one because the simulated model is not affected by noise or disturbances.

**(a)**

**(b)**

In Figures 8(a) and 8(b) the sway speeds for the ship and the simulation model are shown for the commanded rudder angles of −20 deg and +20 deg, respectively. It can be seen how both speeds are very similar, although, as mentioned above, the simulated one is free of noise and disturbances.

**(a)**

**(b)**

The yaw rate for the simulated and the actual systems can be studied in Figures 9(a) and 9(b) for the two manoeuvres, where it is shown that the simulation model and the ship have a similar behaviour. In Figures 9 and 7 we can also notice that the real system behaviour is not exactly symmetric; the turnings are slightly larger for negative rudder angles. This nonsymmetrical behaviour is possibly also the reason for the different (small) errors in surge and sway speeds, which vary depending on the turning angle. Despite the above mentioned, the results obtained from the simulated model are very similar to the actual ones, and their difference is not significant. Moreover, the nonsymmetrical behaviour may be caused by environmental conditions, like currents or winds, or by structural characteristics, like the trimming of the ship. This problem does not arise with the semiphysical model since it does not incorporate environmental disturbances that are always present in an experimental setup. Including the possibility of modelling the environmental disturbances would be some interesting future work.

**(a)**

**(b)**

In Figures 10(a) and 10(b) the approximation errors between the real and the predicted surge speed, sway speed, and yaw rate are shown. Notice how the yaw rate error is larger for negative rudder angles as mentioned above. Despite the commented deviation, the errors are small and their average values are close to zero, providing a more than satisfactory prediction of the real dynamical behaviour of the ship. In this sense, the standard deviation of the predicted surge speed with respect to the real one is 0.1786 m/s in the first manoeuvre and 0.04 m/s in the second one. For the sway speed the standard deviations are 0.0303 m/s and 0.0236 m/s, respectively. Finally the yaw rate standard deviations are 0.0160 rad/s and 0.0129 rad/s, respectively. These standard deviations give us a clear image of the slightly nonsymmetrical behaviour of the real ship, showing also how the simulated model has a dynamical behaviour very close to that seen in the real ship.

**(a)**

**(b)**

###### 4.2.2. Test 2: 10/10 Degree Zig-Zag Manoeuvre

In this second test a 10/10 degree zig-zag manoeuvre is carried out to prove the prediction ability of the model. The manoeuvre is run during 90 seconds. In Figure 11 the surge speed during the zig-zag test is shown for both the simulated model and the ship. Notice again that the scale used in Figure 11 has been chosen to show the difference between both speeds and that the maximum error is around 0.06 m/s. Therefore, both speeds are very similar, and the approximation error is very small, as the details in Figure 14 show.

In Figure 12 the sway speed for both systems is shown, and the similarity between both outputs is again easy to check. Finally, in Figure 13 the yaw rate shows that the simulation model obtained with LS-SVM regression has a dynamical behaviour very close to that of the real ship.

In Figure 14 the approximation errors in the surge speed, sway speed, and yaw rate are shown. The standard deviation of the error in the surge speed for this case is 0.0466 m/s, in the sway speed is 0.0239 m/s, and in the yaw rate is 0.0097 rad/s. Hence, the model predicts again the behaviour of the real ship with large accuracy, validating the model obtained with the LS-SVM regression algorithm.

Therefore, it is clear that the nonlinear mathematical model defined for a surface marine vehicle with LS-SVM provides a satisfactory result which predicts with large accuracy the nonlinear dynamics of the experimental system and that it is suitable to be used for control purposes. Thus, this technique has the potential to be implemented for different kinds of marine vehicles in a simple and fast manner, avoiding many practical tests to define a reliable mathematical model and providing a very large prediction ability.

It would be interesting as future research to compare the results obtained in this work with the results that would be obtained using extreme learning machines (ELM) [46], as this technique overcomes some drawbacks that neural networks present, and it also reduces significantly the computation time [47].

#### 5. Conclusions and Future Work

In this work, the nonlinear ship model of Blanke has been computed using experimental data obtained from a zig-zag manoeuvre test. A semiphysical modelling technique based on a least squares support vector machines algorithm has been applied to determine the parameters of the nonlinear model using the rudder angle, surge and sway speeds, and yaw rate as training data. It was shown that the model obtained fits the training data in a nice manner, showing the simulated system a behaviour very similar to that of the real ship. Furthermore, the prediction ability of the model was validated carrying out several experimental tests, like turning manoeuvres and zig-zags, demonstrating that the mathematical model can reproduce the actual ship dynamics with large accuracy in different manoeuvres. In addition, the model computed is suitable to be used for testing control algorithms in simulation, avoiding the execution of a large number of experimental tests.

Future work will aim at (i) extending the methodology developed to deal with models whose structures are not known in advance to capture all the features of the real ship, incorporating disturbances and environmental conditions, (ii) studying the performance of control algorithms for path following and tracking with the ship model defined in comparison with the results obtained for the real vehicle, and (iii) comparing the results obtained in this work with other different identification techniques, like the extreme learning machines (ELM).

#### Acknowledgments

The authors wish to thank the Spanish Ministry of Science and Innovation (MICINN) for support under Projects DPI2009-14552-C02-01 and DPI2009-14552-C02-02. The authors wish to thank also the National University Distance Education (UNED) for support under Project 2012V/PUNED/0003.