Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

nport Class Reference

This is the most generic linear circuit/element device. More...

#include <nport.h>

Inheritance diagram for nport::

device attenuator branch circuit circulator connection current_sink data_ptr_nport deembed generator hybrid180 hybrid90 inst_circuit power_divider reduced_nport sdata_interp series_tee simple_nport slot_antenna spimp time_delay transconductance transformer trl_base twin_slot_antenna voltage_source yterm zterm List of all members.

Public Methods

 nport (int n=0)
 The default constructor. More...

virtual ~nport ()
virtual const sdataget_data ()
virtual const sdataget_data (state_tag calc_id)
 Return the nport data, recalculating only if calc_id is different from when we last recalculated. More...

virtual const sdataget_last_data () const
 Return the nport data. More...

virtual const sdataget_data_S ()
 Special function to save time in circuits: calculate only the S matrix and B vector parts of the sdata. More...

virtual const sdataget_data_S (state_tag calc_id)
 Special function to save time in circuits: calculate only the S matrix and B vector parts of the sdata only if calc_id is different from when we last recalculated. More...

virtual int size ()
 The number of ports this device has. More...

virtual const data_infoget_data_info ()
virtual bool has_noise ()
virtual bool is_active ()
virtual bool is_source ()
virtual complex S (int p1, int p2)
 Recalculate the nport and return a single scattering parameter. More...

virtual complex C (int p1, int p2)
 Recalculate the nport and return a single element of the noise correlation matrix. More...

virtual complex B (int p)
 Recalculate the nport and return a single element of the source vector. More...

virtual port get_port (int index)
 This is a trivial function that returns a port's port id. More...

virtual int get_port (port p)
 This is a trivial function that returns a port's index. More...

virtual v_index_mode mode ()
 A function for those rare cases when an nport may not use Index_1 indexing. More...


Protected Methods

virtual void recalc ()=0
 The function for calculating sdata. More...

virtual void recalc_S ()
 If the following function is implemented, it should only calculate the S matrix and B vector parts of data, leaving the C matrix part stale. More...


Protected Attributes

sdata data
 data includes the scattering matrix, noise matrix, size, etc. More...

data_info info
 holds the flags returned by get_data_info(). More...


Detailed Description

This is the most generic linear circuit/element device.

All circuits and primitive elements are subclasses of class nport.

Class nport is an abstract class. It will never be instantiated directly.

Definition at line 98 of file nport.h.


Constructor & Destructor Documentation

nport::nport ( int n = 0 ) [inline]
 

The default constructor.

Parameters:
n   the number of ports (defaults to 0.)

Definition at line 159 of file nport.h.

nport::~nport ( ) [inline, virtual]
 

Definition at line 163 of file nport.h.


Member Function Documentation

complex nport::B ( int i ) [virtual]
 

Recalculate the nport and return a single element of the source vector.

Parameters:
p   the port
Returns:
the element of the source vector at this freq

Definition at line 108 of file nport.cc.

complex nport::C ( int i,
int j ) [virtual]
 

Recalculate the nport and return a single element of the noise correlation matrix.

Parameters:
p1   row of the noise correlation matrix
p2   column of the noise correlation matrix
Returns:
the element of the noise correlation matrix

Definition at line 95 of file nport.cc.

complex nport::S ( int i,
int j ) [virtual]
 

Recalculate the nport and return a single scattering parameter.

Parameters:
p1   row of the scattering matrix
p2   column of the scattering matrix
Returns:
the element of the scattering matrix

Definition at line 82 of file nport.cc.

const sdata & nport::get_data ( state_tag calc_id ) [inline, virtual]
 

Return the nport data, recalculating only if calc_id is different from when we last recalculated.

Parameters:
calc_id   used to determine if this device needs to be recalculated
Returns:
the scattering matrix, noise correlation matrix, etc.

Reimplemented in data_ptr_nport.

Definition at line 175 of file nport.h.

const sdata & nport::get_data ( ) [inline, virtual]
 

Returns:
the nport data in one chunk after recalculating the nport

Reimplemented in data_ptr_nport.

Definition at line 166 of file nport.h.

Referenced by B(), C(), S(), circuit::calc(), connection::calc_block(), connection::calc_inter(), connection::calc_intra(), inst_circuit::currents(), two_match::get(), amp_mag_delta::get(), amp_k::get(), input_tn::get(), s_mag::get(), gain_dB::get(), radial_stub::recalc(), alias::recalc(), mixer_currents::recalc(), inst_circuit::recalc(), fet::recalc(), cascade::recalc(), deembed::recalc_S(), and inst_circuit::voltages().

const sdata & nport::get_data_S ( state_tag calc_id ) [inline, virtual]
 

Special function to save time in circuits: calculate only the S matrix and B vector parts of the sdata only if calc_id is different from when we last recalculated.

The noise correlation matrix will contain stale values.

Parameters:
calc_id   used to determine if this device needs to be recalculated
Returns:
the scattering matrix, noise correlation matrix, etc.

Reimplemented in data_ptr_nport.

Definition at line 208 of file nport.h.

const sdata & nport::get_data_S ( ) [inline, virtual]
 

Special function to save time in circuits: calculate only the S matrix and B vector parts of the sdata.

The noise correlation matrix will contain stale values.

Returns:
the scattering matrix, noise correlation matrix, etc.

Reimplemented in data_ptr_nport.

Definition at line 197 of file nport.h.

Referenced by circuit::calc(), connection::calc_block(), connection::calc_inter(), connection::calc_intra(), mixer::balancer::fill_data(), radial_stub::recalc(), reduced_nport::recalc_S(), alias::recalc_S(), fet::recalc_S(), cascade::recalc_S(), and twin_slot_antenna::recalc_S().

const data_info & nport::get_data_info ( ) [inline, virtual]
 

Returns:
info about the sdata of the device

Reimplemented in twin_slot_antenna, power_divider, attenuator, circuit, cascade, connection, resistor, series_RLC, parallel_RLC, zterm, yterm, alias, sdata_interp, generator, voltage_source, current_sink, microstrip, cpw, r_waveguide, and trline.

Definition at line 224 of file nport.h.

Referenced by connection::calc_inter(), connection::calc_intra(), alias::get_data_info(), connection::get_data_info(), circuit::get_data_info(), has_noise(), is_active(), and is_source().

const sdata & nport::get_last_data ( ) const [inline, virtual]
 

Return the nport data.

Do not perform a calculation.

Returns:
the scattering matrix, noise correlation matrix, etc.

Reimplemented in data_ptr_nport.

Definition at line 188 of file nport.h.

int nport::get_port ( port p ) [virtual]
 

This is a trivial function that returns a port's index.

Parameters:
p   the port we are searching for
Returns:
the index of the port, or 0 if the port is not found

Reimplemented in connection.

Definition at line 70 of file nport.cc.

port nport::get_port ( int index ) [virtual]
 

This is a trivial function that returns a port's port id.

Parameters:
index   the index of the port
Returns:
the port, or (0,0) if index is not in proper range.

Reimplemented in connection.

Definition at line 60 of file nport.cc.

Referenced by circuit::build_tree(), circuit::calc(), and connection::connection().

bool nport::has_noise ( ) [inline, virtual]
 

Returns:
true if the noise correlation matrix should be nonzero

Definition at line 227 of file nport.h.

bool nport::is_active ( ) [inline, virtual]
 

Returns:
true if passive (Johnson) noise calculation at the current value of device::T is inadequate (ie, must have recalc() calculate the noise).

Definition at line 233 of file nport.h.

bool nport::is_source ( ) [inline, virtual]
 

Returns:
true if the source vector may be nonzero (ie, must have recalc() do it).

Definition at line 239 of file nport.h.

v_index_mode nport::mode ( ) [inline, virtual]
 

A function for those rare cases when an nport may not use Index_1 indexing.

Reimplemented in data_ptr_nport.

Definition at line 288 of file nport.h.

Referenced by circuit::add_port(), and circuit::connect().

void nport::recalc ( ) [protected, pure virtual]
 

The function for calculating sdata.

recalc() should do the following:

  • (1) Read device::f, device::Z0, and, by default, device::T to get the operating conditions for the response calculation.
  • (2) Calculate the S, C, and B matrix values and store them to nport::data, with all values normalized using device::Z0.
  • (3) Store the normalizing impedance to nport::data by calling data.set_znorm().

Reimplemented in slot_antenna, twin_slot_antenna, power_divider, attenuator, circuit, cascade, circulator, connection, deembed, time_delay, resistor, capacitor, inductor, series_RLC, parallel_RLC, branch, series_tee, zterm, yterm, transconductance, fet, fhx13x, fhr02x, kukje, jpltrw160, jpltrw300, hybrid90, hybrid180, inst_circuit, mixer, mixer_currents, alias, simple_nport, radial_stub, reduced_nport, sdata_interp, generator, voltage_source, current_sink, transformer, microstrip, cpw, r_waveguide, and trline.

Referenced by radial_stub::recalc(), and radial_stub::recalc_S().

void nport::recalc_S ( ) [inline, protected, virtual]
 

If the following function is implemented, it should only calculate the S matrix and B vector parts of data, leaving the C matrix part stale.

Reimplemented in twin_slot_antenna, power_divider, attenuator, circuit, cascade, connection, deembed, resistor, series_RLC, parallel_RLC, zterm, yterm, fet, alias, simple_nport, radial_stub, reduced_nport, sdata_interp, generator, voltage_source, current_sink, microstrip, cpw, r_waveguide, and trline.

Definition at line 151 of file nport.h.

Referenced by data_ptr_nport::get_data_S(), get_data_S(), trline::recalc(), r_waveguide::recalc(), cpw::recalc(), microstrip::recalc(), reduced_nport::recalc(), parallel_RLC::recalc(), series_RLC::recalc(), and twin_slot_antenna::recalc().

int nport::size ( ) [inline, virtual]
 

The number of ports this device has.

Returns:
the number of ports

Reimplemented in twin_slot_antenna, attenuator, circuit, cascade, circulator, connection, time_delay, spimp, branch, series_tee, transconductance, fet, hybrid90, hybrid180, mixer, mixer_currents, data_ptr_nport, alias, radial_stub, reduced_nport, generator, voltage_source, current_sink, transformer, and trl_base.

Definition at line 221 of file nport.h.

Referenced by B(), C(), S(), cascade::add(), circuit::add_port(), circuit::calc(), circuit::connect(), connection::connection(), sdata_interp::copy(), deembed::deembed(), mixer::flag_mixer_incomplete(), mixer::freq(), get_port(), mixer::port(), cascade::recalc(), cascade::recalc_S(), twin_slot_antenna::set(), mixer::set_balance_terminator(), mixer::set_rf(), alias::size(), mixer::size(), and cascade::size().


Member Data Documentation

sdata nport::data [protected]
 

data includes the scattering matrix, noise matrix, size, etc.

Definition at line 131 of file nport.h.

data_info nport::info [protected]
 

holds the flags returned by get_data_info().

Definition at line 134 of file nport.h.


The documentation for this class was generated from the following files:

Please direct comments and corrections to supermix@submm.caltech.edu
Go to the supermix home page
Generated by doxygen1.2.7