We present a MATLAB solver designed with special
focus on the following class of nonlinear singular
boundary value problems with a singularity of the
first kind:
The solver is based on collocation at either
equidistant or Gaussian collocation points. For
singular problems, the choice of equidistant nodes
does not imply a loss of efficiency since no
convergence order higher than the stage order can be
expected in general. An asymptotically correct error
estimate for the global error of the approximate
solution is also provided. This estimate is a
modification of an idea originally proposed by
Zadunaisky and based on the defect correction
principle. Particular attention was paid to the
efficiency of the error estimation procedure. On the
basis of this estimate, we succeeded to realize a mesh
selection procedure which is robust with respect to
the singularity. This means that if the solution is
smooth close to the singular point the mesh remains
coarse in this region, independently of the
unsmoothness of the direction field. We discuss the
details of the implementation in MATLAB 5.3
(with a preview of a MATLAB 6.0 version),
describe the measures taken to optimize the
performance of the code and demonstrate how the mesh
adapting works.