00001 // radial_stub.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 // 00033 // 11/16/99: changes to support new noise calculations 00034 // 1/15/99: changed return values of some void functions 00035 // 9/23/98: algorithm now ensures that the sum of the area of 00036 // the microstrips is equal to the area of the stub. 00037 // 9/18/98: radial_stub is now a subclass of data_ptr_nport. 00038 00039 #include "radial_stub.h" 00040 #include "error.h" 00041 #include <math.h> 00042 00043 radial_stub::radial_stub() : data_ptr_nport() 00044 { 00045 info.source = false; 00046 // Unless a separate temperature parameter gets added, stubs are passive 00047 info.active = false; 00048 nsections = 15; 00049 00050 for(int i=0; i<=nsections; i++) 00051 sec[i].sub_thick = &sub_thick; 00052 00053 sec[0].width = &width; 00054 sec[0].length = &length; 00055 00056 for(int i=0; i<nsections; i++) 00057 rs.connect(sec[i], 2, sec[i+1], 1); 00058 00059 rs.add_port(sec[0], 1); 00060 rs.add_port(sec[nsections], 2); 00061 } 00062 00063 radial_stub & radial_stub::substrate(dielectric & d) 00064 { 00065 sub = &d; 00066 00067 for(int i=0; i<=nsections; i++) 00068 sec[i].substrate(*sub); 00069 00070 return *this; 00071 } 00072 00073 radial_stub & radial_stub::superstrate(dielectric & d) 00074 { 00075 super = &d; 00076 00077 for(int i=0; i<=nsections; i++) 00078 sec[i].superstrate(*super); 00079 00080 return *this; 00081 } 00082 00083 radial_stub & radial_stub::top_strip(surfimp & s) 00084 { 00085 top = &s; 00086 00087 for(int i=0; i<=nsections; i++) 00088 sec[i].top_strip(*top); 00089 00090 return *this; 00091 } 00092 00093 radial_stub & radial_stub::ground_plane(surfimp & s) 00094 { 00095 ground = &s; 00096 00097 for(int i=0; i<=nsections; i++) 00098 sec[i].ground_plane(*ground); 00099 00100 return *this; 00101 } 00102 00103 void radial_stub::recalc(bool noise) 00104 { 00105 // Radius of the inner part of the stub that overlaps with the 00106 // transmission line that feeds the stub. 00107 double r0; 00108 00109 // Length of the annular slices. 00110 double sect_len; 00111 00112 // Calculate inner radius so that the sum of the areas of the transmission 00113 // lines equals the area of the real physical radial stub. 00114 r0 = width / sqrt(2. * angle * tan(0.5*angle)); 00115 00116 // Make sure the stub is bigger than the transmission line feeding it. 00117 if(r0 >= radius) 00118 { 00119 error::fatal("radial_stub is smaller than the transmission line feeding it!"); 00120 } 00121 00122 sect_len = (radius - r0) / nsections; 00123 00124 // Set the width and length of the annular slices. 00125 // sec[0] should already be set, because its parameters are shadowing. 00126 for(int i=1; i<=nsections; i++) 00127 { 00128 sec[i].length = sect_len; 00129 sec[i].width = angle * (r0 + ((i-0.5) * sect_len)); 00130 } 00131 00132 // Now that the microstrips are set, have the circuit calculate itself. 00133 data_ptr = (noise) ? &rs.get_data() : &rs.get_data_S(); 00134 00135 // // Print out microstrip sizes for debugging. 00136 // double area = 0.0; 00137 // cout << "width = " << width/Micron << endl; 00138 // cout << "angle = " << angle << endl; 00139 // cout << "r0 = " << r0/Micron << endl; 00140 // for(int i=0; i <= nsections; i++) 00141 // { 00142 // cout << "Section " << i << ": " << sec[i].width/Micron 00143 // << " microns wide X " << sec[i].length/Micron 00144 // << " microns long." << endl; 00145 // area += (sec[i].width/Micron) * (sec[i].length/Micron); 00146 // } 00147 // cout << "Total area = " << area << " microns^2." << endl; 00148 } 00149 00150 radial_stub::radial_stub(const radial_stub & r) 00151 { 00152 info.source = false; 00153 // Unless a separate temperature parameter gets added, stubs are passive 00154 info.active = false; 00155 nsections = r.nsections; 00156 00157 radius = r.radius; 00158 angle = r.angle; 00159 length = r.length; 00160 width = r.width; 00161 sub_thick = r.sub_thick; 00162 00163 if(r.sub != 0) 00164 substrate(*r.sub); 00165 if(r.super != 0) 00166 superstrate(*r.super); 00167 if(r.top != 0) 00168 top_strip(*r.top); 00169 if(r.ground != 0) 00170 ground_plane(*r.ground); 00171 00172 for(int i=0; i<=nsections; i++) 00173 sec[i].sub_thick = &sub_thick; 00174 00175 sec[0].width = &width; 00176 sec[0].length = &length; 00177 00178 for(int i=0; i<nsections; i++) 00179 rs.connect(sec[i], 2, sec[i+1], 1); 00180 00181 rs.add_port(sec[0], 1); 00182 rs.add_port(sec[nsections], 2); 00183 } 00184 00185 radial_stub & radial_stub::operator=(const radial_stub & r) 00186 { 00187 // Beware of self assignment: r = r 00188 if(this != &r) 00189 { 00190 radius = r.radius; 00191 angle = r.angle; 00192 length = r.length; 00193 width = r.width; 00194 sub_thick = r.sub_thick; 00195 00196 if(r.sub != 0) 00197 substrate(*r.sub); 00198 if(r.super != 0) 00199 superstrate(*r.super); 00200 if(r.top != 0) 00201 top_strip(*r.top); 00202 if(r.ground != 0) 00203 ground_plane(*r.ground); 00204 00205 } 00206 return *this; 00207 }
Please direct comments and corrections to
supermix@submm.caltech.edu
Go to the supermix home page
Generated by
1.2.7