Don't show value <2.66 on contour + how to find 2 values where PS=0

Hey all,
I'm making a matlab file to analyse the performance of an aircraft. I have all my formulas, change of atmosphere already written in matlab. But I do have some problems I don't know how to solve: - First of all: the Clmax value is 2,66, so if the calculated value is higher than 2,66, it should not be displayed on the contour plot. I tried this with an if function and then else cl(i,j)=0, but that gives me a very weird graph which is not the correct way to do it I guess. - The graph I'm plotting is thus the excess power. Now i want to find the altitude where the excess power becomes 0. But PS depends on the rho (thus altitudes), but also on the speeds. So basically there will be two values which would need to be displayed when PS=0. I know the partial differential of both would variables would be 0 if PS=0, but it's hard for me to implement this into matlab.
TA= 667233.2; W=228000; S=360; CDO=0,02; b=60; AR=10; h=0;
v= [60:10:350] hoogte= [0:1000:17000]
%TEST
for j=1:length(hoogte) hoogte_temp = hoogte(j) [rho c] = Atmos(hoogte_temp) sigma= rho/1.225
for i= 1:length(v)
v_temp = v(i);
q= rho*v_temp*v_temp/2
cl(i,j) = W*9.81/S/q
if (cl<2.66)
else %als Cl kleiner is dan 1,91: niet weergeven, ook niet Cd, D en ook niet Ps
cl(i,j)=0
cd(i,j)=NaN
D(i,j)=NaN
PS(i,j)=NaN
end
if(v_temp/c<1)
beta(i)=sqrt(1-(v_temp/c)^2)
else
beta(i) = NaN
end
cd(i,j) = 0.02 + cl(i,j)^2/(AR*3.14*0.8)/beta(i)
D(i,j)= cd(i,j)*q*S
PS(i,j)=(TA*sigma-D(i,j))*v_temp/(W*9.81)
end
end figure contour(v,hoogte,PS')
This is what i have until now. Would be good if someone can tell me the functions i need to use! Thanks!

Answers (0)

Products

Asked:

on 30 May 2013

Community Treasure Hunt

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

Start Hunting!