disp(' ');
disp(' column_buckling  ver 1.0  October 21, 2010');
disp(' by Tom Irvine  Email: tomirvine@aol.com');
disp(' ');
%
clear E;
clear I;
clear k;
clear L;
clear F;
%
icross=input(' Enter the cross-section: \n 1=rectangle  2=solid cylinder  3=other ');
disp(' ');
if(icross==1)
			width=input(' Enter the width (inch) ');
			thick=input(' Enter the thickness (inch) ');
			A=width*thick;
			I=(1./12.)*width*(thick^3.);
end
if(icross==2)
			diam=input(' Enter the diameter (inch) ');
			A=(pi/4.)*(diam^2.);
			I=(pi/64.)*(diam^4.);
end
if(icross ~=1 & icross ~=2)
            disp(' ');
            I = input(' Enter the area moment of inertia (in^4) ');
            %
            disp(' ');
            A = input(' Enter the cross-section area (in^2) ');
end
%
disp(' ');
imat=input(' Enter material: \n 1=aluminum  2=steel  3=other ');
%
if(imat==1)
    rho=0.1;
	E=1.0e+07;
end
if(imat==2)
    rho=0.29;
    E=3.0e+007;
end
if(imat ~=1 & imat ~=2)
    disp(' ');   
    E = input(' Enter the elastic modulus (lbf/in^2) ');
%    disp(' ');
%    rho = input(' Enter the mass density (lbm/in^3) ');           
 end
%
rho=rho*A/386.;
%
disp(' ');
L = input(' Enter the length (inch) ');
%
disp(' Enter boundary conditions ');
disp('  1=pinned-pinnded ');
disp('  2=fixed-fixed');
disp('  3=fixed-pinned');
disp('  4=fixed-free');
%
ibc=input(' ');
%
if(ibc==1)
    k=1;
end
if(ibc==2);
    k=0.5;
end
if(ibc==3)
    k=0.699;
end
if(ibc==4)
    k=2;
end
%
clear KL;
KL=k*L;
F=pi^2*E*I/(KL)^2;
%
out1=sprintf('  The critical buckling load = %8.4g lbf \n',F);
out2=sprintf('  The effective length       = %8.4g in ',KL);
disp(out1);
disp(out2);
%