can anyone help me. I am getting error of the following problem
이전 댓글 표시
bb_go
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
Chuguang Pan
2025년 11월 12일
What is the dimension of state vector y, it seems that the dimension of y is 4 but the yvector is 5.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Mathematics and Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!