can anyone help me. I am getting error of the following problem

bb_go
b = 0.2000
R = 0.5000
M = 0.2000
L = 2
Error using bvp4c (line 196)
Unable to solve the collocation equations -- a singular Jacobian encountered.

Error in solution>bb_go (line 7)
sol = bvp4c(@bvp2D,@bc2D,sol1);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
function [y]=bb_go
% defining parameters
b=0.2,R=0.5,M=0.2,L=2, Pr=0.4;
sol1 = bvpinit(linspace(0,3,5),[1 0 1 0 1]);
sol = bvp4c(@bvp2D,@bc2D,sol1);
x = sol.x;
y = sol.y;
%%% Plotting of the velocity
figure (1)
plot(x, y(2, :) ,'linewidth', 1)
hold on
xlabel('\eta', 'fontweight', 'bold', 'fontsize', 16)
ylabel('f^/(\eta)', 'fontweight', 'bold', 'fontsize', 16)
%% Residual of the boundary conditions
function residual = bc2D(y0, yinf)
residual=[y0(1); y0(2); y0(3)-1; yinf(2); yinf(3)];
end
%% System of First Order ODEs
function yvector = bvp2D(t,y)
yy1 = (1/(1+1/b))*(M*y(2)-y(1)*y(3)-L*(1-y(2)*y(2)));
yy2=(1/(1+R))*Pr*(y(2)*y(3)-y(1)*y(4));
yvector = [y(2);y(3);y(4);yy1;yy2];
end
end

댓글 수: 1

What is the dimension of state vector y, it seems that the dimension of y is 4 but the yvector is 5.

댓글을 달려면 로그인하십시오.

 채택된 답변

Torsten
Torsten 2025년 11월 12일
이동: Torsten 2025년 11월 12일
Let's ignore the fifth differential equation in your code for a moment.
Then you set up code for the differential equation
y'''' = 1/(1+1/b) * (M*y' - y*y'' - L*(1-y'^2))
What are the four boundary conditions you want to impose for this equation (thus most probably 4 out of the 5 you set in your code) ?
residual=[y0(1); y0(2); y0(3)-1; yinf(2); yinf(3)];
After you've selected these 4, the fifth differential equation needs a condition that involves y(5), either at x=0 or x=Inf.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기

태그

질문:

2025년 11월 12일

댓글:

2025년 11월 25일

Community Treasure Hunt

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

Start Hunting!

Translated by