Ports

Port (Base Class)

class openEMS.ports.Port(CSX, port_nr, start, stop, excite, **kw)

Bases: object

The port base class.

Parameters:
  • CSX – Continuous Structure

  • port_nr – int – port number

  • R – float – port reference impedance, e.g. 50 (Ohms)

  • stop (start,) – (3,) array – Start/Stop box coordinates

  • p_dir – int – port direction

  • excite – float – port excitation amplitude

  • priority – int – priority of all contained primtives

  • PortNamePrefix – str – a prefix for all ports-names

  • delay – float – a positive delay value to e.g. emulate a phase shift

Lumped Port

class openEMS.ports.LumpedPort(CSX, port_nr, R, start, stop, exc_dir, excite=0, **kw)

Bases: Port

The lumped port.

See also

Port

MSL Port

class openEMS.ports.MSLPort(CSX, port_nr, metal_prop, start, stop, prop_dir, exc_dir, excite=0, **kw)

Bases: Port

The microstrip transmission line port.

Parameters:

prop_dir – int/str – direction of propagation

See also

Port

Waveguide Port

class openEMS.ports.WaveguidePort(CSX, port_nr, start, stop, exc_dir, E_WG_func, H_WG_func, kc, excite=0, excite_type=0, E_WG_file=None, H_WG_file=None, local_origin=None, **kw)

Bases: Port

Base class for any waveguide port.

The mode shape can be supplied either as analytic expressions (E_WG_func / H_WG_func) or as an HDF5 mode file (E_WG_file / H_WG_file). Exactly one of the two sources must be provided.

Parameters:
exc_dirint or str

Propagation direction of the waveguide (0/’x’, 1/’y’, 2/’z’).

E_WG_funclist of str or None

Electric field mode profile as a list of three fparser expressions, one per Cartesian component. Use None when supplying a mode file.

H_WG_funclist of str or None

Magnetic field mode profile as a list of three fparser expressions. Use None when supplying a mode file.

kcfloat

Cut-off wavenumber of the mode in drawing units (e.g. pi/a for TE10). Used by CalcPort() to compute the propagation constant beta and the analytic waveguide impedance.

E_WG_filestr or None

Path to an HDF5 file containing the electric field mode profile. Required when E_WG_func / H_WG_func are None.

H_WG_filestr or None

Path to an HDF5 file containing the magnetic field mode profile. Required when E_WG_func / H_WG_func are None.

local_originarray-like, ‘corner’, ‘center’, or None

Coordinate origin used when evaluating mode functions or looking up mode file data. Coordinates are shifted by this amount before being passed to the mode profile, so the profile can be defined relative to a local origin rather than the global one. Shorthands: 'corner' resolves to min(start, stop) per axis; 'center' resolves to the midpoint. Default None means no shift (global coordinates are used as-is).

See also

Port, RectWGPort

Rect Waveguide Port

class openEMS.ports.RectWGPort(CSX, port_nr, start, stop, exc_dir, a, b, mode_name, excite=0, local_origin='corner', **kw)

Bases: WaveguidePort

Rectangular waveguide port with automatic TE mode profile generation.

Constructs the analytic TE_mn mode functions (Pozar, Microwave Engineering) and forwards them to WaveguidePort. Only TE modes are currently supported.

Parameters:
afloat

Waveguide width in metres (dimension along the first transverse axis).

bfloat

Waveguide height in metres (dimension along the second transverse axis).

mode_namestr

Four-character mode string, e.g. 'TE10' or 'TE11'.

local_originarray-like, ‘corner’, ‘center’, or None

Defaults to 'corner' so that the generated mode functions, which are defined relative to the lower-left corner of the port, are evaluated correctly regardless of where the port is placed in the mesh. See WaveguidePort for the full description.

See also

Port, WaveguidePort

Circular Waveguide Port

class openEMS.ports.CircWGPort(CSX, port_nr, start, stop, exc_dir, radius, mode_name, pol_ang=0, excite=0, local_origin='center', **kw)

Bases: WaveguidePort

Circular waveguide port with analytic TE mode profile.

Generates Bessel-function mode functions (Pozar 3rd ed.) and forwards them to WaveguidePort. Only TE modes with the listed (n, m) indices are supported. The fparser variables rho and a describe cylindrical coordinates in the xy-plane, so the propagation axis must be z (exc_dir=2) for the mode functions to be evaluated correctly in Cartesian meshes.

Parameters:
exc_dirint or str

Propagation direction: 0/’x’, 1/’y’, or 2/’z’. The mode functions are expressed in the two transverse Cartesian coordinates, so all three directions are supported.

radiusfloat

Waveguide radius in metres.

mode_namestr

Four-character TE mode string, e.g. 'TE11' or 'TE21'.

pol_angfloat, optional

Polarisation angle in radians (0 = horizontal, pi/2 = vertical).

local_originarray-like, ‘corner’, or ‘center’, optional

Forwarded to WaveguidePort. Defaults to 'center' so that the mode functions are evaluated relative to the port midpoint.

Notes

Supported modes and their Bessel zeros p’_nm (zeros of J_n’):

TE01 3.832 TE11 1.841 TE21 3.054 TE02 7.016 TE12 5.331 TE22 6.706 TE03 10.174 TE13 8.536 TE23 9.970

For each propagation direction the two transverse Cartesian coordinates (u, v) are determined by ny_P = (exc_ny+1)%3 and ny_PP = (exc_ny+2)%3. The transverse radius and angle are then rho_t = sqrt(u²+v²) and a_t = atan2(v, u), which replace the xy-plane built-ins rho and a used in earlier versions.

Coaxial Port

class openEMS.ports.CoaxialPort(CSX, port_nr, pec_prop, mat_prop, start, stop, prop_dir, r_i, r_o, r_os, excite_amp=0, **kw)

Bases: Port

Coaxial transmission line port.

Creates the coaxial geometry (inner conductor, outer shell, optional dielectric fill), voltage/current probes for the differential TL method, and an optional weighted radial-field excitation.

Parameters:
pec_propCSProperties

Metal property for the inner conductor and outer shell.

mat_propCSProperties or None

Dielectric property for the filling between the conductors. Pass None for an air-filled coaxial line.

prop_dirint or str

Direction of wave propagation (0/1/2 or ‘x’/’y’/’z’).

r_ifloat

Inner conductor radius in drawing units.

r_ofloat

Outer conductor inner radius in drawing units.

r_osfloat

Outer conductor outer radius in drawing units.

excite_ampfloat, optional

Excitation amplitude of the transverse E-field profile. Set to 0 (default) for a passive port.

FeedShiftfloat, optional

Distance in drawing units to shift the excitation from start.

Feed_Rfloat, optional

Lumped port resistance. Default is numpy.inf (open). Only 0 (short/metal termination) and inf (open) are currently supported.

MeasPlaneShiftfloat, optional

Distance in drawing units from start to the measurement plane. Default is the midpoint of the port.

See also

Port, MSLPort

Stripline Port

class openEMS.ports.StripLinePort(CSX, port_nr, metal_prop, start, stop, prop_dir, exc_dir, height, excite=0, **kw)

Bases: Port

Stripline transmission line port.

Creates the stripline metal, symmetric voltage probes (above and below the strip toward the upper and lower ground planes), current probes spanning the full strip width, and an optional symmetric excitation.

Parameters:
metal_propCSProperties

Metal property for the stripline conductor.

prop_dirint or str

Direction of wave propagation (0/1/2 or ‘x’/’y’/’z’).

exc_dirint or str or (3,) array

E-field direction (must have exactly one non-zero component).

heightfloat

Distance from the strip to each ground plane, in drawing units.

excitebool or float, optional

Set to True (or non-zero) to enable the port excitation.

FeedShiftfloat, optional

Excitation shift from start in drawing units.

Feed_Rfloat, optional

Lumped resistance in Ohms. Default inf (open).

MeasPlaneShiftfloat, optional

Measurement plane distance from start in drawing units.

See also

Port, MSLPort, CPWPort

Coplanar Waveguide Port

class openEMS.ports.CPWPort(CSX, port_nr, metal_prop, start, stop, prop_dir, exc_dir, gap_width, excite=0, **kw)

Bases: Port

Coplanar waveguide (CPW) port.

Creates the CPW metal, gap-spanning voltage probes (left and right gaps), current probes, and an optional symmetric excitation across the two gaps.

Parameters:
metal_propCSProperties

Metal property for the CPW conductor.

prop_dirint or str

Direction of wave propagation (0/1/2 or ‘x’/’y’/’z’).

exc_dirint or str or (3,) array

E-field direction across the gaps (one non-zero component).

gap_widthfloat

Width of each CPW gap in drawing units.

excitebool or float, optional

Enable port excitation.

FeedShiftfloat, optional

Excitation shift from start.

Feed_Rfloat, optional

Lumped resistance in Ohms (applied to each gap as 2*R).

MeasPlaneShiftfloat, optional

Measurement plane distance from start.

Curve Port

class openEMS.ports.CurvePort(CSX, port_nr, R, start, stop, excite=0, **kw)

Bases: Port

One-dimensional curve-based lumped port.

Creates a single-cell lumped port aligned with the nearest mesh edge. When start and stop span more than one mesh cell, PEC curves are added to connect the user coordinates to the one-cell port location at the midpoint.

Parameters:
Rfloat

Port reference impedance in Ohms.

excitebool or float, optional

Enable port excitation.

See also

Port, LumpedPort