Error using bvp4c (line 251) : Unable to solve the collocation equations -- a singular Jacobian encountered
Show older comments
The differential equation goes as depicted in the image

This is my code:
f = @(x,y) [y(2); (4*x*y(1)-((0.14*2*x)*(y(2))))/(0.14*x-x^2)];
bc = @(ya, yb) [ya(1)-500; yb(2)];
xmesh = linspace(0.1,0.14,100);
solinit = bvpinit(xmesh, [0 1]);
sol = bvp4c(f, bc, solinit);
figure;
plot(sol.x,sol.y);
I am unsure if the intitial guess is correct and maybe that is causing the problem. Please help me out.
Thanks !
2 Comments
Torsten
on 30 May 2021
- In your function definition: 0.14-2*x instead of 0.14*2*x
- Integrate up to 0.139 instead of 0.14. Otherwise, you will divide by zero.
Shlok Laddha
on 30 May 2021
Answers (0)
Categories
Find more on Boundary Value Problems in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!