In this final phase of our investigation, we assume that the surface is given, not analytically by a formula, but digitally, by a collection of data coordinates. Because we will interpolate the data points to generate a smooth surface, we need to impose some structure on the grid supporting the heights of the surface. The grid does not have to be equispaced in the supporting xy-plane, but it has to be regular. By regular, we mean that heights are known at each point
, where
is a member of an ordered list of x-coordinates in the data set, and
is a member of the corresponding list of y-coordinates. In effect, the surface is known at each point of the direct product of the lists of x- and y-coordinates.
Thinking of the function used earlier, namely
| (1) |
we write the coordinate lists

and generate a matrix of corresponding function values:
| (2) |
Next, we define
, a function that interpolates the given data.

The first argument to ArrayInterpolation is a list of the lists of the independent coordinates. The second argument is the matrix of known heights. The third argument defines the "target," that is, the points at which "new" function values are to be calculated. Ordinarily, this would be an Array with the coordinates of many points. Here, it consists of the coordinates of a single point,
. Thus,
is the interpolated height at the single point
.
The final argument to ArrayInterpolation is the interpolating method. Since this is merely an illustrative example, we've picked "spline" for no particular reason. Figure 5 displays the surface generated by the interpolating function
.
|
Figure 5 Surface generated by the interpolating function
|
Now we must devise a "steepest-ascent algorithm" that works strictly numerically, on just data. We don't have a function whose gradient field we can integrate. We can use only the given data points and the interpolating function
.
Here is our thinking. If we are at a point
where the height is
, we want to move to the "nearest highest point." Of course, for a continuous surface, this is meaningless. So instead, we ask for the nearest highest point in a neighborhood of P, and define that neighborhood as a small circle around P. But how do we find the highest point on
subject to a constraint such as
? We use the Search command from Dr. Sergey Moiseev's DirectSearch package. A sequence of such optimizations generates the steepest-ascent curve as a set of points in
.
For example, we start a steepest-ascent curve at the point on the base contour where
, and compute the corresponding y-coordinate to be
| (3) |
and hence, the initial point on the steepest-ascent curve is
Additional points are then obtained as per the calculations in Table 3.

|
Table 3 A sequence of steepest-ascent points computed as constrained maxima
|
Figure 6 contains a graph of the connected points, superimposed on the surface in Figure 5.
|
Figure 6 Discretely computed steepest-ascent curve on the surface in Figure 5
|
Of course, the calculations in Table 3 would have to be repeated for a number of different initial points if we wanted to reproduce the equivalent of Figure 4. Other considerations include the "stepsize," that is, the radius of the constraint circle defining the neighborhood of each point on the surface.