mwavepy.transmissionLine.genericTEM
index
/home/alex/docs/python/path/mwavepy/transmissionLine/genericTEM.py

general class for TEM transmission lines

 
Modules
       
mwavepy.mathFunctions
numpy

 
Classes
       
__builtin__.object
GenericTEM

 
class GenericTEM(__builtin__.object)
    == Intro ==
This is a general super-class for TEM transmission lines. The 
structure behind the methods dependencies is a result of  
physics. a brief summary is given below. 
 
== Class Structure ==
This class can support two models for TEM transmission lines:
        1)simple media: in which the distributed circuit quantities are 
                NOT functions of frequency,
        2)not-simple media:  in which the distributed circuit quantities
                ART functions of frequency
 
1) The simple media can be constructed with scalar values for the 
distributed circuit quantities. then all methods for transmission
line properties( Z0, gamma) will take frequency as an argument. 
 
2) The not-simple media must be constructed with array's for 
distributed circuit quanties and a frequency array. alternativly, 
you can construct this type of tline from propagation constant,  
characterisitc impedance, and frequency information, through use of
the class method; from_gamma_Z0().
 
== Physics ==
A TEM transmission line can be described by a characterisitc 
impedance and propagation constant, or by distributed impedance and 
admittance. This description will be in terms of distributed 
circuit quantities, given:
 
        distributed Capacitance, C
        distributed Inductance, I
        distributed Resistance, R
        distributed Conductance, G
        
from these the following quantities may be calculated, which
are functions of angular frequency (w):
 
        distributed Impedance,  Z(w) = wR + jwI
        distributed Admittance, Y'(w) = wG + jwC
 
from these we can calculate properties which define their wave 
behavior:
        
        characteristic Impedance, Z0(w) = sqrt(Z(w)/Y'(w))              [ohms]
        propagation Constant,   gamma(w) = sqrt(Z(w)*Y'(w))     [none]
        
given the following definitions, the components of propagation 
constant are interpreted as follows:
        
        positive real(gamma) = attenuation
        positive imag(gamma) = forward propagation 
 
this sign convention means that the transmission gain through a
distance, d, is given by, 
        
        S21 = exp(-gamma*d)
        
and then finally these all produce methods which we use 
        
        electrical Length (theta) 
        input Impedance
        relfection Coefficient
 
  Methods defined here:
Y(self, f=None)
distributed Admittance, Y'(w) = wG + jwC
 
takes:
        f: frequency [Hz]. if None, will use self.f if exists
        
returns:
        Y: distributed admittance in ohms^-1 /m
Z(self, f=None)
distributed Impedance,  Z(w) = wR + jwI
 
takes:
        f: frequency in Hz. if None, will use self.f if exists
 
returns:
        Z: distributed impedance in ohms/m.
Z0(self, f=None)
The  characteristic impedance at a given angular frequency.
        Z0(w) = sqrt(Z(w)/Y'(w))
 
takes:
        f:  frequency
 
returns:
        Z0: characteristic impedance  in ohms
__init__(self, C, I, R, G, f=None)
TEM transmission line constructor.
 
takes:
        C: distributed_capacitance [real float]
        I: distributed_inductance [real float]
        R: distributed_resistance [real float]
        G: distributed_conductance [real float]
        
 
notes:
        can be constructed from propagation constant, and 
characteristic impedance as well, through the class method; 
from_gamma_Z0, like so,
        my_tline = GenericTEM.from_gamma_Z0(....)
note that this requires frequency information.
 
        see class help for details on the class structure.
electrical_length(self, f, d, deg=False)
convenience function for this class. the real function for this 
is defined in transmissionLine.functions, under the same name.
gamma(self, f=None)
the propagation constant 
        gamma(w) = sqrt(Z(w)*Y'(w))
 
takes:
        f: frequency [Hz]
        
returns:
        gamma: possibly complex propagation constant, [rad/m]

Class methods defined here:
from_gamma_Z0(cls, gamma, Z0, f) from __builtin__.type

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
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]])
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')])

 
Data
        INF = 1e+99
ONE = 1.00000000000001
c = 299792458.0
cos = <ufunc 'cos'>
epsilon_0 = 8.854187817620389e-12
exp = <ufunc 'exp'>
inf = inf
log = <ufunc 'log'>
mil = 2.5399999999999997e-05
mu_0 = 1.2566370614359173e-06
pi = 3.141592653589793
sin = <ufunc 'sin'>
sqrt = <ufunc 'sqrt'>
tan = <ufunc 'tan'>