%
%  circular_SS_base_sine.m  ver 1.0  February 28, 2012
%
%
function[]=circular_SS_base_sine(iu,fn,damp,NT,nodal_diam,PF,Cc,Dc);
%        
    tpi=2*pi;
    disp(' ');
    ff=input(' Enter excitation frequency (Hz): ');
    disp(' ');
    AA=input(' Enter base acceleration (G): ');
%
    Hrd=0.;
    Hra=0.;
%
    omega=tpi*ff;
%
    j=sqrt(-1);
%
    for jk=1:NT
            if(abs(PF(jk))>0)
                omegan=tpi*fn(jk);
                den=(omegan^2-omega^2)+j*(2*damp*omegan*omega);
%
                kr=0; 
                arg=0.;
                nn=nodal_diam(jk);
%        
                ZZ=Cc(jk)*( besselj(nn,kr)- Dc(jk)*besseli(nn,kr))*cos(arg);  
%
                Hrd=-Hrd+ZZ*PF(jk)/den;
                Hra= Hra+ZZ*PF(jk)*omega^2/den;
            end
%                             
    end
%
    Haa=1+Hra;
%
    Hrd_phase=(180/pi)*atan2(imag(Hrd),real(Hrd)); 
    Haa_phase=(180/pi)*atan2(imag(Haa),real(Haa)); 
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
    if(iu==1)
        Hrd=Hrd*386.;
    else
        Hrd=Hrd*9.81;
    end
%
    Haa_mag=abs(Haa);
    Hrd_mag=abs(Hrd);
%
    disp(' ');
    disp(' Response Magnitudes at Center ');
      out1=sprintf('          Acceleration = %8.4g G',Haa_mag*AA);
%   
    if(iu==1)
        out2=sprintf('\n Relative Displacement = %8.4g in',Hrd_mag*AA);    
    else
        out2=sprintf('\n Relative Displacement = %8.4g m',Hrd_mag*AA);        
    end
%    
    disp(out2);
    disp(out1);

