Author information file Paper title : Stochastic Optimization of Sailing Trajectories in an Upwind Regatta Authors: Robert C. Dalang, Ecole Polytechnique Fédérale de Lausanne Frédéric Dumas, Ecole Polytechnique Fédérale de Lausanne Sylvain Sardy, Ecole Polytechnique Fédérale de Lausanne Stephan Morgenthaler, Ecole Polytechnique Fédérale de Lausanne Juan Vila, Paterna (Valencia). Spain. Corresponding author: Robert C. Dalang Institut de mathématiques Ecole Polytechnique Fédérale 1015 Lausanne Switzerland email: [email protected] phone: +41 21 693 25 51 fax: +41 21 693 53 80 Statement of contribution: In a sailboat race, the navigator's attempts to plot the fastest possible course are hindered by shifty winds. We present mathematical models appropriate for this situation, that use statistical analysis of wind fluctuations and are amenable to stochastic optimization methods. We describe the decision tool that was developed and used in the 2007 America's Cup race, and its impact on the races. The main contributions to OR consist in developing models and a decision tool in which optimization methods such as stochastic dynamic programming were used to provide real-time help in decision-making to experienced sailors. Stochastic Optimization of Sailing Trajectories in an Upwind Regatta Abstract. In a sailboat race, the navigator’s attempts to plot the fastest possible course are hindered by shifty winds. We present mathematical models appropriate for this situation, that use statistical analysis of wind fluctuations and are amenable to stochastic optimization methods. We describe the decision tool that was developed and used in the 2007 America’s Cup race and its impact on the races. Keywords: Sailboat race, statistical analysis of wind fluctuations, stochastic programming, America’s Cup. 2010 Mathematics Subject Classifications. Primary: 93E20; Secondary: 62L10, 60G40. 1 Introduction Hi-tech sailboat races, such as the America’s Cup race, make heavy use of mathematical tools for improving performance of the racing yachts. This includes issues of yacht design (shape of the hull, design of sails), but also route optimization under uncertain wind and weather forecasts: see Philpott, Henderson and Teirney [7], Philpott and Mason [8], and Philpott [6], as well as Parolini and Quarteroni [5] and Formaggia, Miglio, Mola and Parolini [3]. This paper describes a project that was initiated by the Swiss sailing team Alinghi, and then team member/navigator J. Vila, who asked the other authors of this paper to work with them during the 2007 America’s Cup race. The objective was to help the navigator deal with wind fluctuations while attempting to plot the fastest possible course. Indeed, sailboats move by using the forces provided by the wind, and it turns out that on certain time scales, wind fluctuates randomly. Therefore, it is natural to use methods of stochastic optimization. The goal was to develop a tool for use onboard their racing yacht. We shall describe how the race is organized, what are the main features of randomness in the wind, how we developed statistical models for wind fluctuations and then mathematical models amenable to methods of stochastic optimization. Finally, we describe the results that were obtained and how these results were used to produce a “decision tool” that was used onboard the Alinghi racing yacht. We report on how this tool was used for training purposes, for pre-race planning and for providing provided real-time recommendations and information based both on forecasts and on observed wind conditions during the race. We also mention further mathematical work motivated by this problem. 1 2 Race basics The sailboat race that we are concerned with involves only two boats at a time and is organized so that the start line is perpendicular to the “average wind direction”, and consists in a first leg during which the boats must sail upwind to a buoy, called the top mark, circle around this buoy, then sail downwind through a line called the “leeward gate,” then back upwind to the top mark, and finally downwind through the finish line: see Figure 1. Since a sailboat cannot sail directly into the wind, it must follow a zigzag path which sails -3 min. 1st uw leg 1st dw leg 2nd uw leg 2nd dw leg Figure 1: Running of a regatta. “uw” stands for “upwind” and “dw” for “downwind”. alternatively toward the right of the race course, then toward the left, and so on. When the wind comes into the sails from the right, the boat is said to be on starboard haul, otherwise it is on port haul. The action of switching from one haul to the other is called a tacking. Each tack implies a loss of time, and implies that the boat heads toward a different part of the race area, so when and where to tack are crucial decisions for the navigator. Given that wind direction and wind speed vary over time and space in unpredictable ways, as we shall see, the following basic questions have no simple answer and were identified as key objectives of the project: (1) Should the boat start off by going toward the right or the left of the race course? (2) When should the boat tack? It was decided that we would focus on the first upwind leg of the race, since the sailors felt that if they reached this mark first, then they were likely to be able to stay in front of the other boat. Therefore our goal was to bring the boat to the top mark as quickly as possible. 2 3 Wind The behavior of a sailboat in a match race is determined by many factors, such as its design, the materials used for its construction and the quality of the crew, but the wind and sea conditions also play an important role. Of these last two, the wind dominates, partly because it is more variable over short distances and over time, but mostly because it is the power source for a sailboat. Wind is a three-dimensional physical phenomenon which varies over time and space. Wind models have a long tradition in weather forecasting and climatology. In the first area, the focus is on the prediction of high wind speeds and the likely future path of a storm. In climatology, the long range patterns in the prevailing winds, the occurrence of storms and extremal winds are of interest. More recently, the potential of winds for energy generation has sparked renewed interest in wind models (see [10], for instance). The optimal placement of wind farms, the prediction of the energy production of a wind generator and related questions have been studied extensively. On the other hand, the prediction of winds for sailing has rapidly declined with the widespread use of motor ships. Furthermore, the needs of yacht match racing differ from those of most of these other areas, due to the relevant time and geographic scales (respectively, about half and hour or so and about 6 by 6 kilometers). Today, all wind models have an important stochastic component, because even shortterm predictions based on detailed knowledge of meteorological conditions are not entirely reliable. Wind is traditionally described by the wind angle on a compass and the wind speed, which can together be conveniently visualized by a single two-dimensional vector. Wind is then characterized at each point in (two-dimensional) space and time by its direction and speed. The direction is an angle that is measured in degrees relative to the north (we use the convention that the angle is measured in the clockwise direction, so that if a 0o wind is coming from the north, then a 90o wind is coming from the east). The first graph in Figure 2 shows the wind direction measured at a specific location near Valencia, Spain, during a 5 hour period in late Spring 2005. The graph is very irregular, but we see that the wind direction starts out at around 110o , then turns to about 90o after one hour, then turns back to about 120o later in the afternoon. As we can see from the second graph in Figure 2, wind speed exhibits similar features. Both of these graphs show that wind variations contain three main components: 1. High-frequency variation. This is the variation on very short time scales, of a few seconds. Since wind is turbulent, it is difficult to measure accurately. The instruments used for wind measurement are fairly simple. For instance, wind direction is measured by a wind vane, which sits on the mast of a boat that, even if anchored, is subject to wave motion, and there is a lot of imprecision in any individual measurement. Some of the variation present in Figure 2 may be real, but mostly it is measurement error. These high frequency variations can be reduced by smoothing, which we did by taking 3 Figure 2: On the left, the wind direction, observed in a specific location (39.4◦ N 0.3◦ W), over a 5 hour period. On the right, the wind speed, observed in the same location and period. the median of about a dozen consecutive measurements. 2. Medium frequency variation. This is the variation on time scales of a few minutes. It is important that a mathematical model capture these fluctuations, because they influence significantly the motion of the boat. We will model these variations by a stochastic process with parameters to be estimated from historical wind data. 3. Low-frequency variation. This is the variation over hour-long periods, such as a wind that turns slowly from north to north-east. This is a trend, that will also have to be estimated from the data. After smoothing out the high-frequency variations, typical sample paths of wind direction and speed are shown in Figure 3. These graphs cover a 20 minute period, which was the typical duration of an upwind leg. We note that variations of a few degrees are relevant for the boat, as are variations in wind speed of 1 or 2 knots. A final important point concerns the information available to the sailors concerning wind conditions on the race field. Sailors aboard the boat can use the instruments onboard and their visual observations. Up to 5 minutes before the start of the race, the sailors can communicate in particular with their weather team, which consists of meteorologists located onshore as well as spread out over the race course: they attempt to provide the most upto-date information about the weather just before communications are cut off. During the 4 Figure 3: Wind direction (γ) and True Wind Speed (TWS) during a 20 minute period, after smoothing out the high-frequency variations. race, visual observations of wind gusts can be important, but we will focus mainly on wind as it is shown in Figure 3. 4 Boat modeling A sailboat is a very complex system. A diagram of a typical monohull “Class America” sailboat used in past America’s Cup races is shown in Figure 4. Such boats weigh 24 tons, are 25 meters long, with a mast height of 35 meters and a crew of 17 sailors. Most mathematical modeling efforts aim to determine the best shape of the hull, or of the bulb under the hull, as well as the shape of the sails (see, for instance, [3, 5]). There is some information about dynamics of such boats, which describe how a sailboat accelerates and decelerates, for instance during a tack, but fortunately, what is most needed in our problem is information about the kinematics of the sailboat, that is, its velocity during steady-state motion. In our model, a sailboat is described by a set of curves, called the boat polars (see also [6]). An example of such curves is shown in Figure 5. In this figure, the wind is assumed to be coming down from the top of the page. For a given wind speed (of 6, 10, 16, 20 or 30 knots), and a given bearing α relative to the wind direction, the boat’s velocity is given by the distance from the origin to the point located at the intersection of the radial line with angle α and the curve labeled with that wind speed. This velocity is zero if the boat attempts to sail too directly into the wind. In Figure 6, the graph on the left shows a single boat polar curve. Notice that if the goal is to sail upwind as quickly as possible, then one should select the angle relative to the wind 5 Figure 4: The components of a sailboat. Figure 5: Boat polars. 6 Figure 6: The picture on the left shows a boat polar. For a bearing α, the boat’s speed is the ~ . The picture on the right shows the optimal angle αopt for sailing length of the vector OP upwind with this wind speed. Figure 7: The two laylines at angle αopt . which maximizes the projection onto the vertical axis. This particular angle αopt is shown in the graph on the right in Figure 6. The existence of such an angle is well-known to sailors. The angle αopt depends on the particular sailboat and the wind speed. It can vary from about 45o for an ordinary sailboat and in light winds to about 30o for a racing sailboat in heavier winds. An important consequence of the existence of the angle αopt is that in a constant wind, it is optimal for the sailboat always to sail in a direction parallel to the two lines shown in Figure 7, which are called laylines. These two lines pass through the top mark, and have angle ±αopt with the wind direction. In a constant wind, the optimal trajectory for a sailboat is simply to sail on its initial tack to the layline (port or starboard, depending on its initial tack), then to tack once and to sail directly to the top mark. Starting from any point on the horizontal line passing though point B in Figure 7, the boat will take the same amount of time to reach the top mark A. It is never advantageous to sail past the laylines (though if there, the best course is to head straight toward the top mark). In a constant wind and an upwind race, it is easy to determine which of two sailboats is ahead: one simply takes the orthogonal projection of the boat onto an axis parallel to the wind direction, and the lead of one boat over the other is proportional to the distance between these two projections. This method is not applicable in a variable wind. 7 Figure 8: The paths of two boats in a wind that changes direction once. From the above discussion, we can see why the question of starting off by going toward the right or the left of the race field is important in a non constant wind. Indeed, imagine two identical boats Y1 and Y2 that start from the center B of the start line, with a wind that comes straight down from the top mark. Boat Y1 heads to the left and boat Y2 heads to the right, with both sailing at an angle of ±αopt relative to the wind direction, as in Figure 8. After a few minutes, both boats are still even, located respectively at points A1 and B1 shown in Figure 8. Now suppose that the wind direction changes suddenly, and is now blowing from the northwest, at an angle θ < 0 relative to the previous wind direction. After this time, we must use the axis of the new wind to determine which boat is ahead, and it is clear from Figure 8 that Y1 is now well-ahead of Y2 . If the wind stays constant until the two boats reach the top mark, then Y1 will tack at A2 , Y2 will tack at B2 , Y1 will get to the top mark first, and at that instant, Y2 will be at position B3 shown in Figure 8. This simple example shows the impact of variations in wind direction, why major (but generally unsuccessful) efforts are made to predict them, and why stochastic optimization can be useful. Variations in wind speed are also important: the higher the wind speed, the higher the 8 speed of the boat, though the relationship is not linear. In addition, the angle αopt depends on the wind speed, so the wind speed affects the boat’s course. This gives a different reason for wanting to start off by going toward a particular side of the race field: expecting higher wind speeds on that side. It turns out that this is very difficult to anticipate and we will not address this issue here. A final key issue is to model how a boat tacks. In principle, during a tack, the boat follows a curved path, begins by slowing down, and then speeds up again. The amount of time needed to return to steady state is about 30 seconds, which is small relative to the race time of 20 minutes. The key issue is the time lost during a tack. This depends on the wind speed, and varies from about 4 seconds in a high wind to about 9 seconds in a light wind. That is, in a constant wind, a boat that makes one extra tack will arrive at the top mark 4 (respectively 9) seconds behind a boat that did not tack. In our model, we will consider that tacking is instantaneous, and we will add a tacking penalty to the travel time to account for the time lost during a tacking. This penalty depends on the wind speed (see Table 1). wind speed (kn) penalty (seconds) 6 9 8 7 10 6 12 14 5.5 5 16 5 18 4.5 20 4.5 22 4.5 24 4.5 Table 1: Tacking penalty as a function of the wind speed. 5 A fully discrete model In the previous section, we have seen that some key features of our problem are: • in a constant wind, always sail at an angle ±αopt relative to the wind direction when within the laylines; • a tacking involves a time penalty; • wind is variable. In this section, we present a simple, fully discrete mathematical model which still captures these main features. We first imagine a set of equally spaced horizontal lines on the race course, separated by ∆X meters, with the first such line passing through the top mark. We also assume that the wind speed is constant, and the wind direction is a two-state Markov chain, that shifts between the two states ±γ. The wind shifts occur precisely at those times where the boat is on one of the horizontal lines. We also assume that between shifts, the wind direction is 9 Figure 9: Choosing the angle γ. constant and the boat advances without tacking, at angle ±αopt , up to the next horizontal line. Then the wind may shift or not, the new wind is observed, and the boat decides whether to tack or not. If the boat hits a layline in between wind shifts, then it can tack so as to stay on the layline (this particular maneuver is called a tack against the layline), and then the boat continues up to the next horizontal line. This process is repeated until the boat reaches the top mark. This model is not quite satisfactory, because the number of possible boat positions on the horizontal lines may grow exponentially with the distance to the top mark. It turns out, however, that for certain choices of the angle γ, this number grows linearly. Indeed, looking at Figure 9, we see that if we choose γ so that 2 tan(−γ + αopt ) = , tan(γ + αopt ) 3 (5.1) and set ∆Y = 31 tan(γ + αopt ), then a boat on port tack will see its y-coordinate increase by 2∆Y units if the wind angle is −γ and by 3∆Y units if the wind angle is +γ. One angle γ0 that satisfies (5.1) is γ0 = arcsin(sin(2αopt )/5)/2, which is very close to 5o for αopt = 30o . With the choice γ = γ0 , the nodes that can be visited by the boat are shown in Figure 10. Notice that the boat always sails at the angle ±αopt relative to the wind direction, and at speed vopt , with one exception: if the boat is on an exterior layline, such as the exterior port layline, which corresponds to the wind in direction +γ, and the wind shifts to −γ, then the boat finds itself outside of the laylines of the present wind (which is an unfavorable situation); in this case, we assume that the boat sails directly towards the top mark, at the speed ve ≥ vopt . We can now formulate our problem as a Markovian stochastic control problem, in which the wind is a two-state Markov chain, and the probability of a wind change after 1 step is p ∈ ]0, 1[. The finite state-space for the boat consists of the set of nodes in Figure 10. At each step, there is a finite set of allowed actions: continue, tack, and for nodes near the laylines, tack against the layline and follow the exterior layline. The one-step cost (the travel time from one node to the next) of each action is calculated using the velocities vopt , ve , and 10 Figure 10: The discrete race field for γ satisfying (5.1). simple trigonometric considerations (including the tacking penalty if relevant). Finally, we assume that the boat’s objective is to minimize its expected travel time up to the top mark. In order to compute the optimal strategy, let T (w, h, x, y) denote the minimal expected travel time from position (h, x, y), if the present wind is w (we use position to refer to the triplet that includes the haul, and location to refer to the point with coordinates (x, y)). At the top mark, we have T (w, h, 0, 0) = 0. Now let tw,h,x,y,o denote the one-step cost, that is, the travel time from position (h, x, y) to the next node, if the wind is w and action o is chosen. We use Bellman’s equation and induction to compute T (w, h, x, y) for all (w, h, x, y) as follows (see for instance [9, Chapter 4] or [1]). For all w, for x = 1, 2, . . . , N , for all positions (h, x, y) on the line x and for all actions o, let T (w, h, x, y, o) = tw,h,x,y,o + (1 − p) T (w, h̃, x − 1, ỹ) + p T (−w, h̃, x − 1, ỹ) and set T (w, h, x, y) = min T (w, h, x, y, o). o 11 In these formulas, ỹ denotes the new location on the line x−1 attained by the boat, assuming that it started in position (h, x, y), the wind was w and the boat selected action o, and h̃ denotes the haul at the new position. When x = 1, this location is ỹ = (0, 0), so T (±w, h̃, x− 1, ỹ) = 0 in this case. For x = 1, 2, . . . , N , T (±w, h̃, x − 1, ỹ) has been computed during the previous step. An optimal action at position (h, x, y) under wind w is then oopt if T (w, h, x, y) = T (w, h, x, y, oopt ). If there is more than one action satisfying this equality, we select one by putting a priority ordering on the set of actions. It is fairly straightforward to implement the above algorithm numerically. A typical result is shown in Figure 11. A key feature is that the positions where the boat should tack are Figure 11: A representation of the optimal strategy. The picture on the left concerns a boat on starboard tack sailing in a wind with angle −γ, and the figure on the right is for a boat on port tack in the same wind. The light grey color indicates that the boat should sail on port haul (which implies a tacking in the left picture) and dark grey indicates that it should sail on starboard haul. The pictures in the two other configurations are obtained by symmetry. no longer straight lines, but the curves that separate the two different colors. We call these curves stochastic laylines. One notices that for a boat on port haul sailing in a wind with angle −γ, it is no longer optimal to go all the way to the (deterministic) layline, but it should tack earlier. In this case, one looks for the boat’s position in the picture on the left, and 12 the boat should continue until reaching the stochastic layline shown there. Assuming that the wind has not yet changed, the boat will tack on this stochastic layline, and so on. If the wind changes, then one should look at the two pictures for angle +α, which are not shown in Figure 11, or, equivalently, consider that the boat is in a symmetric position with respect to the vertical line passing through the top mark and in wind −γ. In particular, this model captures some important features that sailors are aware of, such as the presence of stochastic laylines: in a shifty wind, it is best to tack before reaching the deterministic laylines, at least when one is at some distance from the top mark (this fact was already observed by Philpott in [6]). It is also not difficult to vary the parameter p, and to see that the more shifty the wind, the farther the stochastic laylines are from the deterministic laylines. A third observation can also be made if we extend the model slightly, in order to allow the boat to sail at more than one angle. Surprisingly, while in a constant wind, it is always optimal to sail at the constant angle αopt , in a random wind and in certain positions, it is optimal to sail at an angle different from αopt . This phenomenon, discovered in 1987 during the 26th America’s cup in Los Angeles, jointly by the Stars and Stripes team (USA) and Ockam Instruments Inc., is now known as Wally. A detailed description can be found in [4], which proposes several recipes. Here, if we allow the boat to sail at a slightly larger angle α1 > αopt , then the optimal strategy is shown in Figure 12, and there are indeed regions where it is optimal to sail at the angle α1 . 6 A more realistic model The discrete model of the previous section served mainly as a “proof of concept.” It showed that methods of stochastic optimization could capture certain features that were expected by experienced sailors. With the objective of providing quantitative results, such as giving the precise positions of stochastic laylines, precise position where Wally should be used, etc., so as to provide help in decision-making onboard a boat during an actual race, it is necessary to develop a realistic model for wind variations and to enlarge the set of allowed actions of the boat, which may want to use a range of bearings relative to the wind. First of all, we discuss the wind. As we mentioned in Section 3, it is natural to consider that wind is two-dimensional. One difficulty concerning data collection is that America’s Cup races occur in May-June-July (when they take place in the Northern hemisphere), and the wind typically behaves differently during other months. This means that if you are planning during the Fall for a race that is to occur next summer, then you will not be able to gather any relevant new data. And before the race area was selected, little effort was probably devoted to gathering wind data at the location that you are now interested in. In the end, it turned out that we had less than 30 days of good quality data for our statistical analysis. This data were gathered at about 10 different locations, at the altitude of 6 meters, 13 Figure 12: The optimal strategy when the boat is allowed to sail at an angle α1 > αopt . The four possible configurations of wind angle and the boat’s haul are shown in the four small boxes. The medium grey regions are those where the boat should sail at angle α1 . in or near the race area. The characteristics of the wind vary greatly between geographical sites (for instance, the model that we used for Valencia, Spain was quite different than the one that had been developed for Auckland, New Zealand [7, 8]). Indeed, local features of the coastline and terrain have a major effect on wind behavior. Philpott et al. [7, 8] base their weather model on Taylor’s hypothesis, under which the wind has a mean wind direction and eddies are carried along in this direction. Observing the wind over time at a particular spot is then the same as observing it in a single instant but along a line in the mean direction. Inversely, the moving yacht will observe wind patterns similar to time series observed at a fixed weather station (but at different rates that depend on the yacht’s speed). Their model assumes stochastic independence between angle and speed. For the wind speed, they found that a good fit was obtained with a Gaussian autoregressive moving average model ARMA(2,2) with time steps of 5 seconds. The wind angle was modeled in two stages, first via a hidden Markov jump process between direction bins and second as a Gaussian ARMA(2,2) process as long as it remained in the same bin. The parameters of the ARMA process are universal and do not change after a jump. For our own purposes, we built on the model of Philpott et al. [7, 8], but replaced the discrete time approach by a continuous time stochastic differential equation (an approach 14 also used in [12]). The simplest such model is linear with constant coefficients: see below. To build a model for wind, we analysed a good number of short time sequences similar to those shown in Figure 2. As in Philpott et al. [7, 8], we found insufficient evidence for a stochastic dependence between wind speed and wind angle over the time frames of interest in match racing. Since treating them as independent random processes simplifies modeling considerably, we opted for this choice. We also undertook extensive research in attempting to build a predictive model. In match racing, predictions, even of moderate accurracy, of the wind conditions over the spatial domain and over time would be worthwhile. Our investigations of the spatial-temporal correlations and the use of various linear and nonlinear predictors did, however, not lead to success. We found that the wind and weather data would have to be collected by a fairly extensive grid of monitoring stations and be available a relatively short time before the start of the race. Both of these conditions are not satisfied in practice. Constructing a model that mimics the wind angle and wind speed at a particular site during a three to four hour time-window turns out to be a doable task. This can serve as a model for the wind being encountered by a moving boat in the surroundings of the measurement site. We decided that the most important observable would be the wind observed onboard the boat at time t. This implies that we can use two stochastic processes A = (At , t ∈ R+ ) and V = (Vt , t ∈ R+ ) that represent respectively wind direction (in degrees relative to the North) and the wind speed (in meters per second), as observed onboard the boat at time t. The simplest possible models are to consider that each of these processes consists of a trend and fluctuations around this trend, which leads us to set At = Xt + µa t, Vt = Yt + µv t, where the processes X = (Xt , t ∈ R+ ) and Y = (Yt , t ∈ R+ ) are defined by the stochastic differential equations dXt = −sa Xt + σa dBt1 , dYt = −sv Yt + σv dBt2 . In this model, there are 6 parameters to estimate, and it is also necessary to specify the law of the random noise process (dBt1 , dBt2 ). A statistical analysis showed that the data was compatible with the following assertions: • The processes A and V are independent. This is important since we can then deal separately with wind angle and wind speed. • Each noise process (Bti ) has independent increments. • The noise processes are Gaussian. In fact, we put a lot of effort into deciding this issue, but it turned out that there was not enough data to lead us to prefer any other probability distribution. 15 • The parameters sa and sv vanish: sa = sv = 0, so At and Vt are Brownian motions with drifts. This was also an important issue, since a non-zero value of these parameters would mean that X and Y are Ornstein-Uhlenbeck processes which fluctuate around their mean value, and return to this value at a certain mean rate. Brownian motions behave quite differently and this model fit the data better. • The parameter µv vanishes: µv = 0 (no trend for wind speed). Indeed, wind speed is more stable than wind direction, and this means that there is one less parameter to estimate. Finally, there remain three parameters to estimate: µa , σa , and σv . Of course, it does not make much sense to attempt to estimate these parameters with high precision. Rather, we decided to consider three categories for the volatility of wind direction, namely “low,” “medium” and “high,” and two categories for the volatility of wind speed (“low” and “high”). Based on a statistical analysis of the available data, we decided that these categories would be represented respectively by the values 1.2, 2 and 4 for σa (in degrees per 40 seconds), and by 0.7 and 1.3 for σv (in meters per 40 seconds; we will see below why 40 seconds is a reasonable time step). Concerning the trend µa , we settled on the 9 values −20o , −15o , . . . , 15o , 20o . This yields 3 × 2 × 9 = 54 choices for the triplet (σa , σv , µa ), so there are 54 wind situations, for each of which we can solve a stochastic optimization problem numerically. We now consider the possible actions of the boat, which should include: • At time t, select an angle α(t) ∈ [αmin , αopt + 10o ], and sail at that angle relative to the wind. • Tack at any time t. Of course, time is continuous, location is continuous, and even though there are only two possibilities for the haul (Starboard or Port), the problem involves, in principle, continuous space-time and a continuous action space. However, most of the time, the optimal action α∗ (t) is ±αopt , sometimes it is “tack and then sail at angle ±αopt ,” and on rare occasions, it will be something else. This suggests that a discrete action space will be a good approximation. Since we are going to seek a numerical approximation of the optimal strategy anyway, it is natural to discretize both the observables and the action space. Concerning observables, since variations in wind direction of a few degrees, and variations of wind speed of one or two knots, are relevant, we will assume, similar to the choices made in [8], that the wind direction belongs to the set Wa = {−18, −15, −12, −9, −6, −3, 0, 3, 6, 9, 12, 15, 18} and that wind speed belongs to the set Ws = {6, 8, 10, 12, 14, 16, 18, 20, 22, 24}. 16 Figure 13: A semi-discrete race field: the boat location will be on one of the horizontal lines, but not necessarily at a node. Wind transitions can now be modeled by two independent Markov chains (Wna , n ∈ N) and (Wns , n ∈ N), with state spaces Wa and Ws , respectively. Their transition matrices are obtained by discretizing the Gaussian increments dAt and dVt , respectively. Concerning boat locations, we consider first the set of nodes {(i∆X, j∆Y ) : i = 0, . . . N, |j| = 1, . . . , M } and the boat positions {(i∆X, y) : i = 0, . . . N, |y| ≤ ymax } × {S, P }, so that the boat locations are not limited to nodes (see Figure 13), but consist of a set of horizontal gridlines. The value of ∆X is set to 150 meters, so that it typically takes a yacht about 40 seconds to move from one horizontal gridline to the next. Concerning boat actions, we assume that for each wind speed ws , the boat can choose either to tack or not, and then sail up to the next horizontal gridline at angle α relative to the wind, with α ∈ {±αmin (ws ), ±α−1 (ws ), ±αopt (ws ), ±α1 (ws ), . . . , ±α5 (ws )} where αmin (ws ) is the smallest angle relative to the wind at which the boat can still sail, αopt (ws ) is the optimal angle for the wind speed ws , and α−1 (ws ) is the angle in between αmin (ws ) and αopt (ws ) for which the boat’s speed is 0.1 knot slower than at angle αopt (ws ). The angles α1 (ws ), . . . , ±α5 (ws ) are also chosen to correspond to speed increments of 0.1 knot each, and it turns out that α5 (ws ) ≤ αopt (ws ) + 10o . If necessary, an additional possible action is to tack against the layline of the present wind. Finally, due to wind shifts, the boat may find itself outside of the laylines, and for this, some specific considerations are needed which we will not discuss here. 17 Once the boat has chosen an action, we assume that the boat moves as follows: during one step of the Markov chains, the boat sails under a constant wind and from a position on the line i∆X to a position on the line (i − 1)∆X; these positions are usually not grid nodes. The optimal strategy can now be computed by the following algorithm. Let T (w, h, x, y) denote the minimal expected travel time from position (h, x, y) up to the top mark, if the present wind is w. Clearly, T (w, h, 0, 0) = 0. Let tw,h,x,y,o be the one-step cost, that is, the travel time from position (h, x, y) to the next grid line, if the wind is w and action o is chosen. Using Bellman’s principle, we define, for all w, for i = 1, 2, ..., N , for all nodes (h, i∆X, j∆Y ) on the grid line i∆X and for all actions o, T (w, h, i∆X, j∆Y, o) = tw,h,i∆X,j∆Y,o + X p(w, w0 ) T (w0 , h̃, x̃, ỹ). w0 ∈W In this formula, the p(w, w0 ) are the coefficients of the transition matrix of the Markov chain ((Wna , Wns ), n ∈ N) with values in W = Wa × Ws and (h̃, x̃, ỹ) denotes the position of the boat when it reaches the new grid line. This position depends of course on w and the action o. Then we set T (w, h, i∆X, j∆Y ) = min T (w, h, i∆X, j∆Y, o). o Finally, we extend this formula to locations that are not nodes by defining T (w, h, i∆X, y), for y 6∈ {j∆Y }, by linear interpolation between the two nearest grid nodes. In order to give an idea of the numerical problem, we show in Figure 14 the segmentation of the race area into different regions, which correspond to different sets of allowed actions. In order to represent the optimal strategy, we use a strategy map as shown in Figure 16 for wind angle 0, wind speed 10 knots, and port haul. In the central region, the optimal action is to continue without tacking, while the curve on the right-hand side is the stochastic layline at which it becomes optimal to tack. In the left part of the picture, it is optimal to sail at an angle larger than αopt (ws ). There are 540 such maps (one for each of the 10 wind speeds and 54 choices of volatilities and trends). Since the original continuous space/time problem is rotation invariant, rather than use the calculated strategy maps for wind angles wa 6= 0, we rotate the boat’s position by −wa degrees and use the action prescribed for this new position by the map associated with wind angle 0. All these strategy maps can be calculated offline in advance of the race and stored onboard the boat, together with the expected time to top mark from each position and for each wind direction and speed. Then, during a race, for every position, haul, wind angle and wind speed, these maps indicate the optimal action for the boat. 7 Extracting additional information from the model In addition to the optimal actions and the optimal expected time to the top mark, there are many questions to which a navigator would like to have answers and which can be obtained 18 Figure 14: The segmentation of the race area according to the sets of allowed actions. The boats never enter zones A and I. In zones B and H, the boat can only head directly toward the top mark. In the remaining zones, the boat can choose to tack or not and to follow one of the available bearings. In zones D and H, “tack against the layline” is allowed. Close to the top mark, in zone E1 , some special considerations are needed. from our model. Probability distribution of the optimal travel time to top mark. The model provides directly the expected travel time T (w, h, x, y) to the top mark under the computed optimal strategy that is stored in the strategy maps. However, it is also useful to have the probability distribution of the actual travel time τ (w, h, x, y), for instance to get an estimate of the probability that this random variable might be significantly greater than its expected value. For each node in the race field, we simulated 1000 wind sequences and the corresponding trajectories under the optimal strategy, and recorded the travel time, in order to obtain an estimate of the probability distribution of τ (w, h, x, y). Histograms of these distributions were stored onboard the boat; for some representative locations, they are shown in Figure 16. Probability of beating the opponent to the top mark. The data stored with the strategy maps provides us with the expected lead over the opponent, as long as the opponent’s location is known: we simply calculate the difference of the optimal travel times from each position. In addition, it is interesting to have an estimate of the probability that a yacht in a given position will reach the top mark before a yacht located at some not too distant position. This estimate will be obtained by assuming that there is no interaction between the two 19 Figure 15: The strategy map for wind angle 0, wind speed 10 knots, and port haul. The colors code the optimal action. Figure 16: Probability distributions of travel times to the top mark. Each histogram shows the probability distribution starting from a position near where the histogram is drawn. 20 boats, that they see the same wind time series (since they are not very far apart) and that they have the same polars (which is reasonable since they are both Class Americas). By simulating simultaneously the trajectories of two boats A and B, starting respectively from positions (h, x, y) and (h̃, x̃, ỹ), we obtain a histrogram of the probability distribution of τ (w, h, x, y) − τ (w, h̃, x̃, ỹ), and, in particular, of P {τ (w, h, x, y) < τ (w, h̃, x̃, ỹ)}, which is the probability that A reaches the top mark before B. These histograms can be computed offline in advance of the race for a large number of representative pairs of positions of the two boats. During a race, given the present positions of the two boats, this probability is estimated by interpolation. Advantage of our strategy over an alternate strategy. At a given position, the boat may have good reasons for not wanting to follow the optimal strategy recommended by our model. For instance, this could be because of tactical considerations related to the presence of the opponent, which our model does not take into account. In this case, the navigator would like to know how much time he may be losing by taking this suboptimal route. Of course, the meaning of “suboptimal route” is unclear, since there are many possible such routes. As a representative “alternate strategy,” we decided that this would mean choosing the haul opposite to the recommended one, sailing for 1.5 minutes without tacking, with an angle αopt relative to the wind, and from that point on (which is a good distance from where the boat would have been had it stayed on our recommended tack), using our optimal strategy. Slightly different rules were needed for locations near the laylines or near the top mark. With this, it becomes straightforward, using simulations as above, to obtain the probability distribution and expected travel time T alt (w, h, x, y) to the top mark under the alternate strategy. Probability of beating the alternate strategy. By simulating simultaneously the trajectories of two boats from the same starting position, one of which uses the optimal strategy and the other the alternate strategy, we also obtain an estimate of the probability distribution of τ (w, h, x, y) − τ alt (w, h, x, y), that is, of the time won (or lost) by using the optimal strategy rather than the alternate strategy. Comparing starting positions. Racing yachts normally clear the start line at one of its two extremities, so, including the two possible tacks, there are four “usual” starting positions. During the pre-start phase, which lasts three minutes, the two boats “battle” against each other, maneuvering for their preferred starting position. Usually, both boats want the same starting position, but in any case, it is useful to know which position is best, and also how much better this one is than the other three. Indeed, if two such positions are not so different, then it may not be worthwhile to take big risks to win this position. Knowing the remaining time t before the start of the race, we can calculate the expected optimal time Tt,w (±h, x, ±y) = E(T (Wt , ±h, x, ±y)) to top mark given the present wind 21 w, for each of the four starting positions (±h, x, ±y); here, Wt is the wind t units into the future, given that the present wind is w, so we compute the expectation using the transition probabilities from w to each possible value of Wt during t units of time. The position with the smallest value is the “best” starting position: let Tmin be the associated expected time, ` r and let Tmin and Tmin be the minimal values at the left (respectively right) of the start r ` ` ), and (resp. Tmin line. Let hmin (respectively hrmin ) be the haul that corresponds to Tmin r ` let hmax (resp. hmax ) be the haul on the left (respectively right) side of the start line that is not recommended. In order to estimate the time associated with the haul that is not recommended, we replace T (Wt , h, x, ±y) by T alt (Wt , h`min , x, ±y) and T alt (Wt , hrmin , x, ±y) alt in the above formula, yielding an expected time Tt,w (h, x, ±y). The expected times that will be lost by starting in these positions is alt ` Tt,w (hmin , x, −y) − Tmin and alt r Tt,w (hmin , x, +y) − Tmin , while the expected time lost by starting with the correct haul is Tt,w (h`min , x, −y) − Tmin and Tt,w (hrmin , x, +y) − Tmin . One of these last two values will be zero. In addition to the expected lost time, using the probability distributions of the optimal travel time to top mark and of the travel time to top mark under the alternate strategy, we can also obtain the probability that a boat might win starting from one of the three suboptimal positions. These values can be computed in advance of the race and storred onboard for use during the prestart maneuvering. Expected time until next tack. Since a tack is an event that requires efforts from the entire crew, it is helpful to give them time to prepare for this important maneuver. By assuming that the wind will be constant for the next three minutes, it is possible to look ahead in the strategy maps to see if the boat is approaching a stochastic layline, and to estimate the remaining amount of time until the next tack. This information can be provided in real time onboard the boat. If the tack is more than three minutes away, then “> 3 min” is displayed, rather than a numerical estimate. 8 The decision tool and its use onboard For the 2007 America’s Cup, the Alinghi team integrated the strategy software containing the strategy maps and related data, together with a user interface, into their onboard computer system. The yacht’s instruments, sensors, and onboard GPS feed this system in real time, transmitting wind data, such as wind speed and direction, the boat’s location and its haul, in real time, along with regular updates of the opponent’s position. 22 Prior to the start of the race, the navigator inputs the race course geometry (the positions of the extremities of the starting line, of the top mark, the leeward gate and the finish line), so that geographic coordinates can be translated into (x, y)-coordinates of the strategy maps, and wind angles relative to the North can be translated into an angle in Wa . The next step is to select the appropriate triplet (σa , σv , µa ) of wind direction/speed volatilities and wind trend for use during the race. A Weather Team, which consists of several meteorologists, obtains these values by statistical methods after monitoring for several hours an array of weather stations located around the race course, that provide continuous wind observations. These values are communicated to the navigator by the Weather Team before the cut-off of communications, using a precise protocol to avoid communication errors. Usually, the navigator would use the weather team’s value, but he would also explore “whatif?”scenarios to see how things might change with a different choice of parameters. Once all the necessary inputs are set, the strategy software automatically updates and outputs information based on the boat’s position, the currently measured wind, and the opponent’s relative position (determined several times per minute using laser shots). Before using this new and somewhat experimental system in an actual race, the system was extensively tested during in-house races during the months leading up to the America’s Cup. The Alinghi Team found, for instance, that the pre-start estimates were consistently more accurate than those that were previously available and were based on purely geometric considerations, without accounting for future wind fluctuations. This is one reason why the crew developed a high level of confidence in the new tool during the preparations for the 2007 America’s Cup. During actual races, the Alinghi Team successfully used this tool to choose the right strategy during the first leg of the race, and as a result was most often in the lead when approaching the windward mark. During the upwind leg of the race, both a graphical view and a numerical data summary are updated real time on the navigator’s laptop, which is strapped to his waist. An example is shown in Figure 17. The graphic display of the upwind leg consists of a color coded optimum strategy recommendation (continue, tack, sail on the same tack at a certain angle greater than αopt , sail on the opposite tack at a certain angle greater than αopt ). Isochrones of expected time to the top mark are also plotted on the graphical view, and since the boats’ positions are overlaid in the plot, it is easy to visualize the current and future strategy changes, as well as the ahead/behind situation relative to the opponent. The user interface also displays a numerical summary: the current strategy recommendation, the current Wally recommendation, the expected time to the top mark from the current position, the expected time loss to the top mark if we do the alternate – non-optimal – strategy, the probability of beating the optimum strategy if we do the alternate, the probability of being ahead of the opponent at the top mark, the projected time to a coming tack for Alinghi and for the opponent, and the expected lead in time over the opponent. All these numbers are updated in real time. During many of the preparatory in-house races, the Alinghi Team recognized that this 23 Figure 17: A picture of the screen on the navigator’s laptop. new method for calculating the lead over the opponent made a significant improvement on the tactics and decision, including in certain situations for which the tool was not explicitly designed. For instance, on one occasion, it allowed the boat to choose the optimum time to tack, putting Alighi’s boat in a strong starboard position relative to the opponent. On another occasion, while approaching the windward mark, the helmsman exploited the information provided by the “distance ahead” calculations to force a penalty on the opponent near the point where the paths of the two yachts were about to intersect. It general, it was in close situations, where a few meters advantage is important, that the improved accuracy of the decision tool made the most difference. 9 Concluding remarks If we make the analogy with mathematical modeling in finance, the model of Section 5 is somewhat analogous to the Cox-Ross-Rubenstein model: indeed, it is fully discrete and captures some essential features of the problem. It is however not sufficient to provide quantitative answers that can be used in real time onboard the boat. On the other hand, the model of Section 6, which is based on actual statistical data, turned out to be useful even for experienced sailors. It certainly did not replace their experience, but it confirmed intuitions that they had and gave precise quantitative answers to questions that interested them. For instance, it was not only possible to say that starting on the right 24 side of the start line was better than starting on the other side, but it could give them the expected advantage of one side over the other, given the present wind conditions. Given that the Swiss team implemented our strategy software into their onboard computer system, trained to use it, and finally actually won the 2007 America’s Cup race, we can consider that stochastic optimization techniques were useful to the team. However, since a typical team’s budget is on the order of one hundred million dollars, it is clear that a team of a few mathematicians only makes a small contribution to the overall effort. On the other hand, since the boats were of a type that had already been used for many years, the benefits attainable by classical efforts, in the directions of material science or hull shape optimization, were already highly exploited, while this effort in stochastic optimization was comparatively new. There are many important issues that we have not discussed (see [2]). For instance, it is important to analyze the robustness of the model and the impact of incorrect parameter selection. Our analysis showed that the most important parameter is the wind trend µa , then the wind direction volatility σa and finally the wind speed volatility σv . Indeed, an incorrectly predicted sign of the wind trend (wind turning to the left rather than to the right, for instance), can lead to an expected loss of time on the order of 1 minute in a 20 minute upwind leg, while an incorrect prediction of the wind direction volatility costs only a few seconds, and this is less than a second for the wind speed volatility. Since it is the weather team’s role to predict the wind trend, their role is quite important. For comparison, an improvement in the shape of the hull, for boats that were already so well optimized, might lead to a gain of a few seconds in a 20 minute leg. One could hope that the methods that we have developed could be used by amateur sailors everywhere. Unfortunately, this is not the case. For instance, on an ordinary sailboat, one does not easily have access to the boat’s location on the water, but one can only estimate this visually. Boats in the America’s Cup not only have an onboard GPS, but also high quality instruments for estimating the wind speed and direction, and an on board computer system for real-time computations. In another direction, while it is nice to have a numerical solution that is adequate for use on board a sailboat, it would be nice from a mathematical point of view to have a mathematical model within which an explicit solution of the stochastic optimization problem is available. Such models have been proposed and studied in [11] and work in this direction is in progress. A last issue that should be mentioned is that an America’s Cup race is actually a match race between two boats. While getting to the finish line quickly is important, the most important issue is to get there before the opponent. Since the two boats are allowed to maneuver, according to certain rules, in such a way as to hinder the progress of the other boat, the problem becomes a stochastic game, in which interactions between the two boats are central. This game-theoretic aspect is also the subject of current research. 25 References [1] Cairoli, R. & Dalang, R.C. Sequential Stochastic Optimization. Wiley, New York (1996). [2] Dumas, F. Stochastic Optimization of Sailing Trajectories in an America’s Cup Race. Ph.D. Thesis no. 4884. Ecole Polytechnique Fédérale de Lausanne, Switzerland (2010). [3] Formaggia, L., Miglio, E., Mola, A. & Parolini, N. Fluid-structure interaction problems in free-surface flows: application to boat dynamics. International Journal for Numerical Methods in Fluids 56 (2008), 965–978. [4] Gladstone, B. Performance Racing Tactics. North U, Madison, 6th edition (2002). [5] Parolini, N. & Quarteroni, A. Mathematical models and numerical simulations for the America’s Cup. Computer Methods in Applied Mechanics and Engineering 194 (2005), 1001–1026. [6] Philpott. A.B. Stochastic Optimization and Yacht Racing. In: Applications of Stochastic Programming (Stein W. Wallace & William T. Ziemba, eds). MOS-SIAM Series on Stochastic Optimization 5 (2005), Philadelphia, PA. [7] Philpott, A.B., Henderson, S.G. & Teirney, D. A simulation model for predicting yacht match race outcomes. Operations Research 52 (2004), 1–16. [8] Philpott. A.B. & Mason, A. Optimising Yacht Routes under Uncertainty, In: Proceedings of the Fifteenth Chesapeake Bay Yacht Symposium (2001), 89–98. [9] Puterman, M.L. Markov Decision Processes. Wiley, New York (1994). [10] Raftery, AE. & Haslett, J. Space-time modeling with long memory dependence: assessing Ireland’s wind power resource. Applied Statistics 38(1) (1989), 1-50. [11] Vinckenbosch, L. Stochastic Control and Free Boundary Problems for Sailboat Trajectory Optimization. Ph.D. Thesis no. 5381. Ecole Polytechnique Fédérale de Lausanne, Switzerland (2012). [12] Zarate-Minano, R., Anghel, M. & Mila, F. Continuous Wind Speed Models based on Stochastic Differential Equations. Applied Energy 104 (2013), 42–49. 26
© Copyright 2026 Paperzz