mwavepy.media.distributedCircuit
index
/home/alex/docs/python/path/mwavepy/media/distributedCircuit.py

A transmission line defined in terms of distributed circuit components

 
Modules
       
numpy

 
Classes
       
mwavepy.media.media.Media(__builtin__.object)
DistributedCircuit

 
class DistributedCircuit(mwavepy.media.media.Media)
    A TEM transmission line, defined in terms of  distributed impedance
 and admittance values. This class takes the following information,
 
        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
 
 
Method resolution order:
DistributedCircuit
mwavepy.media.media.Media
__builtin__.object

Methods defined here:
Z0(self)
The characteristic impedance in ohms
__init__(self, frequency, C, I, R, G, *args, **kwargs)
generic, distributed circuit model transmission line constructor.
 
takes:
        frequency: [mwavepy.Frequency object]
        C: distributed_capacitance [real float, or vector]
        I: distributed_inductance [real float, or vector]
        R: distributed_resistance [real float, or vector]
        G: distributed_conductance [real float, or vector]
 
returns:
        mwavepy.Media object
 
notes:
        C,I,R,G can all be vectors as long as they are the same length
        
        can be constructed from a Media instance too, see the 
        classmethod from_Media()
 
        see class help for details on the class structure.
__repr__(self)
__str__(self)
gamma(self)
possibly complex propagation constant, [rad/m]
        gamma = sqrt(Z'*Y')
 
note:
the components of propagation constant are interpreted as follows:
 
positive real(gamma) = attenuation
positive imag(gamma) = forward propagation

Class methods defined here:
from_Media(cls, my_media, *args, **kwargs) from __builtin__.type
initializer which creates  DistributedCircuit from a Media 
instance

Data descriptors defined here:
Y
distributed Admittance,in ohms^-1 /m
 
 Y'(w) = wG + jwC
Z
distributed Impedance, ohms/m.
 
 Z'(w) = wR + jwI

Methods inherited from mwavepy.media.media.Media:
capacitor(self, C, **kwargs)
A lumped capacitor
 
takes:
        C: capacitance, in Farads, [number]
 
returns:
        mwavepy.Network
delay_load(self, Gamma0, d, unit='m', **kwargs)
creates a Network for a delayed load transmission line
 
takes:
        Gamma0: reflection coefficient of load (not in dB)
        d: the length (see unit argument) [number]
        unit: string specifying the units of d. possible options are 
                'm': meters, physical length in meters (default)
                'deg':degrees, electrical length in degrees
                'rad':radians, electrical length in radians     
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network. the kwarg
                'z0' can be used to create a line of a given impedance
 
returns:
        a 1-port Network class, representing a loaded transmission
        line of length d
        
 
note: this just calls,
line(d,**kwargs) ** load(Gamma0, **kwargs)
delay_open(self, d, unit='m', **kwargs)
creates a Network for a delayed open transmission line
 
takes:
        d: the length (see unit argument) [number]
        unit: string specifying the units of d. possible options are 
                'm': meters, physical length in meters (default)
                'deg':degrees, electrical length in degrees
                'rad':radians, electrical length in radians
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network. the kwarg
                'z0' can be used to create a line of a given impedance
returns:
        a 1-port Network class, representing a shorted transmission
        line of length d
        
 
note: this just calls,
line(d,**kwargs) ** open(**kwargs)
delay_short(self, d, unit='m', **kwargs)
creates a Network for a delayed short transmission line
 
takes:
        d: the length (see unit argument) [number]
        unit: string specifying the units of d. possible options are 
                'm': meters, physical length in meters (default)
                'deg':degrees, electrical length in degrees
                'rad':radians, electrical length in radians
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network. the kwarg
                'z0' can be used to create a line of a given impedance
returns:
        a 1-port Network class, representing a shorted transmission
        line of length d
        
 
note: this just calls,
line(d,**kwargs) ** short(**kwargs)
electrical_length(self, d, deg=False)
calculates the electrical length for a given distance, at 
the center frequency. 
 
takes:
        d: distance, in meters 
        deg: is d in deg?[Boolean]
 
returns:
        theta: electrical length in radians or degrees, 
                depending on  value of deg.
guess_length_of_delay_short(self, aNtwk)
guess length of physical length of a Delay Short given by aNtwk
 
takes:
        aNtwk: a mwavepy.ntwk type . (note: if this is a measurment 
                it needs to be normalized to the reference plane)
        tline: transmission line class of the medium. needed for the 
                calculation of propagation constant
impedance_mismatch(self, z1, z2, **kwargs)
returns a two-port network for a impedance mis-match
 
takes:
        z1: complex impedance of port 1 [ number, list, or 1D ndarray]
        z2: complex impedance of port 2 [ number, list, or 1D ndarray]
        **kwargs: passed to mwavepy.Network constructor
returns:
        a 2-port network [mwavepy.Network]
        
note:
        if z1 and z2 are arrays or lists, they must be of same length
        as the self.frequency.npoints
inductor(self, L, **kwargs)
A lumped inductor
 
takes:
        L: inductance in Henrys [number]
 
returns:
        mwavepy.Network
line(self, d, unit='m', **kwargs)
creates a Network for a section of matched transmission line
 
takes:
        d: the length (see unit argument) [number]
        unit: string specifying the units of d. possible options are 
                'm': meters, physical length in meters (default)
                'deg':degrees, electrical length in degrees
                'rad':radians, electrical length in radians
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network. the kwarg
                'z0' can be used to create a line of a given impedance
 
returns:
        a 2-port Network class, representing a transmission line of 
        length d
 
 
example:
        my_media = mwavepy.Freespace(...)
        my_media.line(90, 'deg', z0=50)
load(self, Gamma0, nports=1, **kwargs)
creates a Network for a Load termianting a transmission line 
 
takes:
        Gamma0: reflection coefficient of load (not in db)
        nports: number of ports. creates a short on all ports,
                default is 1 [int]
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network
returns:
        a n-port Network class, where  S = Gamma0*eye(...)
match(self, nports=1, z0=None, **kwargs)
creates a Network for a perfect matched transmission line (Gamma0=0) 
 
takes:
        nports: number of ports [int]
        z0: characterisitc impedance [number of array]. defaults is 
                None, in which case the Media's z0 is used. 
                Otherwise this sets the resultant network's z0. See
                Network.z0 property for more info
        **kwargs: key word arguments passed to Network Constructor
 
returns:
        a n-port Network [mwavepy.Network]
 
 
example:
        mymatch = wb.match(2,z0 = 50, name='Super Awesome Match')
open(self, nports=1, **kwargs)
creates a Network for a 'open' transmission line (Gamma0=1) 
 
takes:
        nports: number of ports. creates a short on all ports,
                default is 1 [int]
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network
returns:
        a n-port Network [mwavepy.Network]
short(self, nports=1, **kwargs)
creates a Network for a short  transmission line (Gamma0=-1) 
 
takes:
        nports: number of ports. creates a short on all ports,
                default is 1 [int]
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network
returns:
        a n-port Network [mwavepy.Network]
shunt(self, ntwk, **kwargs)
returns a shunted ntwk. this creates a 'tee', connects 
'ntwk' to port 1, and returns the result
 
takes:
        ntwk: the network to be shunted. [mwavepy.Network]
        **kwargs: passed to the tee() function
        
returns:
        a 2-port network [mwavepy.Network]
shunt_capacitor(self, C, *args, **kwargs)
a shunt capacitor
 
takes:
        C: capacitance in farads
        *args: passed to self.capacitor
        **kwargs:passed to self.capacitor
returns:
        a 2-port mwavepy.Network
shunt_delay_load(self, *args, **kwargs)
a shunted delayed load:
 
takes:
        *args: passed to self.delay_load
        **kwargs:passed to self.delay_load
returns:
        a 2-port network [mwavepy.Network]
shunt_delay_open(self, *args, **kwargs)
a shunted delayed open:
 
takes:
        *args: passed to self.delay_load
        **kwargs:passed to self.delay_load
returns:
        a 2-port network [mwavepy.Network]
shunt_delay_short(self, *args, **kwargs)
a shunted delayed short:
 
takes:
        *args: passed to self.delay_load
        **kwargs:passed to self.delay_load
returns:
        a 2-port network [mwavepy.Network]
shunt_inductor(self, L, *args, **kwargs)
a shunt inductor
 
takes:
        L: inductance in henrys
        *args: passed to self.inductor
        **kwargs:passed to self.inductor
returns:
        a 2-port mwavepy.Network
splitter(self, nports, **kwargs)
returns an ideal, lossless n-way splitter.
 
takes:
        nports: number of ports [int]
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network. 
returns:
        a n-port Network [mwavepy.Network]
tee(self, **kwargs)
makes a ideal, lossless tee. (aka three port splitter)
 
takes:
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network. 
returns:
        a 3-port Network [mwavepy.Network]
 
note:
        this just calls splitter(3)
theta_2_d(self, theta, deg=True)
converts electrical length to physical distance. The electrical
length is given at center frequency of self.frequency 
 
takes:
        theta: electrical length, at band center (see deg for unit)
                [number]
        deg: is theta in degrees? [boolean]
        
returns:
        d: physical distance in meters
thru(self, **kwargs)
creates a Network for a thru
 
takes:
        **kwargs: key word arguments passed to match(), which is 
                called initially to create a 'blank' network
returns:
        a 2-port Network class, representing a thru
 
note:
        this just calls line(0)
white_gaussian_polar(self, phase_dev, mag_dev, n_ports=1, **kwargs)
creates a complex zero-mean gaussian white-noise signal of given
standard deviations for phase and magnitude
 
takes:
        phase_mag: standard deviation of magnitude
        phase_dev: standard deviation of phase
        n_ports: number of ports. defualt to 1
        **kwargs: passed to Network() initializer
returns:
        result: Network type

Data descriptors inherited from mwavepy.media.media.Media:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)
characteristic_impedance
propagation_constant
z0

 
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'>