00001 // fet.cc 00002 // SuperMix version 1.0 C++ source file 00003 // 00004 // Copyright (c) 1999 California Institute of Technology. 00005 // All rights reserved. 00006 // 00007 // Redistribution and use in source and binary forms for noncommercial 00008 // purposes are permitted provided that the above copyright notice and 00009 // this paragraph are duplicated in all such forms and that any 00010 // documentation and other materials related to such distribution and 00011 // use acknowledge that the software was developed by California 00012 // Institute of Technology. Redistribution and/or use in source or 00013 // binary forms is not permitted for any commercial purpose. Use of 00014 // this software does not include a permitted use of the Institute's 00015 // name or trademark for any purpose. 00016 // 00017 // DISCLAIMER: 00018 // THIS SOFTWARE AND/OR RELATED MATERIALS ARE PROVIDED "AS-IS" WITHOUT 00019 // WARRANTY OF ANY KIND INCLUDING ANY WARRANTIES OF PERFORMANCE OR 00020 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE OR PURPOSE (AS SET 00021 // FORTH IN UCC 23212-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE 00022 // LICENSED PRODUCT, HOWEVER USED. IN NO EVENT SHALL CALTECH/JPL BE 00023 // LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING BUT NOT LIMITED TO 00024 // INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING ECONOMIC 00025 // DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF 00026 // WHETHER CALTECH/JPL SHALL BE ADVISED, HAVE REASON TO KNOW, OR IN 00027 // FACT SHALL KNOW OF THE POSSIBILITY. THE USER BEARS ALL RISK 00028 // RELATING TO QUALITY AND PERFORMANCE OF THE SOFTWARE AND/OR RELATED 00029 // MATERIALS. 00030 // 00031 // Change history: 00032 // 11/16/99: changes to support new noise calculations 00033 // 11/11/98: Changed table access to new syntax 00034 // 9/22/98: fet is now a subclass of data_ptr_nport. 00035 00036 #include "fet.h" 00037 #include <math.h> 00038 #include "error.h" 00039 00040 void transconductance::recalc() 00041 { 00042 // Set normalization impedance. added 12/29/97 00043 data.set_znorm(Z0); 00044 00045 // Calculate S matrix 00046 data.S[1][1] = 1.0; 00047 data.S[2][2] = 1.0; 00048 data.S[1][2] = 0.0; 00049 data.S[2][1] = -2.0*G*Z0*exp(-I*2*Pi*f*Tau); 00050 00051 // The C matrix is all zeros, i.e. the transconductance is noiseless. 00052 00053 // Leave source vector at its default value, all zeroes. 00054 } 00055 00056 fet::fet() : data_ptr_nport() 00057 { 00058 construct(); 00059 } 00060 00061 fet::fet(const fet & f) : data_ptr_nport() 00062 { 00063 construct(); 00064 fet_copy(f); 00065 } 00066 00067 fet & fet::operator=(const fet & f) 00068 { 00069 // Beware of self assignment: f = f 00070 if(this != &f) 00071 { 00072 fet_copy(f); 00073 } 00074 return *this; 00075 } 00076 00077 void fet::construct() 00078 { 00079 // fets are active noise devices, but are sourceless: 00080 info.source = false; 00081 00082 // build the circuitry for the model: 00083 Lg.series(); 00084 Rg.series(); 00085 Cpg.parallel(); 00086 00087 Cgs.parallel(); 00088 Rgs.series(); 00089 00090 Cgd.series(); 00091 Rds.parallel(); 00092 Cds.parallel(); 00093 00094 Rs.parallel(); 00095 Ls.parallel(); 00096 00097 Cpd.parallel(); 00098 Rd.series(); 00099 Ld.series(); 00100 00101 fetckt.add_port(Lg, 1); 00102 fetckt.connect(Lg, 2, Rg, 1); 00103 fetckt.connect(Rg, 2, Cpg, 1); 00104 00105 fetckt.connect(b1, 2, Rgs, 1); 00106 fetckt.connect(Rgs, 2, Cgs, 1); 00107 fetckt.connect(Cgs, 2, Gm, 1); 00108 fetckt.connect(Gm, 2, b2, 2); 00109 fetckt.connect(b1, 1, Cgd, 1); 00110 fetckt.connect(b2, 1, Cgd, 2); 00111 00112 fetckt.connect(b2, 3, Rds, 1); 00113 fetckt.connect(Rds, 2, Cds, 1); 00114 00115 fetckt.connect(st3, 1, b1, 3); 00116 fetckt.connect(st4, 1, Cds, 2); 00117 fetckt.connect(st3, 2, Rs, 1); 00118 fetckt.connect(st4, 2, Rs, 2); 00119 00120 fetckt.connect(st5, 1, st3, 3); 00121 fetckt.connect(st6, 1, st4, 3); 00122 fetckt.connect(st5, 2, Ls, 1); 00123 fetckt.connect(st6, 2, Ls, 2); 00124 00125 fetckt.connect(Cpg, 2, st5, 3); 00126 00127 fetckt.connect(st6, 3, Cpd, 1); 00128 fetckt.connect(Cpd, 2, Rd, 1); 00129 fetckt.connect(Rd, 2, Ld, 1); 00130 fetckt.add_port(Ld, 2); 00131 } 00132 00133 void fet::fet_copy(const fet & f) 00134 { 00135 Gm = f.Gm; 00136 Cgs = f.Cgs; 00137 Cds = f.Cds; 00138 Rds = f.Rds; 00139 Cgd = f.Cgd; 00140 Rgs = f.Rgs; 00141 Rg = f.Rg; 00142 Rs = f.Rs; 00143 Rd = f.Rd; 00144 Lg = f.Lg; 00145 Ls = f.Ls; 00146 Ld = f.Ld; 00147 Cpg = f.Cpg; 00148 Cpd = f.Cpd; 00149 }
Please direct comments and corrections to
supermix@submm.caltech.edu
Go to the supermix home page
Generated by
1.2.7