function[out1,out2,AR,S,gamma,theta,An,CL,CD,y]=AnaliseAsa(x,alpha,opt,Lrest,Mmax) % x = [b bt c1 c2 c3 a1 a2 a3] alpha = 0; U0 = 1; [b,bt,c,alpha0,ym,cm,alpha0m,m0m]=ExtractVar(x); [AR,S,gamma,theta,An,CL,CD,y] = ... GlauertSym(ym,cm,alpha,alpha0m,m0m,U0); % Restricoes L = CL*S; M = -trapz(y,gamma.*y'); switch opt case 'fit' out1 = CD; case 'con' C = abs(M)-abs(Mmax); Ceq = L-Lrest; out1 = C; out2 = Ceq; case 'disp' C = M-Mmax; Ceq = L-Lrest; disp('CL CD Ceq C') disp([CL CD Ceq C]) PlotaAsa(ym,cm,-alpha0m*180/pi,m0m); out1 = M; out2 = L; end