フィルターのクリア

How can draw this kind of graph?

1 回表示 (過去 30 日間)
gkb
gkb 2023 年 11 月 13 日
編集済み: DGM 2023 年 11 月 20 日
how can we draw a velocity profile of the 3rd-order non-linear boundary value problem that converges for different values? give me code for u'''+u*u''+s*[Gr*G+Gm*H-M*u']=0 where s=0.02, Gm=10, Gr=4 and M=0.1 with boundary condition u=1,u'=0.001; G=0.001; H=0.001 when t=0 and u'=0; G-0; H=0 when t= infinity, where H=2 and G=4 within one graph for Different values of Gm
  6 件のコメント
Torsten
Torsten 2023 年 11 月 13 日
Use bvp4c or bvp5c to set up the problem.
Sam Chak
Sam Chak 2023 年 11 月 13 日
@gkb, I'm confused.
You only introduced ONE differential equation in the question.
where the parameters other than the state variables u, , , are constants.
Why do F, G, and H magically appear in the context? Can we settle the first and then post another question for the system of differential equations F, G, H?

サインインしてコメントする。

回答 (1 件)

Syed Sohaib Zafar
Syed Sohaib Zafar 2023 年 11 月 19 日
編集済み: DGM 2023 年 11 月 20 日
Here's your required code
code_gkb_Matlab
%%%%%%%%%%%%%%%
function code_gkb_Matlab
global eps Gr Gm M Pr Jh Sc S0
%eq1
eps=0.001; Gr=0.5; M=0.5;
% eq2
Pr=1.4; Jh=0.3; %eps M
% eq3
Sc=0.7; S0=0.2;
val=[0.1 0.2 0.3 0.4];
for i = 1:1:4;
Gm = val(i);
solinit = bvpinit(linspace(0,6),[0 1 0 1 0 1 0]);
sol= bvp4c(@shootode,@shootbc,solinit);
eta = sol.x;
f = sol.y;
figure (1)
plot(eta,f(2,:));
xlabel( '\eta');
ylabel('\bf f'' (\eta)');
hold on
end
lgd=legend('Gm = 0.1','Gm = 0.2','Gm = 0.3','Gm = 0.4');
end
function dydx = shootode(eta,f);
global eps Gr Gm M Pr Jh Sc S0
dydx = [f(2)
f(3)
-f(1)*f(3)-eps*(Gr*f(4)+Gm*f(6)-M*f(2))
f(5)
-Pr*f(1)*f(5)+Jh*Pr*((1/eps)*f(3)^2+M*f(2)^2)
f(7)
2*Sc*f(2)*f(6)-Sc*f(1)*f(7)-S0*Sc*(-Pr*f(1)*f(5)+Jh*Pr*((1/eps)*f(3)^2+M*f(2)^2))
];
end
function res = shootbc(fa,fb)
global eps
res = [fa(1)-1; fa(2)-eps; fa(4)-eps; fa(6)-eps; fb(2)-0; fb(4)-0; fb(6)-0];
end
  1 件のコメント
DGM
DGM 2023 年 11 月 20 日
Edited to add formatting and to make it run.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSolver Outputs and Iterative Display についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by