mwavepy.tlineFunctions | index /home/alex/docs/python/path/mwavepy/tlineFunctions.py

`transmission line theory related functions`

Modules
`` |  |
mwavepy.mathFunctions | numpy |  |

Functions
`` |  | Gamma0_2_Gamma_in = reflection_coefficient_at_theta(Gamma0, theta) `reflection coefficient at electrical length theta takes: Gamma0: reflection coefficient at theta=0 theta: electrical length, (may be complex) returns: Gamma_in note: = Gamma0 * exp(-2j* theta)` Gamma0_2_zin = reflection_coefficient_2_input_impedance_at_theta(z0, Gamma0, theta) `calculates the input impedance at electrical length theta, given a reflection coefficient and characterisitc impedance of the medium takes: z0 - characteristic impedance. Gamma: reflection coefficient theta: electrical length of the line, (may be complex) returns zin: input impedance at theta` Gamma0_2_zl = reflection_coefficient_2_input_impedance(z0, Gamma) `calculates the input impedance given a reflection coefficient and characterisitc impedance of the medium takes: Gamma: reflection coefficient z0 - characteristic impedance.` array(...) `array(object, dtype=None, copy=True, order=None, subok=False, ndmin=0) Create an array. Parameters ---------- object : array_like An array, any object exposing the array interface, an object whose __array__ method returns an array, or any (nested) sequence. dtype : data-type, optional The desired data-type for the array. If not given, then the type will be determined as the minimum type required to hold the objects in the sequence. This argument can only be used to 'upcast' the array. For downcasting, use the .astype(t) method. copy : bool, optional If true (default), then the object is copied. Otherwise, a copy will only be made if __array__ returns a copy, if obj is a nested sequence, or if a copy is needed to satisfy any of the other requirements (`dtype`, `order`, etc.). order : {'C', 'F', 'A'}, optional Specify the order of the array. If order is 'C' (default), then the array will be in C-contiguous order (last-index varies the fastest). If order is 'F', then the returned array will be in Fortran-contiguous order (first-index varies the fastest). If order is 'A', then the returned array may be in any order (either C-, Fortran-contiguous, or even discontiguous). subok : bool, optional If True, then sub-classes will be passed-through, otherwise the returned array will be forced to be a base-class array (default). ndmin : int, optional Specifies the minimum number of dimensions that the resulting array should have. Ones will be pre-pended to the shape as needed to meet this requirement. Examples -------- >>> np.array([1, 2, 3]) array([1, 2, 3]) Upcasting: >>> np.array([1, 2, 3.0]) array([ 1., 2., 3.]) More than one dimension: >>> np.array([[1, 2], [3, 4]]) array([[1, 2], [3, 4]]) Minimum dimensions 2: >>> np.array([1, 2, 3], ndmin=2) array([[1, 2, 3]]) Type provided: >>> np.array([1, 2, 3], dtype=complex) array([ 1.+0.j, 2.+0.j, 3.+0.j]) Data-type consisting of more than one element: >>> x = np.array([(1,2),(3,4)],dtype=[('a','<i4'),('b','<i4')]) >>> x['a'] array([1, 3]) Creating an array from sub-classes: >>> np.array(np.mat('1 2; 3 4')) array([[1, 2], [3, 4]]) >>> np.array(np.mat('1 2; 3 4'), subok=True) matrix([[1, 2], [3, 4]])` distance_2_electrical_length = electrical_length(gamma, f, d, deg=False) `calculates the electrical length of a section of transmission line. takes: gamma: propagation constant function [function], (a function which takes frequency in hz ) l: length of line. in meters f: frequency at which to calculate. [array-like or float]. deg: return in degrees or not. [boolean]. returns: theta: electrical length in radians or degrees, depending on value of deg.` distributed_circuit_2_propagation_impedance(distributed_admittance, distributed_impedance) `converts complex distributed impedance and admittance to propagation constant and characteristic impedance. takes: distributed_admittance: what it says [complex number or array] distributed_impedance: what it says [complex number or array] returns: propagation_constant: what it says [complex number or array] characteristic_impedance: what it says [complex number or array]` electrical_length(gamma, f, d, deg=False) `calculates the electrical length of a section of transmission line. takes: gamma: propagation constant function [function], (a function which takes frequency in hz ) l: length of line. in meters f: frequency at which to calculate. [array-like or float]. deg: return in degrees or not. [boolean]. returns: theta: electrical length in radians or degrees, depending on value of deg.` electrical_length_2_distance(theta, gamma, f0, deg=True) `convert electrical length to a physical distance. takes: theta: electrical length gamma: propagation constant function [function] f0: frequency of interest [number] deg: is theta in degrees [Boolean] returns: d: physical distance note: the gamma function must take a single variable, that is frequency and return complex propagation constant such that the propagating part is positive imag part.` input_impedance_2_reflection_coefficient(z0, zl) `calculates the reflection coefficient for a given input impedance takes: zl: input (load) impedance [number of array]. z0 - characteristic impedance[number of array]. note: input data is typecasted to 1D complex array` input_impedance_2_reflection_coefficient_at_theta(z0, zl, theta) input_impedance_at_theta(z0, zl, theta) `input impedance of load impedance zl at electrical length theta, given characteristic impedance z0. takes: z0 - characteristic impedance. zl: load impedance theta: electrical length of the line, (may be complex)` propagation_impedance_2_distributed_circuit(propagation_constant, characteristic_impedance) `converts complex propagation constant and characteristic impedance to distributed impedance and admittance. takes: propagation_constant: what it says [complex number or array] characteristic_impedance: what it says [complex number or array] returns: distributed_admittance: what it says [complex number or array] distributed_impedance: what it says [complex number or array]` reflection_coefficient_2_input_impedance(z0, Gamma) `calculates the input impedance given a reflection coefficient and characterisitc impedance of the medium takes: Gamma: reflection coefficient z0 - characteristic impedance.` reflection_coefficient_2_input_impedance_at_theta(z0, Gamma0, theta) `calculates the input impedance at electrical length theta, given a reflection coefficient and characterisitc impedance of the medium takes: z0 - characteristic impedance. Gamma: reflection coefficient theta: electrical length of the line, (may be complex) returns zin: input impedance at theta` reflection_coefficient_at_theta(Gamma0, theta) `reflection coefficient at electrical length theta takes: Gamma0: reflection coefficient at theta=0 theta: electrical length, (may be complex) returns: Gamma_in note: = Gamma0 * exp(-2j* theta)` skin_depth(f, rho, mu_r) `the skin depth for a material. see www.microwaves101.com for more info. takes: f: frequency, in Hz rho: bulk resistivity of material, in ohm*m mu_r: relative permiability of material returns: skin depth: in m` surface_resistivity(f, rho, mu_r) `surface resistivity. see www.microwaves101.com for more info. takes: f: frequency, in Hz rho: bulk resistivity of material, in ohm*m mu_r: relative permiability of material returns: surface resistivity: ohms/square` theta = electrical_length(gamma, f, d, deg=False) `calculates the electrical length of a section of transmission line. takes: gamma: propagation constant function [function], (a function which takes frequency in hz ) l: length of line. in meters f: frequency at which to calculate. [array-like or float]. deg: return in degrees or not. [boolean]. returns: theta: electrical length in radians or degrees, depending on value of deg.` zeros(...) `zeros(shape, dtype=float, order='C') Return a new array of given shape and type, filled with zeros. Parameters ---------- shape : int or sequence of ints Shape of the new array, e.g., ``(2, 3)`` or ``2``. dtype : data-type, optional The desired data-type for the array, e.g., `numpy.int8`. Default is `numpy.float64`. order : {'C', 'F'}, optional Whether to store multidimensional data in C- or Fortran-contiguous (row- or column-wise) order in memory. Returns ------- out : ndarray Array of zeros with the given shape, dtype, and order. See Also -------- zeros_like : Return an array of zeros with shape and type of input. ones_like : Return an array of ones with shape and type of input. empty_like : Return an empty array with shape and type of input. ones : Return a new array setting values to one. empty : Return a new uninitialized array. Examples -------- >>> np.zeros(5) array([ 0., 0., 0., 0., 0.]) >>> np.zeros((5,), dtype=numpy.int) array([0, 0, 0, 0, 0]) >>> np.zeros((2, 1)) array([[ 0.], [ 0.]]) >>> s = (2,2) >>> np.zeros(s) array([[ 0., 0.], [ 0., 0.]]) >>> np.zeros((2,), dtype=[('x', 'i4'), ('y', 'i4')]) # custom dtype array([(0, 0), (0, 0)], dtype=[('x', '<i4'), ('y', '<i4')])` zl_2_Gamma0 = input_impedance_2_reflection_coefficient(z0, zl) `calculates the reflection coefficient for a given input impedance takes: zl: input (load) impedance [number of array]. z0 - characteristic impedance[number of array]. note: input data is typecasted to 1D complex array` zl_2_Gamma_in = input_impedance_2_reflection_coefficient_at_theta(z0, zl, theta) zl_2_zin = input_impedance_at_theta(z0, zl, theta) `input impedance of load impedance zl at electrical length theta, given characteristic impedance z0. takes: z0 - characteristic impedance. zl: load impedance theta: electrical length of the line, (may be complex)`

Data
`` |  | INF = 1e+99 ONE = 1.00000000000001 cos = <ufunc 'cos'> exp = <ufunc 'exp'> inf = inf log = <ufunc 'log'> mu_0 = 1.2566370614359173e-06 pi = 3.141592653589793 sin = <ufunc 'sin'> sqrt = <ufunc 'sqrt'> tan = <ufunc 'tan'>