Mathematical modeling of the trajectory of a ship as a control object in local planning

In the article proposes the decomposition of the global planning task in local planning. It is proposed to combine the segment method and the sector method of division of the circle to construct the ship's trajectory in local planning. Corrective coefficients were selected for the correct geometry of the turning trajectory, combining the segment method and the sector method of constructing the ship's trajectory. The article uses formulas of spherical trigonometry; the trajectory of the turn depends on the rudder angle, which in turn depends on the turning ability of the vessel under the given conditions. In determining the value of the angle of the rudder, the control device must take into account the ship's turning ability in the conditions set, the value of the angle of the turn and the constrained water area. The combination of all factors allows to differentiate the ship's turning ability such as: high HG, middle MD or low LW with regard to passage area. The ME shifting operating modes matrix proposed in the article works as a filter of modes of operation and is completely dependent on the readings of pressure, temperature and vibration sensors. The ship's trajectory is constructed using calculations in MS Excel and graphic simulations in the MATLAB environment.


Introduction
The development of the modern transport industry in the world is characterized by the intensification of the use of unmanned vehicles. is also the case in the water transport industry. An important feature is the need to increase the ability of such vessels, to expand the range of tasks. The article is devoted to the processing of the task of global planning in local planning when programming a control device, which will control the vessel, according to the requirements for unmanned vessels [1] connection with the above, the topic of the work seems relevant.
One of the important tasks of commercial operation of the vessel is to ensure that the cost of a highly skilled command force is reduced by increasing the level of automation of the ship's control. The proposed mathematical model will save the cost of crew on merchant ships and reduce the loss of human resources on military vessels during combat operations.
The decomposition of the global planning mission to simulate the ship's trajectory is an important step towards the creation of an unmanned vessel with a fourth degree of autonomy, according to the classification MARITIME AUTONOMOUS SURFACE SHIPS (MASS) [1]. The fourth degree of autonomy involves making decisions by a management device without human involvement.

Analyzing literature and formulating of problem
The choice of literature was based on three principles: relevance, capacity, truthfulness. In order to introduce development into the marine fleet, it was necessary to analyze: the legal acts of the Maritime Safety Committee; global planning task for constructing of ship's trajectory; foundations of discrete mathematics; geometry and cinematic of process; hydrodynamic features of the ship's movement; existing developments on automated (autonomous) ship control, assess their effectiveness; methods for solving direct and reverse geodesic problems; research of engine diagnostics and monitoring.
The regulatory framework for the programming of the control device is set out in the research [1, 3−6]. Modern developments should focus on the report of the Maritime Safety Committee at its 100th session, MSC 100/20/Add.1, Annex 2 [1]. At the source [1] was assessed the degree to which the existing regulatory framework under its purview may be affected in order to address MASS operations.
In source [2] was represented mathematical model of global planning tasks using discrete logic. A problem for ship motion global planning [2] was to establish a link between the top of the graph and the corresponding scenario, avoiding a conflict of priorities when performing a global planning assignment in local planning. Papers [3][4][5][6] used as basic international regulatory for Autonomous vessel creation.
Autopilot system known from Japanese patent [7] allows you to adapt the work of the ship's steering gear to the environment by changing control mode. This patent, based on weather data, changes the parameters of the steering machine, but requires constant human control on board. From a Chinese patent application [8] known way to optimize the route of an unmanned vessel based on environmental information. Chinese elaboration is similar to the elaboration [7], but creates the recommended trajectory. This elaboration, like the previous one, has limited functionality and cannot provide the 4th level of autonomy of the vessel [1].
Methods proposed in research [7] and [8] have a significant disadvantage, which does not allow to name the vessels with such devices autonomous: these devices do not classify operational scenarios in real time or form a global planning mission. In research [9] is the development of an unmanned boat called «Surface robot». It is a water robot that does not require a human presence to work and can perform its task autonomously without remote control. It is more intended for dangerous or routine and repetitive military and civilian tasks such as military strikes (respectively with the size of a vessel), geomorphology, patrolling, rescue operations and environmental monitoring, but cannot be used to transport cargoes and people.
Therefore, functionality of existing unmanned vessels is not sufficient to execute difficult tasks for merchant fleet. The above models cannot allow a large unmanned vessel to moor without tugs. Elaboration, mentioned in article, will admit increasing displacement of merchant unmanned vessels and dimensions of military unmanned vessels (their hit power). Research [10][11][12] dedicated to accidents on fleet. According to statistics mistakes in people's work are the causes 75%-80% of all accidents [10−12]. Human errors are errors that occur when receiving and converting information, when making and executing a decision. The possibilities of discrete mathematics have been researched in paper [13]. In this book were represented theoretical principles of discrete mathematics, which were used in this research. The theoretical justification for considering the vessel as a control facility is the sources [14,[16][17][18][19].
In the research [14] authors define a person as a control device, a person's conceptual separated from the means of steering, and the vessel accepted as object of control. Also in work [14] pay high attention to manoeuvring characteristics of the vessel, their calculation and comparison with experiment. «The integral control system includes a control body (control device), controls (steering machine, engines, bow thruster, surface and underwater surveillance equipment, etc.) and a control object (ship)» [2].
In thesis [15] authors noted the main difference between program and device. In the article [16] were proposed program code for calculating and for constructing the ship's turning circle in MATLAB.
In research [17] were elaborated empirical formulas have been to construct the ship's turning circle and to calculate the geographical coordinates of the ship's center of gravity during turning. In work [18] were proposed method of assessing the reliability of a person's work as a control device on a ship. In work [19] describes the use of sensors to construct a path trajectory. Work [20] is manual "Basics of automation" by Józef Lisowski contains basic information in the field of automation given in a popular-scientific way.
In research [21] describes divergence in constrained conditions, the means of automated radar laying, organizing the work of the bridge team in the control of the movement of the ship. In research [27] illuminated method of calculating distance on rhumb line. In research [28] illuminated method of constructing a trajectory of the turn with the help of two segments. Research [29] it's an internet page dedicated to solving geodesic problems.
The paper [30] presents algorithms for marine diesel engines' working process monitoring designed by analyzing data obtained with IMES pressure sensors (monitoring and diagnostic of main engine).

The aim and tasks of elaboration
The aim of the elaboration is to process the global planning task in local planning by the control device, taking into account the manoeuvring characteristics of the vessel, the conditions of navigation and the type of ship power plant.
In order to achieve this aim the following tasks have been identified: to elaborate an algorithm for choosing the rudder angle depending on the ship's turning ability; to select the correcting coefficients of the turning trajectory, combining the segment method and the sector method of constructing the ship's trajectory; to show a graphic simulation of the ship's trajectory in local planning using a programming environment MATLAB; to elaborate mode switching matrix when main engine is braking.

Materials and methods used for elaboration
This article shows a mathematical model for procession a global planning task in local planning. When constructing a trajectory, the method of segments was combined [28] with sector method [26] based on the ship's manoeuvring characteristics, such combination is innovation. At the same time, special corrective coefficients were calculated and described in article. When choosing the rudder angle, control device program takes into account external conditions, affecting the steering of the vessel, as well as a safe corridor for manoeuvring. The ship's braking occurs when the appropriate scenario appears, the coordinates of the ship's stop are based on data from beacons, pilot-operator and all surface and underwater surveillance equipment available on the vessel, including radar and optical. The alongside vessel's motion scenario S4 is also calculated and implemented in local planning based on data from beacons, pilot-operator and all surface and underwater surveillance equipment available on the vessel. The main advantage of this mathematical model is the simplicity of algorithms and the lack of subjective perception. The ship's trajectory is constructed using calculations in MS Excel and graphic simulations in the MATLAB environment.
Here are the definitions for this article: − local planning -generating the ship's trajectory in the form of a series of points, placed in the route matrix based on the different parameters of the vessel and data from all means of observation; generated route matrix line based on coordinates of route vertex of global planning, using trigonometry formulas, − segment method -mathematical method used to calculate the turn route of the vessel, which is to calculate the distance between the starting point of the turning and the vertex of the turn, as well as the distance between the top of the turn and the end of the turn, is applied when it allows the distance between the tops of the turns, − sector method -mathematical method used to calculate the route of the ship's, consisting in dividing the circle of the turn on the arc of a particular sector step and calculating the coordinates of the points separating the circle, − a set of navigational data is a data with automatic updates over the Internet.

Elaboration of algorithm to select the rudder shift, depending on the ship's turning ability
In the initial form of the path matrix ( Fig. 1.) the ship would move from point A to point B without any scenarios, but knowing the purpose of arrival to the point B and/or the mooring board, the control device will determine the Fig. 2 scenario, which represents the path matrix with active braking at point B. But if the braking scenario is calculated earlier, the vessel should stop before the vertex of the corresponding turn no closer than at the point H, calculating the coordinates of the stop. According to the segment method [28], segment MH will depend on the rudder's shift at the point H. In determining the value of the angle of the rudder, the control device must take into account the ship's turning ability in the conditions set (weather conditions, cargo condition of the vessel), the value of the angle of the turn and the constrained water area. The combination of all factors allows to differentiate the ship's turning ability such as: high HG, middle MD or low LW with regard to passage area.
Below is mentioned Table 1, which shows the typical distribution of rudder shifts depending on the turning ability and angle of turn for the vessel with a metacentric height, allowing to put the helm on board. The first column of the table is the assessment of turning ability, the second is the angle of the turn Q, the third is the rudder angle δ. An important role in the manoeuvring of the vessel is executed by the safety corridor, which is selected from the database for each section of the track. The section of the track for the safety corridor is not tied to the turning points. The section of the track is calculated percent of the total length of the track, and each section has its own safety corridor. Fig.3. and Fig.4. represent the turn of the ship at a certain turn Q for rudder shift.    Figure 4 shows the correction of the first two segments of the turn angle and the final section of the turn angle.

A selection of correcting coefficients for geometry of the turn trajectory, combining the segment method and the sector method of constructing the ship's trajectory
Length of circular arc HM1 and M1M2 corrected by special compensatory coefficients, that compensate for the part of the evolutionary period during which the course does not change or change, but not significantly. The length of the first two arcs indicates , . The lengths of the other arcs can be defined as d. The main coefficient for all arcs is the attrition coefficient , as the helm is shifted when the course is stabilized in the opposite to the turn direction. This coefficient depends on the initial rudder shift. Coefficients and used for all arcs (Fig. 5, algorithm 1), the rest of the coefficients are only used for , . Through numerous graphic simulations, the coefficient values were calculated for the vessel «UMM QARN» IMO: 9732333, which are presented in Table 2, and other compensating coefficients for the ship «UMM QARN» IMO: 9732333, selection algorithms of which are presented on Figure 5. Coefficients ( ) (Fig. 5,  − these are coefficients dependent on the cargo condition of the ship and the rudder shift δ. If the vessel is in ballast, the coefficient will be less, and in load condition − will be greater. This is due to the fact that when the ship is in load condition, the turning circle advance increases and the tactical diameter decreases. And when the ship is in ballast condition, turning circle advance decreases, and the tactical diameter is growing. Coefficient (Fig. 5., algorithm 3) applies at small angle of the turn, as the distance between the top of the turn and its end is less than two length of the vessel. Coefficient (Fig. 5, algorithm 4) is used, if the distance S between the tops of the turn is smaller or equal to the differentiated distance for the vessel and the direction of the turns equally (two consecutive courses increase/decrease). Initial formulas for segments HM and MK [28].
Differential values of turning angles in the questions on the figure 5, (algorithm 1, 3) − these are the angles that the ship's trajectory simulation was oriented towards. «UMM QARN» IMO: 9732333. Algorithm questions (2)    Length of arc 0 without the correction would have been calculated according to the formula: 0 = × / ′ (1) Δψ -this is the value of the exchange course between the two points of the turn arc and at the same time the sector step (Fig.6); Δψ′ -it's an attitude 360˚/ Δψ; These co-components were also successfully tested during a mathematical experiment for the vessel «MSC EMMA» ΙΜΟ 9463047, that has different turning circle parameters. (Fig. 9.) Based on all of the above, empirical formulas have been created to calculate the latitude coordinates of points M1, M2, M3-Mn (2,3). And longitude should be considered by the formula: Thus, the trajectory is generated as a chain of points, the coordinates of which are calculated by trigonometry. Segment method [28] snaps the calculation of the segment value MK to turning circle transfer , that necessitates its adjustment by changing the formula when programming trajectory parameters. Calculation of MH tied to the advance of turning circle , that's why at small angle of the rudder shift and small angles of the turn it should also be corrected.
Based on the above-mentioned, it can be argued that the circumference of each turn has its own geometric features, but these features are not only in the evolutionary period of the turn, but also in its completion. The trajectory of the ship turn can be called an ellipsoid, as its radius changes. In local planning of the ship's turns, it is necessary to solve the problem of entering the turn trajectory to the point K. This task is solved by successive experimental approximations. When solving this task, it is important to determine when the turn trajectory should be simplified into a straight line to the point K.
For vessel «UMM QARN» IMO: 9732333 it was definitely that if the angle of the turn Q more than 45˚, the trajectory is simplified into a straight line and enters the point K, when remains 0.33 of the difference between the initial and the finish course until the turn is completed. Under other conditions, the trajectory is simplified into a straight line and enters the point K, when remains 0.36 of the difference between the initial and the finish course (on figure 4 this transition is shown by a segment M6K).
As you know, the main task of local planning is to change the trajectory movement of the ship in real time. Consider the implementation of passive and active braking in local planning, where scenario S1 -it's a passive braking scenario, а S2 -it's an active braking scenario [2] (Fig.7 a, b). At the same time, the need to accelerate or slow down the ship is not a scenario, as it does not change the route matrix. The passive braking scenario is determined numerically if the speed required for safe movement is below the minimum speed at which the vessel is steered. the scenario of active braking is determined if a full stop of the ship is needed. If you should stop before turning at a minimum distance from the top, the calculation of geographic coordinates uses bearing and distance to the point H.  = ̶ (7915.70447×lg(tg((45+ /2)×π/180)×((1 ̶ e×sin(( )×π/180)/(1+ +e×sin(( )×π/180))))) ̶ 7915.70447×lg(tg((45+ /2)×π/180)×((1 ̶ e×sin(( )×π/180)/ /(1+e×sin(( )×π/180))))))×tg(( )×π/180)/60 When the active braking scenario is running, which simultaneously allows you to move astern (and the distance you need to walk back is calculated in meters), formula for calculating latitude will be as: Scenario S3 -this is the scenario of skipping a planned point (points).

Graphic simulation of the ship's trajectory in local planning using a programming environment MATLAB
On figure 7(b) represented active braking scenario in point 13. When an point falls out of the route matrix in local planning, the trajectory is based on the vertex that remain (Fig. 8 a,  b). a b Fig. 7. Constructing a trajectory without braking and braking at the vertex 13.
Slowing or accelerating is not part of the scenario matrix because the velocity change does not change the route matrix. This article only looks at the deviation from the course through a point pass, scenario 3. The usual deviation from the course in this article is not considered, as this is a separate scenario of local planning not related to global planning. In developing such a deviation from the course should be calculated not only the possibility of deviation from the course, but also the possibility of returning to the course. The trajectory of the turn can be presented as a matrix, Fig. 10. Scenario S4 -this is the scenario of active braking and alongside movement at the same time. The alogside movement scenario occurs as a result of the pilot's command, or as a result of linear calculations of the control device. Starboard side alongside movement code is "1", port side is "0". The trajectory of the alongside movement is calculated trigonometrically using the exchange angle 90° or -90°, as presented in the formula (8,9).

̶
In formulas use back bearing , so when the alongside movement directed to port side, the formula uses (+90), and when to starboard side -use (-90).

Elaboration a main engine shifting operating modes matrix
Scenario S1 is the scenario of passive bracking, S2 is the scenario of passive bracking, S4 is the scenario of active braking and side movement. Braking on vessels with the fourth level of autonomy should be carried out without an operator and without the constant presence of service personnel in the engine rooms.
In passive and active braking, the control device must monitor the main and supportive mechanisms of the engine room. If necessary, the control device should turn off heating devices of automated boilers, fuel pumps, engine room fans. Emergency warning alarm system must be directly connected to the control device.
In order to monitor the safety of braking, the vessel is proposed to use the following main engine shifting operating modes matrix (Fig. 11). In this matrix, transitions between modes occur as follows: if the row is completely zero, an indication from all ME sensors is normal ̶ the active braking continues, if is not ̶ the control device expects all indicators to return to normal before switching the next main engine mode or returning to previous position or to the position STOP ENGINE. On Fig.  11. mentioned situation, when need to return to previous ME operating mode in case of temperature and vibration.
The temperature of the cylinder is determined by three indicators: temperature, cooling water temperature, oil temperature. Gas temperature sensors are on exhaust manifold pipes. Cooling water temperature sensors are located near the engine cylinder bushings.
Crankshaft bearing temperature sensors indirectly indicate the temperature inside the cylinder. Indications of the oil temperature sensor at the exit of the engine are also important in terms of diagnosing the entire engine.
The pressure of the gases inside the cylinders is determined by pressure sensors on the cylinder covers [30]. The level of vibration is determined by stationary sensors on the engine flywheel.

Conclusions
1. To perform global planning scenarios, an algorithm has been developed to select the rudder angle. The algorithm gives steering option to respond to real-time environmental changes. The main advantage of this mathematical model is the simplicity of algorithms and the lack of subjective perception.
2. By connecting the segment method and the sector method and correcting coefficients the trajectory of turns is constructing correctly. 3. Main engine shifting operating modes matrix is an effective tool for monitoring and manage the work of ME.
4. The practical usefulness of this elaboration is shown through a graphic simulation. From source [2] it is known that the relative reliability of the device based on this development is 1.33, and economic efficiency 37626$ for crew 23 persons per month on one merchant ship according to ITF ILO Minimum Wage Scale [23]. On warship, this elaboration can save many lives while performing combat missions in a priori unequal conditions. The proposed mathematical modeling of the ship's trajectory in local planning brings the creation of a control electronic device that will be able to control large vessels. At the same time, the control device will operate in accordance with international requirements set out in the sources [1, [3][4][5][6].