Ports
AddLumpedPort
- AddLumpedPort(CSX, prio, portnr, R, start, stop, dir, excite, varargin)
Full definition:
[CSX, port] = AddLumpedPort( CSX, prio, portnr, R, start, stop, dir, excite, varargin )
Add a lumped port as an excitation.
A lumped port consists of an excitation, a lumped resistor, a voltage and current probe.
CSX: CSX-object created by InitCSX()
prio: priority for substrate and probe boxes
portnr: (integer) number of the port
R: internal resistance of the port (lumped element)
start: 3D start rowvector for port definition
stop: 3D end rowvector for port definition
dir: direction/amplitude of port (e.g.: [1 0 0], [0 1 0] or [0 0 1])
excite (optional): if true, the port will be switched on (see AddExcitation()) Note: for legacy support a string will be accepted
V_Probe_Weight: additional weight for the voltage probes
I_Probe_Weight: additional weight for the current probes
optional (key/values):
‘PortNamePrefix’: an prefix to the port name
varargin (optional): additional excitations options, see also AddExcitation
example:
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 impedance
Sebastian Held sebastian.held@gmx.de Jun 1 2010 Thorsten Liebig Jul 13 2011
See also InitCSX AddExcitation
AddCurvePort
- AddCurvePort(CSX, prio, portnr, R, start, stop[, excite, varargin])
Full definition:
[CSX,port] = AddCurvePort( CSX, prio, portnr, R, start, stop [, excite, varargin] )
Creates a curve port (1-dimensional). The mesh must already be initialized.
input:
CSX: CSX-object created by InitCSX()
prio: priority for excitation, metal, sheet and probe boxes
portnr: (integer) number of the port
R: internal resistance of the port
start: 3D start rowvector for port definition
stop: 3D end rowvector for port definition
excite (optional): if true, the port will be switched on (see AddExcitation()) Note: for legacy support a string will be accepted optional (key/values): varargin: optional additional excitations options, see also AddExcitation ‘PortNamePrefix’: a prefix to the port name
output:
CSX:
port:
example:
start = [0 0 0]; stop = [0 0 12];
this defines a lumped port in z-direction the excitation/probe is placed between start(1) and stop(1)
(C) 2010 Sebastian Held sebastian.held@uni-due.de See also InitCSX AddExcitation
AddMSLPort
- AddMSLPort(CSX, prio, portnr, materialname, start, stop, dir, evec, varargin)
Full definition:
[CSX,port] = AddMSLPort( CSX, prio, portnr, materialname, start, stop, dir, evec, varargin )
CSX: CSX-object created by InitCSX()
prio: priority for excitation and probe boxes
portnr: (integer) number of the port
materialname: property for the MSL (created by AddMetal())
start: 3D start rowvector for port definition
stop: 3D end rowvector for port definition
dir: direction of wave propagation (choices: 0, 1, 2 or ‘x’,’y’,’z’)
evec: excitation vector, which defines the direction of the e-field (must be the same as used in AddExcitation())
variable input:
varargin: optional additional excitations options, see also AddExcitation
‘ExcitePort’ true/false to make the port an active feeding port (default is false)
‘FeedShift’ shift to port from start by a given distance in drawing units. Default is 0. Only active if ‘ExcitePort’ is set!
‘Feed_R’ Specify a lumped port resistance. Default is no lumped port resistance –> port has to end in an ABC.
‘MeasPlaneShift’ Shift the measurement plane from start t a given distance in drawing units. Default is the middle of start/stop.
‘PortNamePrefix’ a prefix to the port name
Important: The mesh has to be already set and defined by DefineRectGrid!
example:
CSX = AddMetal( CSX, 'metal' ); %create a PEC called 'metal'
start = [0 -width/2 height];
stop = [length +width/2 0 ];
[CSX,port] = AddMSLPort( CSX, 0, 1, 'metal', start, stop, 'x', [0 0 -1], ...
'ExcitePort', true, 'Feed_R', 50 )
Explanation:
this defines a MSL in x-direction (dir=’x’) –> the wave travels along the x-direction
with an e-field excitation in -z-direction (evec=[0 0 -1])
the excitation is active and placed at x=start(1) (‘ExcitePort’, true)
a 50 Ohm lumped port resistance is placed at x=start(1) (‘Feed_R’, 50)
the width-direction is determined by the cross product of the direction of propagation (dir=’x’) and the excitation vector (evec=[0 0 -1]), in this case it is the y-direction
the MSL-metal is created in a xy-plane at a height at z=start(3) –> It is important to define the MSL height in the start coordinate!
the ground (xy-plane, not defined by the port) is assumed at z=stop(3) –> The reference plane (ground) is defined in the stop coordinate!
Sebastian Held sebastian.held@gmx.de May 13 2010 Thorsten Liebig thorsten.liebig@gmx.de (c) 2011-2013
See also InitCSX DefineRectGrid AddMetal AddMaterial AddExcitation calcPort
AddStripLinePort
- AddStripLinePort(CSX, prio, portnr, materialname, start, stop, height, dir, evec, varargin)
Full definition:
[CSX,port] = AddStripLinePort( CSX, prio, portnr, materialname, start, stop, height, dir, evec, varargin )
CSX: CSX-object created by InitCSX()
prio: priority for excitation and probe boxes
portnr: (integer) number of the port
materialname: property for the stripline (created by AddMetal())
start: 3D start rowvector for port definition
stop: 3D end rowvector for port definition
height: height of the stripline (top and bottom)
dir: direction of wave propagation (choices: 0, 1, 2 or ‘x’,’y’,’z’)
evec: excitation vector, which defines the direction of the e-field (must be the same as used in AddExcitation())
variable input:
varargin: optional additional excitations options, see also AddExcitation
‘ExcitePort’ true/false to make the port an active feeding port (default is false)
‘FeedShift’ shift to port from start by a given distance in drawing units. Default is 0. Only active if ‘ExcitePort’ is set!
‘Feed_R’ Specify a lumped port resistance. Default is no lumped port resistance –> port has to end in an ABC.
‘MeasPlaneShift’ Shift the measurement plane from start t a given distance in drawing units. Default is the middle of start/stop.
‘PortNamePrefix’ a prefix to the port name
Important: The mesh has to be already set and defined by DefineRectGrid!
example:
CSX = AddMetal( CSX, 'metal' ); %create a PEC called 'metal'
start = [0 -width/2 0];
stop = [length +width/2 0];
[CSX,port] = AddStripLinePort( CSX, 0, 1, 'metal', start, stop, height, 'x', ...
[0 0 -1], 'ExcitePort', true, 'Feed_R', 50 )
Explanation:
this defines a stripline in x-direction (dir=’x’) –> the wave travels along the x-direction
with an e-field excitation in -z-direction (evec=[0 0 -1])
the excitation is active and placed at x=start(1) (‘ExcitePort’, true)
a 50 Ohm lumped port resistance is placed at x=start(1) (‘Feed_R’, 50)
the width-direction is determined by the cross product of the direction of propagtion (dir=’x’) and the excitation vector (evec=[0 0 -1]), in this case it is the y-direction
the stripline-metal is created in a xy-plane at a height at z=start(3) –> The upper and lower reference plane (ground) must be defined by the user
Thorsten Liebig thorsten.liebig@gmx.de (c) 2013
See also InitCSX DefineRectGrid AddMetal AddMaterial AddExcitation calcPort
AddCPWPort
- AddCPWPort(CSX, prio, portnr, materialname, start, stop, gap_width, dir, evec, varargin)
Full definition:
[CSX,port] = AddCPWPort( CSX, prio, portnr, materialname, start, stop, gap_width, dir, evec, varargin )
CSX: CSX-object created by InitCSX()
prio: priority for excitation and probe boxes
portnr: (integer) number of the port
materialname: property for the CPW (created by AddMetal())
start: 3D start rowvector for port definition
stop: 3D end rowvector for port definition
gap_width: width of the CPW gap (left and right)
dir: direction of wave propagation (choices: 0, 1, 2 or ‘x’,’y’,’z’)
evec: excitation vector, which defines the direction of the e-field (must be the same as used in AddExcitation())
variable input:
varargin: optional additional excitations options, see also AddExcitation
‘ExcitePort’ true/false to make the port an active feeding port (default is false)
‘FeedShift’ shift to port from start by a given distance in drawing units. Default is 0. Only active if ‘ExcitePort’ is set!
‘Feed_R’ Specify a lumped port resistance. Default is no lumped port resistance –> port has to end in an ABC.
‘MeasPlaneShift’ Shift the measurement plane from start t a given distance in drawing units. Default is the middle of start/stop.
‘PortNamePrefix’ a prefix to the port name
Important: The mesh has to be already set and defined by DefineRectGrid!
example:
CSX = AddMetal( CSX, 'metal' ); %create a PEC called 'metal'
start = [0 -width/2 0];
stop = [length +width/2 0];
[CSX,port] = AddCPWPort( CSX, 0, 1, 'metal', start, stop, gap_width, 'x', ...
[0 0 -1], 'ExcitePort', true, 'Feed_R', 50 )
Explanation:
this defines a stripline in x-direction (dir=’x’) –> the wave travels along the x-direction
with an e-field excitation in -z-direction (evec=[0 0 -1])
the excitation is active and placed at x=start(1) (‘ExcitePort’, true)
a 50 Ohm lumped port resistance is placed at x=start(1) (‘Feed_R’, 50)
the width-direction is determined by the cross product of the direction of propagtion (dir=’x’) and the excitation vector (evec=[0 0 -1]), in this case it is the y-direction
the stripline-metal is created in a xy-plane at a height at z=start(3) –> The upper and lower reference plane (ground) must be defined by the user
Thorsten Liebig thorsten.liebig@gmx.de (c) 2014
See also InitCSX DefineRectGrid AddMetal AddMaterial AddExcitation calcPort
AddCoaxialPort
- AddCoaxialPort(CSX, prio, portnr, pec_name, materialname, start, stop, dir, r_i, r_o, r_os, varargin)
Full definition:
function [CSX,port] = AddCoaxialPort( CSX, prio, portnr, pec_name, materialname, start, stop, dir, r_i, r_o, r_os, varargin )
CSX: CSX-object created by InitCSX()
prio: priority for excitation and probe boxes
portnr: (integer) number of the port
pec_name: metal property for coaxial inner/outer conductor (created by AddMetal())
materialname: substrate property for coaxial line (created by AddMaterial()) Note: this may be empty for an “air filled” coaxial line
start: 3D start rowvector for coaxial cable axis
stop: 3D end rowvector for coaxial cable axis
dir: direction of wave propagation (choices: 0, 1, 2 or ‘x’,’y’,’z’)
r_i: inner coaxial radius (in drawing unit)
r_o: outer coaxial radius (in drawing unit)
r_os: outer shell coaxial radius (in drawing unit)
variable input:
varargin: optional additional excitations options, see also AddExcitation
‘ExciteAmp’ excitation amplitude of transversal electric field profile, set to 0 (default) for a passive port
‘FeedShift’ shift to port from start by a given distance in drawing units. Default is 0. Only active if ‘ExciteAmp’ is set!
‘Feed_R’ Specify a lumped port resistance. Default is no lumped port resistance –> port has to end in an ABC.
‘MeasPlaneShift’ Shift the measurement plane from start t a given distance in drawing units. Default is the middle of start/stop.
‘PortNamePrefix’ a prefix to the port name
the mesh must be already initialized
example:
Thorsten Liebig thorsten.liebig@gmx.de (c) 2013
See also InitCSX AddMetal AddMaterial AddExcitation calcPort
AddWaveGuidePort
- AddWaveGuidePort(CSX, prio, portnr, start, stop, dir, E_WG_func, H_WG_func, kc, exc_amp, varargin)
Full definition:
function [CSX,port] = AddWaveGuidePort( CSX, prio, portnr, start, stop, dir, E_WG_func, H_WG_func, kc, exc_amp, varargin )
Create a waveguide port, including an optional excitation and probes
Note: - The excitation will be located at the start position in the given direction - The voltage and current probes at the stop position in the given direction - Only TE modes are currently supported in MATLAB/Octave
parameter:
CSX: complete CSX structure (must contain a mesh)
prio: priority of primitives
start: start coordinates of waveguide port box
stop: stop coordinates of waveguide port box
dir: direction of port (0/1/2 or ‘x’/’y’/’z’-direction)
E_WG_func: electric field mode profile function as a string
H_WG_func: magnetic field mode profile function as a string
kc: cutoff wavenumber (defined by the waveguide dimensions)
exc_amp: excitation amplitude (set 0 to be passive)
optional (key/values):
varargin: optional additional excitations options, see also AddExcitation
‘PortNamePrefix’: a prefix to the port name
‘E_WG_file’: Name (and path) of the E-field mode file
‘H_WG_file’: Name (and path) of the H-field mode file
‘local_origin’: Local coordinate origin for mode/function evaluation, as a Cartesian point for any mesh type. Either a 3-element vector [x,y,z], ‘corner’ (min of start/stop per axis) or ‘center’ (midpoint). Default: no shift (global coordinates are passed unchanged). The ‘corner’/’center’ shorthands derive from start/stop and are Cartesian-mesh only; on a cylindrical mesh give an explicit vector ([0 0 z] keeps the mode centered on the mesh axis).
output:
CSX: modified CSX structure
port: port structure to use with calcPort
example:
% create a TE11 circular waveguide mode, using cylindircal coordinates
p11 = 1.841;
kc = p11 / radius; % cutoff wavenumber with radius in meter
kc_draw = kc*unit; % cutoff wavenumber in drawing units
% electric field mode profile
func_E{1} = [ num2str(-1/kc_draw^2,15) '/rho*cos(a)*j1(' num2str(kc_draw,15) '*rho)'];
func_E{2} = [ num2str(1/kc_draw,15) '*sin(a)*0.5*(j0(' num2str(kc_draw,15) '*rho)-jn(2,' num2str(kc_draw,15) '*rho))'];
func_E{3} = 0;
% magnetic field mode profile
func_H{1} = [ '-1*' num2str(1/kc_draw,15) '*sin(a)*0.5*(j0(' num2str(kc_draw,15) '*rho)-jn(2,' num2str(kc_draw,15) '*rho))'];
func_H{2} = [ num2str(-1/kc_draw^2,15) '/rho*cos(a)*j1(' num2str(kc_draw,15) '*rho)'];
func_H{3} = 0;
start=[mesh.r(1) mesh.a(1) 0 ];
stop =[mesh.r(end) mesh.a(end) 100];
[CSX, port{1}] = AddWaveGuidePort(CSX, 0, 1, start, stop, 2, func_E, func_H, kc, 1);
(c) 2013 Thorsten Liebig (thorsten.liebig@gmx.de) (c) 2023-2025 Gadi Lahav (gadi@rfwithcare.com)
See also InitCSX, AddExcitation, calcWGPort, calcPort
AddRectWaveGuidePort
- AddRectWaveGuidePort(CSX, prio, portnr, start, stop, dir, a, b, mode_name, exc_amp, varargin)
Full definition:
function [CSX,port] = AddRectWaveGuidePort( CSX, prio, portnr, start, stop, dir, a, b, mode_name, exc_amp, varargin )
Create a rectangular waveguide port, including an optional excitation and probes
Note: - The excitation will be located at the start position in the given direction - The voltage and current probes at the stop position in the given direction
input:
CSX: complete CSX structure (must contain a mesh)
prio: priority of primitives
start: start coordinates of waveguide port box
stop: stop coordinates of waveguide port box
dir: direction of port (0/1/2 or ‘x’/’y’/’z’-direction)
a,b: rectangular waveguide width and height (in meter)
mode_name: mode name, e.g. ‘TE11’ or ‘TM21’
exc_amp: excitation amplitude (set 0 to be passive)
optional (key/values):
varargin: optional additional excitations options, see also AddExcitation
‘PortNamePrefix’: a prefix to the port name
‘local_origin’: origin for mode function evaluation (default: ‘corner’, i.e. the per-axis minimum of start/stop). Override only if the waveguide cross-section does not start at x=0, y=0 in the transverse plane and the default corner is wrong.
output:
CSX: modified CSX structure
port: port structure to use with calcPort
example:
% create a TE10 circular waveguide mode, using cylindircal coordinates
start=[mesh.r(1) mesh.a(1) 0 ];
stop =[mesh.r(end) mesh.a(end) 100];
[CSX,port] = AddCircWaveGuidePort( CSX, 99, 1, start, stop, 320e-3, 'TE11', 0, 1);
(c) 2013 Thorsten Liebig (thorsten.liebig@gmx.de)
See also InitCSX, AddExcitation, calcWGPort, calcPort
AddCircWaveGuidePort
- AddCircWaveGuidePort(CSX, prio, portnr, start, stop, radius, mode_name, pol_ang, exc_amp, varargin)
Full definition:
function [CSX,port] = AddCircWaveGuidePort( CSX, prio, portnr, start, stop, radius, mode_name, pol_ang, exc_amp, varargin )
Create a circular waveguide port, including an optional excitation and probes
Note:
The excitation will be located at the start position in the given direction
The voltage and current probes at the stop position in the given direction
input:
CSX: complete CSX structure (must contain a mesh)
prio: priority of primitives
start: start coordinates of waveguide port box
stop: stop coordinates of waveguide port box
radius: circular waveguide radius (in meter)
mode_name: mode name, e.g. ‘TE11’ or ‘TM21’
pol_ang: polarization angle (e.g. 0 = horizontal, pi/2 = vertical)
exc_amp: excitation amplitude (set 0 to be passive)
optional (key/values):
varargin: optional additional excitations options, see also AddExcitation
‘PortNamePrefix’: a prefix to the port name
‘local_origin’: origin for mode function evaluation. On a Cartesian mesh this defaults to ‘center’ (midpoint of start/stop), so that rho/a are measured from the waveguide axis. On a cylindrical mesh rho/a are the mesh coordinates already and no shift is applied (nor should one be given).
output:
CSX: modified CSX structure
port: port structure to use with calcPort
example:
% create a TE11 circular waveguide mode, using cylindircal coordinates
start=[mesh.r(1) mesh.a(1) 0 ];
stop =[mesh.r(end) mesh.a(end) 100];
[CSX,port] = AddCircWaveGuidePort( CSX, 99, 1, start, stop, 320e-3, 'TE11', 0, 1);
(c) 2013 Thorsten Liebig (thorsten.liebig@gmx.de)
See also InitCSX, AddExcitation, calcWGPort, calcPort
AddMRStub
- AddMRStub(CSX, materialname, prio, MSL_width, len, alpha, resolution, orientation, normVector, position)
Full definition:
CSX = AddMRStub( CSX, materialname, prio, MSL_width, len, alpha, resolution, orientation, normVector, position )
Microstrip Radial Stub
CSX: CSX-object created by InitCSX()
materialname: property for the MSL (created by AddMetal() or AddMaterial())
prio: priority
MSL_width: width of the MSL to connect the stub to
len: length of the radial stub
alpha: angle subtended by the radial stub (degrees)
resolution: discrete angle spacing (degrees)
orientation: angle of main direction of the radial stub (degrees)
normVector: normal vector of the stub
position: position of the end of the MSL
This radial stub definition is equivalent to the one Agilent ADS uses.
example:
CSX = AddMRStub( CSX, 'PEC', 10, 1000, 5900, 30, 1, -90, [0 0 1], [0 -10000 254] );
Sebastian Held sebastian.held@gmx.de Jun 1 2010
See also InitCSX AddMetal AddMaterial