Spline Toolbox    

Example: Construction of the Chebyshev Spline

The Chebyshev spline C = Ct = Ck,t of order k for the knot sequence = (ti=1:n+k) is the unique element of Sk,t of max-norm 1 that maximally oscillates on the interval [tk . . tn+1] and is positive near tn+1. This means that there is a unique strictly increasing n-sequence so that the function given by

all i, has max-norm 1 on [tk . . tn+1]. This implies that , and that , all i. In fact, , all i. This brings up the point that the knot sequence is assumed to make such an inequality possible, i.e., the elements of Sk,t are assumed to be continuous.

In short, the Chebyshev spline C looks just like the Chebyshev polynomial. It performs similar functions. For example, its extreme sites are particularly good sites to interpolate at from Sk,t since the norm of the resulting projector is about as small as can be; see the toolbox command chbpnt.

In this example, which can be run via chebdem, we try to construct C for a particular knot sequence t.

We deal with cubic splines, i.e., with order

and use the break sequence

and use simple interior knots, i.e., use the knot sequence

Note the quadruple knot at each end. Since k = 4, this makes
[0..8] = [breaks(1)..breaks(lp1)] the interval [tk..tn+1] of interest, with
n = length(t)-k the dimension of the resulting spline space Sk,t. The same knot sequence would have been supplied by

As our initial guess for the , we use the knot averages

recommended as good interpolation site choices. These are supplied by

We plot the resulting first approximation to C, i.e., the spline c that satisfies

, all i:

Here is the resulting picture:

Figure 1-16: First Approximation to a Chebyshev Spline

Starting from this approximation, we use the Remez algorithm to produce a sequence of splines converging to C. This means that we construct new as the extrema of our current approximation c to C and try again. Here is the entire loop.

We find the new interior as the zeros of Dc := the first derivative of c, in several steps. First, we differentiate:

Next, we take the zeros of the control polygon of Dc as our first guess for the zeros of Dc. For this, we must take apart the spline cp.

The control polygon has the vertices (tstar(i),coefs(i)), with tstar the knot averages for the spline, provided by aveknt:

Here are the zeros of the resulting control polygon of cp:

This provides already a very good first guess for the actual zeros.

We refine this estimate for the zeros of Dc by two steps of the secant method, taking tau and this guess as our first approximations. First, we evaluate Dc at both sets:

Now come two steps of the secant method. We guard against division by zero by setting the function value difference to 1 in case it is zero. Since Dc is strictly monotone near the sites sought, this is harmless:

The check

shows the improvement.

Now we take these sites as our new tau,

and check the extrema values of our current approximation there:

The difference

is an estimate of how far we are from total leveling.

We construct a new spline corresponding to our new choice of tau and plot it on top of the old:

Here is the resulting picture:

Figure 1-17: A More Nearly Level Spline

If this is not close enough, one simply reiterates the loop. For this example, the next iteration already produces C to graphic accuracy.


 Example: A Nonlinear ODE Example: Approximation by Tensor Product Splines