%
%   re_thick_plate_bending_shear.m  ver 1.2  by Tom Irvine
%
%   radiation efficiency thick plate Rindel method
%
%    a = smallest of length & width
%    b = largest of length & width
%    c = speed of sound
%    fcr = critical frequency
%
function[rad_eff,fcross]=...
              re_thick_plate_bending_Rindel(freq,fcr,a,b,c,em,md,mu,h)

omega=2*pi*freq;          


[~,cs,fshift]=plate_bending_shear_phase_speed(em,md,mu,h,omega);

fcross=fcr*(cs/c)^2;

f=freq;
fs=fshift;

NL=length(f);

S=a*b;
U=2*(a+b);

fa=c*(pi*U/(256*S^2))^(1/3);

fc=fcr;
fb=fc+5*c/U;

lambda=c/fc;

sigma_max=sqrt( (pi*U) / (16*lambda)  );

limit=1/sqrt(1-(c/cs)^2);



fprintf(' fa=%8.4g  fcr=%8.4g  fb=%8.4g  limit=%8.4g\n',fa,fcr,fb,limit);


rad_eff=zeros(NL,1);

for i=1:NL

   lambda=c/f(i);

   if(f(i)<=fa)
        rad_eff(i)=4*S/lambda^2;
   end
   if(f(i)>fa && f(i)<=fb)
        rad_eff(i)=sqrt(pi*U/(16*lambda));
        LR=rad_eff(i);
        fbl=f(i);
   end    
   if(f(i)>fb)
      N=log10(limit/LR)/log10(f(end)/fbl);
      rad_eff(i)=LR*(f(i)/fbl)^N;
   end    

end    

% [~,ii]=min(abs(f-fb));
% rad_eff(ii)=sigma_max;

