hi! I have a problem solving an implicit equation

10 次查看(过去 30 天)
This is the subprogram that I have created but it didn´t works:
function [Tsurf]=temp_surf(Minf,h)
[Minf,h] = meshgrid(0.05:0.05:0.95,110:100:11000);
[Tinf,Pinf,roinf,Uinf,winf,muinf,kinf,mh2o]=atmosfera(Minf,h);
[he]=convecc_ext(Minf,h);
f=@(Tsurf)18.*he./(1004.*8.135.*roinf).*(101325./Tsurf.*exp(-(2.4e6).*18./8.315.*(1./Tsurf-1./373.15)))-mh2o;
Tsurf=fsolve(f,280+100*Minf-0.001*h);
mesh(h,Minf,Tsurf)
title('Temperatura superficie exterior del perfil')
xlabel('altura(m)')
ylabel('Mach')
zlabel('T_{surf}(K)')
end
This is the error:
??? Error using ==> rdivide
Matrix dimensions must agree.
Error in ==>
temp_surf>@(Tsurf)18.*he./(1004.*8.135.*roinf).*(101325./Tsurf.*exp(-(2.4e6).*18./8.315.*(1./Tsurf-1./373.15)))-mh2o
at 5
f=@(Tsurf)18.*he./(1004.*8.135.*roinf).*(101325./Tsurf.*exp(-(2.4e6).*18./8.315.*(1./Tsurf-1./373.15)))-mh2o;
Error in ==> fsolve at 254
fuser = feval(funfcn{3},x,varargin{:});
Error in ==> temp_surf at 6
Tsurf=fsolve(f,280+100*Minf-0.001*h);
Caused by:
Failure in initial user-supplied objective function evaluation. FSOLVE cannot continue.
I hope someone could help me.Thanks!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by