bvp4c claims singular Jacobian encountered, but I don't think so
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi All, sorry if I'm missing something obvious. I'm solving a fairly simple second order ODE with boundary conditions:
D_FC = 0.00146;
k_loss = 10^9;
k_abs = 10^40;
T = 1e-6;
x0 = 0;
xf = T;
function dFEdx = odefunE(x,F)
%F = [f, f']
dFEdx=zeros(2,1);
dFEdx(1)=F(2); %df/dx=f'=F(2)
dFEdx(2) = (k_loss/D_FC)*F(1);
end
function residual = bcfunE(F0, FT)
%F0 = [f(0), f'(0)]
%FT = [f(T) f'(T)]
residual = [(F0(2)-(k_abs/D_FC)*F0(1)) (FT(2)-diss_flux_T/D_FC)]; %for each boundary
end
initial_mesh = linspace(x0, xf, 100);
solinit = bvpinit(initial_mesh, [1 0]); %initial guess
solutionE = bvp4c(@odefunE, @bcfunE, solinit);
i.e. the ODE is f''(x) = a*f(x) for a constant a. If I solve it by hand I get a simple exponential, so I'm not sure why it's running into trouble.
I noted in previous posts the 'singular matrix' input option, but before introducing that I'd like to understand why this is a problem in the first place.
Thanks for any advice.
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!