From 240ed0a3079d4d95ae5aa2226d840e89280167cc Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Thu, 15 Sep 2011 12:16:54 +0200 Subject: [PATCH] tutorial for a circular waveguide added --- Tutorials/Circ_Waveguide.m | 165 +++++++++++++++++++++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 Tutorials/Circ_Waveguide.m diff --git a/Tutorials/Circ_Waveguide.m b/Tutorials/Circ_Waveguide.m new file mode 100644 index 0000000..13e0559 --- /dev/null +++ b/Tutorials/Circ_Waveguide.m @@ -0,0 +1,165 @@ +% +% Tutorials / Circ_Waveguide +% +% Describtion at: +% http://openems.de/index.php/Tutorial:_Circular_Waveguide +% +% Tested with +% - Matlab 2009b +% - openEMS v0.0.23 +% +% (C) 2010,2011 Thorsten Liebig + +close all +clear +clc + +%% setup the simulation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +physical_constants; +unit = 1e-3; %drawing unit in mm +numTS = 50000; %max. number of timesteps + +% waveguide dimensions +length = 2000; +rad = 350; %waveguide radius in mm + +% frequency range of interest +f_start = 300e6; +f_stop = 500e6; + +mesh_res = [10 2*pi/49.999 10]; %targeted mesh resolution + +%% mode functions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% by David M. Pozar, Microwave Engineering, third edition +freq = linspace(f_start,f_stop,201); +p11 = 1.841; +kc = p11 / rad /unit; +k = 2*pi*freq/C0; +fc = C0*kc/2/pi; +beta = sqrt(k.^2 - kc^2); +n_eff = (beta/k); +ZL_a = k * Z0 ./ beta; %analytic waveguide impedance + +% TE_11 mode profile E- and H-field +kc = kc*unit; %functions must be defined in drawing units +func_Er = [ num2str(-1/kc^2,15) '/rho*cos(a)*j1(' num2str(kc,15) '*rho)']; +func_Ea = [ num2str(1/kc,15) '*sin(a)*0.5*(j0(' num2str(kc,15) '*rho)-jn(2,' num2str(kc,15) '*rho))']; + +func_Ha = [ num2str(-1/kc^2,15) '/rho*cos(a)*j1(' num2str(kc,15) '*rho)']; +func_Hr = [ '-1*' num2str(1/kc,15) '*sin(a)*0.5*(j0(' num2str(kc,15) '*rho)-jn(2,' num2str(kc,15) '*rho))']; + +disp([' Cutoff frequencies for this mode and wavguide is: ' num2str(fc/1e6) ' MHz']); + +if (f_start