Effacer les filtres
Effacer les filtres

Need help on program

1 vue (au cours des 30 derniers jours)
Chinmayraj Doddarajappa
Chinmayraj Doddarajappa le 13 Juil 2022
Hello,
I am trying to model the below conditions. Input h is given as 0:50:25000
rho value should not cross 1.23 (when h=0) and it must decrease as h increases. But I am getting rho value of 7+ which is incorrect (Refer graph).
Can someone help me on this?
,
Below is the script I have written for the above condition
for i = 1:length(h)
if h(i)<11000
Te = 15.04-0.00649.*h;
pe = 101.29.*((Te+273.1)./288.08).^5.256;
elseif h(i)>=11000 & h(i)<=25000
Te = -56.46;
pe = 22.65.*10.^(1.73-0.000157.*h);
else
Te = -131.21+(0.00299.*h);
pe = 2.488*((Te+273.1)/216.6).^(-11.388);
end
end
rhoe = pe./(0.2869.*(Te+273.1));
plot(h,rhoe,'Color',[0 0 1],'LineWidth',1.5);

Réponse acceptée

Torsten
Torsten le 13 Juil 2022
Modifié(e) : Torsten le 13 Juil 2022
h = 0:50:50000;
for i = 1:length(h)
if h(i)<11000
Te(i) = 15.04-0.00649.*h(i);
pe(i) = 101.29.*((Te(i)+273.1)./288.08).^5.256;
elseif h(i)>=11000 && h(i)<=25000
Te(i) = -56.46;
pe(i) = 22.65.*exp(1.73-0.000157.*h(i));
else
Te(i) = -131.21+(0.00299.*h(i));
pe(i) = 2.488*((Te(i)+273.1)/216.6).^(-11.388);
end
end
rhoe = pe./(0.2869.*(Te+273.1));
plot(h,rhoe,'Color',[0 0 1],'LineWidth',1.5);
  1 commentaire
Chinmayraj Doddarajappa
Chinmayraj Doddarajappa le 13 Juil 2022
Thank you

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by