How to deal with Singular Jacobian error?

4 次查看(过去 30 天)
Hi, I'm running a BVP code, and I keep receiving this error. Error using bvp4c (line 252) Unable to solve the collocation equations -- a singular Jacobian encountered.
Error in mat4bvp (line 4) sol = bvp4c(@mat4ode,@mat4bc,solinit);
Here's the code: function dydx = mat4ode(x,y,omega) dydx = [ y(2) -(((omega*(1-exp(-8*x))*8*exp(-8*x))... /(2*(x^2)))-(pi^2/(32*x)))*y(1)]; end
function res = mat4bc(ya,yb,omega) res = [ ya(1) yb(1) ya(2)-1 ];
function yinit = mat4init(x) yinit = [ (1/(2*pi))*sin(2*pi*x) cos(2*pi*x) ];
function mat4bvp omega=0.8057; solinit = bvpinit(linspace(0,2,10),@mat4init,omega); sol = bvp4c(@mat4ode,@mat4bc,solinit); x = linspace(0,2); y = deval(sol,x); plot(x,y(1,:))
Can anyone plz help me?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Boundary Value Problems 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by