How can i pass this showed error ?

when i typed this following code an error is existed , what the solution of this ?
code :
clc;clear;clf
To=288 ; Tx=285 ; Px=98000 ; k=1.4 ; R=287 ; Cp=1005 ;
%Getting Mx from To/Tx
Mx=sqrt(2/(k-1)*((To/Tx)-1)) ;
%Getting Mass flux which is constant for x,y
%Mass conservation equation
roV_y=Px/(R*Tx)*Mx*sqrt(k*R*Tx) ;
Py=10000:2000:40000 ; %downstream pressure values in pa
%solving the equation to find Ty
%energy conservation equation
temp=solve('To=Ty+(roV_y)^2/(2*cp)*(R*Ty/Py)^2','Ty');
Ty=subs(temp);
%as the eqn. was 2nd order Ty will have +ve , -ve values
%we will take the second row which is +ve values
Tyy=Ty(2,:) ;
%calculating delta s
delta_s=Cp*log(Tyy/Tx)-R*log(Py/Px) ;
%plotting fanno line
plot(delta_s,Tyy,'r')
xlabel('\delta s (J/Kg.k)','fontsize',17)
ylabel('Temp.(K)','fontsize',17)
hold on
%plotting rayleigh line
Py=10000:2000:40000 ; %downstream pressure values in pa
%solving the eqn. to find Ty
%Momentum conservation eqn.
temp1=solve('Px+(roV_y)^2*(R*Tx/Px)=Py+(roV_y)^2*(R*Ty/Py)','Ty');
Ty1=subs(temp1) ;
delta_S1=Cp*log(Ty1/Tx)-R*log(Py/Px) ;
plot(delta_S1,Ty1)
legend('Fanno line','Rayleigh line')
Error :
Error using plot
Conversion to double from sym is not possible.
Error in Untitled (line 19)
plot(delta_s,Tyy,'r')

Réponses (0)

Catégories

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

Produits

Version

R2013b

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by