00001 // SuperMix version 1.0 C++ source file 00002 // 00003 // Copyright (c) 1999 California Institute of Technology. 00004 // All rights reserved. 00005 // 00006 // Redistribution and use in source and binary forms for noncommercial 00007 // purposes are permitted provided that the above copyright notice and 00008 // this paragraph are duplicated in all such forms and that any 00009 // documentation and other materials related to such distribution and 00010 // use acknowledge that the software was developed by California 00011 // Institute of Technology. Redistribution and/or use in source or 00012 // binary forms is not permitted for any commercial purpose. Use of 00013 // this software does not include a permitted use of the Institute's 00014 // name or trademark for any purpose. 00015 // 00016 // DISCLAIMER: 00017 // THIS SOFTWARE AND/OR RELATED MATERIALS ARE PROVIDED "AS-IS" WITHOUT 00018 // WARRANTY OF ANY KIND INCLUDING ANY WARRANTIES OF PERFORMANCE OR 00019 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE OR PURPOSE (AS SET 00020 // FORTH IN UCC 23212-2313) OR FOR ANY PURPOSE WHATSOEVER, FOR THE 00021 // LICENSED PRODUCT, HOWEVER USED. IN NO EVENT SHALL CALTECH/JPL BE 00022 // LIABLE FOR ANY DAMAGES AND/OR COSTS, INCLUDING BUT NOT LIMITED TO 00023 // INCIDENTAL OR CONSEQUENTIAL DAMAGES OF ANY KIND, INCLUDING ECONOMIC 00024 // DAMAGE OR INJURY TO PROPERTY AND LOST PROFITS, REGARDLESS OF 00025 // WHETHER CALTECH/JPL SHALL BE ADVISED, HAVE REASON TO KNOW, OR IN 00026 // FACT SHALL KNOW OF THE POSSIBILITY. THE USER BEARS ALL RISK 00027 // RELATING TO QUALITY AND PERFORMANCE OF THE SOFTWARE AND/OR RELATED 00028 // MATERIALS. 00029 // 00030 // antenna.cc 00031 00032 #include "antenna.h" 00033 #include "error.h" 00034 00035 void slot_antenna::recalc() 00036 { 00037 const complex s = (Z - device::Z0)/(Z + device::Z0); 00038 const complex c = 1.0/(3.0 - s); 00039 const double x = 2*sqrt(1.0 - norm(s)); 00040 00041 data.S[1][1] = (1.0 - 3.0*conj(s))*c; 00042 data.S[2][2] = data.S[3][3] = (1.0 + s)*c; 00043 data.S[1][3] = data.S[3][1] = x*c; 00044 data.S[1][2] = data.S[2][1] = - data.S[1][3]; 00045 data.S[2][3] = data.S[3][2] = 2.0*(1.0 - s)*c; 00046 } 00047 00048 00049 twin_slot_antenna::twin_slot_antenna() 00050 : nport(5), pA(0), Temp(&device::T), a(3) 00051 { 00052 info.source = a.set_info().source = false; 00053 00054 // build circuit: 00055 c.add_port(a,1); // port 1: RF in 00056 c.connect(a,2,t1,1); 00057 c.connect(a,3,t2,1); 00058 c.add_port(t1,2); // port 2: ant 1 - output 00059 c.add_port(t1,3); // port 3: ant 1 + output 00060 c.add_port(t2,2); // port 4: ant 2 - output 00061 c.add_port(t2,3); // port 5: ant 2 + output 00062 } 00063 00064 00065 twin_slot_antenna::twin_slot_antenna(nport & s) 00066 : nport(5), pA(0), Temp(&device::T), a(3) 00067 { 00068 set(s); 00069 info.source = a.set_info().source = false; 00070 00071 00072 // build circuit: 00073 c.add_port(a,1); // port 1: RF in 00074 c.connect(a,2,t1,1); 00075 c.connect(a,3,t2,1); 00076 c.add_port(t1,2); // port 2: ant 1 - output 00077 c.add_port(t1,3); // port 3: ant 1 + output 00078 c.add_port(t2,2); // port 4: ant 2 - output 00079 c.add_port(t2,3); // port 5: ant 2 + output 00080 } 00081 00082 00083 twin_slot_antenna & twin_slot_antenna::set(nport & s) 00084 { 00085 if (s.size() != 1 && s.size() != 2) 00086 error::warning("twin_slot_antenna: can only set to an nport with size 1 or 2"); 00087 else 00088 pA = &s; 00089 return *this; 00090 } 00091 00092 00093 void twin_slot_antenna::recalc_S() 00094 { 00095 // fill in data for device a 00096 const Matrix & S = pA->get_data_S().S; 00097 a().S[2][2] = a().S[3][3] = S[1][1]; 00098 a().S[2][3] = a().S[3][2] = S.read(1,2); // will be 0.0 if size is 1 00099 a().S[1][1] = -conj(a().S[2][2]+a().S[2][3]); 00100 a().S[1][2] = a().S[1][3] = a().S[2][1] = a().S[3][1] = 00101 sqrt(0.5 - 0.5*norm(a().S[1][1])); 00102 00103 // calc circuit S matrix only. 00104 data = c.get_data_S(); 00105 }
Please direct comments and corrections to
supermix@submm.caltech.edu
Go to the supermix home page
Generated by
1.2.7