plot(skin friction)

82 次查看(过去 30 天)
Yasir
Yasir 2024-7-14,19:53
编辑: Yasir 2024-7-14,20:37
skinfriction()
RexCf = -3.4554
Rexcf = -3.4554
function skinfriction
Nt=0.5; Nb=0.5; Le=2; Pr=1; lambda=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)')
RexCf = A^(-1/2)*y1(3,1)
Rexcf = A^(-1/2)*y2(3,1)
%%residual of bcs
function res = bcexam2(y0, yinf)
res= [y0(1)-s; y0(2)-lambda; 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)-lambda; 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
please help to plot this graph using the above code
  1 个评论
Torsten
Torsten 2024-7-14,20:20
编辑:Torsten 2024-7-14,20:21
Where are Re, Cf and lambda in your code ? I cannot find them.
And what are "first solution" and "second solution" ? In your code, both will come out the same (I already explained the reason in your previous question).

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

标签

产品


版本

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by