Monday, 18 May 2015

Modelling a yacht race

English schoolchildren these days are assessed in examinations at the ages of 15-16 and 17-18, now known as GCSEs (General Certificate of Secondary Education) and "A"-levels.  In my youth I was examined by "O"-levels and "A"-levels (Ordinary and Advanced).  I remember very few aspects of these examinations  One exception is a question in mathematics, as it was thought-provoking.  "Assuming that a yacht's sail deflects the incoming wind as in a mirror, explain why the angle of the sail affects the speed of the yacht"  Quite obviously it was a matter of vectors of force from the wind against the sail and the resistance of the water on the hull.  But this question was different from the usual questions in books, where the forces were acting on idealised objects ("a pendulum on a rod of negligible mass ... ", "a perfectly smooth bead is on a wire ... ")

I hope that the examiner realised that this question would make the examinees pause and think, and allowed extra marks for the time that this might take; and I wonder if other students can remember the question so many years later.  (I have two other memories of that year's examinations - one that I realised ten minutes after a mathematics paper that I had subtracted 530 from 600 and got the answer 50;  the other that in a physics practical involving the cooling of water, I had poured my water away before measuring the volume - so I quickly measured the warm portion of the container, refilled it to the same depth with cold water and measured that, thus getting an answer which was "near enough".)

In the May issue of the Journal of the Operational Research Society, Robert Dalang, Frederic Dumas, Sylvain Sardy, Stephan Morgenthaler and Juan Vila describe how they modelled the forces acting on a racing yacht to determine the optimum course for that boat in the America's Cup races in 2007.  It was rather more sophisticated than my few lines on the "O"-level script in the 1960s. 

Stochastic optimization of sailing trajectories in an upwind regatta appears in the Journal of the Operational Research Society(2015) volume 66, pp 807–820,doi:10.1057/jors.2014.40 (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, which 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.)

As the abstract points out, the winds are not constant in direction or strength.  Therefore, the model needs analysis of the past variation as well.  One simplification (realistic) was to model the first upwind leg of the race, as the yacht that leads at the first turn is likely to stay in the lead.  In the paper there are diagrams "Boat polars" which would have been useful in the "O"-level; they show the velocity of a selected boat in a wind of given speed and with the course set at a given bearing.  These lead to the optimal bearing for the wind speed.  The paper discusses tacking (changing the direction of the boat when going upwind) and the choice of whether to start on a left-hand tack or right-hand tack.  And then this feeds into an optimisation model which uses a discrete space for the progress of the yacht.  

Boat polars for a given speed of wind showing (on the right) the optimal course to maximise speed against the wind (from the cited paper)


All well-worth reading.  Towards the end of the paper there is a wistful comment:
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 100 million dollars, it is clear that a team of a few mathematicians only makes a small contribution to the overall effort.

With hindsight, how much should the mathematicians (O.R. scientists) have charged for their services?

Thursday, 7 May 2015

Comparing apples with oranges

Long ago, teaching a course on the statistics of surveys, I reminded my classes, repeatedly, that they should make sure that the comparisons that they made between results were rigorous.  If not, the saying goes, you are in danger of "comparing apples with oranges".  The point is that the underlying populations, and the measurements on them, should be comparable.  Apples and oranges are different fruits, grown in different countries, and their agriculture is different.  So, to be ridiculous, one could not measure the cost of producing one orange with the cost  of producing one apple, because one could not grow oranges in an apple orchard and vice versa.

So, today, an advert on a bus in Exeter caught my eye.  "More people see bus advertisements than use social media daily".  Apples=People see an advert on a bus in the course of ... how long?  The text suggests "in a day".  Oranges=People using social media daily.  Measurement in both cases=total number. 

My interest was aroused.  Not everyone who sees an advert on a bus will read it.  Very few will have gone out of their homes saying "I really must read a bus advertisement today".  But people are purposeful when they use social media.  Measurements on apples are not measurements on oranges.  I managed to find estimates of the number of daily users of social media in the UK.  It is roughly 20 million but may be as high as 25 million.  So how many people see a bus - let alone a bus advert - daily?  Guesstimating that number suggested that a figure between 15 and 25 million would be about right, knowing the population of the UK, and the working population who would be commuting and might see a bus.  So the two numbers are in the same ballpark - if the bus advert figure is for daily sightings. 

That was when my search found the website of the company making the claim.  There I found the claim:
30 million people have seen advertising on the outside of a Bus in the last week  - See more at: http://www.exterionmedia.com/uk/what-we-do/our-media/bus-advertising#sthash.jYIkaMpL.dpuf
30 million people have seen advertising on the outside of a Bus in the last week  - See more at: http://www.exterionmedia.com/uk/what-we-do/our-media/bus-advertising#sthash.jYIkaMpL.dpuf

 30 million people have seen advertising on the outside of a Bus in the last week


Aha!  the time scale for apples is now a week.  (And why write "Bus" with a capital "B"?)  My guesstimate is reasonable, since one can assume that in seven days, some people will see adverts on several days, while others will see them on one.

I hope the thousands or millions who see the advert that I saw this morning will recognise that you can't compare random exposure to an advert on a bus in one week with purposeful use of social media.  If they don't, then they shouldn't be entrusted with buying apples; they might buy oranges, or grapes, or tomatoes!
30 million people have seen advertising on the outside of a Bus in the last week  - See more at: http://www.exterionmedia.com/uk/what-we-do/our-media/bus-advertising#sthash.jYIkaMpL.dpuf
30 million people have seen advertising on the outside of a Bus in the last week  - See more at: http://www.exterionmedia.com/uk/what-we-do/our-media/bus-advertising#sthash.jYIkaMpL.dpuf
30 million people have seen advertising on the outside of a Bus in the last week  - See more at: http://www.exterionmedia.com/uk/what-we-do/our-media/bus-advertising#sthash.jYIkaMpL.dpuf
30 million people have seen advertising on the outside of a Bus in the last week  - See more at: http://www.exterionmedia.com/uk/what-we-do/our-media/bus-advertising#sthash.jYIkaMpL.dpuf

Monday, 20 April 2015

Clement Attlee on Operational Research in 1944

I was born several years after the second world war, so do not have any personal experience of that period of world history.  However, for various reasons, I have known about the secrecy associated with the work of British scientists during the war.  So I have been mildly annoyed when reading novels set in that time which make anachronistic reference to that work.  I won't name the guilty parties.  One had a character talk openly about going to Bletchley for a message to be decoded, when the existence of the operations there was a secret for a generation afterwards.  Over the last weekend, another book had a character assuming that the enemy bombers in a raid on Britain in 1942 had "flown under the radar".  Again, the word radar was seldom used at that stage in the war, although there was no way that the radar masts could be disguised, their purpose was secret and the term "radar" was little used, so the expression "under the radar" would not be in civilian usage.  By 1944 the government had admitted the existence and efficacy of Britain's radar system.

So, as I was a little irked by the anachronism, today I turned to an index to newspapers of the period, to find when the press had first used the term "radar".  The Times had used the term twice by 1942, and neither time was there reference to British radar systems.  But it was a 1944 reference which caught my eye. 

On Thursday April 20th, 1944 (six weeks before D-Day) there was a debate in Parliament about support for science; the debate seems to have proceeded on the assumption that the Allies would win the war.  Clement Attlee (then Lord President of the Council, later to be Prime Minister in the peace-time government after the election in 1945) said:
  • The country owed a great debt to scientists, for to a far greater extent than ever before the war had seen the application of science to the production of weapons of offence and defence in all three elements [land, air and sea].  In quality of research we fully held our own.  In the study and the laboratory the brains of our scientists had been pitted against the best brains of the enemy and they had not been found wanting.  Perhaps the most striking instance had been the development of radar.  Another was in operational research.  Today, after operations had taken place, there was a kind of post-mortem by trained scientists to make a careful examination of the facts which had led to success or failure.
So, there we have it.  Praise for operational research in the war effort, both for planning and for the analysis afterwards. 

Clement Attlee, British Prime Minister in the post-war government (picture from history.blog.gov.uk)
 I wonder, on that April day exactly 71 years ago as I write, how many readers of The Times would have known anything about operational research? 

Friday, 17 April 2015

What is a system? A 19th century answer.

Frederic Bastiat is a name that is little known in Operational Research circles.  Actually, I hadn't heard of this nineteenth century economist until earlier this month.  Yet he wrote about one of O.R.'s essential features, the extent of the system being modelled or studied.  Frederic was a French economist, an essayist and member of the French assembly.  In 1850 he published a pamphlet containing his essay "Ce qu'on voit et ce qu'on ne voit pas" ("What is Seen and What is Unseen") which included a story, sometimes called a parable, about the economic effects of a child breaking the glass in a shop-window.

He didn't use the word "system" in the essay.  I shall use that word, because it is part of the language of O.R.  Bastiat simply asked the reader to consider the extent of the effect of that damaged window pane.  "The glazier comes, performs his task, receives his six francs, rubs his hands, and, in his heart, blesses the careless child. All this is that which is seen."

But is that the extent of the system?  Bastiat argued that there is a larger system which is unseen.  "as our shopkeeper has spent six francs upon one thing, he cannot spend them upon another. It is not seen that if he had not had a window to replace, he would, perhaps, have replaced his old shoes, or added another book to his library."

"The window being broken, the glazier's trade is encouraged to the amount of six francs; this is that which is seen. If the window had not been broken, the shoemaker's trade (or some other) would have been encouraged to the amount of six francs; this is that which is not seen."  So the system affected by the broken window extends beyond the glazier to encompass the alternative businesses where that six francs could have been spent.

(some of Frederic's thinking was concerned with what would happen, economically, if all the buildings in a part of Paris were to be destroyed.)

Economists claim that this is the earliest discussion of "opportunity cost".  That is another term which arises in O.R., especially in the context of the sensitivity analysis of a linear programming solution, where the reduced cost (opportunity cost) is the amount by which an coefficient in the objective function would have to improve before it would be possible for the corresponding variable to enter the optimal basis of the solution.

So, rise up, you O.R. scientists, and praise the name of Frederic Bastiat!

Thursday, 2 April 2015

Waste collection in Exeter - some good operational research

There is a Youtube video of how the city of Exeter (here in Devon) is using data collection as part of a suite of tools to monitor and manage the collection of waste in Exeter.  Waste collection is a classic example of a problem of stochastic vehicle routing and scheduling, and there are numerous papers in the O.R. literature about how to solve some of those problems.  (Not all the models are realistic; some are simply theoretical, adding new twists to earlier theoretical models!) The video does not go into great detail (shame!) but shows how there is technology in the vehicles to record information relating to each collection that has been missed or refused.  This is coupled with a display in the council office showing progress of the vehicle around the streets.  The commentary reports cost savings due to doing things better ("science of better" anyone?) and suggests how the GPS technology is being extended to other matters for which accurate spatial location is very important.


The video is obviously a promotional video to encourage the use of GPS for data collection and recording in local authorities and service industries, but behind the scenes is some very good O.R. work (probably not called that) relating to the routing and scheduling of a fleet, and some serious questions about quality of data and whether some data are really needed. 

There were a number of times during my academic career when I listened to a research paper at a conference, and really wanted to ask the presenter what "real" data they had used in their models.  Next time you are tempted to write a theoretical paper about vehicle routing, have a look at this to get a feel for some practical features of everyday life in the world of refuse collection.

Thursday, 19 March 2015

Lake control at Te Anau

Sign by Lake Te Anau

Dealing with multiple, conflicting, objectives is part of operational research.  I have written earlier about the Noah and Joseph problem and the conflicting objectives there.

When we were on holiday, I saw this sign on the bank of Lake Te Anau, in southern New Zealand.  The text is worth recording, as it describes control rules and the conflicting objectives.

Lake Levels
A Government appointed body, The Guardians of Lakes Manapouri, Monowai and Te Anau" ensures that the lakes are managed within their natural levels.
A complex set of guidelines determines how long a lake can be held at a certain level.
It it is too high for too long shoreline vegetation may 'drown'.
If it is too low for too long beaches are prone to sand and gravel loss and slumping.
The rate at which the lake level is lowered is also controlled. but weather determines how fast it rises.
The higher the lake level peaks above this mark (202.7 metres above sea level) the longer it is before the lake is allowed that high again.
for example, if levels reach 202.7 for up to 125 days, recurrence is prevented for another 20 days but if levels go higher to 204.3 even for just 1 day recurrence is prevented for 100 days (this in the high operating range).
As the lake lowers below this mark (201.5) fewer days can be spent at each level (this in the low operating range)

notes at the side read 
Aquatic plants are protected from drying by the lake level guidelines
Vegetation above mean lake level is protected from drowning and shoreline erosion

It is notable that the range of allowable lake levels is only 1.2 metres (4 feet)

Just stop and think about the modelling behind these rules.  Engineering (for the water release and control) meets biology (how long does it take to drown a plant, how long for it to dry out) meets geology (gravel loss) meets hydrology (modelling the lake levels) meets meteorology (rainfall) meets mathematics and operational research.  It is multidisciplinary, in the way that the best O.R. should be!  Well done!

Thursday, 12 March 2015

Hidden queues

Tina and I holidayed in New Zealand in February.  While there, we noticed several warning signs, like this:
Sign by a New Zealand road
How perceptive!  There are hidden queues in many everyday systems.