%
%   iso_apply_rb_accel.m  ver 1.2   December 20, 2011
%
function[x]=iso_apply_rb_accel(m,k)
%
    x=0;
    disp(' ');
    disp(' Apply rigid-body acceleration? ');
    disp(' 1=yes  2=no ');
    irba = input(' ');
%
    if(irba==1)
    
%
        while(1)      
            clear x;
            disp(' ');
            disp(' Enter acceleration (G) ');
            accel=input(' ');
            disp(' ');
            disp(' Enter input axis ');
            disp(' 1=X  2=Y  3=Z ');
            iaxis=input(' ');
%
            aaa=zeros(6,1);
%
            if(iaxis==1)
              aaa(1)=accel;
            end
%
            if(iaxis==2)
               aaa(2)=accel;            
            end
%
            if(iaxis==3)
                aaa(3)=accel;            
            end
            aaa=aaa*386;
            mm=m*aaa;
%
            x=k\mm;
%
            xmax=max(abs(x(1:3)));
%
            for(i=1:3)
                if(abs(x(i))< (xmax/10000) || abs(x(i))< 1.0e-10)
                    x(i)=0;
                end
            end
%
            xmax=max(abs(x(4:6)));
%
            for(i=4:6)
                if(abs(x(i))< (xmax/10000)  || abs(x(i))< 1.0e-10)
                    x(i)=0;
                end
            end
%
            disp(' ');
            disp('   Displacement  ');
            disp('    x         y         z      ');
            disp('   (in)      (in)      (in)    ');
            out1=sprintf(' %6.3g  %6.3g  %6.3g   ',x(1),x(2),x(3));
            disp(out1);
%
            disp(' ');
            disp('   Rotation  ');
            disp('   theta-x     theta-y    theta-z ');
            disp('   (rad)       (rad)       (rad) ');
            out1=sprintf('  %6.3g    %6.3g    %6.3g ',x(4),x(5),x(6));
            disp(out1);        
%
            disp(' ');
            disp(' Perform another rigid-body acceleration case? ');
            disp(' 1=yes  2=no ');
            ian=input(' ');
            if(ian==2)
                break;
            end
%
        end
%
    end   