[WW HOME] [TEACHING] [MATH] [SEARCH] [FEEDBACK]


Simulating the Battle of Trafalgar

Jim Marsalis, Jim McManus, Debbie Preston, and Jim Rahn

Abstract: The Battle of Trafalgar can be modeled by writing differential equations where it is assumed that each side knows the precise location of the opposition. This method of attack is known as "directed" or "aimed" fire, and all our simulations will assume the use of directed fire. The following parameters and differential equations will be used:

b = the rate at which the British fleet destroys the French,

f = the rate at which the French fleet destroys the English,

B = the size of the British fleet,

F = the size of the French fleet,

Undisplayed Graphicdescribes the British destruction rate, and

Undisplayed Graphicdescribes the French destruction rate.

Euler's Method will be utilized, in various implementations, to find solutions for these differential equations. Various methods of solution will be implemented which can be used in classes ranging from beginning algebra to calculus. The design of each implementation is twofold: first, students investigate the effects of the various parameters on the outcome of the battle, and second, the problem can be investigated with different methods of technology, such as spreadsheets, Mathcad, Stella, the TI-82 calculator and the HP-48 calculator. These methods can be used singly or in conjunction with each other, thus making the investigation more accessible.

Historical Overview

October 21, 1805 was the date of the Battle of Trafalgar, the greatest naval engagement of the Napoleonic Wars. The British fleet was under the command of Admiral Lord Nelson, while the allied French and Spanish fleet was under the command of the French Admiral Villeneuve. Although the British had but 17,000 men to the allied forces of 30,000, the British force was so well-trained that Villeneuve was convinced that the allied forces could not defeat the British Royal Navy, even if its forces were one-third weaker than those of the allies. In fact, Villeneuve had to be ordered by Napoleon to put to sea, and, once at sea, he did not intend to give battle to Nelson unless forced.

Nelson's original battle plan was to slice through his opposition, with one force attacking the enemy's forces from the rear, while the remaining British force prevented the reunification of and subsequent interference by the enemy. His forces, however, were unexpectedly weaker than the allies, because 6 of his ships had been sent to Gibraltar for additional supplies. Despite the apparently overwhelming superiority of the opposition, Nelson divided his own fleet, and the first shots of the battle were fired at 11:45 a.m. At about 5:45 p.m., when hostilities ceased, the British were the resounding victors, but Admiral Nelson, whose brilliant tactics had prevented the invasion of Britain, had suffered a mortal wound.

Lanchester's Square Law

Lanchester's Square Law can be used to determine an outcome for a simulated battle. An essential assumption for the use of this law is that of directed fire, where one force knows the other's location. Knowledge of the destructive efficiency of the two forces is assumed. To obtain the mathematical form of the model, it is assumed that the rate of attrition of one force is directly proportional to the troop strength of its enemy. The constant of proportionality is a measure of the effectiveness of the directed fire. Since the location of targets is precisely known, the strength of the force being attacked is irrelevant to its attrition rate (i.e., random volleys are not attempted).

and ,

B = the number of British ships,

F = the number of French ships

b = rate at which a single ship of the British fleet destroys ships of the French fleet

f = rate at which a single ship of the French fleet destroys ships of the British fleet

b and f are in ships destroyed per ship per hour, while t = time in hours

are rates of attrition of British (B) and French (F), respectively, in ships destroyed per hour

and

Therefore the French force of 46 annihilated the British force and had a force of 23 remaining.

The parameters in our model were set with an aim of making the simulated battle times fairly realistic. Since the duration of the Battle of Trafalgar was less than one day, we sought to make most battle scenarios occur in a time span that would seldom exceed two days if fewer than 50 ships were allotted each side. Experimentation verified that choices of efficiency (b and f) of about 0.1 units destroyed per unit per hour were reasonable.

Solving Differential Equations Using Euler's Method

A differential equation describes the rate of change of an unknown function. The solving of differential equations has typically been reserved until late in a first year calculus class when students have learned to find a large number of anti-derivatives. Euler's Method (first formulated and used by Leonhard Euler, an 18th century Swiss mathematician) enables students to approximate the value of the function described by the differential equation if they are given an initial condition. With this method, students are able to solve many differential equations which they could not solve by analytic methods normally taught in the scope of a standard advanced placement calculus course.

Suppose a differential equation f(x, y), with an initial condition of , is given. Using the differential equation and the initial point , it is easy to calculate the slope of the function y at through substitution, and a new point can be generated () . This process is then iterated until enough data has been generated to reach a specific x-value.

Let's look at a specific differential equation with an initial condition of = (1,1).

Point x old y + slope • x = new y P0 1 1 P1 1.1 1 + 1.1 = 1.1 P2 1.2 1.1 + 1.21*.1 = 1.221 P3 1.3 1.221 + 1.44*.1 = 1.365 P4 1.4 1.365 + 1.69*.1 = 1.534 P5 1.5 1.534 + 1.96*.1 = 1.73

The accuracy of the approximations obtained through using Euler's Method can be improved by decreasing the size of . We found that 0 < < .5 provides good results.

Investigations

Using the computational means available, investigate some possible battle outcomes that would be predicted by the model.

Suppose that the British began with 40 ships and the French had 46. Assume that all ships had the same firepower, and that each side knew the positions of the enemy. With these assumptions, a scenario exists that can be approximated by the Lanchester directed fire model.

1. If the entire British fleet squares off against the entire French fleet, how long will it take the French to win? Use an efficiency of 0.1 for both fleets and a step size, , of 0.1. How many French ships will be left?

2. Using initial forces of 46 French ships and 40 British ships, with efficiencies of 0.1, try altering the step size, . Use values from 0.1 to 1.0. Does altering the step size affect the results? Which answer is most nearly correct? Why? Why would you not want to use a step size as small as 0.0001?

3. What happens if the British efficiency is raised to 0.12? How about 0.15? Find an efficiency that results in the annihilation of both forces.

4. Suppose that the British start with 10 ships, and the French with 20. Set the French efficiency at 0.1. By experimenting, find the lowest value of the British efficiency that leads to a tie with the French. (Increase the British efficiency in steps of 0.1.) What if the French started with 30 ships? 40 ships? Fill in this chart for the case of a tie.

ship ratio =

French ships British ships Ship ratio French Eff. British eff. Eff. ratio 20 10 2 .1 _________ _________ 30 10 3 .1 _________ _________ 40 10 4 .1 _________ _________ 50 10 5 .1 _________ _________

Can you find a mathematical relationship between the ship ratio and the efficiency ratio? If so, test your formula by predicting the British efficiency needed to fight 15 French ships to a draw. Why is a draw often an undesirable alternative to both sides?

5. Historians tell us that the French commander, Villeneuve, did not think his forces could defeat Nelson, even if the British forces were one-third weaker than the French. If this were true, and if the French efficiency were 0.1, what would be the minimum possible value of the British efficiency?

6. In the actual Battle of Trafalgar, Lord Nelson split the French fleet and fought what were essentially two separate battles. The remaining British and French ships then cannonaded each other, and the British emerged victorious. Using the model, split the British into fleets of 32 and 8 ships. Find a way to split the French fleet of 46 that leads to an ultimate British victory. Find other combinations, if possible, to also accomplish a British victory. What is the optimum division of forces for the French, as far as the British are concerned?

7. Suppose that the British split the French fleet in half and used all of the British fleet to fight one half of the French ships. The remaining British would then engage the other half of the French in battle. What happens? Would this be a realistic strategy to follow in an actual naval encounter? Justify your answer.

8. Obviously, simple mathematical models often do not account for all of the variables that would have an effect upon the actual situation. In this case, what good is such a model? Care should be taken in which areas with such a model?

Extensions

The model with 40 British and 46 French ships is one commonly used in Trafalgar simulations. In researching this project, we found sources that placed the British strength at 27 ships, while the French fleet had 33 ships. Nelson led a force of 12 ships against 8 French ships, while his subordinate, Admiral Collingwood, commanded a force of 15 ships against 15 French ships. Ten French ships had continued toward the port of Cadiz after the engagement began, and returned to the area too late to be of any help.

What would the Lanchester model predict as an outcome for this encounter? Can you find a change in the British efficiency that would lead to a British win? You may wish to research the battle yourself. In what ways do the reported conditions of the battle correspond to the assumptions of the model? How do they differ? What effect does this have on the applicability of the model?

Sources

Mathematics of Conflict, M. Shubik, editor; Elsevier Science Publishers, B. V., The Netherlands, 1983.
Trafalgar, Countdown to Battle 1803-1805, Alan Schom; Michael Joseph, London, 1990.
Encyclopedia Britannica, 1985
Encyclopedia Americana, 1980

Modeling with the HP-48

The Battle of Trafalgar can be modeled, with variations, using an HP 48 calculator. The following program listing is for one solution to the problem:

<< "ENG EFF" HALT

`B' STO DROP

"FR EFF" HALT `R'

STO DROP "DELTA TIME"

HALT `T' STO DROP

"INIT BRITS" HALT

`X' STO DROP

"INIT FRENCH" HALT

`Y' STO DROP

"# ITER?" HALT `E'

STO DROP X Y 1 E

FOR N `X-R*Y*T'

EVAL `Y-B*X*T'

EVAL `Y' STO `X'

STO X Y NEXT

E 1 + `F' STO

{ F 2 } ->ARRAY

`DAT' STO { B R T

X Y E F } PURGE>>

Store the program in a memory location called `TRAF' using STO and run the program. The English efficiency, French efficiency, change in time, initial number of British ships, initial number of French ships and the number of iterations are requested. Enter each of these values followed by <left shift, ON > to continue. The data is then found in the variables menu in DAT.

A sample run of the previous HP-48 program follows:

COMMAND OUTPUT

TRAF "ENG EFF"

0.1 CONT "FR EFF"

0.1 CONT "DELTA TIME"

1 CONT "INIT BRITS"

40 CONT "INIT FRENCH"

46 CONT "# ITER?"

15 CONT -------

DAT [[ 40 46 ]

[ 39.54 45.6 ]

[ 39.08 45.2 ]

[ 38.63 44.81 ]

. . .

The rest of the data can be found by pressing the down arrow key and then moving around in the resulting environment with the arrow keys.

Modeling with the TI-82

The following program TRAFGRAF provides graphical and table representations of the Lanchester model.

:PROGRAM: TRAFGRAF

:FnOff :ClrDraw :E-B*G*S->H :End

:PlotsOff :Else :End

:ClrHome :0->H T->L1(J+1)

:Func :End E->L2(J+1)

:ClrList L1, L2, L3 :If G A*G G->L3(J+1)

:0->T :Then

:0->I :G-A*E*S->K

:Disp "FINAL TIME" :Else

:Input F :0->K

::Disp "NO OF PTS" :End

:Input N :H->E

:round(N/99,0)->R :K->G

:F/N->S :T+S->T

:Disp "BRITISH SHIPS" :If E<.5

:Input E :Then

:Disp "FRENCH SHIPS" :E=0

:Input G :End

:Disp "BRITISH EFFECTIVENESS" :If G<.5

:Input A :Then

:Disp "FRENCH EFFECTIVENESS" :G=0

:Input B :End

:E->M :Pt-On(T,E)

:If G>E: G->M :Pt-On(T,G)

:0->Xmin :I+1->I

:F->Xmax :If I/R=int (I/R)

:0->Ymin :Then

:M->Ymax :int (I/R)->J

:Repeat E<.5 or G<.5 :T->L1(J) [stores time]

:If E B*G :E->L2(J) [stores number of British ships]

:Then [continued in next column] :G->L3(J) [stores number of French ships] [continued in next column]

A sample run of this TI-82 program follows:

Input:

Final Time [This is to set screen maximum]

?25

No. of Pts [Generally, more points, more accuracy]

?150

British Ships

?40

French Ships

?46

British Effectiveness

?0.1

French Effectiveness

?0.1

Output:

This TI-82 program graphs the number of ships versus time until one side has lost all ships. When the programs ends, hit the "STAT" key, then the "ENTER" key to get the data tables. L1 is time, L2 represents the number of British ships, and L3 represents the number of French ships. For the data entered above, at L1 =12.5 hours, there are no British ships (L2 = 0) and 23 French ships (L3 = 22.554).

PROGRAM: BATTLE

:ClrHome

:Disp "STEP SIZE"

:Input S

:0->T

:Disp "BRITISH SHIPS"

:Input Z

:Z->L2(1)

:Disp "FRENCH SHIPS"

:Input Z

:Z->L3(1)

[continued in next column]

:Disp "BRITISH EFFECTIVENESS"

:Input A

:Disp "FRENCH EFFECTIVENESS

:Input B

:Repeat L2(1) .5 or L3(1) .5

:L2(1)-B*L3(1)*S->L2(2)

:L3(1)-A*L2(1)*S->L3(2)

:T+S->T

:L2(2)->L2(1)

:L3(2)->L3(1)

[continued in next column]

:End

:Disp "BRITS"

:Disp L2(1)

:Disp "FRENCH"

:Disp L3(1)

:Disp "TIME"

:Disp T

The TI-82 program BATTLE is appropriate if the user wants only final battle results. The victor's number of remaining ships and the time of battle are printed on the results screen.

A sample run of this program follows:

Input: Output:

Step size Brits

? 0.1 0.4795972574

British Ships French

?40 22.5724204

French Ships Time

?46 13.1

British Effectiveness

?0.1

French Effectiveness

?0.1

Interpretation: In 13.1 hours, the British have been wiped out and there are 23 French ships left.

Modeling with the STELLA

The STELLA software is a powerful tool for examining systems such as the Lanchester model. In our Trafalgar flowchart, we have already set the British forces at 40 ships, the French at 46 ships. Both efficiencies are set at 0.1. To get a feel for the model, click on Run, then open both the table and graph. You can reasonable assume that the battle is over when one or both of the forces drops below 0.5 ships. This is most easily seen in the table. You can use the STELLA model to carry out all of the suggested investigations by double-clicking on the variables (forces and efficiencies) that you wish to alter.

STELLA MODEL

STELLA EQUATIONS

British_Fleet(t) = British_Fleet(t - dt) + (- Br_Loss_Rate) * dt INIT British_Fleet = 40

Br_Loss_Rate = min (French_Fleet*Fr_Eff,British_Fleet)
French_Fleet(t) = French_Fleet(t - dt) + (- Fr_Loss_Rate) * dt INIT
French_Fleet = 46

Fr_Loss_Rate = min(Br_Eff*British_Fleet, French_Fleet)

Br_Eff = .1

Fr_Eff = .1

STELLA GRAPHIC

STELLA DATA

Hours British Fleet French Fleet

.040.0046.00

.139.5445.60

.239.0845.20

.338.6344.81

.438.1844.43

.537.7444.05

. ..

. ..

. ..

14.5 0.2322.49

14.6 0.2022.48

14.7 0.1822.48

14.8 0.1622.48

14.9 0.1522.48

15.0 0.1322.48

Modeling with Spreadsheets

Spreadsheets are particularly well-adapted to modeling an iterative process, and spreadsheet programs are available for most personal computers and operating systems. A template for the Battle of Trafalgar can be designed which will allow students to experiment with modifying fleet sizes and efficiencies. Copies of spreadsheets showing formulas and sample output follow.

Simulation of the Battle of Trafalgar






NUMBER OF

NUMBER OF

EFFICIENCY OF

EFFICIENCY OF

DELTA

ENGLISH SHIPS

FRENCH SHIPS

ENGLISH FLEET

FRENCH FLEET

TIME

40

46

0.1

0.1

0.1







TIME

CURRENT

CURRENT



(in hours)

ENGLISH FLEET

FRENCH FLEET



O

# of English ships

# of French ships



above cell + dT

X-B*Y*dT

Y-A*X*dT



"

copy down

copy down



"

"

"



"

"

"



"

"

"



"

"

"



"

"

"



"

"

"



"

"

"



"

"

"



x=# of British ships




y=# of French ships




B = French destruction rate




A = English destruction rate




dT = Change in time




Simulation of the Battle of Trafalgar






NUMBER OF

NUMBER OF

EFFICIENCY OF

EFFICIENCY OF

DELTA

ENGLISH SHIPS

FRENCH SHIPS

ENGLISH FLEET

FRENCH FLEET

TIME

40

46

0.1

0.1

0.1







TIME

CURRENT

CURRENT



(in hours)

ENGLISH FLEET

FRENCH FLEET



0

40.00

46.00



0.1

39.54

45.60



0.2

39.08

45.20



0.3

38.63

44.81



0.4

38.18

44.43



0.5

37.74

44.05


. . . . . . . . .


14.4

-2.46

22.69



14.5

-2.68

22.71



14.6

-2.91

22.74



14.7

-3.14

22.77



14.8

-3.37

22.80



14.9

-3.59

22.83



15

-3.82

22.87


Modeling with MATHCAD

The MATHCAD software also provides an alternative way to present a solution in both graphical and tabular form. The equations being iterated appear as a matrix on the same screen as the graphs and tables.

MATHCAD DATA TABLE

Timenunvn 0 4046 0.139.5445.6 0.2 39.0845.2 0.338.6344.81 0.438.18 44.43 0.5 37.7444.05 ... .. . ... 14.4-2.46 22.69 14.5 -2.6822.71 14.6-2.9122.74 14.7-3.1422.77 14.8-3.37 22.8 14.9-3.5922.83 15.0-3.8222.87

[WW HOME] [TEACHING] [MATH] [SEARCH] [FEEDBACK]


Woodrow Wilson Leadership Program in Mathematics * lpt@www.woodrow.org
The Woodrow Wilson National Fellowship Foundation * webmaster@woodrow.org
CN 5281, Princeton NJ 08543-5281 * Tel:(609)452-7007 * Fax:(609)452-0066