solving pohlhausen equation,how I can write true function?
이전 댓글 표시
I write this function for solve pohlhausen equation.(T''+Pr/2 F T'=0 ) That F is output of blasius equation( 2F'''+FF''=0).but my code has error.how I can write true function?
function [Tetadot,fdot]=pohlhausen(eta,Teta,f);
fdot=blasius(eta,f);
Tetadot(1)=Teta(2);
Tetadot(2)=-(0.7/2)*f(1)*Teta(2);
Tetadot=Tetadot';
function fdot=blasius(eta,f);
fdot(1)=f(2);
fdot(2)=f(3);
fdot(3)=-(1/2)*f(1)*f(3);
fdot=fdot';
end
end
댓글 수: 2
mahdi etminan
2019년 6월 6일
Torsten
2019년 6월 6일
You'll have to solve both equations (Blasius and Pohlhausen) together, not one after the other.
답변 (1개)
Star Strider
2019년 6월 6일
If you have the Symbolic Math Toolbox, let it do the programming for you:
% % 2F'''+FF''=0
% % T''+Pr/2 F T'=0
syms F(t) Pr T(t) t Y
Blasius = 2*diff(F,3)+F*diff(F,2) == 0;
Polhausen = diff(T,2) + Pr/2 * F * diff(T) == 0;
[VF,Sbs] = odeToVectorField(Blasius, Polhausen) % Vector Field Representation & Substitutions
polhfcn = matlabFunction(VF, 'Vars',{t,Y,Pr}) % Anonymous Function
varcell = sym2cell(Sbs); % Cell Array Of Substitutions
varstr = sprintfc('%s',[varcell{:}]); % Cell Array Of Substitution Strings (For ‘legend’ Or Other Uses), Can Also Use The ‘compose’ Function
producing:
polhfcn = @(t,Y,Pr) [Y(2);Pr.*Y(2).*Y(3).*(-1.0./2.0);Y(4);Y(5);Y(3).*Y(5).*(-1.0./2.0)];
and other information.
You would define a value for ‘Pr’ in your workspace, then use the function (in ode45, for example, although I have no idea what solver is most appropriate here):
[t,y] = ode45(@(t,Y)polhfcn(t,Y,Pr), tspan, ics);
Check to be sure I entered the equations correctly. I believe I did, although it is always appropriate to check.
카테고리
도움말 센터 및 File Exchange에서 Data Type Identification에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!