%
%  acoustic_power_cylinder_plots_13.m  ver 1.2  by Tom Irvine
%
function[fig_num]=acoustic_power_cylinder_plots_13(fig_num,power,mdens,rad_eff,dlf,num,iu)
 
x_label='Center Frequency (Hz)';
md=4;


ppp1=power;
fmin=min(ppp1(:,1));
fmax=max(ppp1(:,1));

rms=norm(ppp1(:,2));

 
if(iu==1)
    y_label='Power (in-lbf/sec)';   
    t_string=sprintf('One-Third Octave Acoustic Power Spectrum\n  Overall  %6.4g (in-lbf/sec) rms',rms);
else
    y_label='Power (W)';     
    t_string=sprintf('One-Third Octave Acoustic Power Spectrum\n  Overall  %6.3g W',rms);  
end
 
 
[fig_num,h2]=plot_loglog_function_md_h2(fig_num,x_label,...
               y_label,t_string,ppp1,fmin,fmax,md);
           
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

NL=length(ppp1(:,1));

power_dB=zeros(NL,1);

pp=zeros(NL,1);

for i=1:NL

    pp(i)=ppp1(i,2);

    if(iu==1)
        pp(i)=pp(i)*1.35582/12;
    end

    power_dB(i)=10*log10(pp(i)/1e-12);

end

[oadB]=oa_power_function(power_dB);

t_string=sprintf('One-Third Octave Acoustic Power   Overall Level=%7.1f dB \n (ref 1 pico Watt)',oadB);
x_label='Center Frequency (Hz)';
y_label='Power (dB)';
[fig_num,h2]=plot_loglin_function_h2_yfree(fig_num,x_label,y_label,t_string,[ppp1(:,1) power_dB],fmin,fmax);

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

fmin=min(ppp1(:,1));
fmax=max(ppp1(:,1));

ppp=dlf;

t_string='Dissipation Loss Factor';
y_label='\eta'; 
 
[fig_num,h2]=plot_loglog_function_md_h2(fig_num,x_label,...
               y_label,t_string,ppp,fmin,fmax,md);        


ppp1=mdens;
t_string='Cylindrical Shell Modal Density';
y_label='n (modes/Hz)'; 
 
 
[fig_num,h2]=plot_loglog_function_md_h2(fig_num,x_label,...
               y_label,t_string,ppp1,fmin,fmax,md);           
 
               
b=num(:,2);
f=num(:,1);
t_string=sprintf('          Cylindrical Shell \n Number of Modes per One-Third Octave Band');
ylab='num';

[fig_num]=plot_modes_onethird_octave_bar(fig_num,f,b,t_string,ylab);


ppp1=rad_eff;
fmin=min(ppp1(:,1));
fmax=max(ppp1(:,1));
y_label='Rad Eff';
t_string='Cylindrical Shell Radiation Efficiency';
 
 
[fig_num,h2]=plot_loglog_function_md_h2(fig_num,x_label,...
               y_label,t_string,ppp1,fmin,fmax,md);
            