# Mathematical discussion of rangekeeping

In naval gunnery, when long-range guns became available, an enemy ship would move some distance after the shells were fired. It became necessary to figure out where the enemy ship, the target, was going to be when the shells arrived. The process of keeping track of where the ship was likely to be was called rangekeeping, because the distance to the target—the range—was a very important factor in aiming the guns accurately. As time passed, train (also called bearing), the direction to the target, also became part of rangekeeping, but tradition kept the term alive.
Rangekeeping is an excellent example of the application of analog computing to a real-world mathematical modeling problem. Because nations had so much money invested in their capital ships, they were willing to invest enormous amounts of money in the development of rangekeeping hardware to ensure that the guns of these ships could put their projectiles on target. This article presents an overview of the rangekeeping as a mathematical modeling problem. To make this discussion more concrete, the Ford Mk 1 Rangekeeper is used as the focus of this discussion. The Ford Mk 1 Rangekeeper was first deployed on the USS Texas in 1916 during World War I. This is a relatively well documented rangekeeper that had a long service life. While an early form of mechanical rangekeeper, it does illustrate all the basic principles. The rangekeepers of other nations used similar algorithms for computing gun angles, but often differed dramatically in their operational use.
In addition to long range gunnery, the launching of torpedoes also requires a rangekeeping-like function. The US Navy during World War II had the TDC, which was the only World War II-era submarine torpedo fire control system to incorporate a mechanical rangekeeper (other navies depended on manual methods). There were also rangekeeping devices for use with surface ship-launched torpedoes. For a view of rangekeeping outside that of the US Navy, there is a detailed reference that discusses the rangekeeping mathematics associated with torpedo fire control in the Imperial Japanese Navy.
The following discussion is patterned after the presentations in World War II US Navy gunnery manuals.

## Analysis
### Coordinate system

US Navy rangekeepers during World War II used a moving coordinate system based on the line of sight (LOS) between the ship firing its gun (known as the "own ship") and the target (known as the "target"). As is shown in Figure 1, the rangekeeper defines the "y axis" as the LOS and the "x axis" as a perpendicular to the LOS with the origin of the two axes centered on the target.
An important aspect of the choice of coordinate system is understanding the signs of the various rates. The rate of bearing change is positive in the clockwise direction. The rate of range is positive for increasing target range.

### General approach

During World War II, tracking a target meant knowing continuously the target's range and bearing. These target parameters were sampled periodically by sailors manning gun directors and radar systems, who then fed the data into a rangekeeper. The rangekeeper performed a linear extrapolation of the target range and bearing as a function of time based on the target information samples.
In addition to ship-board target observations, rangekeepers could also take input from spotting aircraft or even manned balloons tethered to the own ship. These spotting platforms could be launched and recovered from large warships, like battleships. In general, target observations made by shipboard instruments were preferred for targets at ranges of less than 20,000 yards and aircraft observations were preferred for longer range targets. After World War II, helicopters became available and the need to conduct the dangerous operations of launching and recovering spotting aircraft or balloons was eliminated (see Iowa-class battleship for a brief discussion).
During World War I, target tracking information was often presented on a sheet of paper. During World War II, the tracking information could be displayed on electronic displays (see Essex-class aircraft carrier for a discussion of the common displays).

### Target range

Early in World War II, the range to the target was measured by optical rangefinders. Though some night operations were conducted using searchlights and star shells, in general optical rangefinders were limited to daytime operation. During the latter part of World War II, radar was used to determine the range to the target. Radar proved to be more accurate than the optical rangefinders (at least under operational conditions) and was the preferred way to determine target range during both night and day.

### Target speed

Early in World War II, target range and bearing measurements were taken over a period of time and plotted manually on a chart.
The speed and course of the target could be computed using the distance the target traveled over an interval of time. During the latter part of World War II, the speed of the target could be measured using radar data. Radar provided accurate bearing rate, range, and radial speed, which was converted to target course and speed.
In some cases, such as with submarines, the target speed could be estimated using sonar data. For example, the sonar operator could measure the propeller turn rate acoustically and, knowing the ship's class, compute the ship's speed (see TDC for more information).

### Target course

The target course was the most difficult piece of target data to obtain. In many cases, instead of measuring target course many systems measured a related quantity called angle on the bow. Angle on the bow is the angle made by the ship's course and the line of sight (see Figure 1).
The angle on the bow was usually estimated based on the observational experience of the observer. In some cases, the observers improved their estimation abilities by practicing against ship models mounted on a "lazy Susan". The Imperial Japanese Navy had a unique tool, called Sokutekiban (測的盤), that was used to assist observers with measuring angle on the bow. The observer would first use this device to measure the angular width of the target. Knowing the angular width of the target, the range to the target, and the known length of that ship class, the angle on the bow of the target can be computed using equations shown in Figure 2.
Human observers were required to determine the angle on the bow. To confuse the human observers, ships often used dazzle camouflage, which consisted of painting lines on a ship in an effort to make determining a target's angle on the bow difficult. While dazzle camouflage was useful against some types of optical rangefinders, this approach was useless against radar and it fell out of favor during World War II.

## Position prediction

The prediction of the target ship's position at the time of projectile impact is critical because that is the position at which the own ship's guns must be directed. During World War II, most rangekeepers performed position prediction using a linear extrapolation of the target's course and speed. While ships are maneuverable, the large ships maneuver slowly and linear extrapolation is a reasonable approach in many cases.
During World War I, rangekeepers were often referred to as "clocks" (e.g. see range and bearing clocks in the Dreyer Fire Control Table). These devices were called clocks because they regularly incremented the target range and angle estimates using fixed values. This approach was of limited use because the target bearing changes are a function of range and using a fixed change causes the target bearing prediction to quickly become inaccurate.

### Range

The target range at the time of projectile impact can be estimated using Equation 1, which is illustrated in Figure 3.
| (Equation 1) | ${\begin{array}{lcr}R_{TP}&=&R_{T}+{\frac {dR_{T}}{dt}}\cdot t_{TOF'}\\&=&R_{T}+{\frac {dR_{T}}{dt}}\cdot \left(t_{TOF}+t_{Delay}\right)\end{array}}$ |
where
   * $R_{TP}\,$ is the range to the target at the time of projectile impact.
   * $R_{T}\,$ is the range to the target at the time of gun firing.
   * $t_{TOF'}\,$ is the projectile time of flight $\left(t_{TOF}\right)\,$ plus system firing delays $\left(t_{Delay}\right)\,$, i.e. $t_{TOF'}=t_{TOF}+t_{Delay}\,$.
The exact prediction of the target range at the time of projectile impact is difficult because it requires knowing the projectile time of flight, which is a function of the projected target position. While this calculation can be performed using a trial and error approach, this was not a practical approach with the analog computer hardware available during World War II. In the case of the Ford Rangekeeper Mk 1, the time of flight was approximated by assuming the time of flight was linearly proportional to range, as is shown in Equation 2.
| (Equation 2) | $R_{TP}=R_{T}+{\frac {dR_{T}}{dt}}\cdot \left(k_{TOF}\cdot R_{T}+t_{Delay}\right)\,\!$ |
where
   * $k_{TOF}\,$ is the constant of proportionality between time of flight (TOF) and target range.
The assumption of TOF being linearly proportional to range is a crude one and could be improved through the use of more sophisticated means of function evaluation.
Range prediction requires knowing the rate of range change. As is shown in Figure 3, the rate of range change can be expressed as shown in Equation 3.
| (Equation 3) | ${\frac {dR_{T}}{dt}}=-s_{Oy}-s_{Ty}\,\!$ |
where
   * $s_{Oy}\,$ is the own ship speed along the LOS where $v_{Oy}=\lVert v_{O}\rVert \cdot \cos(\theta _{T})$.
   * $s_{Ty}\,$ is the target ship speed along the LOS where $v_{Ty}=\lVert v_{T}\rVert \cdot \cos(\theta _{AOB})$.
Equation 4 shows the complete equation for the predicted range.
| (Equation 4) | $R_{TP}=R_{T}+\left(-s_{Oy}-s_{Ty}\right)\cdot \left(k_{TOF}\cdot R_{T}+t_{Delay}\right)\,\!$ |

### Azimuth

The prediction of azimuth is performed similarly to the range prediction. Equation 5 is the fundamental relationship, whose derivation is illustrated in Figure 4.
| (Equation 5) | ${\begin{array}{lcr}\theta _{TP}&=&\theta _{T}+{\frac {d\theta _{T}}{dt}}\cdot t_{TOF'}\\&=&\theta _{T}+{\frac {d\theta _{T}}{dt}}\cdot \left(t_{TOF}+t_{Delay}\right)\\\end{array}}$ |
where
   * $\theta _{T}\,$ is the azimuth to the target at the time of gun firing.
   * $\theta _{TP}\,$ is the azimuth to the target at the time of projectile impact.
The rate of bearing change can be computed using Equation 6, which is illustrated in Figure 4.
| (Equation 6) | ${\frac {d\theta _{T}}{dt}}={\frac {s_{Tx}+s_{Ox}}{R_{T}}}\,\!$ |
where
   * $s_{Ox}\,$ is the own ship speed along the x axis, i.e. $s_{Ox}=\lVert v_{O}\rVert \cdot \sin(\theta _{T})\,$.
   * $s_{Tx}\,$ is the target speed along the x axis, i.e. $s_{Tx}=\lVert v_{T}\rVert \cdot \sin(\theta _{AOB})\,$.
Substituting $t_{TOF}{\dot {=}}k_{TOF}\cdot R_{T}$, Equation 7 shows the final formula for the predicted bearing.
| (Equation 7) | $\theta _{TP}=\theta _{T}+\left({\frac {s_{Tx}+s_{Ox}}{R_{T}}}\right)\cdot \left(k_{TOF}\cdot R_{T}+t_{Delay}\right)$ |

## Ballistic correction

Firing artillery at targets beyond visual range historically has required computations based on firing tables. The impact point of a projectile is a function of many variables:
   * Air temperature
   * Air density
   * Wind
   * Range
   * Earth rotation
   * Projectile, fuze, weapon characteristics
   * Muzzle velocity
   * Propellant temperature
   * Drift
   * Parallax between the guns and the rangefinders and radar systems
   * Elevation difference between target and artillery piece
The firing tables provide data for an artillery piece firing under standardized conditions and the corrections required to determine the point of impact under actual conditions. There were a number of ways to implement a firing table using cams. Consider Figure 5 for example. In this case the gun angle as a function of target's range and the target's relative elevation is represented by the thickness of the cam at a given axial distance and angle. A gun direction officer would input the target range and relative elevation using dials. The pin height then represents the required gun angle. This pin height could be used to drive cams or gears that would make other corrections, such as for propellant temperature and projectile type.
The cams used in a rangekeeper needed to be very precisely machined in order to accurately direct the guns. Because these cams were machined to specifications composed of data tables, they became an early application of CNC machine tools.
In addition to the target and ballistic corrections, the rangekeeper must also correct for the ships undulating motion. The warships had a gyroscope with its spin axis vertical. This gyro determined two angles that defined the tilt of the ship's deck with respect to the vertical. Those two angle were fed to the rangekeeper, which applied a correction based on these angles.
While the rangekeeper designers spent an enormous amount of time working to minimize the sources of error in the rangekeeper calculations, there were errors and information uncertainties that contributed to projectiles missing their targets on the first shot. The rangekeeper had dials that allowed manual corrections to be incorporated into the rangekeeper firing solution. When artillery spotters would call in a correction, the rangekeeper operators would manually incorporate the correction using these dials.