       disp(' ')
       disp(' Miles_force.m     ver 1.1    July 29, 2008')
	   disp(' by Tom Irvine ')
   	   disp(' Email: tomirvine@aol.com ')
	   disp(' ')
	   disp(' This program calculates the response of a single-degree-of-freedom ') 
	   disp(' system to an applied force via Miles equation. ')
	   disp(' ')
       %
       clear miles_disp;
       clear miles_rd;
       clear fn;
       clear a;
       clear q;
       clear om;
       clear om2;
       %
       clear mass;
       clear stiffness;
       %
       tpi=2*pi;
       %
 	   disp(' Select input type. Enter ');
	   disp('   1=fn   & mass ');
	   disp('   2=fn   & stiffness ');
	   disp('   3=mass & stiffness ');
       %
       idt=input(' ');
%     
	   if(idt==1 | idt==2)
%
		  disp('Enter natural frequency (Hz)  ');
  		  fn=input(' ');
%
		  omegan =tpi*fn;
		  omegan2=(omegan^2);
       end    
%
	   if(idt==1 | idt==3)
%
		  disp('Enter mass (lbm)  ');
  		  mass=input(' ');
       end
%
	if(idt==2 | idt==3)
		disp('Enter stiffness (lbf/in)  ');
  		stiffness=input(' ');
    end
	if(idt==1)
		stiffness=omegan2*(mass/386.);
    end
	if(idt==2)
		mass=stiffness/omegan2;
		mass=mass*386.;
    end
	if(idt==3)
		omegan = sqrt(stiffness/(mass/386.));
		omegan2=pow(omegan,2);
    end
%
	disp(' ');
	out1=sprintf('        fn= %8.4g Hz',(omegan/tpi));
	out2=sprintf('      mass= %8.4g lbm   ',mass);
	out3=sprintf(' stiffness= %8.4g lbf/in',stiffness);
	disp(out1);
    disp(out2);
    disp(out3);
%
    disp(' ');
    disp(' Enter the PSD (lbf^2/Hz) value at the natural frequency ')
	a=input(' ');
    disp(' ')
    disp(' Enter the Q value (typically Q=10) ');
	Q=input(' ');
    %
    damp=1/(2*Q);
    mass=mass/386.;
    %
    miles_disp= (a/(8*damp))^(0.5)*(1/mass)^(0.25)*(1/stiffness)^0.75;
    %
	out5=sprintf('\n Displacement = %10.3g inch (1 sigma) ',miles_disp);
	out6=sprintf('              = %10.3g inch (3 sigma) ',3.*miles_disp);
    disp(out5)
    disp(out6)
    %
    out5=sprintf('\n     Velocity = %10.3g inch/sec (1 sigma) ',miles_disp*omegan);
	out6=sprintf('              = %10.3g inch/sec (3 sigma) ',3.*miles_disp*omegan);
    disp(out5)
    disp(out6)
    %
	out5=sprintf('\n Displacement = %10.3g mm (1 sigma) ',miles_disp*25.4);
	out6=  sprintf('              = %10.3g mm (3 sigma) ',3.*miles_disp*25.4);
    disp(out5)
    disp(out6)
    %
    out5=sprintf('\n     Velocity = %10.3g mm/sec (1 sigma) ',miles_disp*25.4*omegan);
	out6=  sprintf('              = %10.3g mm/sec (3 sigma) ',3.*miles_disp*25.4*omegan);
    disp(out5)
    disp(out6)
    %