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

 Réponse acceptée

Ingrid
Ingrid le 17 Juin 2015

0 votes

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);

Plus de réponses (1)

Torsten
Torsten le 17 Juin 2015

0 votes

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

Catégories

En savoir plus sur Entering Commands dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by