bvp4c singular jacobian encountered

Hi All,
I've got a system of ODEs that I don't think should be singular, but I'm encountering this error. In the past when I've run into this problem I've found that the issue is in a mesh that is too course or initial conditions that are too far off, but in this case even when I make the mesh very fine and the initial conditions are, I think, quite close, I run into problems.
I was wondering if anyone saw any intrinsic problem with the following function to pass into bvp4c: (I removed constants from the function to make it easier to read, but left them in the BCs)
function dFdx = odefunE(x,F)
dFdx=zeros(5,1);
%Efield balance first
dFdx(5) = (F(3)-F(1));
%electron balance
dFdx(1)=F(2);
dFdx(2) = F(5)*F(2) -F(1)*dFdx(5) +F(1)*F(3);
%hole balance
dFdx(3)=F(4);
dFdx(4) = F(5)*F(4) +F(3)*dFdx(5) +F(1)*F(3);
end
with boundary condition function:
function residual = bcfun(F0, FT)
residual = [(F0(5)-Ez_0)
((D_FC*FT(2)+mu_FC*FT(5)*FT(1))-diss_flux_T)
((D_FC*F0(4)-mu_FC*F0(5)*F0(3))+diss_flux_0)
((D_FC*F0(2)+mu_FC*F0(5)*F0(1))-k_abs*F0(1))
((D_FC*FT(4)+mu_FC*FT(5)*FT(3))+k_abs*FT(3))];
end
solution = bvp4c(@odefunE, @bcfun, solinit);
Thanks for any help!

Answers (0)

This question is closed.

Asked:

on 21 Sep 2013

Closed:

on 20 Aug 2021

Community Treasure Hunt

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

Start Hunting!