Spline Toolbox    

Iteration

We can now complete the construction and solution of the linear system for the improved approximate solution z from our current guess y. In fact, with the initial guess y available, we now set up an iteration, to be terminated when the change is small enough. We choose a relatively mild .

The resulting printout of the errors

shows the quadratic convergence expected from Newton's method. The plot below shows the initial guess and the computed solution, as the two leftmost curves. Note that the computed solution, like the exact solution, does not equal -1 at 0.

Figure 2-16: Solutions of a Nonlinear ODE with Increasingly Strong Boundary Layer

If we now decrease , we create more of a boundary layer near the right endpoint, and this calls for a nonuniform mesh.

We use newknt to construct an appropriate finer mesh from the current approximation:

From the new break sequence, we generate the new collocation site sequence:

We use spcol to supply the matrix

and use our current approximate solution z as the initial guess:

Thus set up, we cut by 3 and repeat the earlier calculation, starting with the statements

Repeated passes through this process generate a sequence of solutions, for  = 1/10, 1/30, 1/90, 1/270, 1/810. The resulting solutions, ever flatter at 0 and ever steeper at 1, are shown in the plot above. The plot also shows the final break sequence, as a sequence of vertical bars.

In this example, at least, newknt has performed satisfactorily.


  Linear System to Be Solved Example: Construction of the Chebyshev Spline