disp(' ');
disp(' vsa_panel_flutter.m   ver 1.0   August 23, 2010');
disp(' by Tom Irvine ');
disp(' ');
disp(' NASA TN D-1058 Method ');
disp(' ');
%
clear x;
clear y;
%
L=input(' Enter Length (inch) ');
W=input(' Enter Width  (inch) ');
T=input(' Enter Thickness (inch) ');
M=input(' Enter Mach number ');
q=input(' Enter dynamic pressure (psf) ');
q=q/144;
%
imat=input(' Enter material: \n 1=aluminum  2=steel  3=other ');
%
if(imat==1)
	E=1.0e+07;
end
if(imat==2)
    E=3.0e+07;
end
if(imat ~=1 && imat ~=2)
    disp(' ');   
    E = input(' Enter the elastic modulus (lbf/in^2) ');           
end
%
ratio=L/W;
%
x(1)=	0.1;	    y(1)=	0.518208;
x(2)=	0.116423;	y(2)=	0.517726;
x(3)=	0.135053;	y(3)=	0.516763;
x(4)=	0.157232;	y(4)=	0.515607;
x(5)=	0.17977;	y(5)=	0.514162;
x(6)=	0.209293;	y(6)=	0.512524;
x(7)=	0.243665;	y(7)=	0.510501;
x(8)=	0.281634;	y(8)=	0.508478;
x(9)=	0.325521;	y(9)=	0.506166;
x(10)=	0.37761;	y(10)=	0.503661;
x(11)=	0.434875;	y(11)=	0.500289;
x(12)=	0.502641;	y(12)=	0.49605;
x(13)=	0.633705;	y(13)=	0.490944;
x(14)=	0.70641;	y(14)=	0.485742;
x(15)=	0.793179;	y(15)=	0.482;
x(16)=	0.957485;	y(16)=	0.474759;
x(17)=	1.05199;	y(17)=	0.468208;
x(18)=	1.15583;	y(18)=	0.460694;
x(19)=	1.25619;	y(19)=	0.45212;
x(20)=	1.35543;	y(20)=	0.4421;
x(21)=	1.46249;	y(21)=	0.429673;
x(22)=	1.57232;	y(22)=	0.414547;
x(23)=	1.6782;	    y(23)=	0.396532;
x(24)=	1.7912;	    y(24)=	0.376782;
x(25)=	1.91182;	y(25)=	0.355877;
x(26)=	2.01851;	y(26)=	0.335164;
x(27)=	2.15443;	y(27)=	0.314933;
x(28)=	2.27467;	y(28)=	0.295472;
x(29)=	2.41907;	y(29)=	0.276012;
x(30)=	2.61016;	y(30)=	0.256551;
x(31)=	2.82656;	y(31)=	0.237861;
x(32)=	3.072;	    y(32)=	0.221002;
x(33)=	3.30269;	y(33)=	0.206551;
x(34)=	3.58948;	y(34)=	0.193738;
x(35)=	3.87302;	y(35)=	0.18237;
x(36)=	4.28623;	y(36)=	0.171965;
x(37)=	4.72638;	y(37)=	0.163006;
x(38)=	5.2496;	    y(38)=	0.155106;
x(39)=	5.83074;	y(39)=	0.148266;
x(40)=	6.6907;	    y(40)=	0.142196;
x(41)=	7.62212;	y(41)=	0.137283;
x(42)=	8.37444;	y(42)=	0.133601;
x(43)=	8.90606;	y(43)=	0.131171;
x(44)=	9.5;	    y(44)=	0.129646;
x(45)=	10;	        y(45)=	0.129039;
%
for(i=1:44)
    if(ratio==x(i))
        YY=y(i);
        break;
    end
%
    if(ratio==x(i+1))
        YY=y(i+1);
        break;
    end
%
    if(ratio>x(i) && ratio<x(i+1))
        length=x(i+1)-x(i);
        xx=ratio-x(i);
        c2=xx/length;
        c1=1-c2;
        YY=c1*y(i)+c2*y(i+1);
        break;
    end    
end
%
FP=(T/L)*((E/q)*sqrt(M^2-1))^(1/3);
%
plot(x,y);
xlabel(' LENGTH WIDTH RATIO  L/W ');
ylabel(' FLUTTER PARAMETER ');
grid on;
set(gca,'MinorGridLineStyle',':','GridLineStyle',':','XScale','log','YScale','lin');
hold on;
plot(ratio,FP,'ro');
hold off;
%
   out1=sprintf('\n Flutter Parameter = %8.4g   Upper Limit = %8.4g',FP,YY);
%
if(FP<YY)
   out2=sprintf('\n Flutter Zone ');   
end
%
if(FP==YY)
   out2=sprintf(' Boderline Case ');      
end
%
if(FP>YY)
   out2=sprintf('\n No Flutter Zone ');       
end
%
disp(out1);
disp(out2);
%