2012-01-17 14:49:37 +00:00
|
|
|
%
|
|
|
|
% Tutorials / Parallel_Plate_Waveguide
|
|
|
|
%
|
2022-03-11 21:17:27 +00:00
|
|
|
% Description at:
|
2012-01-17 14:49:37 +00:00
|
|
|
% http://openems.de/index.php/Tutorial:_Parallel_Plate_Waveguide
|
|
|
|
%
|
|
|
|
% Tested with
|
2015-06-16 19:13:25 +00:00
|
|
|
% - Matlab 2011a / Octave 4.0
|
|
|
|
% - openEMS v0.0.33
|
2012-01-17 14:49:37 +00:00
|
|
|
%
|
|
|
|
% (C) 2011,2012 Sebastian Held <sebastian.held@gmx.de>
|
2015-06-16 19:13:25 +00:00
|
|
|
% (C) 2011-2015 Thorsten Liebig <thorsten.liebig@gmx.de>
|
2012-01-17 14:49:37 +00:00
|
|
|
|
|
|
|
close all
|
|
|
|
clear
|
|
|
|
clc
|
|
|
|
|
|
|
|
% init and define FDTD parameter
|
|
|
|
FDTD = InitFDTD(100,0,'OverSampling',50);
|
|
|
|
FDTD = SetSinusExcite(FDTD,10e6);
|
|
|
|
BC = {'PMC' 'PMC' 'PEC' 'PEC' 'MUR' 'MUR'};
|
|
|
|
FDTD = SetBoundaryCond(FDTD,BC);
|
|
|
|
|
|
|
|
% init and define FDTD mesh
|
|
|
|
CSX = InitCSX();
|
|
|
|
mesh.x = -10:10;
|
|
|
|
mesh.y = -10:10;
|
|
|
|
mesh.z = -10:30;
|
|
|
|
CSX = DefineRectGrid(CSX, 1, mesh);
|
|
|
|
|
|
|
|
% define the excitation
|
|
|
|
CSX = AddExcitation(CSX,'excitation',0,[0 1 0]);
|
|
|
|
CSX = AddBox(CSX,'excitation',0,[-10 -10 0],[10 10 0]);
|
|
|
|
|
|
|
|
% define a time domain e-field dump box
|
|
|
|
CSX = AddDump(CSX,'Et','DumpMode',0);
|
|
|
|
CSX = AddBox(CSX,'Et',0,[-10 0 -10],[10 0 30]);
|
|
|
|
|
|
|
|
% remove old simulation results (if exist)
|
|
|
|
rmdir('tmp','s');mkdir('tmp');
|
|
|
|
|
|
|
|
% write openEMS xml data file
|
|
|
|
WriteOpenEMS('tmp/tmp.xml',FDTD,CSX);
|
|
|
|
|
|
|
|
% view defined structure
|
|
|
|
CSXGeomPlot( 'tmp/tmp.xml' );
|
|
|
|
|
|
|
|
% run openEMS simulation
|
|
|
|
RunOpenEMS('tmp','tmp.xml','');
|
|
|
|
|
|
|
|
disp('use Paraview to visualize the FDTD result...');
|