%
%  circular_plate_materials.m   ver 1.0  February 28, 2012
%
function[iu,D,rho,mass,radius,h,mu]=circular_plate_materials()
%
disp(' ');
disp(' Enter unit type: 1=English 2=metric');
iu=input(' ');
disp(' Enter plate type: ');
disp(' 1=homogeneous 2=honeycomb-sandwich');
ib=input(' ');
%
if(iu==1)
    disp(' ');
    diam=input(' Enter diameter (inch) ');
    disp(' ');
else
    disp(' ');
    disp(' Select diameter unit:');
    disp(' 1=meters  2=cm  3=mm ');
    ilu=input(' ');  
    if(ilu==1)
        disp(' ');
        diam=input(' Enter diameter (m) ');       
    end
    if(ilu==2)
        disp(' ');
        diam=input(' Enter diameter (cm) ');
        diam=diam/100;
    end  
    if(ilu==3)
        disp(' ');
        diam=input(' Enter diameter (mm) ');
        diam=diam/1000;
    end   
end
radius=diam/2;
%
if(ib==1) % homogeneous
%
    if(iu==1)
        disp(' ');
        h=input(' Enter thickness (inch) ');
    else
        disp(' ');
        h=input(' Enter thickness (mm) ');
        h=h/1000;
    end
%
    disp(' ');
    imat=input(' Enter material: \n 1=aluminum  2=steel  3=G10  4=other ');
%
    if(imat==1) % Al
        if(iu==1)
            rho=0.1;
            E=1.0e+07;
        else
            rho=2768;
            E=6.891e+010;
        end
        mu=0.3;
    end
    if(imat==2) % steel
        if(iu==1)
            rho=0.29;
            E=3.0e+007;
        else
            rho=7887;
            E=2.067e+011;
        end
        mu=0.3;
    end
    if(imat==3) % G10
        if(iu==1)
            rho=0.065;
            E=2.7e+006;
        else
            rho=1799;
            E=1.861e+010;        
        end
        mu=0.12;
    end
    if(imat ~=1 && imat ~=2 && imat ~=3)
        if(iu==1)
            disp(' ');   
            E = input(' Enter the elastic modulus (lbf/in^2) ');
            disp(' ');
            rho = input(' Enter the mass density (lbm/in^3) '); 
        else
            disp(' ');   
            E = input(' Enter the elastic modulus (N/m^2) ');
            disp(' ');
            rho = input(' Enter the mass density (kg/m^3) ');        
        end
        disp(' ');
        mu=input(' Enter Poisson ratio ');    
    end
%
    volume=pi*(radius^2)*h;
    D=E*h^3/(12*(1.-mu^2));
%
    smass=rho*(diam^2)*h*pi/4;
%
else % honeycomb-sandwich
    if(iu==1)
        disp(' ');
        disp(' Enter core thickness (inch)')
        c=input(' ');
%
        disp(' ');
        disp(' Enter individual face sheet thickness (inch)')
        t=input(' ');
    else
        disp(' ');
        disp(' Enter core thickness (mm)')
        c=input(' ');
        c=c/1000;
%
        disp(' ');
        disp(' Enter individual face sheet thickness (mm)')
        t=input(' ');
        t=t/1000;
    end
%
    disp(' ');
    disp(' Select face sheet material ');
    disp(' 1=aluminum  2=other ');
    imat = input(' ');
%
    if(imat==1)
        if(iu==1)
            E=1.0e+07;
            rho=0.1;
        else
            E=6.891e+010;
            rho=2768;
        end
        mu=0.3;
    else
        if(iu==1)
            disp(' ');
            disp(' Enter elastic modulus of face sheets (lbf/in^2)');
            disp(' ');
            E=input(' ');
            disp(' ');
            rho = input(' Enter the face sheet mass density (lbm/in^3) ');     
        else
            disp(' ');   
            disp(' Enter the elastic modulus of face sheets (N/m^2) ');
             E=input(' ');
            disp(' ');       
            rho = input(' Enter the face sheet mass density (kg/m^3) ');    
        end
        disp(' ');
        mu=input(' Enter the face sheet Poisson ratio ');  
    end
%
    if(iu==1)
        disp(' ');
        rho_core = input(' Enter the core mass density (lbm/in^3) ');
    else
        disp(' ');
        rho_core = input(' Enter the core mass density (kg/m^3) ');
    end
%
    area=pi*(radius^2);
    mass_face=area*(2*t)*rho;
    mass_core=area*c*rho_core;
    mass=mass_face+mass_core;
%
    H=c+t;
    D=E/(1-mu^2);
    D=(D*t*H^2)/2;
%
    thickness = c+2*t;
    h=thickness;
    volume = area*thickness;
    rho = mass/volume;
%
    smass=mass;
end
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
disp(' ');
if(iu==1)
    out1=sprintf(' Structural mass = %8.4g lbm',smass);
else
    out1=sprintf(' Structural mass = %8.4g kg',smass);
end
disp(out1);
disp(' ');
disp(' Add uniformly distributed non-structural mass ?');
disp(' 1=yes  2=no ')
imass=input(' ');
%
NSM=0;
if(imass==1)
  disp(' ');
  if(iu==1) 
    disp(' Enter added mass(lbm) ');
  else
    disp(' Enter added mass(kg) ');
  end
  NSM=input(' ');
end
%
mass=NSM+smass;
M=mass;
rho=M/volume;
%
disp(' ');
if(iu==1)
    out1=sprintf('     Structural mass = %8.4g lbm',smass);
    disp(out1);
    out1=sprintf(' Non-structural mass = %8.4g lbm',NSM);
    disp(out1);  
    out1=sprintf('          Total mass = %8.4g lbm ',M);
    disp(out1);
    out1=sprintf('     Total thickness = %8.4g in ',h);
    disp(out1);     
    out1=sprintf('            Diameter = %8.4g in ',2*radius);
    disp(out1);  
    out1=sprintf('              Volume = %8.4g in^3 ',volume);
    disp(out1);
    out1=sprintf('Overall mass density = %8.4g lbm/in^3 ',rho);
    disp(out1); 
    %
    disp(' ');
    out1=sprintf(' Plate Stiffness Factor  D = %8.4g lbf in',D);
    disp(out1); 
    out1=sprintf('                       D/E = %8.4g in^3',D/E);
    disp(out1);    
    %
    mass=mass/386;
    M=M/386;
    rho=rho/386;   % mass per volume
else
    out1=sprintf('     Structural mass = %8.4g kg',smass);
    disp(out1);   
    out1=sprintf(' Non-structural mass = %8.4g kg',NSM);
    disp(out1); 
    out1=sprintf('          Total mass = %8.4g kg ',M);
    disp(out1);
    out1=sprintf('     Total thickness = %8.4g mm ',h*1000);
    disp(out1);     
    out1=sprintf('            Diameter = %8.4g m ',2*radius);
    disp(out1);     
    out1=sprintf('              Volume = %8.4g m^3 ',volume);
    disp(out1);   
    out1=sprintf('Overall mass density = %8.4g kg/m^3 ',rho);
    disp(out1);     
    %
    disp(' ');
    out1=sprintf(' Plate Stiffness Factor  D = %8.4g N m',D);
    disp(out1);     
    out1=sprintf('                       D/E = %8.4g m^3',D/E);
    disp(out1);       
end
%