From 081038db62122f3dfdaef7018e018bd26e54bb89 Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Wed, 23 Jan 2013 09:11:36 +0100 Subject: [PATCH] matlab doc updates Signed-off-by: Thorsten Liebig --- matlab/AddLumpedPort.m | 10 +++++----- matlab/AddPML.m | 24 ++++++++++++++++++------ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/matlab/AddLumpedPort.m b/matlab/AddLumpedPort.m index 8f09b50..1e81342 100644 --- a/matlab/AddLumpedPort.m +++ b/matlab/AddLumpedPort.m @@ -1,7 +1,7 @@ function [CSX, port] = AddLumpedPort( CSX, prio, portnr, R, start, stop, dir, excite, varargin ) % [CSX, port] = AddLumpedPort( CSX, prio, portnr, R, start, stop, dir, excite, varargin ) % -% Add a 3D lumped port as an excitation. +% Add a lumped port as an excitation. % % A lumped port consists of an excitation, a lumped resistor, a voltage and % current probe. @@ -18,10 +18,10 @@ function [CSX, port] = AddLumpedPort( CSX, prio, portnr, R, start, stop, dir, ex % varargin (optional): additional excitations options, see also AddExcitation % % example: -% start = [-0.1 -width/2 0]; -% stop = [ 0.1 width/2 height]; -% [CSX] = AddLumpedPort(CSX, 5 ,1 , 50, start, stop, [0 0 1], 'excite'); -% this defines a lumped port in z-direction with a 50 Ohm port impedence +% start = [0 -width/2 0]; +% stop = [0 width/2 height]; +% [CSX] = AddLumpedPort(CSX, 5 ,1 , 50, start, stop, [0 0 1], true); +% %this defines an active lumped port in z-direction with a 50 Ohm port impedence % % openEMS matlab interface % ----------------------- diff --git a/matlab/AddPML.m b/matlab/AddPML.m index 251417c..4e7ba80 100644 --- a/matlab/AddPML.m +++ b/matlab/AddPML.m @@ -1,5 +1,5 @@ function mesh = AddPML( mesh, numcells, CoordSystem ) -%mesh = AddPML( mesh, numcells, ) +% mesh = AddPML( mesh, numcells, ) % % Adds equidistant cells to the specified directions of the simulation % area. This is used to put a PML (perfectly matched layer) absorber there. @@ -10,19 +10,31 @@ function mesh = AddPML( mesh, numcells, CoordSystem ) % % input: % mesh: mesh structure -% .x: 1xn vector (lines in x direction) -% .y: 1xn vector (lines in y direction) -% .z: 1xn vector (lines in z direction) % numcells: 1x6 vector (xmin,xmax,ymin,ymax,zmin,zmax) with number of % cells to add to this direction +% CoordSystem (optional): set to 1 in case of cylindrical mesh using +% mesh.r, mesh.a and mesh.z % % output: -% mesh: new mesh +% mesh: new mesh with the added lines +% +% example: +% % some fixed mesh lines +% mesh.x = [-100 0 100]; +% mesh.y = [-100 0 100]; +% mesh.z = [0 500]; +% mesh = DetectEdges(CSX, mesh); %detect edges +% mesh = SmoothMesh(mesh, c0/fmax/20/unit); % smooth the mesh +% +% mesh = AddPML(mesh, 8); % add 8 lines to all directions +% % or +% mesh = AddPML(mesh, [0 0 0 0 8 8]); % add 8 lines in both z-directions +% +% See also DefineRectGrid, SmoothMesh, DetectEdges % % openEMS matlab interface % ----------------------- % Sebastian Held -% See also DefineRectGrid % check error( nargchk(2,3,nargin) );