"Not enough input arguments"

조회 수: 2 (최근 30일)
Claudia
Claudia 2015년 6월 17일
답변: Torsten 2015년 6월 17일
Hey there!
I am trying solve two equations with fsolve but it is not working propertly. There is always the same error popping up. Could somebody tell me why? That would be great.
function x = start
%Berechnung mit Shield und Al2O3 T2_b
x0=[1700,1400];
x=fsolve(@eqns,x0);
end
function fcns=eqns(x)
T_1=x(1); T_2=x(2);
H=0.30; %[m] r1=0.15; %[m] r2=0.25; %[m] r3=0.40; %[m] T_in=1873; %[K] T_inf=298; %[K] k_al2o3=9; %[W/m*K] k_air=0.026; %[W/m*K] k_xe=0.0054; %[W/m*K] u= 0.08; %[m/s]-ANNAHME!!! v=158*10^-7; %[m^2/s] v_xe=86.6*10^-6 %[m^2/s a=20*10^-6; %[m^2/s] e=0.5 %Annahme!!!!!!! sig=5.67*10^-8 %[W/m^2*K^4]
Re=u*H/v; Pr=v/a; Nu=0.332*Re^(1/2)*Pr^(1/3);
h_out=Nu*k_air/H; h_rad=e*sig*(T_1^2+T_2^2)*(T_1+T_2)
Lc=(2*[log(r3/r2)]^(4/3))/((r2^(-3/5)+r3^(-3/5))^5/3) Rac= (g*beta)/(v_xe*alpha)*(T_1-T_2)*Lc %Rayleigh number k_eff=k_xe*0.386*(Pr/(0.861+Pr))^(1/4)*Rac^(1/4)
Rtot=log(r2/r1)/(2*pi*H*k_al2o3)+1/(h_out*2*r3*pi*H)+((log(r3/r2)/(2*pi*H*k_eff))*1/(h_rad*2*pi*H*r2))/((log(r3/r2)/(2*pi*H*k_eff))+1/(h_rad*2*pi*H*r2))
fcns(1)=h_out*r3*(T_2-T_inf)-((T_in-T_1)/log(r2/r1)); fcns(2)=(T_in-T_inf)/Rtot-h_out*2*pi*r3*(T_2-T_inf);
end
thank you a lot
Best Claudia

채택된 답변

Ingrid
Ingrid 2015년 6월 17일
without looking at your own defined function but try this as it is the correct syntax for anonymous function definition
x=fsolve(@(x) eqns(x),x0);
  댓글 수: 1
Claudia
Claudia 2015년 6월 17일
Thanks a lot

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Torsten
Torsten 2015년 6월 17일
I guess x0 must be a column vector:
x0=[1700;1400];
x=fsolve(@eqns,x0);
Best wishes
Torsten.

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by