How do I plot eta only when it's then 0?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi everybody, and thanks for your help.
I need some help for the gollowing code:
- print rendimento only when eta>0
- evalute p02 p2 =((1+((eta.*deltaideal)/(T01*cp))).^(k/(k-1))); when m>0 and with p02=m^2 when m<0
while N<Nmax+1
U1 = (D1*pi.*N)/60;
U2 = (D2*pi.*N)/60;
alfa2b = atan((D1*tan(beta1b))/(sigma*D2));
deltaideal = sigma*(U2^2);
deltahii = 0.5.*((U1-((cot(beta1b).*m)/(ro1*Ai))).^2);
deltahid = 0.5.*(((sigma*D2*U1)/D1)-((m.*cot(alfa2b))/(ro1*Ad))).^2;
deltahfi = kf.*(m.^2);
deltahfd = kfd.*(m.^2);
deltan = deltanbf+deltanv+deltanc+deltand;
deltaloss = deltahii+deltahid+deltahfi+deltahfd;
eta = ((deltaideal)./(deltaideal+deltaloss))-deltan;
p2 =((1+((eta.*deltaideal)/(T01*cp))).^(k/(k-1)));
figure(1);
title('Rendimento')
xlabel('Mass Flow [kg/s]')
ylabel('eta')
grid on
plot(m,eta);
hold on
figure(2);
title('Pressione')
xlabel('Mass Flow [kg/s]')
ylabel('p02')
grid on
plot(m,p2);
hold on
N=N+Nincr
end
1 comentario
prasanth s
el 17 de Oct. de 2019
write the plot function inside the if condition
if eta>0
plot(m,eta);
end
Respuestas (1)
Paul Rogers
el 17 de Oct. de 2019
2 comentarios
Walter Roberson
el 17 de Oct. de 2019
eta is a vector. What does it mean to print rendimento only when eta>0 ? Do you want non-positive values to be skipped in the plot?
Ver también
Categorías
Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!