Why do I receive an error about a "singular Jacobian" when I use the BVP4C function within MATLAB?

138 Ansichten (letzte 30 Tage)
I am trying to solve a boundary value problem, but receive the error:
ERROR: ??? Error using ==> bvp4c\nUnable to solve the collocation equations -- \na singular Jacobian encountered

Akzeptierte Antwort

MathWorks Support Team
MathWorks Support Team am 20 Dez. 2021
Bearbeitet: MathWorks Support Team am 13 Jan. 2022
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.

Weitere Antworten (0)

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by