A singular Jacobian indicates that the initial guess causes the solution to diverge. The BVP4C function finds the solution by solving a system of nonlinear algebraic equations. Nonlinear solvers are only as effective as the initial guess they start with, so changing your starting guess may help. Also, BVP4C is responsible for providing a guess for the solution from one iteration to another.
There might be several things going wrong with this problem:
1) The problem could be posed incorrectly, either in its mathematical formulation or due to a coding error. It is easy to come up with a BVP that has no solution, or one that has an infinite number of solutions.
2) The initial guess, which you specify, may not be sufficient to produce convergence. This is particularly true for difficult problems, such as those where the solution has sharp changes or discontinuities.
3) BVP4C may converge for first few iterations, but at some point, become unable to provide a next guess that will be sufficient to find the solution.
The first thing to do is examine the problem and its coding, then try different initial guesses and/or tolerances.
If this does not help, keep in mind that solving BVPs is more an art than science -- there are several 'tricks' that sometimes allow you to solve 'difficult' problems. You can refer to the following link for an example of the process for solving BVPs using BVP4C:
Additionally, BVP4C is just one choice for solving a BVP in MATLAB. Therefore, you may consider using, for example, SBVP, a similar solver available from MATLAB Central at:
Note that MathWorks does not guarantee or warrant the use or content of these submissions.
Any questions, issues, or complaints should be directed to the contributing author.
One last thing to try might be an ad hoc shooting method, which can be done by wrapping a nonlinear algebraic solver around an initial value problem ODE solver such as ODE45 or ODE23.