The Battleship That Solved a Differential Equation
Four Days of Silence
I have not posted in four days. On this blog that counts as a long silence, and a long silence deserves a loud return, so this time there is no stochastic process and no Gödel walking home with Einstein. There are nine 16-inch guns.
On 1 July 1984, off Vieques Island in Puerto Rico, USS Iowa fired all nine at once, and a Navy photographer caught the instant the sea went flat under the blast. The heavier of her two shells weighs 1,225 kg, about as much as a small car. It leaves the muzzle at 762 metres a second and can come down 38.7 km away after a minute and a half in the air, having climbed to 11 km, the height at which airliners cruise.

Pointing a gun like that is not aiming. The target is below the horizon. The shell flies for 95 seconds through air that thins as it climbs, the wind leans on it, and the Earth turns underneath. The answer to “which way, and how high?” is called a firing solution, and it is the answer to a boundary-value problem for an ordinary differential equation. So I solved it, built a fire-control board you can play with further down, and let it answer a few questions. Three of the answers surprised me: the gun cannot reach its own best angle, a bunker breaks only from farther away, and the weaker charge is the kinder one.
A Shell Is an Ordinary Differential Equation
Treat the shell as a point of mass $m$ at position $\mathbf r = (x, y, z)$, with $x$ east, $y$ north and $z$ up. Three forces act on it: the drag of the air, gravity, and, because everything is measured from the turning Earth, the Coriolis force. Newton’s second law becomes six first-order equations:
Here $S = \pi d^2/4$ is the shell’s cross-section, 0.130 m² for a 16-inch (406 mm) shell, $\mathbf w$ is the wind, and $\boldsymbol\Omega$ is the Earth’s rotation, 7.29 × 10⁻⁵ radians a second about the polar axis. The drag term is the whole difficulty. It grows with the square of the speed through the air, it depends on the air’s density $\rho(z)$ at the shell’s height, and its coefficient $C_D$ depends on the Mach number, the speed divided by the local speed of sound:
That is the standard atmosphere: temperature falling by $L$ = 6.5 K per kilometre from 15 °C at sea level, the density following from it, and above 11 km a layer of constant temperature where the density falls exponentially. The factor with $c$ is mine. It lets the fitted upper air differ from today’s standard, and it absorbs whatever the makers of the Navy’s tables assumed about the air that we do not know.
For the drag coefficient I use a law with three numbers, fitted to the Navy’s range table as the next sections explain:
Below Mach 1.2 the coefficient follows a fixed shape: flat through Mach 1, then a fall to about a third of its supersonic value, the transonic drag rise run backwards. The numbers are not small. At the muzzle the AP shell flies at Mach 2.24 and its drag coefficient is 0.30. The air pushes back on it with 14 kN, more than the shell’s own weight of 12.0 kN. There is no closed-form solution to these equations; they have to be integrated step by step. I use the classical fourth-order Runge–Kutta method with steps of 0.02 seconds, about 4,800 steps for the longest flight.
What the Air Takes
Without air the problem is the one every physics student meets. A shell fired at speed $v_0$ and elevation $\theta$ over flat ground flies a parabola:
At 762 metres a second and 45 degrees that is a range of 59.2 km, a highest point of 14.8 km and 110 seconds in the air. The Navy’s table says 38.72 km. The air takes a third of the range. The model, integrated through the atmosphere, gives 38.72 km, a highest point of 11.2 km and a flight of 95 seconds. The shell never slows below Mach 1.36 on the way, and it strikes at Mach 1.51.

The textbook also says that 45 degrees gives the longest range, and that drag lowers the best angle, as it does for a thrown ball. For this shell the opposite happens. The higher it climbs, the thinner the air it spends its long flight in: at 11 km the density is 29% of that at sea level. Climbing is worth more than it costs, and the best elevation comes out at 47.5 degrees, not 45. The Iowa’s turrets stop at 45, so her guns can never reach their own best angle. The loss is only 122 metres, but the principle was worth a great deal to the Germans in 1918: the Paris Gun was fired at 55 degrees, sent its shells 42.3 km up into the stratosphere, and reached 130 km.
There is a second, quieter consequence. Below the best angle, range grows steadily with elevation, so for any target within reach there is exactly one elevation between 0 and 45 degrees that hits it. That uniqueness is what makes the firing solution computable by bisection.
Four Numbers and a Table
The drag law has four free numbers per shell: $a$, $b$ and $d$ in the drag coefficient and $c$ in the air. They come from the Navy’s published range table, as NavWeaps reproduces it, with nine rows per shell from 5,000 yards to maximum range. Each row gives the elevation, the range, the angle of fall, the time of flight, the striking speed and the highest point. I fitted the four numbers by least squares to four of those columns, with every row counted, and for the AP shell the fit already reproduced every range within 0.19%.
Then I made the ranges exact. Each row gets a multiplier $k$ on the drag, the one that makes the model land exactly at the published range, and between rows the multiplier is interpolated in elevation. For the AP shell the nine multipliers lie between 0.999 and 1.031, so they barely change anything, and they buy a solution that agrees with the Navy wherever the Navy measured.

The honest test is a column the fit never saw. The highest point of each flight was never used, and the model reproduces it within 0.94% for every AP row. After the calibration the times of flight agree within 0.11% and the striking speeds within 0.24%. The weak column is the angle of fall. In the two longest rows the model and the table differ by 2.1 degrees, the model shallower at 36 degrees of elevation and steeper at 45. I have left that visible rather than fitted it away.
The HC table has a stranger problem, and the fit found it. To reproduce its two shortest rows, the multiplier must be 1.63 at 5,000 yards and 1.07 at 10,000, while every other row needs between 0.996 and 1.007. No drag law makes a shell 63% draggier at 2 degrees of elevation than at 11, so those rows disagree with the rest of the table. The table’s 45-degree row gives a striking speed of 1,839 feet a second. The model says 1,558, and NavWeaps’s own penetration table, for the same shell at the same range, says 1,552. That is almost certainly a typo.
One more check comes free. The reduced charge fires the shells so slowly that they fly through Mach 1, where the drag shape is assumed rather than fitted. Its published maximum ranges are 22.11 km for AP and 25.01 km for HC. The model gives 22.26 and 24.40, within 0.7% and 2.4%, from numbers that were never fitted to them.
The Firing Solution
Now the question the gunners had to answer. A gun stands at $\mathbf r_0$ on the ship and the target at $\mathbf r_T$ on the island. The unknowns are the bearing $\beta$ and the elevation $\theta$. The ODE carries the shell from the muzzle until it comes down through the target’s height, at a time $t^*$ that is itself part of the answer. The firing solution is the root of two equations in two unknowns:
This is a boundary-value problem: the shell starts at the muzzle and must end at the target, and the method that solves it is the one numerical analysts call shooting, named after exactly this picture. Guess the angles, fly the ODE, see where it lands, correct, fly again. Two facts make it easy here. Range grows steadily with elevation below the best angle, so bisection on $\theta$ cannot fail. And the drift across the line of fire, from wind and the Earth’s rotation, is small, so turning the bearing by the angle the miss subtends converges in two or three rounds.
Algorithm — The Firing Solution
input: gun (x, y, z), target (x, y, z), shell, charge
β ← the bearing from the gun to the target
repeat up to 4 times:
if the shell falls short at 45°: out of range; stop
θ_lo ← the turret's lowest elevation, θ_hi ← 45°
repeat 40 times: bisection: 45°/2⁴⁰
θ ← (θ_lo + θ_hi)/2
fly the ODE down to the target's height
if it lands short: θ_lo ← θ, else θ_hi ← θ
e ← the cross-range miss of that flight
if |e| < 5 cm: stop
β ← β − arctan(e / D) turn into the drift
fly (β, θ) over the real terrain
if a hill takes the shell first: the target is masked
return β, θ, flight time, angle of fall, speed
Each turret solves for itself. The Iowa’s forward and aft turrets stand 125.5 metres apart, and if all three fired on one solution computed amidships, their shells would land 125.5 metres apart even with perfect guns. Correcting for that is called parallax.
A worked example, the one you can repeat on the board. The ship lies 34.9 km south of the island’s Hangar 2, heading east. The centre turret’s solution is a bearing of 358.84 degrees and an elevation of 32.35 degrees. The shell climbs to 6.55 km, flies for 72.9 seconds, and strikes at 481 metres a second at 41.9 degrees from the horizontal. The forward and aft turrets’ bearings differ from it by a fifth of a degree between them. In the model the solution lands within a tenth of a millimetre of its aim. The bisection’s last step is 4 × 10⁻¹¹ degrees.
The sensitivities show what matters. At this range a tenth of a degree of elevation moves the fall of shot 50 metres, and a muzzle velocity 1 foot a second slow puts it 23 metres short. A 10 metre-a-second wind across the line of fire, ignored, moves it 187 metres. The Earth’s rotation, the famous correction, moves it 19 metres at 18 degrees north.
I assumed at first that her officers had no computer, only printed tables. They had both. Below the waterline, inside the armoured belt, each main-battery plotting room held a Mark 8 Rangekeeper, an electromechanical analogue computer that worked out bearing and elevation continuously. It took the target’s range and bearing from the director and the radar, the ship’s course from the gyrocompass, her speed from the pitometer log, her roll and pitch from a stable vertical, and the wind from an anemometer. Its ballistics were cut into a cam; its integrations were done by ball-and-disk integrators, and its sums by differential gears. It solved this problem, target motion included, with gears.
Six Bags of Powder
The propellant came in bags. A full charge was 660 pounds of powder in six bags of about 110 pounds each, and it drove the AP shell at 2,500 feet a second (762 m/s) and the lighter HC shell at 2,690. A reduced charge was 305 pounds, also in six smaller bags, for 1,800 and 2,075 feet a second. The number of bags is not a dial that the solution may turn; it is one of two published charges, and the solution is computed for whichever is loaded.

The gun in that photograph is the one that killed 47 of Iowa’s crew on 19 April 1989. During an exercise north-east of Puerto Rico, five bags of powder in the centre gun of the No. 2 turret ignited with the breech open. The Navy and a later inquiry by the Government Accountability Office and Sandia National Laboratories reached conflicting conclusions about why.
The charge also decides how fast a barrel wears out. NavWeaps counts wear in equivalent service rounds: one is a full-charge AP round from a new gun, and a barrel lasted about 290 of them. A full-charge HC round costs 0.43 of one, a round at the reduced AP velocity 0.08, and an HC round at 1,900 feet a second 0.03. A worn barrel fires slower, which is the subject of a later section.
The Board
This is the fire-control board. The ship and the island are seen from above. The island is fictional, 7.4 by 4.1 km, with a ridge rising to 211 metres. It holds 43 military targets and a town of 1,101 buildings that must never be hit. Drag the ship anywhere outside the 3 km of shoal water, turn her, pick a target, choose the shell and the charge, and press FIRE. The solver on the page and this post’s Python agree exactly, flight for flight. It works out each turret’s solution, trains the turrets at their real 4 degrees a second, and flies all nine shells, with sound.
Where Nine Shells Land
The solution is exact to a tenth of a millimetre. The shells are not. No two leave the barrel at quite the same speed or with quite the same spin, and the spread is measured, not modelled. In test shoots off Crete in 1987, fifteen shells were fired from 34,000 yards, five from the right gun of each turret. The shell-to-shell dispersion was 123 yards, 0.36% of the range. I take every shell to land at its computed point plus a circular normal error with that standard deviation:
The approximation holds when the target is small beside $\sigma$, and it carries the whole economics of distance. Because $\sigma$ grows in proportion to the range, the chance of a hit falls with its square: halve the distance and a shell is four times as likely to strike. Hangar 2 is 60 by 48 metres. From 34.9 km, where $\sigma$ is 126 metres, the formula gives a 2.9% chance per shell and a simulation of 20,000 salvos gives 2.87%. A salvo of nine hits it 23% of the time, and it takes 4.4 salvos on average to destroy it.
A miss is not wasted on an airfield. A salvo aimed at Hangar 2 does $7.6 million of damage on average, and 54% of it falls on the structures around it.
Farther Is Harder
The command bunker sits on the ridge’s north slope under 3.5 metres of reinforced concrete. From the south the ridge stands in the way: at every distance out to 22 km, the shell hits the hillside first. From 22.5 km it falls steeply enough to clear the crest.
Clearing the ridge is not enough, because the roof must be broken. A shell falling at angle $\omega$ from the horizontal crosses the roof on a slant, through more concrete than the roof’s thickness $t$. What it can pierce depends on its striking speed $v$, and a power law fitted to NavWeaps’s penetration table for 5,000 psi reinforced concrete reproduces it within 2%:
For the AP shell, $P_{500}$ is 5.94 metres and $n$ is 1.41. Near the ship the shell strikes fast but almost flat, and the slant path through the roof is enormous: at 5 km the shell falls at 1.5 degrees. Far away it strikes a little slower but much more steeply. The steepness wins. From the north, the full-charge AP shell breaks through only from 33.5 km. The reduced charge never does: at its maximum range the path is 4.7 metres and the shell can pierce 4.4. The HC shell never does either: where it strikes fast enough to pierce 3.5 metres it falls too flat, and where it falls steeply it could not pierce the roof even straight down. To break the bunker, the ship must sail away from it.

The Town Next Door
The garrison headquarters stands 98 metres from the nearest house of the town, and 72 houses lie within 300 metres of it. A shell does its damage by blast, and the reach of a blast grows with the cube root of the charge, the scaling of Hopkinson and Cranz that the Defense Department’s explosives-safety manual uses for its distances:
The AP shell carries 18.55 kg of explosive and the HC shell 69.67 kg, so the 8 psi ring, at which an ordinary building is destroyed, has a radius of 11.5 metres for AP and 17.9 metres for HC. The manual’s fractions set the damage to each house: destroyed inside 8 psi, half inside 3.5 psi, and less further out.
From 27 km with the full charge, the HQ is hit by 1.8% of shells. A salvo hits it only 15% of the time, and 68% of salvos put at least one house inside an 8 psi ring. Destroying it takes 6.5 salvos on average, costs $1.4 million in shells, and does $8.3 million of damage to the town.
The fix looks obvious: come closer, since the scatter shrinks with the range. From 6 km, 97% of salvos hit the HQ and almost none reach the town. But from 6 km the shell falls at 3.4 degrees and skids off the roof. Under 15 degrees I count a strike as a glancing blow. With the full charge the shell falls steeply enough only from 19 km, where the scatter is already 68 metres.
The reduced charge resolves it. Its shells are slow, so they arc high and fall steeply from much shorter range: 16.6 degrees from 12 km. At 12 km the scatter is 43 metres, and 57% of salvos destroy the HQ. Destroying it takes 1.7 salvos and $161,000 in shells, and does $490,000 of damage to the town, a seventeenth of the full charge’s bill from 27 km. The weaker charge is the precise one: what it buys is not scatter, which depends only on the range, but a steep fall at a short range. With the HC shell, whose blast is larger, the full charge from 27 km does $15.8 million to the town for each HQ destroyed, and the reduced charge from 13 km does $1.5 million.

A Worn Gun and a Spotter
Every solution above assumes a new gun. A worn barrel lets the gas slip past the shell, which leaves slower. I assume a fully worn barrel fires 50 feet a second slow, that each of the nine barrels wears at its own rate, and that the round-to-round spread grows with the wear. At 60% wear the guns lose 30 feet a second on average, and at 34.9 km, where each foot a second costs 23 metres, the salvo lands 689 metres short.
The cure is the spotter, who watches the fall of shot and moves the aim point by the salvo’s miss. Write the aim at salvo $k$ as $\mathbf a_k$ and the centre of the salvo’s fall as $\bar{\mathbf x}_k$:
Here $s$ is the scatter of one salvo’s centre. The board’s APPLY SPOT corrects by the whole miss, $\gamma_k = 1$. One spot takes the error from 689 metres to 142, but after that it stays there, because every correction also copies the last salvo’s own random scatter into the aim. Correcting by the running average of all the misses so far, $\gamma_k = 1/k$, keeps the systematic error out and lets the random part average away: 126, 116, 114 and 111 metres after two to five spots. That is the Robbins–Monro method of stochastic approximation, from 1951. On a gun, the lesson is to spot once, then correct gently. In the 1980s the Iowas also had a radar on each turret, the DR-810, that measured every gun’s muzzle velocity, so the solution could be computed for the gun as it actually was.
What It Costs
The board also keeps accounts, in 2024 dollars. An AP shell’s unit cost is $500 on a museum’s exhibit sign, which I take as a Second World War price, and an HC shell cost $1,352 in the Korean War; that is $9,066 and $16,004 today. A barrel cost about $240,000, some $4.4 million today, and lasted about 290 full-charge AP rounds, so each such round wears away $15,006 of barrel. A full salvo of AP costs $216,648 and a reduced one $92,398, powder not included, because I found no published price for it.
On the other side, each target is valued at what the Defense Department’s own pricing guide says it would cost to build, per square metre of its footprint and by the kind of building. Hangar 2 is worth $15.2 million, the garrison HQ $4.2 million, the command bunker $2.7 million and the dry dock $132 million, the dearest thing on the island. Destroying Hangar 2 from 34.9 km costs about $943,000 in shells.
What the Model Leaves Out
The shell is a point. A real shell spins and yaws, and spin drifts it sideways, which the Mark 8 Rangekeeper corrected and this model does not. The Earth is flat, as in my fit to the table, and the ship stands still, level and unrolling. The atmosphere is standard, with no weather beyond one steady wind. The dispersion is the 1987 figure applied to every range and both charges, and applying it to the reduced charge is my assumption. The penetration law is extrapolated below the table’s slowest shell. The 15-degree glancing limit, the 10% of a structure’s value lost to a hit the roof stops and the 5% lost to a glancing blow are my rules, not published ones, and so is the wear model. The island and its town are fictional.
Gears Below the Waterline
This mathematics went to war long before anyone could run it on a laptop. Iowa fired on Korean coastal defences in 1952, and the rangekeepers of her class directed their last rounds in combat in the Persian Gulf War of 1991: analogue computers with cams and ball-and-disk integrators, solving the problem in this post while the ship turned and rolled.

A firing solution is exact. The shell is not, the town is next door, and the roof wants a steep fall. Everything interesting happens between the equation and the target.
Sources
- T. DiGiulian, “United States of America 16″/50 (40.6 cm) Mark 7”, NavWeaps, navweaps.com: the range tables, charges, muzzle velocities, the 1987 Crete dispersion, barrel life and wear, costs, the concrete-penetration table and the HC crater.
- International Organization for Standardization, ISO 2533:1975 Standard Atmosphere (1975).
- The Paris Gun’s 55-degree elevation, 42.3 km apex and 130 km range: Wikipedia, “Paris Gun”.
- The Mark 8 Rangekeeper, its inputs and its plotting room: Wikipedia, “Armament of the Iowa-class battleship”.
- The rangekeeper’s cams, ball-and-disk integrators and differentials, and its last combat in 1991: Wikipedia, “Rangekeeper”.
- The turret explosion of 19 April 1989: U.S. Naval Safety Command, “USS Iowa (BB-61) turret explosion, 19 April 1989”, Today in Naval History (safety lesson).
- H. Robbins and S. Monro, “A stochastic approximation method”, Annals of Mathematical Statistics 22 (1951) 400–407.
- U.S. Department of Defense, DoD 4145.26-M: DoD Contractors’ Safety Manual for Ammunition and Explosives (2008): the blast-ring scaling factors and the damage to ordinary buildings.
- U.S. Department of Defense, UFC 3-701-01: DoD Facilities Pricing Guide (2010): the unit costs of each kind of structure.
- The AP shell’s unit cost of $500: the exhibit sign at the Buffalo and Erie County Naval & Military Park, photographed by W. Maloney, williammaloney.com.
- U.S. Bureau of Labor Statistics, Consumer Price Index for All Urban Consumers (CPI-U): the conversion to 2024 dollars.
Every number in the text and the four charts are computed by the scripts archived with this post, from results solved once. The board’s solver and the post’s Python agree exactly on the same flights.
Interested in applying these ideas to your work? Get in touch.