How to draw Fig. 1 from the attached pdf with this code
Ältere Kommentare anzeigen
function main
Pr=1; G=0.1;
% phi=input('phi='); %%0,.05, .1, .15, .2
phi=0.0;
rhof=997.1;Cpf=4179;kf=0.613; %for WATER
rhos=6320;Cps=531.8;ks=76.5; %for CuO
a1=((1-phi)^2.5)*(1-phi+phi*(rhos/rhof));
a2=(1-phi+phi*((rhos*Cps)/(rhof*Cpf)));
A=(ks+2*kf+phi*(kf-ks))/(ks+2*kf-2*phi*(kf-ks)); %%%%Knf
xa=0;xb=6;
solinit=bvpinit(linspace(xa,xb,101),[0 1 0 1 0]);
sol=bvp4c(@ode,@bc,solinit);
xint=linspace(xa,xb,101);
sxint=deval(sol,xint);
figure(1)
plot(xint,(1-phi)^-2.5*sxint(3,:),'-','Linewidth',1.5); %for f''(0)/(1-phi)^2.5 vs phi
xlabel('\eta');
ylabel('f''(0)/(1-phi)^2.5');
hold on
function res=bc(ya,yb)
res=[ya(1); ya(2)-1-G*ya(3); ya(4)-1; yb(2); yb(4)];
end
function dydx=ode(x,y)
dydx=[y(2); y(3); a1*(y(2)^2-y(3)*y(1)); y(5); -A*Pr*a2*y(1)*y(5)];
end
end
[EDITED, Jan, Attachment added].
11 Kommentare
Walter Roberson
am 29 Apr. 2019
No figure was attached
MINATI
am 29 Apr. 2019
@MINATI: It is not hard to attach a file. Please mention, which problem you have with it. I've attached it here now, but as soon as other comments are posted, it will run out of view. So please try again to attach it to the original question, where readers expect it: Open the question for editing, press the paperclip in the toolbar, select the file, press "Open" in the dialog, an click on "Submit" finally.
What is the problem with the posted code?
MINATI
am 29 Apr. 2019
@MINATI: "I'm unable to attach" does not explain, what you are doing and which error message you get or which other problem occurs.
As far as I remember the clip symbol is disabled, if you have posted a certain number of attachments at a specific day already. You can simply find out if it is "deactivated perhaps" by clicking on it. What do you see then? (It is the one left beside the question mark.)
I've added the paper to the question now.
MINATI
am 29 Apr. 2019
Walter Roberson
am 29 Apr. 2019
Dig out the relevant equations and post them. Indicate the initial conditions. Indicate whether you are looking for numeric solution or theoretical solution. Figure out whether it is a "stiff" system, or if you need a Mass Matrix. I see an f''' in there: does that hint that we could provide the Jacobian or Hessian as functions?
Do you have the Symbolic Toolbox?
David Wilson
am 30 Apr. 2019
If I understand correctly, the BVP you are trying to solve has BCs at infinity. You have chosen 6 (& the paper uses 8), so you might like to validate that approximation.
What exactly is the problem ?
My solution is for the Pr=6.2, \gamma=0.1. This seems to follow your Fig 1. 

Jan
am 30 Apr. 2019
@MINATI: See https://en.wikipedia.org/wiki/Stiff_equation
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!