mwavepy.discontinuities.variationalMethods | index /usr/local/lib/python2.6/dist-packages/mwavepy/discontinuities/variationalMethods.py

`variational calculations, for solving equivalent networks of
discontinuities.`

Modules
`` |  |
pylab |  |  |

Functions
`` |  | V_dominant_mode(mode_type, m, n, wg, **kwargs) `mode voltage coupling of dominant mode to itself. assumed field is sin(pi*x/a) ; for 0 < x < wg.a, 0 < y < wg.b takes: mode_type: type of mode, a string, acceptable values are ['te','tmz'] m: mode index in width dimension n: mode index in heigth dimension wg: a RectangularWaveguide type` V_offset_dimension_change(mode_type, m, n, wg, x0, y0, a, b) `mode voltage coupling for dominant mode field of a rectangular aperture of dimension axb, radiating into a larger waveguide of dimensions wg.a x wg.b. assumed field is sin(pi/a*(x-x0)) ; for x0 < x < x0+a, y0 < y < y0+b takes: mode_type: type of mode, a string, acceptable values are ['te','tmz'] m: mode index in width dimension n: mode index in heigth dimension wg: a RectangularWaveguide type x0: offset of aperture in width (a) dimension [m] y0: offset of aperture in height (b) dimension [m] a: aperture size in width dimension b: aperture size in height dimension returns: normalized coupling value, a scalar.` aperture_field(wg_I, wg_II, V_I, V_II, freq, M, N, d, Gamma0, V_I_args={}, V_II_args={}, normalizing_mode=('te', 1, 0)) `calculates the equivalent network for a discontinuity in a waveguide, by the aperture-field variational method. takes: wg_I: a RectangularWaveguide instance of region I wg_II: a RectangularWaveguide instance of region II V_I: mode voltage for region I V_II: mode voltage for region II freq: Frequency object M: number of modes in 'a' dimension N: number of modes in 'b' dimension d: termination distance for region II Gamma0: terminating reflection coefficient for region II V_I_args: dictionary holding key-word arguments for V_I V_II_args: dictionary holding key-word arguments for V_II normalzing mode: triplet of (mode_type, m,n), designating the mode which the normalized aperture admittance is normalized to. returns: a dictionary holding the following keys 'V_I_mat': V_I_mat, 'V_II_mat': V_II_mat, 'Y_I_mat': Y_I_mat, 'Y_II_mat': Y_II_mat, 'R_I_mat': R_I_mat, 'R_II_mat': R_II_mat, 'Y_in_norm':Y_in_norm, 'ntwk': ntwk note: mode voltages are called like: V_I(mode_type,m,n,wg,**V_I_args) so whatever you pass for the mode voltage functions must adhere to this convention` converge_junction_admittance(y_tol=0.001, mode_rate=1, M_0=2, N_0=2, min_converged=1, max_M_0=100, output=True, converge_func=<function junction_admittance>, **kwargs) `the design of this function is stupid, it was ad-hoc` junction_admittance(wg_I, wg_II, V_I, V_II, freq, M, N, normalizing_mode=('te', 1, 0), **kwargs) `calculates the equivalent network for a discontinuity in a waveguide, by the aperture-field variational method. takes: wg_I: a RectangularWaveguide instance of region I wg_II: a RectangularWaveguide instance of region II V_I: mode voltage for region I V_II: mode voltage for region II freq: M: N: normalzing mode: **kwargs: note: mode voltages are called like: V(mode_type,m,n,wg,**kwargs) so whatever you pass for the mode voltage functions must adhere to this convention` junction_admittance_with_termination(wg_I, wg_II, V_I, V_II, freq, M, N, d, Gamma0, normalizing_mode=('te', 1, 0), **kwargs) `calculates the equivalent network for a discontinuity in a waveguide, by the aperture-field variational method. takes: wg_I: a RectangularWaveguide instance of region I wg_II: a RectangularWaveguide instance of region II V_I: mode voltage for region I V_II: mode voltage for region II freq: M: N: normalzing mode: **kwargs: note: mode voltages are called like: V(mode_type,m,n,wg,**kwargs) so whatever you pass for the mode voltage functions must adhere to this convention` junction_impedance(wg_I, wg_II, I_I, I_II, freq, M, N, normalizing_mode=('te', 1, 0), **kwargs) plot_mag_phase(out) rectangular_junction(freq, wg_I, wg_II, da, db, d=1, Gamma0=0.0, nports=1, **kwargs) `Calcurates the equivalent 1-port network for a generic junction of two rectangular waveguides, with the input guide matched. the guides are may be offset from lower-left corner alignment, by xy. input guide is wg_I, ouput is wg_II. the assumed field used in the variational expression is the TE10 mode of the common cross-section takes: freq: a Frequency Object wg_I: a RectangularWaveguide instance representing input guide wg_II: a RectangularWaveguide instance. ouput guide. da: offset in teh 'a' dimension from lower left corner alignment db: offset in teh 'a' dimension from lower left corner alignment d: distance to termination [m]. default is 1m Gamma0: reflectin coefficient at termiantion, default is 0. **kwargs: passed to converge_junction_admittanace(), then aperture_field() returns: ntwk: one-port Network instance, representing junction NOTEL a clarification of geometry: wg_I: lower left corner = (0,0) width = wg_I.a height= wg_I.b wg_II: lower left corner = (x,y) ( which is xy[0],xy[1]) width = wg_I.a height= wg_I.b` rectangular_junction_centered(freq, wg_I, wg_II, da, db, d=1, Gamma0=0.0, **kwargs) `Calcurates the equivalent 1-port network for a junction of two rectangular waveguides, with the input guide matched. the guides are may be offset from ON-CENTER alignment, by xy. takes: freq: a Frequency Object wg_I: a RectangularWaveguide instance representing input guide wg_II: a RectangularWaveguide instance. ouput guide. da: offset in a-dimension, from on-center alignment db: offset in b-dimension from on-center alignment d: distance to termination [m]. default is 1m Gamma0: reflectin coefficient at termiantion, default is 0. (match) **kwargs: passed to converge_junction_admittanace(), then aperture_field() returns: ntwk: one-port Network instance, representing junction` rotated_waveguide(wg, freq, da, db, d, Gamma0, **kwargs) `calculated response of a terminated rotated waveguide of same cross-section as input guide, with possible offset from on-center alignment takes: wg: RectangularWaveguide Object. freq: Frequency Object offset: tuple holding d: distance to termination [m] Gamma0: reflection coefficient of termination at the termination **kwargs: passed to converge_junction_admittance, see its help for more info returns: ntwk: a Network type representing the junction NOTE: this just formats input and calls rectangular_junction()` show_coupling(out) `## OUTPUT` zeros(...) `zeros(shape, dtype=float, order='C') Return a new array of given shape and type, filled with zeros. Parameters ---------- shape : {tuple of ints, int} 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 -------- numpy.zeros_like : Return an array of zeros with shape and type of input. numpy.ones_like : Return an array of ones with shape and type of input. numpy.empty_like : Return an empty array with shape and type of input. numpy.ones : Return a new array setting values to one. numpy.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')]) array([(0, 0), (0, 0)], dtype=[('x', '<i4'), ('y', '<i4')])`

Data
`` |  | micron = 9.9999999999999995e-07 mil = 2.5399999999999997e-05 pi = 3.1415926535897931 sin = <ufunc 'sin'>