I want to plot the attenuation coefficient of circular waveguide using zeros of Bessel function, can someone kindly suggest how to do it for multimodes not for single mode??
    5 views (last 30 days)
  
       Show older comments
    
u=1.84
nu=linspace(0.1e12,1e12,100);
lambda=3e8./nu;
n=1
ko=(2*pi)./lambda;
T=4e-3;
zo=-i*n.*ko.*T;
m=besselj(1,u)./besselj(0,u);
zTE=-i.*(m./u).*zo;
rm=(zTE-zo)./(zTE+zo);
rm1=-(besselj(0,u)+i*besselj(1,u))./(besselj(0,u)-i*besselj(1,u));
Rm=abs(rm).^2;
% Rm1=abs(rm1)
thetaz=asin((u)./(n.*ko.*T));
m1=(2./u).*(zTE.*zo)./(zTE.^2-zo.^2)
m2=-(2./u).*(besselj(1,u)*besselj(0,u))./(besselj(1,u).^2+besselj(0,u).^2)
alpha=(1-Rm)./(2.*T.*cot(thetaz)+(2*T*cot(thetaz).*real(m2)))
plot(nu,(alpha))
0 Comments
Answers (1)
  Epsilon
      
 on 18 Sep 2024
        
      Edited: Epsilon
      
 on 18 Sep 2024
  
      Hi Deepak, 
To plot the attenuation coefficient of circular waveguides using the zeros of Bessel function for multiple modes, start with identifying the zeros of the Bessel function to determine the cutoff frequencies for each mode. Then use a loop to calculate the attenuation coefficient for each mode separately. 
Here is an exemplar code for your reference: 
% Parameters
nu = linspace(0.1e12, 1e12, 100);  % Frequency range
lambda = 3e8 ./ nu;                % Wavelength
n = 1;                             % Refractive index
ko = (2 * pi) ./ lambda;           % Wave number
T = 4e-3;                          % Thickness
modes = [1.84, 3.05, 4.2];         % Zeros of the Bessel function for different modes
% Preallocate for efficiency
alpha_modes = zeros(length(modes), length(nu));
% Loop over each mode
for mode_index = 1:length(modes)
    u = modes(mode_index);  % Current mode zero
    zo = -1i * n .* ko .* T;
    m = besselj(1, u) ./ besselj(0, u);
    zTE = -1i .* (m ./ u) .* zo;
    rm = (zTE - zo) ./ (zTE + zo);
    Rm = abs(rm).^2;
    thetaz = asin((u) ./ (n .* ko .* T));
    m2 = -(2 ./ u) .* (besselj(1, u) * besselj(0, u)) ./ (besselj(1, u).^2 + besselj(0, u).^2);
    alpha = (1 - Rm) ./ (2 .* T .* cot(thetaz) + (2 * T * cot(thetaz) .* real(m2)));
    % Store the result for this mode
    alpha_modes(mode_index, :) = alpha;
end
% Plot the results
figure;
hold on;
colors = lines(length(modes));
for mode_index = 1:length(modes)
    plot(nu, alpha_modes(mode_index, :), 'DisplayName', ['Mode ' num2str(mode_index)], 'Color', colors(mode_index, :));
end
hold off;
xlabel('Frequency (Hz)');
ylabel('Attenuation Coefficient');
title('Attenuation Coefficient for Multiple Modes');
legend show;
Hope this helps!
1 Comment
See Also
Categories
				Find more on Bessel functions in Help Center and File Exchange
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


