dual solution for skin friction and nusselt number and sheerword number using bvp4c solver: mathematical equations and the code is given in description.
44 次查看(过去 30 天)
显示 更早的评论
Artical:Unsteady boundary-layer flow and heat transfer of a nanofluid over a permeable stretching/shrinking sheet
here are the mathematical equations:
f^'''+A(ff^''-f^'2 )+f^'+η/2 f^''=0
1/Pr θ^''+(Af+η/2) θ^'+Nbθ^' φ^'+Nt(θ^' )^2=0
φ^''+Le(Af+η/2) φ^'+Nt/Nb θ^''=0
boundary conditions:
f(0)=s, f^' (0)=λ, θ(0)=1,φ(0)=1
f^' (η)→0,θ(η)→0,φ (η)→0 as η→inf
the code is :
Ibrardual()
function Ibrardual
clc
clear all
Nt=0.5; Nb=0.5; Le=2; Pr=1; alpha=1.5; s=1; A=3;
%% solution in structure form
%First solution
sol = bvpinit(linspace(0,6,10), [0 0 0 0 0 0 0]);
sol1 = bvp4c(@bvpexam2, @bcexam2, sol);
x1 = sol1.x;
y1 = sol1.y;
% Second solution
opts = bvpset('stats','off','RelTol',1e-10);
sol = bvpinit(linspace(0,5,10), [-1 0 0 0 0 0 0]);
sol2 = bvp4c(@bvpexam2, @bcexam2_dual, sol,opts);
x2 = sol2.x;
y2 = sol2.y;
% Plot both solutions
plot(x1,y1(3,:),'-'); hold on
plot(x2,y2(3,:),'--');
xlabel('\eta')
ylabel('f`(\eta)')
result1 = A^(-1/2)*y1(3,1)
result2 = A^(-1/2)*y2(3,1)
%%residual of bcs
function res = bcexam2(y0, yinf)
res= [y0(1)-s; y0(2)-alpha; y0(4)-1; y0(6)-1; yinf(2); yinf(4);yinf(6)];
end
function res = bcexam2_dual(y0, yinf)
res= [y0(1)-s; y0(2)-alpha; y0(4)-1; y0(6)-1; yinf(2); yinf(4);yinf(6)];
end
%% first order odes
function ysol = bvpexam2(x,y)
yy1 = -(A*y(1)*y(3)-A*(y(2))^2)-y(2)-(x/2)*y(3);
yy2 = -Pr*(A*y(1)*y(5)+(x/2)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2);
yy3 = (-Le*(A*(y(1)*y(7)+(x/2)*y(7)))-(Nt/Nb)*( -Pr*(A*y(1)*y(5)+Nb*y(5)*y(7)+Nt*(y(5))^2)));
ysol = [y(2); y(3); yy1;y(5);yy2;y(7);yy3];
end
end
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1733758/image.jpeg)
4 个评论
Torsten
2024-7-13
编辑:Torsten
2024-7-13
If you don't change a model parameter in the second run, the results will be the same. Somehow logical, isn't it ?
Modifying the initial guess vector just makes the solver iterate from a different starting point - it doesn't change the final solution. And since the solution is already converged to its final value, using 5 or 6 as Inf doesn't matter, too.
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!