Has anyone seen a model for getting the best set of "tacks" for a sailboat when trying to sail upwind to a buoy in the water? ("Tacking" means sailing at zigzags in order to go up toward the source of the wind. A sailboat can sail into the wind up to 45 degrees but no higher. See http://en.wikipedia.org/wiki/Tacking_%28sailing%29 for more.) The way I see the problem is that you are trying to minimize time from (x0, y0) to (x1, y1) by minimizing the total distance of the tacks (one tack == one leg on the zigzag). The boat sails at a constant speed during a tack (say 6 miles per hour), but each tack incurs a time penalty (say 10 minutes), and each tack must be 45 degrees off the wind (or more). Hopefully the pictures on wikipedia will be enough to understand... I started to work on an AMPL model, but I have an integer variable for the number of tacks AND I want to use that variable to index an array with the start and finish of each tack  that won't work, I don't think. I could expand the array to have a dimension 1..max_tacks, but that seems tricky. I also wonder if this wouldn't be better solved with a combinatorial optimization language like minizinc. There are a lot more subtleties to picking the best windward course, but I think this is a decent place to start (especially for an amateur practitioner in both OR and sailing). If anyone wants to expand, though, I would be interested. (I can see optimizing for more than a single line, acceleration in a tack, allowing for different speeds depending on the tack angle, and somehow accounting for wind variability...) Thanks! Hopefully I am not the only one who thinks this might be an interesting puzzle. asked 06 Feb '12, 16:25 forkandwait Thiago Serra 
I've seen this before. http://orfe.princeton.edu/~rvdb/sail/sail.html is one site. I thought there was a paper about this, but I can't locate this at the moment. answered 06 Feb '12, 18:27 Michael Trick ♦♦ That is cool, esp the use of markov chains to simulate wind changes. I will try to figure out to use the ideas with our local courses and wind patterns. I might need to do a combination simulation and optimization, which I am not quite sure how to best do technically (for i = 1..100, for j = 1..Nlegs, optimize next course change, find wind...)
(06 Feb '12, 19:37)
forkandwait

You're really talking about optimizing the process of beating to windward, correct? (The Wikipedia entry explains the difference between beating and tacking.) The Wikipedia article also points out one constraint on doing a single leg on each tack: the width of the channel you are in. There's also a less obvious issue. If you point a sailboat at your destination (let's assume for simplicity the destination is not in the eye of the wind) and lock the helm, you likely will not arrive where you intended. Various forces can push the boat a bit off course. Tacking more often as you beat to windward reduces the likelihood that you will have a large course correction on the last leg. I'm not sure that the incremental distances involved in course corrections are constant (i.e., that a bunch of small ones will add up to the same distance as one large one). I'm also not too sanguine about your assumption of constant speed. I suspect you are lumping the deceleration/acceleration involved in a tack into the time penalty per tack. The problem with this is that (a) the boat is actually making progress during the deceleration/acceleration, so you have to credit for some progress on each, and (b) if you tack often enough, the boat never reaches your assumed constant speed. I suppose you can at least partially finesse that by requiring that the boat hold its new heading at least long enough to reach full speed. answered 06 Feb '12, 18:39 Paul Rubin ♦♦ My assumption re constant speed was for simplification. And great points altogether. Now if I can just write the model before summer... ;)
(06 Feb '12, 18:49)
forkandwait
If you want to assume that the destination is in the eye of the wind, and that you always beat 45 degrees off that direction, you can do a pretty decent approximation with a shortest path model. Nodes have two dimensions, which can be (x,y) coordinates or (d1, d2) where d1 is distance from destination along a straight line course and d2 is distance orthogonal to the straight line course. An arc between two nodes represents one full leg; its weight is the total time of the leg (including time spent turning, and adjusted for acceleration).
(06 Feb '12, 18:57)
Paul Rubin ♦♦

Actually, the basic problem is trivial as posed (whoops!): since the distance sailed is always the same whether you cut up into multiple legs or just one big oneandback. Therefore, you should do a single big one and back to minimize number of tacks. (I could have thought about the geometry a little more,...)
However, that is crappy sailing strategy because you curtail your ability to maneuver at the mark. It also might make it a lot easier to optimize other stuff.
More later, but I am pleased to see Bo interested at least!
Yes, I am interested. I deleted my answer, since it was more a comment and not really helping ( note to myself don't post when late and tired.. )