• Nie Znaleziono Wyników

On minimal-time ship routing

N/A
N/A
Protected

Academic year: 2021

Share "On minimal-time ship routing"

Copied!
71
0
0

Pełen tekst

(1)

^^^./^/. 05^2./: 5-/

ON MINIMAL-TIME SHIP ROUTING

\

J

(2)
(3)

SHIP ROUTING

PROEFSCHRIFT

TER VERKRIJGING VAN DE GRAAD VAN DOCTOR IN DE TECHNISCHE WETENSCHAPPEN AAN DE TECHNISCHE HOGESCHOOL DELFT, OP GEZAG VAN DE RECTOR MAG-NIFICUS IR. H.B. BOEREMA, HOOGLERAAR IN DE AF-DELING DER ELECTROTECHNIEK, VOOR EEN COMMISSIE AANGEWEZEN DOOR HET COLLEGE VAN DEKANEN TE VERDEDIGEN OP WOENSDAG 11 JUNI 1975 TE 14.00 UUR

DOOR

SAKE JOHANNES BIJLSMA

DOCTORANDUS WIS- EN NATUURKUNDE GEBOREN TE DEN HELDER

1975 f

(4)
(5)

Summary

Automation of the manual system for the meteorological navigation of ships in the North Atlantic Ocean requires that the following tasks be computerized: (1) the construction of wind charts from pressure charts of the northern part of the Atlantic Ocean;

(2) the composition of wave charts with the aid of this wind information; (3) the determination of the least-time track with the assistance of these wave charts.

In this paper the third point is dealt with. The problem of computing the least-time track is a special case of the control problem of Bolza. The problem of Bolza is treated in Section 3. In Section 4 it is shown that, under certain conditions, the solu-tions of the Euler-Lagrange equasolu-tions depend continuously on the initial values of the Lagrange multipliers. This property, which holds both in the case of restricted and unrestricted manoeuvrability, forms the basis of a method for the computation of the least-time track. This method is considered in Section 6. An example is shown in Section 7. In Section 5 attention is paid to the problem of minimizing fuel consump-tion, and in Section 2 we give a description of the coordinate system used in practical computations. Finally an example of a computer program, written in ALGOL-60, is presented in Section 8.

(6)

Samenvatting

Automatisering van het manuele systeem voor de meteorologische navigatie van schepen op het noordelijk gedeelte van de Atlantisch Oceaan betekent dat de vol-gende werkzaamheden verricht zullen moeten worden met behulp van een reken-machine:

(1) de constructie van windkaarten uit luchtdrukkaarten van het noordelijk gedeelte van de Atlantische Oceaan;

(2) de samenstelling van golfkaarten met behulp van deze windinformatie; (3) de bepaling van de kortste-vaartijd route met gebruikmaking van deze golf-kaarten.

In deze publicatie wordt het derde punt behandeld. Het probleem betreffende het berekenen van de kortste-vaartijd route is een speciaal geval van het probleem van Bolza uit de theorie van optimaal geregelde processen. Het probleem van Bolza wordt besproken in hoofdstuk 3. In hoofdstuk 4 wordt aangetoond dat de oplossingen van de Euler-Lagrange vergelijkingen, onder bepaalde voorwaarden continu af-hangen van de beginwaarden van de Lagrange multiplicatoren. Deze eigenschap, die geldt zowel in het geval van beperkte als onbeperkte manoeuvreerbaarheid vormt de basis van een methode voor het berekenen van de korste-vaartijd route. Deze methode wordt beschouwd in hoofdstuk 6. Een voorbeeld wordt getoond in hoofdstuk 7. In hoofdstuk 5 besteden we aandacht aan het probleem van het minimaliseren van het brandstofgebruik en in hoofdstuk 2 geven we een beschrijving van het coördinaten-systeem, dat gebruikt wordt bij de werkelijke berekeningen. Een voorbeeld van een rekenprogramma, geschreven in ALGOL-60, wordt tenslotte gepresenteerd in hoofd-stuk 8.

(7)

1 Introduction / page 9

2 The coordinate system / page 14

3 Necessary conditions for a minimum / page 18 case 1: The unrestricted case / page 19

case 2: The restricted case / page 22 4 Time fronts and extremals / page 26

case 1: Unlimited manoeuvrability / page 26

case 2: Modifications in the case of prohibited courses / page 33 5 Minimum fuel consumption / page 36

6 The computation of the least-time track / page 38 7 Results / page 46

8 An example of a computer program, written in ALGOL-60 / page 55 References / page 66

Curriculum Vitae / page 69 Acknowledgment / page 71

(8)
(9)

1 Introduction

Optimal ship routing is a term meaning that we seek to find a route for a ship during its transit over the ocean between two given places so that a certain criterion (e.g. transit time, damage to cargo, fuel consumption or comfort of passengers) is optimized. In the case dealt with here the transit time is minimized, and in this con-nection we speak of minimal-time ship routing. In order to compute the least-time path, all the disturbing forces which may influence the ship on its way must be known. One of the most important forces which a ship encounters is formed by the disturbed ocean surface. As a consequence we assume here that the state of the ocean surface is fully known beforehand.

In practice this is not the case for the time being. Today we work with a weather forecast of 72 hours. In order to recommend the best possible route, this weather forecast is assumed to be valid during this time, leading to a route which may be changed every 12 hours when the next forecast is available. Nevertheless, it is of great importance now, when computing the best possible route step by step, to be compared at a later stage with the optimal route, and in the future, when longer-term forecasts will be available, to have a method at one's disposal for numerical

computa-i

HEAD

BEAM JBI BEAM - *

V FOLLOWING V

1

(10)

tion of the least-time track on an operational scale. It was the aim of developing such a method which led to this paper.

Let us first consider the history of ship routing. This history goes back to the middle of the nineteenth century, when Maury (1855) recommended least-time tracks for sailing vessels based on statistical wind and current data compiled from ships' logs. In those days the wind direction was of course extremely important.

The conversion from sail to other means of propulsion made Maury's work obso-lete. Although developments in aviation led to several investigations on this subject, it was not until more than a century later that James (1957) introduced a manual method for the calculation of least-time tracks for ships. His method can be described as follows. Depending on the relative wave direction resulting in head, beam and following waves (see Fig. 1) he constructed, in an empirical manner, graphs showing the connection between the ship's speed and the significant wave height as illustrated in Fig. 2.

By analysis of these data (including ocean current) the least-time track is constructed by introducing time fronts analogous to wave fronts in geometrical optics (see also Section 4).

The introduction of the computer led to the development of several methods for the computation of the least-time track. These methods can be roughly divided into two groups: one group using networks partly or wholly covering the navigation area (such as developed by Braddock (1968) and Zoppoli (1972)), and a second group

SHIP'S SPEED

FOLLOWING WAVES

BEAM WAVES

HEAD WAVES

SIGNIFICANT WAVE HEIGHT Fig. 2

(11)

containing applications of the calculus of variations or optimal control theory (e.g. Bleick and Faulkner (1965) or Marks et al. (1968)). In most methods the ship's velocity is approximated by a polar velocity diagram of elliptic form constructed by means of empirical data as presented in Fig. 2. We shall return to this subject in Section 6. For a theoretical treatment of the response of a ship to waves, the reader is referred to publications such as those of the Society of Naval Architects and Marine Engi-neers. In our opinion, application of the optimal control theory is preferable for practical reasons (see Section 6) when computing the least-time track. As a con-sequence the method presented here is an application of results of this theory.

Let us now consider some practical aspects of ship routing at the Royal Netherlands Meteorological Institute (KNMI). The Ship Routing Office was established at the KNMI in 1961. The activities of this Office can be generally outlined as follows. (a) To supply information it is first necessary to collect a variety of data, such as the synoptic surface pressure analysis of the North Atlantic (delivered twice daily by the Weather Service of the KNMI), 500-mb charts for 72 hours ahead (transmitted by the National Oceanographic and Atmospheric Administration at Suitland), ship's reports containing wind and wave data, usually every 6 hours (from selected ships), information on ocean currents (from the US Hydrographic Office), the oc-currence of pack ice, etc. The North Atlantic analyzed surface pressure charts are converted into corresponding wind velocity charts which are corrected by means of reported winds in the ship's reports.

(b) These wind charts are converted into wave charts, containing the significant wave height and direction of sea and swell, by manual analysis of the fetch and duration of the various wave generating areas. The wave charts are in turn corrected by ship's reports on waves.

(c) Given a specified ship and a well-defined operational policy, it is possible to obtain an average speed that the ship can maintain during 6 or 12 hours in different directions subject to the disturbing forces of the ocean surface.

With the aid of the above information the best possible route is recommended. Afterwards, following the manual method of James (1957), a least-time track is additionally constructed using the analyzed wave charts. Finally, sailing times along fixed routes, such as great circle and rhumb line, are calculated.

A survey of the points of departure and arrival of ships handled by the Routing Office is given in Fig. 3. The number of routed ships increased from 38 in 1961 to 711 in 1973. Recently an initial attempt was made at the KNMI to automate the manual routing method by successive numerical computation of wind charts, wave charts and least-time track. Results are found in Bijlsma en Van Rietschote (1972), Bijlsma en

(12)
(13)

Folkers (1973) and Bijlsma, Van Rietschote en Folkers (1973). As mentioned above only the numerical method for the computation of the least-time track is dealt with here. Theoretical aspects of this method are considered in Section 4, practical aspects in Section 6. Section 2 contains a description of the coordinate system and Section 3 a summary of relevant results of optimal control theory. An example is presented in Section 7. In Section 5, attention is paid to the problem of minimum-fuel routing.

(14)

2 The coordinate system

In order to simplify the computations, the navigation area is mapped conformally onto a plane by means of stereographic projection, which is commonly used in meteorology. We shall give a short description of this projection. In stereographic projection, the earth's surface is mapped onto a plane V, which is parallel or equal to the tangent plane at a point S of the earth's surface, by assigning to each point P of the spherical earth a point P' which is the point of intersection of V and the straight line through P and S', the point diametrically opposite S. In the case under considera-tion, the point S coincides with the north pole and the plane V passes through the circle of 60N latitude (see Fig. 4). We speak of a polar stereographic projection in this case.

Instead of geographical coordinates, we shall use here spherical coordinates

0 and (j) (see Fig. 5).

In the plane V we first introduce polar coordinates r and 0 with the mapped north pole as origin and a scale factor s so that the following relation holds (see Fig. 4)

Fig. 4

(15)

Fig. 5

R

r = — (1 + cos 71/6) tan (^/2.

s

Next we consider an orthogonal coordinate system with coordinates x^ and Xj where the Xj axis is parallel to the projection of the meridian of 30W longitude (see Fig. 6).

The relation between polar and rectangular coordinates is given by

^1 = ^in + 3 ~ sin (0 — 7t/6),

Xj = X2„ + — cos (Ö — 7r/6),

do

(2.1)

where Xi„ and X2„ are the coordinates of the projected north pole and d^ the mesh distance corresponding to 318 km at 60N where the projection is true. From (2.1) we find the inverse transformation

e = arctan {{x^ - XjJ / (x2 - X2„)} + 7i/6,

with

0 = 2 arctan {öoVC^i " ^inf + (^2 - ^inf]

^°~ R{\ + cos 71/6) '

(16)

Fig. 6

By differentiating (2.1) we find the local transformation

JX] =mi(j})R {sin (Ö - nl6)d(j) + cos (0 - ji/6) sin cj) dO},

dx2 = m((j>) R {cos (0 — T:l6)d(j) — sin (0 — 7r/6) sin 4> dO}

with

1 + cos Tt/6

m {(j)) = ;— •

srfo(l + cos(p)

Hence it follows that differential distances on the earth's surface must be multiplied by the map factor m((^) in order to convert them into differential distances in the (xi, X2) plane. In the practice of ship routing we are also concerned with sailing along the great circle or rhumb line as we saw in Section 1. We shall therefore give a short derivation of their equations in the (Xj, Xj) or (r, 0) plane.

(a) great circle

Let the pole P of a great circle have the spherical coordinates 0o and ^Q- Then in the spherical triangle NPQ (see Fig. 7) the relation

(17)

holds. Combination of (2.2) and (2.3) gives the equation of the projection of the great circle in the (xj, Xj) plane, which is a circle again, as was to be expected. As a result we find

with

Xim = Xi„ + So sin (j)o sin (0o - it/6),

X2m = X2„ + SQ sin (^0 cos (ög — 7t/6) and Sg = (ÖQ cos (/>o)~^.

The spherical coordinates ÖQ and (j)o are simply found by substituting the coordinates of two points of the great circle in (2.3).

(b) rhumb line

Owing to the fact that we are applying conformal mapping, it is clear that the rhumb line is mapped as a logarithmic spiral, with the projection of the north pole as its centre, satisfying the equation

with r = Tj exp {«(0 — öj)} a = In (rz/j-i) / (Ö2 - ÖJ and R r,- = — (1 + cos 71/6) tan (jjjl (i = 1, 2), s

where ((/>!, d^) and (02» Ö2) are the coordinates of two points of the rhumb line.

(18)

3 Necessary conditions for a minimum

In this section we shall summarize the conditions necessary for a minimum for the problem of Bolza. As an introduction to this, let us first consider our basic problem of minimizing the transit time for a ship of known performance. The equations of motion of a ship in a Cartesian coordinate system with coordinates Xj and X2 are given by

Xi = V{t, Xi, X2, p) cos p + Slit, Xi, X2),

X2 = Vit, Xi, Xj, p) sin p + Siit, Xj, X2).

Here the dot denotes differentiation to the time t. Further F(f, Xj, X2, p) gives the (maximum attainable) speed of the ship relative to the water as a function of the position coordinates Xj and X2, the time t and the course p. The functions S^it, x^, Xj) and S2((, Xi, X2) denote the velocity components of the ocean current. In practice these components are nearly time-independent during a winter or summer season.

The path of the ship is completely determined by the initial values of x^ and X2 and by the value of pit) over the voyage, so that the problem is to determine the function

pit) 0 < t < ti

which will minimize the transit time ij among all paths with prescribed conditions on the initial and final values Xi(0), XjCO), x^it^) and XjCfj). Instead of the problem described above, we consider the following, more general problem in the calculus of variations.

Consider a class of functions

ujit) a = l,...,p;to<t< <,)

and a class of arcs

x,(0 (i = 1,. . ., ti), connected by the differential equations

Xi =fiit, X, u) (M = « ! , . . ., Up-, X = Xi, . . ., x„) (3.1)

! and end conditions

(19)

We now seek to find a set of functions Uj{t) and x^it) which minimizes an integral of the form

/ = foit, X, u)dt. (3.3)

(0

This problem is called the control problem of Bolza. The functions Ujit)

are called control functions. The problem described initially is clearly a special case of the control problem of Bolza. We now distinguish two cases. First we consider the unrestricted case where no conditions are imposed on the control functions Uj or the coordinates X;. In the second case, however, these variables are restricted to a closed set.

In practical ship routing this means that the navigation area for the ship is bounded or that certain courses are forbidden.

CASE 1: The unrestricted case

We now return to the control problem of Bolza as formulated above. We restrict ourselves in this case to elements f, x = (x,, . . ., x„) and M = («i, . . ., u^) which lie in open sets T, X and U. These elements are called admissible. The cases where U or X is a closed set are extensions of the classical calculus of variations and are dealt with in textbooks on optimal control theory (see for instance Pontryagin (1962) or Hestenes (1966)). These cases are considered in the second part of this section. We consider arcs

C: Xi(0, Wj(0 (to < t < ti; i = l,...,n;j = l,...,p) such that

(a) the functions Uj{t) are continuous on the interval IQ < t < fj. In addition the functions ƒ;(/, x, u) (i = 0, . . ., n) are assumed to be continuously diiferentiable of the second order with respect to x and u and continuously diiferentiable with respect to t.

(b) its elements (t, x, u) are admissible. Suppose now that an arc

(20)

which is normal in the sense described below in this section and satisfies conditions (a) and (b) minimizes (3.3) subject to equations (3.1) and (3.2). Then there exist continuously differentiable multipliers A(t) = {Ao(0, • • •, -^„(0}. -^oCO — constant < 0 not vanishing simultaneously and a function

n

H{t, X, u,X)= X ^ifi,

i = 0

SO that conditions (1), (2), (3) and (4) described below hold on C". For a proof of the results of this section one is referred to Hestenes (1966).

(1) The first necessary condition. On C° the Euler-Lagrange equations

Xi = H^., Xi= - H^^, H^j = 0 (i = 1, . . ., n ; j = 1, . .., p)

hold and also the equation

dH

= ƒ/,.

dt

Variables as subscripts denote partial differentiation. In the case of movable ends the differentials of Xj^, (s = 0, 1) are connected by the transversality condition

t Uts) dx,, = 0 (s = 0, 1). i = l

(2) The necessary condition of Weierstrass. Along C° the inequality

H{t, x°, u, X) < Hit, x°, u°, X)

must hold for every admissible element (t, x°, u). In addition H{t„x°iQ,u''ia^{Q] = 0.

The generalization of the conditions (1) and (2) in the case where [/ is a closed set is known as Pontryagin's maximum principle and is considered in the second part of this section. Solutions of the Euler-Lagrange equations with continuous control functions are called extremals. As an immediate consequence of the condition of Weierstrass we have

(3) The necessary condition of Legendre. At each element (/, x", u°, X) of C° the inequality

(21)

holds for any non-zero ^ = (ii, . . ., y . If the determinant I Jï„,u. I 0", k = l,...,p)

is different from zero the arc C° will be called non-singular. This concept of non-singul-arity will be dealt with in more detail in Section 4. There still remains one necessary condition. In order to describe this condition we introduce the concept of variation.

Let

C: Xiit, e), Uj{t, e) (i = I, . . ., n; j = I,. . ., p)

be a one-parameter family of arcs satisfying equations (3.1) and (3.2) and containing C" for e = 0. Since equations (3.1) and (3.2) are identities in e we find, taking derivatives with respect to e at e = 0,

yi=t Ainyn + t BijVj (i = 1 , . . ., n), (3.4)

y,(Q = 0 (s = 0, 1), (3.5)

where

AiH =fi.u' Bu =ƒ•„,, y'iit) = XiXt, 0) and Vj(t) = Uj,{t, 0).

The arc

y- ytitXvjit) {i = l,...,n;j=l,...,p;to<t<ti)

is called the variation of the family C along x° if the functions Vj(t) are continuous and the functions yi{t) have continuous derivatives for ^o < ' < 'i- We are now in a position to define normality. The arc C° will be called normal if there exist 2n variations

/ : yKt), Vjit) (a = 1, . .., 2n)

satisfying equation (3.4) such that no linear combination of these arcs satisfies equa-tion (3.5). This is the case if and only if the determinant

((• == 1 , . . . , n; ff = 1,. . . , 2n)

yKk)

yKh)

(22)

is different from zero. Normality ensures the existence of the one-parameter family C\ The second variation l2(y) of ƒ along C° is obtained by evaluating I along the family C and then differentiating twice to e at e = 0. This second variation is given by

12(7) = -where 2a){t,y{t),v{t)]dt, to n n p p i , / i = l ( = 1 11=1 i.k=l

The fourth necessary condition can now be formulated as follows.

(4) The second-order condition. The second variation Ixiy) of / along C** is such that

iiiy) > 0

for every variation 7 satisfying equations (3.4) and (3.5).

As a consequence of normality, the equality sign for the multiplier AQ is excluded, so that by choosing AQ = — 1 the multipliers A^O (' = U • • •> ") are unique. In the practical problems discussed in this paper, the condition of normality is assumed to be fulfilled.

CASE 2: The restricted case

The results of the foregoing part of this section can be generalized in the case where the arcs

C: Xi(0, Uj{t)

not only satisfy equations (3.1) and (3.2) but also a set of additional constraints. Since we are primarily interested in the governing equations of our problem contained in the necessary conditions (I) and (2), we shall only consider generalizations of these conditions. First we assume that (7 is a closed set.

(7 IS A CLOSED SET.

We consider inequality constraints of the form

(t>i{t,x,u)<(i {l=\,...,q) (3.6)

(23)

to be continuously differentiable. An element (t, x, u) is called admissible if the sets

T and X are open, while u is restricted to a closed set U. Let

C°: x°(0, u°(0

be an arc which satisfies conditions (a) and (b) and minimizes (3.3) subject to equa-tions (3.1), (3.2) and condition (3.6). Let moreover the matrix

( 0 ; J (' = /i, • • - lr;k=l,.. ., p)

have rank r at each point {t, x, u) satisfying </>, = 0 (/ = / j , . . ., /,). Then there exist continuously differentiable and continuous multipliers X{t) = {/lo(0> • • •> Ki'O}^ K = constant < 0 and ^ ( 0 = {/^i(0, • • •, /^,(0}> and a function

n q

H(t, X, u, X,n)= X ^ifi - X ^/^/' 1 = 0 1=1

so that conditions (1) and (2) described below hold on C°. (1) The first necessary condition. On C" the equations

X; = H^,, 1; = - H^,, /ƒ„. = 0, </), < 0 (i = 1,. . ., n; 7 = 1,. . ., p ; / = 1,. . ., 9) hold and also the equation

dH

= H,.

dt

Moreover ;U,(0 > 0 (/ = 1, . . ., g) where /i,(f) = 0 at each point of C" at which </., < 0 .

(2) The second necessary condition. Along C" the inequality

H{t, x°, M, A, 0) < H{t, x°, u°, X, 0)

must hold for every admissible element (t, x", u) for which (/>,(?, x°, u) < 0.

So far we have considered the maximum principle contained in conditions (1) and (2) on an open set X. We now continue with the case where the trajectory x lies partly or wholly on the boundary of a closed set X, i.e. we consider constraints of the form

(24)

The functions il/„(x) are assumed to be continuously diiferentiable of the second order.

The set U may be open or closed. Analogous to the foregoing, the concept of admissibility is defined.

Z IS A CLOSED SET.

As before, we consider an arc

C°: x°(0, M°(0

which satisfies equations (3.1), (3.2) and condition (3.7), and minimizes (3.3). Let the matrix

( E fmx/iu^ j ( m = 1, . . ., r ; fc = 1, . . ., p )

have rank r. Then there exist continuously differentiable and continuous multipliers A(0 = {Ao(0> • • •> 'ln(0}^ -^0 = constant < 0 and v{t) = {vi(0,. . ., v,(0}, and a function

n r n

H(t, X, U, A, V) = X ^ifi - Z E ^m^mx/i > i = 0 m = l 1=1

so that the following equations hold on C°.

(1) The first necessary condition. On C° the equations

Xi = H^„ 1; = - H^^, H^j = 0 (i = 1,. . ., n; j = 1,. . ., p)

hold and also

dH dt H,.

Moreover the multipliers v„(t) (m = 1,. .., r) are non-increasing on ÏQ < * < ' i and are constant on every interval on which

iA„{x°(0} < 0.

(2) The second necessary condition. Along C" the inequality

(25)

must hold for every admissible element (t, x", u) for which il/^ix^) < 0.

Moreover, if [/ is a closed set, u must also satisfy conditions of the form (3.6). This concludes the results of the general theory. In the next section we shall apply these results to the problem of ship routing in order to derive the necessary equations for this problem.

(26)

Time fronts and extremals

In this section we return to the problem of minimizing the transit time. We shall derive some properties of extremals which form the basis of a method for the com-putation of the least-time track. The problem under consideration was to determine a function

pit) 0 < t < ti,

so that it minimizes the transit time ti subject to the equations

Xi = V{t, Xi, X2, p) cos p + Si (t, Xi, X2), (4.1)

±2 = V(t, Xi, X2, p) sin p + 82(1, Xi, X2) (4.2)

with

xM = ^io, ^.('1) = Xn (i = 1, 2).

Let us first consider the case of unlimited manoeuvrability. CASE 1: Unlimited manoeuvrability

Application of the results of Section 3 with n = 2, u^ = p, (Q = fixed = 0,/o = 1, / i = F cos p + Si and ƒ2 = Ksin ;? + S2 yields the equations

^i = - 1 A,(Ki,. + S,,,), (4.3) i = l ^2 = - E ^iiVi,, + S,J, (4.4) i = l Z ^i K, = 0, (4.5) i = l

where F, = F cos p and V2 = V sin p.

First of all we would point out that the //-function vanishes along an extremal, so that

(27)

(V,V,)

Fig. 8 The ship is situated at O. 0 is the angle between the ship's heading and the wave direction.

A second remark concerns the case of a movable end point. In the case of an optimal transit time i^ differential changes in the coordinates of the end point are connected by the relation

X Ut,)dx,, = 0. (4.7)

i = l

Equations (4.5), (4.6) and (4.7) have a simple geometrical meaning, as we shall see below. At this point it is convenient to introduce a polar velocity diagram as shown in Fig. 8, giving the ship's velocity as a function of the angle between the ship's heading and the wave direction for fixed values of Xi, Xj and t (see Section 6). This velocity diagram will be called the indicatrix after Caratheodory (1904), (see also Bolza (1909)), although strictly speaking the ocean current should also have been taken into account.

Next we consider a theorem on systems of differential equations yk=fk{t,yi,--->yn,s) (fc = ! , . . . , « )

depending on a parameter s. For a proof one is referred to Coddington and Levinson (1955, p. 58).

THEOREM 1.

For k = I, . . ., n the following assumptions are made concerning the real functions

fkiuyi, • • •,y„,s).

(a) fi^{t, y,, . . ., y„, s) is a continuous and bounded function of the variables

(28)

(b) for s = SQ and a^(so) = a° there exists a unique system of functions >'/((') •So) = yïit) satisfying the equations

y„it,s) = afc(s) + A{t,yiit,sl...,y„{t,s),s}dt (4.8)

'0

with a < (Q < ^• Let moreover

lim afc(s) = a°,

s->so

then every solution yi^{t, s) of (4.8) also satisfies the relation lim y^it, s) = y^it).

s-*so

In conclusion we give a theorem on implicit functions. For a proof one is referred toHestenes(1966,p. 22).

THEOREM 2.

Consider a system of n simultaneous equations

fii^i, • • ; z„, >'i, ...,y„) = 0 {i = 1 , . . . , «).

We assume that

(a) the functions/j(zi, . . ., z„, ^ i , . . ., >>„) are real continuous functions on an open set S.

(b) the partial derivatives

fiy, {i,i = \,...,n)

are continuous on S. Let the functional determinant be given by

D = \f:y,\.

Suppose that the relations

J - / 0 0 0 0 \ / - v r » / ' 0 0 0 0\ , r\

/ i ( z i , . . ., z^, y^,. . ., y„) = 0, D ( z i , . . ., z„, y^,. ..,y„)^0

hold at a point (z?,. . ., z°, yl,.. ., y^) in S. Then there exist continuous functions yiiz) = yii^i, • • •> Zm)

(29)

in a neighbourhood of z° such that

>';(z°) = y°, fi{^, yi (z), • • •. y.i^)] = o (i = i , . . . , « ) hold only in case

yt =

y.Cz)-We now return to equation (4.5). The geometrical meaning of this equation is illustrated in Fig. 9. Instead of considering p as a function of the time t, we now

regard p as a function of the variables x^, x^, ^ i , X^ and t given by (4.5).

In fact p is a function of arctan (/I2//I1) as easily follows by writing equation (4.5) in the form

p = arctan (A2M1) + arctan (Fp/F).

In the following we are interested in continuous functions p(f, Xj, x^, /li, /I2). Application of Theorem 2 to equation (4.5) yields the non-singularity condition

Z h Vi,, # 0, (4.9)

( X l - X j )

WAVE MOTION

(Y.v^)

Fig. 9 In view of the Weierstrass or Legendre condition there is a unique choice for p. The course p is measured as indicated.

(30)

so that in view of the Legendre condition

Z A, F;p, < 0. (4.10)

1 = 1

In addition V, Vp and Vpp must be continuous functions with respect to Xj, Xj, p and (.

Combination of (4.5) and (4.9) gives

V^ + 2Vl-VVppy^0. (4.11)

The geometrical interpretation of this result is elementary, as illustrated in Fig. 10 (see for instance Bolza (1909, p. 369)).

Writing >li(0) = cos a and >^2(0) = sin a. Theorem 1 can be applied to equations (4.1), (4.2), (4.3), (4.4) with (4.5) if we set to = 0, s = a, y,= x,, y^ = Xj, y^ = X^,

y^ = X2, «1 (a) = Xio, «2 ifl) = ^2o> O's if^ = cos a, «4 (a) = sin a, fi = V cos p + Si, f, = Vsinp + S2,f, = -Y ^i(Vi^. + Su,) and ƒ4 = - ^ A,.(^^.,, + S , J and if we

1=1 i = l

assume that the right-hand sides of (4.1), (4.2), (4.3) and (4.4) with (4.5) are continuous

Fig. 10 Condition (4.11) implies that the indicatrix must be convex, so that the tangents forp and p perpendicular to the direction (Ai, Aa) cannot coincide, which would lead to a corner in the corresponding solution.

(31)

and bounded, and satisfy the Lipschitz condition so that condition (b) of Theorem 1 is fulfilled. In view of the homogeneity of equations (4.3), (4.4) and (4.5) it is clear that all extremals starting from (x^o, ^20) are found by varying parameter a. Sum-marizing the foregoing, we have the following result.

RESULT 1.

Let the functions V, V^, V^^, K^,, V^^, S;, Si^^ and S,.,^ (( = 1, 2) be continuous for 0 < / < fi and let relation (4.10) be valid. Futher let the right-hand sides of equations (4.1), (4.2), (4.3) and (4.4) with (4.5) be bounded and satisfy a Lipschitz condition with respect to Xj, X2, k^ and X2- Then X;(f, a) and Xi(t, a) (( = 1, 2; 0 < ï < /,) as solutions of equations (4.1), (4.2), (4.3) and (4.4) with x,(0) = XJQ (i = 1, 2), where

p is given by (4.5), are continuously differentiable with respect to ( and continuous in

their dependence on the parameter a defined by Ai(0) = cosa and l2(0) = sina. Result 1 enables us to introduce a numerical method for the computation of the least-time track which appears to be very suitable in practical cases. The practical aspects of this method are discussed in Section 6. Let us proceed with a geometrical interpretation of the foregoing. Integrating the system of equations and varying para-meter a, we find after a time T a set of points S(T) which can be reached ultimately. For the sake of simplicity we first restrict ourselves to a field of extremals, which means that the extremals starting from the point O at time t = 0 (see Fig. 11) do not intersect. The set of points S ( T ) is called a time front. Let {XI(T, a), X2(T, a)} be a point of S(x). We further assume that the tangent {XI„(T, a), X2a(T, a)} in this point

exists. Let us now consider {XI(T, a), X2(T, a)} as a movable end point. Since X;(f, a)

(i = 1, 2; 0 < ? < T) is a solution of our optimal problem with movable ends, the differentials of the coordinates {XI(T, a), X2(T, a)} with respect to a must satisfy

relation (4.7), yielding

2

Y, li(T, a) X;^ir, a) = 0. i = l

In view of this relation one can construct time fronts in a geometrical manner by determining the direction of the normal to S(T) and applying the construction of Fig. II. According to equation (4.6), the angle between the normal to S ( T ) and (Fi -t- Si, F2 + S2) must be acute. The first time front which contains the fixed end point obviously yields the least-time track.

Let us now consider the more realistic situation that usually occurs in practice when a part of the one-parameter family of extremals has an envelope C, as sketched for instance in Fig. 12.

(32)

..sk) (V, ,V, )

lp 2p

Fig. 11

{\.\)

(V, + S,,V2+S2)

Fig. 12 S(T), the set of ultimately attainable points at time ? = T for a ship starting at time / = 0 at O, is indicated by a heavy line.

(33)

The curves C are called caustic curves. In particular they can degenerate into one point. The tangent point of an extremal with an envelope is called a conjugate point to O. As a consequence of the fourth necessary condition a non-singular extremal be-tween two points cannot be a minimal curve if it contains a conjugate point bebe-tween those points. This condition is called the necessary condition of Jacobi. The necessary conditions of Euler-Lagrange (I), Weierstrass (II), Legendre (III) and Jacobi (IV) from the classical calculus of variations were in fact discovered in the sequence I, III, IV, II. An arc satisfying these four conditions furnishes a relative minimum for our problem. In order to find an absolute minimum we have to consider the time front S(T)(Fig. 12), which is in fact the boundary of the set of points that could possibly be reached at the time f = T. An extremal x,(t) (i = 1, 2) furnishes an absolute mini-mum for our problem if XJ(T) (/ = 1, 2) belongs to the boundary S(T) for all T with 0 < T < (i. This property has been proved by Halkin (1964, see p. 9).

CASE 2: Modifications in the case of prohibited courses

In the first part of this section we ignored the fact that some courses could be for-bidden. We shall consider this case here. The prohibition of a course is due to heavy rolling which occurs if the course is at a certain angle, depending on the ship's velocity and wave period, with respect to the wave direction. The polar velocity diagram is changed for instance as indicated in Fig. 13.

The course p is here restricted to sector I or II determined by the angles M,(r, Xj, Xj) (/ = 1, 2, 3, 4). For courses p which are interior courses of these sectors, the above equations remain valid. If p would exceed one of the boundary courses, say Mj, it is equalized to this value. According to the theory of Section 3, equations (4.3) and (4.4) change into

\ WAVE MOTION • SECTOR n - *

Fig. 13 The non-coinciding boundary courses Mi{t, xi, X2) (I = 1, 2, 3, 4) are measured in the same way as the course p.

(34)

2

I

( = 1 i l = - Z ^X^^x. + S,x.) - /.,M;,„ (4.12) ^2 = - Z A,.(I^-., + S,,,) - HjMj,^, (4.13) 1 = 1

where /i^ is a Lagrange multiplier given by (4.15).

Let us now consider the variables p and Hj in their dependence on Xj, Xj, Ai, /Ij and (. We start with the course p. If p is an interior course of sector I or II (we first assume Xj, Xj and t to be fixed) then p{t, Xj, Xj, Aj, Aj) is a continuous function of arctan {^2l^i)- ^ s soon as this angle equals or exceeds a boundary value, say arctan {^IjC^jOMiC^j)}. P obtains the value Mj{t, x^, X2). So at the boundary the following relation holds

P = i

Mj{t, Xi, X2) if arctan (/I2M1) > arctan {A2(Mj)//li(Mj-)}.

(4.14) p(i, Xi, Xj, ij,/I2) otherwise.

Of course the inequality sign may be changed in the opposite sense, depending on the situation.

If we require Mi{t, x^, X2) ( / = 1, 2, 3, 4) to be continuous functions of Xj, X2 and t and moreover if p is restricted to lie in one of sectors I or II, then p is continuous in its dependence on Xi, X2, A,, Aj and t. With respect to ^j we have

i^j = i

2

I^ ^iVip with p = Mj .^ ^^^^^^ ^^^^^^^ ^ ^^^^^^ {A2(M,.)Mi (Mj)}. (4.15) 0 otherwise.

We now return to equations (4.1), (4.2), (4.12) and (4.13). Analogous to the previous case we have the following result.

RESULT 2 .

Let Mj(t, Xi, X2) and Mj^^(j= 1, 2, 3, 4; i = 1, 2) be continuous with respect to Xi, X2 and t. Further let the conditions of Result 1 be fulfilled for courses in sectors I and II, including the boundary courses for 0 < ? < fj. Then Xi{t, a) and li(t, a)

(i = I, 2; 0 < t < ti) as solutions of equations (4.1), (4.2), (4.12) and (4.13) with

Xj(0) = Xio(i = 1, 2), where p and Hj (j = 1, 2, 3, 4) are given by (4.14) and (4.15), are continuously differentiable with respect to t and continuous in their dependence on the parameter a defined by /li(0) = cos a and ^2(0) = sin a.

(35)

Regions of limited and unlimited manoeuvrability are assumed to be separated from each other by closed curves in the (x^, Xj) plane changing continuously with time and containing the limiting points where Mj and Mj as well as M3 and M4 coincide. So that extremals along which the conditions of Result 1 and Result 2 are satisfied still depend continuously on their initial values, we have to make additional assumptions with respect to A^ and /I2 along the boundary curves. The range of values of /li and A2 along these curves must be such that the corresponding courses p in the regions of limited and unlimited manoeuvrability pass into each other continuously. When computing the least-time track afterwards we shall not use this concept of limited manoeuvrability, because the least-time track will never go through such a region of higher waves. To conclude this section we shall pay some attention to the behaviour of extremals near a fixed boundary. In practical ship routing this boundary may be formed by land or ice. Assuming that such a boundary can be described locally by functions which are linear in the variables Xi and Xj, say c^x^ + C2X2 < 0, the fol-lowing equations hold

>^i = - Z (^i - ^i^j) (Vu, + 5-.),

1 = 1

i = l

(]' = I, . . ., n; where n is the number of inequalities needed to describe the whole

boundary) where v^- is again a Lagrange multiplier analogous to (4.15). In connection with the position of beginning and end points in practical cases it is assumed here that extremals either touch these boundaries, so that Vj = 0, or will be cancelled.

(36)

5 Minimum fuel consumption

For the sake of completeness, we shall now consider the problem of minimizing costs during transit, apart from the costs determined by the time of arrival, which in general are minimized by minimizing the transit time. It is supposed here that the costs of a ship during an ocean crossing are mainly due to fuel consumption. As a result, it is the minimization of this quantity which will be discussed. We therefore first consider the speed K as a new control variable. Moreover, we assume that the rate of decrease of fuel can be described by the equation

Xo=foit,Xi,X2,V,p), (5.1)

where Xo(0 denotes the fuel as a function of the time t. According to the theory of Section 3, we now seek to find functions p{t) and V{t) satisfying the equations

Xi = Fcos p + Si(f, Xi, Xj), (5.2)

X2 = V sin p + 82(1, Xi, X2) (5.3)

with

^i(O) = x,o, Xi(fi) = ^ii (1 = 1,2) which minimize

/o(f, Xi,X2, V,p)dt. (5.4)

Of course the speed V is restricted to a range of values given by ^'mi^(^ Xi, Xj, p) < V < K„„(«, Xi, X2, p),

where V^^^{t, Xi, Xj, p) denotes the maximum attainable speed depending on wave height and wave direction and V^i„{t, Xj, Xj, p) an acceptable minimum. Since we assume that V will not take these boundary values, the corresponding Lagrange multipliers vanish. Moreover, we choose XQ = — 1. For the sake of simplicity we neglect ocean current. Application of the theory of Section 3 yields

A. =/ox„ (5.5)

(37)

— fov + ^i cos;? + Aj sin p = O, (5.7) -fop - ^iV smp + X^V cos p = 0. (5.8)

Since the H-function vanishes along an extremal we also have

- / o + A, K c o s p + zlz Fsin;7 = 0. (5.9) From (5.7) and (5.9) it follows that the speed V along an extremal must be so

chosen that it maximizes the quotient

^^ (5.10)

foiU xi, X2, V, p)

As a result we could prescribe in every point of the (xj, X2) plane an optimal speed

V{t, Xi, X2, p) satisfying (5.10), leading to a more direct approach to our problem

analogous to the time-optimal case. As before we can derive conditions which must be satisfied so that the solutions of equations (5.2), (5.3), (5.5), (5.6), (5,7), (5.8) and (5.9) depend continuously on their initial values.

Let the initial values of the multipliers X^ and Xj ^^ denoted by a and b. Then because of the inhomogeneity of equations (5.5) through (5.9) we must consider X;(«, a, b) and Xi{t, a, b) (i = 1, 2) in the {a, b) plane. Although it is possible to proceed in this way, it seems more sensible in view of the accuracy of the fuel functions /o(f, Xi, X2, V, p), which are derived from empirical data, to apply suitable

approxima-tions in practical cases. For instance, if we assume that/o{f, x,, Xj, V(t, x,, Xj, p), p} does not depend on Xj, X2 and p, we can apply the results of the preceding section.

(38)

6 The computation of the least-time track

In this section we shall apply the results of Section 4 to the computation of the least-time track. In this connection some remarks will be made on practical aspects of the problem.

(1) When solving equations (4.1), (4.2), (4.3), (4.4) with (4.5) numerically, the time step is determined by the fact that wave charts are available every 12 hours. Depending on the ship's speed one can introduce 6-hour or 12-hour time steps inter-polating between two successive wave charts, so that the distance which can be covered by the ship is of the order of magnitude of the mesh distance. As a consequen-ce of practical experienconsequen-ce, it is assumed that the wave height and direction between grid points can be obtained by bilinear interpolation.

(2) A second point concerns the approximation of the derivatives with respect to the coordinates x^ and Xj in the grid. If we denote the Xj and Xj coordinates of a grid point by (/, ;') and for instance the ship's speed at this point by V{i, j) then derivatives are approximated by

v,,(ij) = Hni + uj)-v(i-i,j)},

where distances are measured in mesh units. Moreover, it is assumed that derivatives between grid points can be obtained by bilinear interpolation. The validity of this approximation has been tested by means of a numerical construction of time fronts in the geometrical way as described in Section 4. The actual geographical velocity diagram showing the relation between ship's velocity and wave direction (and wave height) is assumed to be of elliptic form. It is constructed with the aid of the actual geographical values of the ship's speed in the case of following, beam and head waves (see Fig. 14). These values, which must be multiplied by the map factor m((j)) when applied in the (xj, Xj) plane, are obtained from empirical data. It is supposed here that the speed exceeds the numerical value of the ocean current for all waveheights. (3) We shall now pay some attention to the occurrence of forbidden courses. Consider a ship with zero velocity in a wave field composed of waves of a single period. If the direction of the waves lies in a suitable sector and if their period corresponds to the resonance period of the ship, then the ship will undergo violent movements.

(39)

Fig. 14 The velocity diagram. The ship is situated at O. Vf, Vb and vii correspond with the ship's speed in the case of following, beam and head waves.

As a consequence, one has to change the position of the ship with respect to the wave direction in order to avoid heavy rolling. If we now consider the more realistic situa-tion of a moving ship in a seaway, some modificasitua-tions will appear due to the fact that (a) the wave period which causes resonance and also the corresponding sector of relative wave direction are dependent on the velocity of the ship, and

(b) instead of waves of a single period, a spectrum of wave periods is present. As a representative period, one could take in this case the period which is related to the maximum energy in the spectrum.

As we saw in Section 4, the velocity diagram must be changed, as shown in Fig. 15, where the sectors of forbidden courses are indicated. For simplicity it is assumed here that these sectors depend merely on the significant wave height (which in fact deter-mines the maximum ship's speed). Owing to the danger of heavy rolling, a ship will in general not follow a strategy as mentioned by De Wit (1968), (see also Zoppoli (1972)), where points in the forbidden sectors can be reached by steering a combina-tion of boundary courses.

WAVE MOTION

(40)

r

Fig. 16 Computer produced by means of an incremental plotter using wave information over the period 17 January-23 January 1970, fictitious ship's data and a 12-hour time step. The least-time track is indicated by the dashed line.

(41)

(4) Let us now consider the continuous dependence on the initial values (Results 1 and 2 of Section 4) from a practical point of view. Consider two extremals {xi{t),Xi{t)} and {Xj(0 + AXiit), /li(0 + A^i{t)} (i = 1, 2) satisfying equations (4.1), (4.2), (4.3) and (4.4), starting from the point (X^Q, ^20) with parameter values a and a + Aa (see again Results 1 and 2 of Section 4). Since these solutions depend continuously on the initial values, it follows that Axi{t), A2.i(t) ^ 0 (i = 1, 2; 0 < t < tjif Aa -^ 0.

As a consequence, we can start an extremal at time t = T {0 < T < tj) with initial values which can be obtained by linear interpolation between the corresponding values of its neighbours if the distance y/Ax^ity + AX2{T:)^ is small enough (see Fig. 16). The above procedure can be applied in the case of forbidden courses, if the courses

p and/» + Ap connected with the two extremals both belong to sector I or sector II

(Result 2, Section 4), otherwise a gap occurs between the two extremals.

(5) Further we may remark on the behaviour of extremals near a boundary. In some cases there are parts of the ocean region which cannot be reached along extremals. To avoid this situation, points are chosen in a suitable way along which extremals can penetrate these areas. These points can be considered as new points of departure or arrival (see Fig. 16). The computation of an extremal is stopped if it intersects the boundary. As a result near a boundary only those extremals will be considered which coincide with it partly or wholly. We shall conclude with a remark on the exclusion of extremals.

As we saw in Section 4, extremals can be excluded because of

(a) the presence of a conjugate point between beginning and end point (no rela-tive minimum), and

(b) the fact that not every point of this extremal belongs to the boundary of the corresponding set of reachable points (no absolute minimum).

In the practical situations treated here (with 6-hour or 12-hour time steps) the second condition will not be satisfied in all cases. Although in general we consider all extremals when computing the least-time track, there are situations where the exclusion of extremals on account of condition (a) saves a lot of computing time. These situa-tions can be handled very simply. After these introductory remarks, we shall give a survey of the method for the computation of the least-time track in the form of a flow diagram. This flow diagram gives a description of the computation of the route which is presented in Section 7. The corresponding computer program is found in Section 8.

(42)

Flow diagram

compute points attainable in optimal directions after the first

time step.

compute also points attainable along great circle (gc) and

(43)

compute points attainable along extremals, gc and rl after the \^^ 12-hour

time step.

determine indices \ of points of optimal \ route and compute ) distance covered and /

crossing time. /

/ stop the \ / computation of an \

/ extremal if it intersects the )

\ boundary of the / \ navigation area. /

print ship's data, and distance covered and crossing time along

(44)

compute the position of the ship

along gc after the jih 12-hour time

step.

/ compute distance \

( covered and crossing V

-\ time along rl. /

yes

print distance covered and crossing time along rl.

print the 12-hour postions of the ship along optimal

route, gc and r l .

compute the postionof the ship along rl after the j '

1 2 - h o u r t i m e step

(45)

At this point we shall touch lightly on other methods applied in ship routing for solving equations (4.1), (4.2), (4.3), (4.4) with (4.5). We can distinguish two types of iterative methods: a steepest-ascent method or method of gradients, Kelley (1962), Bryson and Denham (1962), and a method which uses variational relations between initial values and end conditions, Marks (1968), Bleick and Faulkner (1965), see also Faulkner (1963, 1964). Of course a third method can be found by using the geometrical relations between time fronts and extremals as mentioned in Section 4 (see De Wit (1968)). The disadvantages with respect to the application of the iterative computing methods are first of all, that the solution depends on the choice of the initial course, which is unacceptable for operational use, and secondly, that there may be convergence problems, especially in view of the use of empirical data. The geometrical time front method is more suited for manual use than for numerical application because of the introduction of random errors when computing the normal direction, which in fact is assumed to exist. In conclusion we consider the possibilities of a practical application of the numerical method. At the Routing Office of the KNMI, transit times along least-time track and standard routes are provided afterwards, using analyzed wave charts in order to check the value of the recommended route.

Since the number of ships had increased to 711 by 1973, as we saw in Section 1, computerization of only this evaluation would be time-saving.

(46)

7 Results

In this section an example is presented of an ocean crossing between Greenock (Tory Island) and Charleston (Frying Pan) (see also Fig. 3). The service speed of the chosen general cargo-ship was 21 knots. This ship departed from Tory Island on the 25th October 1973 at 03.00 GMT. The recommended route manually constructed with the aid of the 72-hour weather forecasts is indicated in Fig. 17. The transit time was 8 days and 2.5 hours. Before being used for computations with respect to the least-time track, great circle and rhumb line the ship's performance data were corrected by recomputing this route with analyzed wave charts. The crossing times along the least-time route, great circle and rhumb line (see Fig. 17) were respectively 7 d 20.7 h, 8 d l 9 h a n d 8 d 7 . 3 h .

The detours of the least-time route and recommended route with respect to the great circle were 296 and 253 miles.

This section concludes with a series of wave charts showing the 12-hour ship's positions along the least-time track and great circle. These wave charts contain significant wave height contours in meters and wave motion arrows. Sea is indicated by solid lines, swell by dashed lines.

(47)

*--'-- tl

Wave chart 25 October 1973 12.00 GMT

(48)

Wave chart 26 October 1973 12.00 GMT

" " M •

y<^)^ .

(49)

Wave chart 27 October 1973 12.00 GMT

(50)

Wave chart 28 October 1973 12.00 GMT

(51)

Wave chart 29 October 1973 12.00 GMT

(52)

1 / ^^

..-3-1 ,•2-" ' » » » . ^ . ' I ',

Wave chart 30 October 1973 12.00 GMT

^ ^ ^ ^

r^ /..ii:('V

1 .-•••; ».^6 >. •f» v . - ^ / / . i Wave chart 31 October 1973 00.00 GMT

(53)

* v'

/ ; / » . ^ 6

'. , / *^

Wave chart 31 October 1973 12.00 GMT

(54)

54

r

Wave chart 1 November 1973 12.00 GMT

•/ ' ( & ^ . / / ": • • 3 -- -- 2 ^ . ^ . , . • 2 -i - 3 - " ' . 2 -» . ^ 6 U

(55)

8 An example of a computer program, written in ALGOL-60

begin comment This computer program has been used for the computation of the least-time track from Greenock to Charleston , a route vhloh Is presented In Section 7* It Is a simplified version of the program applied at the KNHI. The input/output procedures are determined by the use of an ELJC8 computer; Integer ant,Bt,at1,at3,ctr,ai,d2,f,h,hl,hh,hk,hk1,hk2,l,10,11 ,12,100,101,102, 111,1001,10001,ll,ln,ln1,lp,J,JO,j2,JOO,J001,JJ,JJ1,Jg,Jl,jr,k,k1,11,mnd,pla, •pt,srt,t1 ,tot,tk,tr,x,y;

real aO,aa,aa1 ,afst1 ,afst2,afst3,alpha,ajin,bb,bbl ,cc,cc1 ,copgr,copl,d,dx,dx1, dy,dy1 ,e1 ,e2,e3,ft,g,grd,gur,l,12,13,lU,101,102,111 ,1111 ,llm,llm1 ,P,p2,p3,p'>, pOI ,p02,pl,pl2,plU,pl6,pl9,pln2,pp,pr,pr1 ,pu1 ,pii2,pu3,q,r,rO,r1 ,r2,s,s1 ,slpgr ,slpl,t,th,tp2,tp3,tpU,tt,tt1 ,tt2,ur,vh,xe,xg,xk,xl,x8,xv,}cx,xxl,xjcx,ye,yg,yk ,yl,ys,ysn,yv,yy,yyy;

Integer array AF[l :3],XX,YY[l :12],I,PIA[1:50],PS[l :100],PA,PB[1:150], GH,GR,XGS,1R3S[0!27,0:19]5

array AH[l :3l,AnC,AFY[l :lt],L[l :12],XGC,YOC,XIX,YL1C,XOR,TOR[0:50], A,IA,MJ,P,PX,Fï[O:3OO],AA[l:3,O:15],X,Y[0:300,O:2];

boolean joke,joke1J

real procedure BR(x,y); value x,y; real x,y) BR:--«rotan(3(irt((x-7.5)/t\2+(y+8.5)^\2)xa0)x2+pl2; real procedure lE(x,y)j value x,y; real x,y; LE:»arotan((x-7.5)/(y+8.5) )+pl6;

procedure PI (u); value u; real u; begin Integer dj real ru;

d:-entler(u/2U); ru:"U-*<2Uj

SPACE(19); ABSFIXT(2,0,d); ABSFIXT(lU,l ,ru); HLCR; NXOR end PI J

procedure P2(A,B,g,tkt)s value g; Integer g; array A,B) string tkt} begin Integer 1; KEWPAGE; CAI!RIAGE(5); PRIMTTE3CT(|qpolnts ^)s PRIirnEXT(tkt); PRIMTrE)CT(|c r o u t e : x1 x2 l a löl>)l CAi®IAGE(2)j for i ; - 0 , l + 1 while 1 ^ do begin NLCR; SPACE(29); ABSFIXT(2,2,A[1]); A B S F I X T ( U , 2 , B [ 1 ] ) ; ABSFr!(T(U,2,BR(A[l],B[l])/grd); ftBSFIXT(l(,2,I£(A[l],B[l])/grd) end end F2;

(56)

procedure I S ; begin I n t e g e r J1J

J 1 : - J - 1 ;

vh:-1-ArST(XG0[j1 ],ÏGC[J11,xk,yk)/ AFST(XGC[J1 ],ÏB0[J1 ],XGC[J l.YOOtj]) J I f v h O then KOto RIK e l s e beffln J o k e l i ^ f a l s e j B a ; - a a 1 : bb:"bhl5 e c ; " c c 1 ; J001:-JJ 111:-\*X111; I 1 1 1 : - U i x l l l s xx1:-((yk-bb)xs(irt(ooxU-lll)xtk+aa^xk)xlll/(oex2)J XGC[j];«xg:-xk+xx15 ÏGC[j]!«yg:-yk-((xk-aa)Xxx1xa+111l)/((yk-bb)x2) end; RIK: end US;

procedure CB(x,y); value x,y; real x,y; begin real prdx,prdy,s;

prdx:"prdy:"0;

OOBY: 8:-(((prdx/2+x-7. Jl-t^+Cprdy/S+y+e. 5)|2)XaOXRO+1 )Xs1} If prdx^O V prdy+0 then goto KIM;

prdx:-sXdx; prdy:"sXdy; goto OOBï;

KIM: dx:-sxdx; dy:"sXdy end CB;

real procedure AFST(x1 ,y1 ,xg,y2); value x1 ,y1 ,x2,yg; real x1 .y1 .x2,yg; AreT:-sqrt((x1-x2)^v2+(yl-ya)^\2)x636,5/

((((x1+x2)/2-7.5)'t>2+( (y1+y2)/S+8.5)|£)xaaxaO+1 ) / f t ; procedure AM(x,y); value x , y ; r e a l x , y ;

begin Intef^er 1; a i m : ' 2 | 1 5 } t r ; - 0 ;

Tor I;«11,l+1 vfalle l<In do

begin diHlFSTCxd.OljYEl.OljX.y); I f d ^ i m then begin anin:"d; t r : " l end end

end AM;

real procedure ARCTM((x,y); value x,y; real x,y; ARCTAH:" If x-0 then 3lgn(y)Xpl2 else

If x<D then arctan(y/x)+slgn(y)Xpl+(lf y»0 then pi else O) else arctan(y/x); real procedure IM(x,y); value x,y; real x,y;

begin real cd,cso,sc;

od;-arctan(cos(lE(x,y)-12)xtp2);

ose:"Oos(p2)xcos(pl2-BR(x,y)-cd)/oos(cd); 8o:-sqrt(l-oscXosc);

IM:-aretan(sc/cso)x6378l78/l852/AA[1,a] end IM}

(57)

•procedure MWCAF(x,y,a)5 value x,y,a; real x,y,a;

begin real ooa«r,oog,coggr,cogr,dx1,dy1,gh,gr,grO,grl,6r00,gr01,gr10,grl1, 11,111,sia«r,3lg,slggr,slgr,xl;

Integer h,h1,J1 ,k,k1 ,spr;

real procedure IP(A); Integer array A;

IP:-(sx($<A[h,kl+pXA[h1 ,k])+rx(qxA[h,kl ]+pXA[h1 ,k1 J))/10} 3pr!-0j J1:-J-1;

I f a=20 A J<yot2 then

begin lnarray(druin,J1x600,GH)5 lnarray(drum, J1 x600+3C1000,GR); hold(GR) end; M)RT: h : = e n t l e r ( x ) ; h1:=h+1; k : = e n t l e r ( y ) ; k l : - k + 1 ; p : - x - h ; q:»1—p; r:»y—k; s : « 1 - r ; dx:"IP(XGS)s (ly:-IP(YGS); gh:-IP(GH);

I f J"1 then bef^n dx:=dxXgur; dy:-dj«<gur end; I f gh>1't.9 then g h : - l l t . 9 ;

grO0:-GR[h,k]; grOl :-GR[h,k1 ] ; gr10:^R[h1 , k ] ; g r i l :-<;R[h1 ,k1 ] ; I f grO(>-«r10>l80 then grlO:=gr10+360;

I f gri 0-grOO>180 then grO0:»grOO+36O; I f gr01-grl1>l80 then g r i l : - g r i 1+360; I f gr11-gr01>l80 then grOI :-gr01+360; grO:"qXgrOO+piXgrlO; gri :"(J<gr0l+pXgrl1;

I f grO-gr1>l80 then gri :-grl+36o; I f gr1-grO>l8o then grO:-grO+360; gr:-(sXgrO+rt<gr1 )Xgrd;

I f gr<0 then grt-gr+plmS; I f gr>plni2 then gr:»gr-plni2; cogrr-cosTgr); 3 l g r : - s l n ( g r ) ; h : - e n t l e r ( g h ) ; h l : " h + 1 ; p:=gh—h; q:»!—p;

for k : - 1 , 2 , 3 do AH[k]:=AA[k,h]xq+AA[k,hl ]xp; 1^ J=1 then for k:=1,2,3 do AH[k]:=AH(k]xgur;

e1:-(AH[1]+AH[3l)/2; e2:-AH[l ] - e l ; e3:''e1XAH[2]/3qrt(AH[l ]xAH[3]); I f a-10 V a=20 V a=30 then

begin I f a-30 then goto PL;

I f a-10 then g:=ARCTAN(tk, (aa-x)/(y-bb)xtk) e l s e

g:-ARCTAN{tk, ((y+8.5)/alpha-jt+7.5)/( (x-7.5)/alpha+y+8.5)xtk); PL: cog:-co3(g); 3 l g : » 3 l n ( g ) ; pr:-dxXcog+dyxslg; coggr:»co3(g-gr); 3 l g g r : - 3 l n ( g - 6 r ) ; p:-e3Xe3Xcoggr; q:-e1xe1X3lggr; r : - e a < 3 l g g r ; r i - r X r ; 3 : -pxooggr+(f<3lggr; l : - ( 3 q r t ( s - r ) x e 1 X e 3 - e a < p ) / 3 ; p r i : » l + p r ;

I f a-30 then goto MAC; dx:-prixoog; d y : - p r i x s l g end e l s e

(58)

begin coagr:"Cofl(ar-gr); 8 l a g r : " S l n ( a - g r ) ; p t - e i x c o a g r ; q:-e3xolagr; r:"8qrt(pXp+(3f<(i); s:"eixp/ri-e2; t:"e3Xq/r; t t l :-8Xeogr-tXslgrj tt2;»sXBlgiM--tJ<cogr; d x : - d x + t t 1 ; dy:-dy+tt2 end; CB(x,y)s

I f a-l 0 V a-20 then

bCRln I f spr-O then begin dxl :»dx} dyl ;"dy end e l s e bej^ln dx;-(ax+dxl ) / 2 ; ay:"(dy+dy1 )/2 end; l1:»3qrt(dxXdx+dyXdy); n i : - l 1 X l l ; I f a-10 then

b e s l n Xl:"(11ix(aa-XGC[J1 ]) +

tkxllx(YGC[j1 ]-bb)xsqrt('txco-111 ))/(2Xco); x:-XGC[jl]+x1;

y:-TOC[J1 ]-((XGC[Jl ]-aa)xx1x2+11l)/((YGC[j1 )-bb)x2); I f spi+O then

begin XGC[j]:"xg:-x; TOC[j]:-yg:-y; Roto MAC «id end e l s e

begin I 1 : " l l / 3 q r t ( l / ( a l p h a x a l p h a ) + l ) ; t t : - l n ( t k x l l / ( r C t < a l p h a ) +

exp((LE(XDC[Jl ],ÏIX[J1 ])-th)/alpha))xalpha+-th; r 2 : - e x p ( ( t - ^ - t h ) / a l p h a ) x r 0 ;

t t : - t t ^ p l 6 ;

x : " s l n ( t t ) x r 2 + 7 . 5 j y : - c o s ( t t ) X r 2 - 8 . 5 ; I f sprf0 then

begin X I X [ J ] : - x l : - x ; Y I X [ j ] : - y l ! - y ; goto MAC end end; lnarray(arum, jx600,GH); lnarray(druiii,30000fJx600,OR); hoia(GR); 3 p r : - 1 ; goto M3RT end; MAC: end MAXAF;

I f 1 oonipareflle(tape(2),^arleb-ortn:|») then goto AFL; t o t : = J J 1 : = p l a : = P I A [ l ] : - 0 ; xk:-13.3l6; yki-S.SUS; a f s t i : " a f s t 2 : » a f s t 3 : " 0 ; p i : - a r c t a n ( l ) x l > ; plra2:"plx2; p l 2 : = p l / 2 ; p l l t : - p l / U ; p l 6 ! » p l / 6 ; p l 9 : " p l / 9 ; g r a : - p l / l 8 0 ; f t : - c o B ( p l 6 ) + 1 ; a t ! - 5 3 ; J0O:»U5; J 0 : - 1 0 0 ; t l : " 1 ; aO:-31.8/(637.1229Xft); 31:-l852/(aOX127U2U58); Joke:«joke! : * t r u e ;

LI: k:-REBYM; i f k<i120 then goto L1; L2: k:-KESYM; I f k-120 then goto 1 3 ;

R S [ t l ] : " k ; t l : " t 1 + 1 ; goto Lg;

L3: for 1:-0,1+1 while l < l 6 do for .1:-1,2,3 do AA[J,1]!-REA1X1.2; Jr!-READ; imd:-REW3; d1 :-READ; ur:=READ;

(59)

xs:-XOR[0]:"READj ys:-YOR[0]:=READ; xe:"READ; yei-READ;

t t : " t h : - 1 2 : - I £ ( x s , y 3 ) ; 1 3 : - I E ( x e , y e ) ; ll*:=IE(xk,yk);

I f X3>xe then begin t k : - - 1 ; hkl:=195i hk2:=2Uoj l n : - 7 5 ; a t : - 9 0 eni e l s e begin t k : - l ; hkl :=355 hk2:-=10j ln:-755 at:=33 end;

p2:=-BR(x3,ys)+pl2; p3:=-BR(xe,ye)+pl2; pU:-^BR(xk,yk)+pl2; tp2:-sln(p2)/TO3(p2); t p 3 : » s l n ( p 3 ) / c o s ( p 3 ) ; tpl»:-3ln(pUV°°3(p'*)» r 0 : - s l n ( p 2 / 2 ) / o o 3 ( p 2 / 2 ) / a 0 ; r 1 : - s l n ( p 3 / 2 ) / c o 3 ( p 3 / 2 ) / a 0 ; a l p h a : » ( 1 3 - 1 2 ) / l n ( r l / r 0 ) ; 1 0 1 : - a r c t a n ( ( c o s ( 1 2 ) / t p l ) - c o 3 ( l U ) / t p 2 ) / ( 3 l n ( l U ) / t p 2 - s l n ( l 2 ) / t p l » ) ) ; 1 0 2 : » a r c t a n ( ( o o 3 ( l l t ) / t p 3 - o o 3 ( l 3 ) / t p l * ) / ( s l n ( 1 3 ) / t p l i - a l n ( l U ) / t p 3 ) ) ) pOI !«arctan(-co3(p2)/(sln(p2)xoo3(12-101))); p02:>=arotan(-co3(plt)/(sln(pU)xco3(ll|-102))); oc:"l/aO/cos(pOl); ooi:»l/a0/oo3(p02); aa:=isin(p01)XBln(l01-pi6)xoo+7.5; aal:=3ln(p02)xsln(l02-pl6)xoc1+7.5j bb:"3ln(pOl)Xoo3(l01-pl6)xoc-8.5; bbl:"3ln(p02)xoo3(l02-pl6)xoo1-8.5; oc:*coXoo; col:«cclXcc1; for l : " J i ^ 1 s t e p -1 u n t i l 73 do I f l^xk=± then t o t : - t o t + 3 6 6 e l s e t o t : " t o t + 3 6 5 ; for 1:^1 s t e p 1 u n t i l imd-l do

begin I f i-k V 1-6 V 1-9 V 1=11 then 11 :-30 e l s e 11 :»31 ; I f 1=2 then begin I f Jr_^'txU=jr then 11 :-29 e l s e 11 :-28 end; tot:»tot+11

end;

I f ui^12 then begin d 2 : - 3 ; u r : - u r - 1 2 end e l s e a 2 : - 2 ; g u r : - 1 - u r / l 2 ;

srt:-(tot+d1-27'i)x2+d2;

lnarray(tape(2),1,XGS)} lnarray(tape(2),2,YGS); hold(TCS)s a n t : - s r t + 3 0 ;

for j : - 3 r t , J + 1 v h l l e J<3ant do

begin Inarray(tape(2),jx2-1,GH); lnarray(tape(2),JX2,GB); hoia(GR)s outarray(drujn,JJ1x600,GH); outarray(dru!n,ij1x600+30000,GR)5 hold(GR);

JJ1:=JJ1+1 end;

e l o s e f l l e ( t a p e ( 2 ) ) s 11:«0; j : - 1 ;

llin:-IM(xe,ye); Umi :-LM(xk,yk);

lnarray(drumi,0,GH)j lnarray(drum,30000,GR); hold(GR); for 1:=0,1+1 v h l l e l<ln do begin A [ l ] : - ( h k 1 - l ) x g r d ; I A ( l ] : - o o s ( A [ l ] ) ; M U [ l ] : - s l n ( A [ l ] ) ; MAXAF(x8,ys,A[l]); X[l,1]:=xs+dx; Y [ l , 1 ] : - y s + d y ; d x : - t t 1 ; d y : - t t 2 ; C S ( x 3 , y 3 ) ; PX[l]:-dx; PY[l]:-dy end; XOC[0]:-XLX(0]:-xg:-xl:-xsj YGC[0]:-YIX[0]:-yg:-yl:-y3; MftXAF(xg,yg,10); MAXAF(xl,yl,20);

(60)

for 1:-0,1+1 while l<ln do begin MAXAF(X[1,1],Y[1,1 ),A[1]);

X [ l , 0 ] : = X [ l , 2 ] : = ( X [ l , l ] + x a + d x ) / 2 ; Y ( l , 0 ] : - Y [ l , 2 ] : - ( Y [ l , l ] + y s + d y ) / 2 ; d x : - t t l ; d y : " t t 2 ;

CB(X[1,1],Y[1,1]);

P ( l ]:-ARCTAN(PX[l ]+dx,FY[l ]+dy) end;

outarray(drura,100000,X); outarray(druiii,l 00902,Y); hold(Y); forh:=-l,h+1 while h<151 do PB[h]:=PA[h]:=l000;

crutarray(drum,60000,PB); outarroy(drum,60250,PA); hold(PA); NEXTR: J:=J+1;

for 1:=0,1+1 while l<ln do begin I f Y [ l , 0 ] - - q 9 then goto Lit;

3 l p l : - s l n ( P [ l ] ) ; c o p l : = c o s ( p [ l ] ) ; h : - e n t l e r ( X [ l , 0 ] ) ; k : = e n t l e r ( Y [ l , o ] ) ; J 2 : = 1 ; for J J : « h - 1 , h - l , h , h , h , h , h + 1 , h + l , h - H ,h+l,h+2,h+2 do begin XX[J2]:-JJ; J2:=J2+1 end; J 2 : - l ; f o r JJ:»k,k+l,k-l,k,k+l,k+2,k-l,k,k+1,k+2,k,k+l do

begin YY[jgl;-JJ; j2:-J2+1 end; for JJ:=1,JJ+1 while JJ<13 do bei^ln x:=.XX[jj]; y : = Y y [ j j ] ; h h : - e n t l c r ( G H [ x , y l / l O ) ; p:->GH[x,y]/lO-hh; q:=l-p; for r : - 1 , 2 , 3 do AH[rl:-AA[r,hh]Xq+AA[r,hh+1 ]Xp; e1:.(AH[l]+AH[3])/2;

e2:-elXAH[2]/sqrt(AH[l ]xAH[3l); e3:"AH[l ] - e 1 ;

oopgr:=oo3(P[ll-Cr![x,ylxgi-d); 3 l p g r : - s l n ( p [ l l - G R [ x , y ] X g r a ) ; p:=e2Xe2xcopgr; q:=eixeixslpgr;

r : " e 3 x s l p g r ; r : » r x r ; s:=pXcopgr+(^slpgr;

l : = (^piXe3+e1xe2xsqrt(s-r))/sx(LALl]xcopl+MJ[lJXsipl) + (LA[1 ]XXGS[x,y ]+ML-[l ]XYGS[x,y])/l 0;

dx:«lxoopl; dy:»lX3lpl; CB(x,y); I-[ J J ] :»sqrt(dxXdx+dyXdy) end; AFX[1]:.L[8]-L[1]; AFY[l]:=L[5l-L[3]; AFX[2]:-L[9]-L(2]; AFy[2]:=L(6]-L[U]; AFX[3]:L[n ]L(U]; A F Y [ 3 ] : L [ 9 ] L [ 7 L -AFX[I*]:.L[12]-L[5]; A F Y [ I » ] : = . L [ 1 0 ] - L [ 8 ] ; p : - X [ l , 0 ] - i i ; q : - 1 - p ; r : - Y [ l , 0 l - k ; s : - l - r ; U [ l ]:-LA(l ]-(li<(rxAFX[U]+3XAFX[3])+<p<(l«AM[2]+sXAFX[l ]) ) / 2 ; Mj[l]:-MU[l]-(px(rt<AFY[l*]+sXAFY[3l)+<ï<(r!<AFY[2]+sXAFy[l]))/2j A(l]:.APCTAN(U[l],MU[l]); MMCAF(X[l,0],Y[l,Ol,A[ll); X [ l , l ] : - X t l , 0 ] + d x ; Y ( l , l ] : - Y [ l , 0 ] + d y ;

(61)

d x : = t t l ; d y : - t t 2 ; C B ( X [ l , o l , Y [ l , 0 ] ) ; P X [ l ] : . d x ; PY[l]:-dyJ LU: end; MftXAF(xg,yg,10); 111 :"sqrt(dxxdx+dyXdy); MAXAr(xl,yl,20);

for 1:"0,I+1 while l<ln do

begin If Y [ l , 0 ) - - 9 9 then begin Y [ l , 2 ] : - - 9 9 ; goto L5 endj M«CAF(X[1,1 ],Y[1,1 ],A[1]);

X [ l , 2 ] : - ( X [ l , l ] + X [ l , 0 ] + d x ) / 2 ; Y ( l , 2 ] : - C Y [ l , l ) + Y [ l , 0 ] + d y ) / 2 ; d x : - t t 1 ; d y : " t t 2 ; C B t X [ l , l ] , Y [ l , l ] ) ; p[l]:=ARCTANCPX[l]+dx,FY[l]+dy); L5ï end; IT j > e n t l e r ( l i m ) then begin AM(xe,ye); 1 0 : = t r ;

I f aiiioAFST(X[10,2],Y[10,2],X[iO,0],Y[10,o]) then ^oto NEG e l s e begin pp:=AFST(xe,ye,X[10,0],Y[lO,0))/ AFST(X[10,2],Y[10,2],X[10,0],Y[10,0])-4ir/l2; goto EIND end; VBO: end; I f J > e n t l e r ( l l r a l ) A Joke then beifin AM(xk,yk); 100:=-tr; vh:-l-anin/AFST(X[100,2],Y[100,2],X[100,0],Y[100,0]);

I f vh<0 then goto NEGl e l s e bejjln J o k e : = f a l s e ; JO0:-J; 101 :"100 end;

end;

I f J>entler(llm1) A Jokel t h m I S ; for 1:-=0,1+1 v h l l e l < l n do begin I f Y[l,0]=-9q then goto L7;

I f Y[l,2]>10 V Y[1,21<1.35 V X[1,2]<1.5 V (x[l,2]>13 A Y[l,2]-A.5) then goto L 6 ;

it X[l,2]>13 A X[l,2]<13.58 A Y [ l , 2 ] < 5 . l 8 then goto L 6 ;

I f X[l,2]>13.58 A X[l,2]<13.906 A Y[l.2]<U.86 then j^oto L 6 ; I f X[l,0]<ick A X[l,2]>xk then

b e ^ m y 3 n : - ( ( Y [ l , 2 ] - Y [ l , 0 ] ) / ( X [ l , 2 j J C [ l , 0 ] ) ) x ( x k - J C [ l , 2 ] ) + Y [ l , 2 ] ; I f ysn<^k then goto L 6

end; goto L7;

L 6 : Y [ l , 2 ] : ^ 9 9 ; L7:

end;

L 8 : I f Y C I 1 , 2 ] - - 9 9 then bej^ln 11:=1H-1; goto L 8 end; L9: I f Y[ln,2]»-99 then be^ln l n : - l n - l ; goto L9 end;

P I A [ J ] : - p l a : - 1 1 ; NEGl:

Cytaty

Powiązane dokumenty

Abstract—A parallel EAX-based algorithm for minimizing the number of routes in the vehicle routing problem with time windows is presented.. The main contribution is a novel

A parallel algorithm for minimizing the number of routes in the vehicle routing problem with time windows (VRPTW) is presented.. The algorithm components cooperate periodically

Now the lemma follows by the Kirszbraun’s theorem ([K], [F], Th. 5.1) stating that each Lipschitz function de- fined on a subset of a metric space can be extended to a

We find that our model of allele frequency distributions at SNP sites is consistent with SNP statistics derived based on new SNP data at ATM, BLM, RQL and WRN gene regions..

In this section we shall present some considerations concerning convergence of recurrence sequences, and their applications to solving equations in Banach

[r]

Using these two sequential runs, the effectiveness of applying a multigrid method to SWAN was tested by performing a systematic analysis of the effect of different reductions

Niniejsze opracowanie poświęcone jest w głównej mierze szkole, w której 6-letni Wojciech Kilar podjął naukę muzyki, tj. szkole mu- zycznej we Lwowie, prowadzonej w