00001 // hotcold.cc 00002 // 00003 // Generate simulated pumped IV and hot/cold load curves using a 00004 // full, nonlinear simulation of a multijunction SIS mixer. 00005 // 00006 // Shows a possible way to organize the source code for a complex simulation 00007 // which offers improved maintainablity and reusability. 00008 // ========================================================================== 00009 00010 // First include the physical dimensions and other specific data for 00011 // a particular receiver using this design (also includes object definitions): 00012 00013 #include "specs.h" 00014 00015 00016 int main(int argc, char** argv) 00017 { 00018 00019 // ========================================================================== 00020 // Here is where any command line parameters should be read, if needed. 00021 00022 00023 // ========================================================================== 00024 // INCLUDE CODE TO BUILD THE MIXER MODEL: 00025 // This is an unusual approach to source code. Since there is significant 00026 // work required to be executed in main() in order to build the receiver 00027 // circuitry (for example, see rfmatch.cc and mixer.cc), and this code is 00028 // required by any simulation of this design, we have pulled out this code 00029 // into a special include file. 00030 // 00031 // Since this include file contains code to be executed inside main(), it 00032 // is clearly not a header file. We use the extension ".inc" to emphasize 00033 // this distinction. 00034 00035 # include "build_mixer.inc" 00036 00037 // ========================================================================== 00038 // CODE FOR THE SPECIFIC SIMULATION OR OPTIMIZATION FOLLOWS: 00039 00040 // We are calculating unpumped and pumped IV curves as well as the IF ouput 00041 // noise power spectral density (expressed in Kelvin) at the IF freq, 00042 // with the LO source temperature set to a hot value and a cold value. 00043 // This simulates laboratory pumped IV curve and Y-factor measurements. We 00044 // will sweep the SIS bias voltage and output unpumped and pumped total SIS 00045 // bias current, and cold and hot load IF output noise. 00046 00047 parameter SOURCE_TEMP; // will be the hot/cold source temperature 00048 LO.Temp = & SOURCE_TEMP; // now LO temperature shadows the source temp 00049 00050 // LO power and frequency will use the values in specs.h 00051 00052 IF_FREQ = 1.5*GHz; 00053 00054 double power = LO_POWER; 00055 double hot = 300*Kelvin, cold = 80*Kelvin; // Hot and cold load temp's 00056 00057 // Now we sweep the bias voltage and calculate the results 00058 for(double v = 0; v <= 4; v += .05) { 00059 00060 // First set the SIS bias voltage and report it: 00061 00062 V_BIAS = v * mVolt; 00063 cout << V_BIAS/mVolt; 00064 00065 // Now for the unpumped and pumped IV curves. We set the LO power and 00066 // then perform a harmonic balance of the mixer. Following this we 00067 // fetch a Vector containing the junction currents at harmonic 0, i.e., 00068 // DC. We sum these currents to get the total bias current, since 00069 // for this model the two junctions are in parallel at DC. 00070 00071 // First the unpumped current: 00072 00073 LO_POWER = 0.0; 00074 mix.balance(); 00075 00076 // mix.I_junc(n) returns a vector of the complex currents at harmonic 00077 // n. The vector has an element for each SIS junction in the mixer, in 00078 // the same order that the junctions were added to the mixer using 00079 // add_junction() (in the code in the file build_mixer.inc). 00080 00081 cout << "\t" << (mix.I_junc(0)[1]+mix.I_junc(0)[2]).real/(Micro*Amp); 00082 00083 // ditto with the LO power turned on, the pumped current: 00084 00085 LO_POWER = power; 00086 mix.balance(); 00087 cout << "\t" << (mix.I_junc(0)[1]+mix.I_junc(0)[2]).real/(Micro*Amp); 00088 00089 // Now we need the cold and hot load IF output powers. By setting 00090 // the SOURCE_TEMP parameter we indirectly control the noise 00091 // temperature of the LO source using parameter shadowing. Class 00092 // mixer can perform two different but related small signal analyses: 00093 // get_data() does the same thing as it does for any other nport, but 00094 // get_term_data() first terminates the RF input ports at every 00095 // harmonic with the balance terminators set by calls to the mixer's 00096 // set_balance_terminator(). During harmonic balance, these 00097 // terminators are required to fully specify the linear embedding 00098 // network the SIS junctions see; often this is how you inject LO 00099 // power, which is only needed during harmonic balance calculations. 00100 // However, when you use get_term_data(), the same terminations are 00101 // used, reducing the mixer to an nport with only IF ports. These 00102 // terminations introduce noise given by their noise temperatures and 00103 // their RF sideband frequencies. If set to 0 Kelvin, they serve to 00104 // inject the quantum noise needed to be added to the mixer noise 00105 // calculations. 00106 00107 00108 // First the cold load calculation. We get the IF output noise 00109 // correlation matrix element of the source + mixer combination using 00110 // get_term_data(). The noise correlation element gives the noise 00111 // power spectral density at the IF frequency as a temperature, 00112 // kT = Power/Hz. 00113 00114 SOURCE_TEMP = cold; 00115 cout << "\t" << mix.get_term_data().C[IF_PORT][IF_PORT].real/Kelvin; 00116 00117 // The hot load calculation: 00118 00119 SOURCE_TEMP = hot; 00120 cout << "\t" << mix.get_term_data().C[IF_PORT][IF_PORT].real/Kelvin; 00121 cout << endl; 00122 } 00123 00124 }
Please direct comments and corrections to
supermix@submm.caltech.edu
Go to the supermix home page
Generated by
1.2.7