initial guessing - for mixed boundary condition
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
f'''+(1/2)*f*f''+lamda*theta
theta''+pr*(1/2*f*theta'+f'*theta
with B.C f(eta) = 0,f'(eta) = delta*f''(eta) , theata(eta)=1+beta*theta'(eta) at eta = zero
f'(eta) = 1 ,theta(eta) = 0 as eta = infinity
close all
solinit = bvpinit(linspace(0,2),@exlinit );
options = bvpset('RelTol',1e-6);
sol = bvp4c(@convec,@bvp,solinit,options);
figure(1)
plot(sol.x,sol.y(4,:),'linewidth',1.5);
%plot(sol.x,sol.y(5,:),'--','linewidth',1.5);
hold on
function dy = convec(t,y)
lamda = 1;
Pr = 6.2;
dy(1) = y(2);
dy(2) = y(3);
dy(3) = -(1/2)*y(1)*y(3)+lamda*y(4);
dy(4) = y(5);
dy(5) = -(Pr)*(1/2*y(1)*y(5)+y(2)*y(4));
dy =[dy(1);dy(2);dy(3);dy(4);dy(5)];
end
function res = bvp(ya,yb)
delta = 0.5;
beta = 1;
res = [ya(1)-0
ya(2)-delta*ya(3)
yb(2)-1;
ya(4)-1-beta*ya(5);
yb(4)-0];
end
function v = exlinit(t)
v = [0
1
1-exp(-t)
1
exp(-t)];
end
the program is running but not getting correct one for example temperature profile ie y(4)
kindly give a suggestion for guessing a initial condition for the problem
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1117110/image.jpeg)
1 Kommentar
Torsten
am 5 Sep. 2022
From your equations, it should be
dy(3) = -(1/2)*y(1)*y(3)-lamda*y(4);
instead of
dy(3) = -(1/2)*y(1)*y(3)+lamda*y(4);
Antworten (1)
Sarthak
am 13 Sep. 2023
Hi N Nithya,
I understand you are looking for a way of initial guessing, but I found something else in the code which might help.
The equation for dy(3) should be:
dy(3) = -(1/2)*y(1)*y(3) - lamda*y(4)
The original equation, dy(3) = -(1/2)y(1)y(3) + lamday(4), is incorrect because the term lamday(4) should be negative.
The negative sign in front of the term lamda*y(4) is important because it ensures that the derivative of dy(3) is always negative. This is necessary because dy(3) represents the rate of change of y(3), and the rate of change of y(3) should always be negative when y(3) is increasing.
Hope this solves your query.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Function Creation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!