SuperMix Amplifier Simulation
F.1 Source Code
private:
circuit fetckt;
jpltrw160_bump_5mA_500mV trans;
series_tee st1, st2;
branch br;
void recalc() { data_ptr = &fetckt.get_data(); } };
int main(void) {
// A circuit to hold the assembled components.
circuit intamp;
// Transistors, one per stage.
fet_with_source t1, t2, t3;
// Gate tuning and bias components (one each for 3 stages) branch bg1, bg2, bg3; // Gate bias line connects with a branch.
sdata_interp rg1, rg2, rg3; // 1 K gate bias resistors.
sdata_interp gsc1a, gsc2a, gsc3a;
resistor g50ohm1, g50ohm2, g50ohm3;
sdata_interp gsc1b, gsc2b, gsc3b;
open_term got1, got2, got3; // This is where the bias is connected.
sdata_interp spiral1, spiral2, spiral3;
// Drain tuning and bias components (one each for 3 stages) sdata_interp ld1, ld2, ld3;
sdata_interp rd1, rd2, rd3;
branch bd1, bd2, bd3; // Drain bias line connects with a branch.
sdata_interp dsc1a, dsc2a, dsc3a; // Shorts drain bias resistors to ground.
resistor d50ohm1, d50ohm2, d50ohm3;
sdata_interp dsc1b, dsc2b, dsc3b; // Shorts drain bias resistors to ground.
open_term dot1, dot2, dot3; // This is where the bias is connected.
sdata_interp dcblock2, dcblock3, dcblock4, dcblock5;
inductor in_bond, out_bond;
in_bond.L = 0.25 * Nano * Henry;
out_bond.L = 0.25 * Nano * Henry;
// Set up input and output cpw lines.
const_diel gaas;
gaas.eps.set(12.9);
gaas.tand.set(0.);
// Set up gold film, conductivity for 295 K, from Kittel page 144 normal_film copper;
copper.Thick = 0.5 * Micron;
copper.rho = 2.2 * Micro * Ohm * Centi * Meter;
// Make the cpw lines cpw in_cpw, out_cpw;
in_cpw.top_strip(copper);
in_cpw.substrate(gaas);
in_cpw.bottom_plane(copper);
in_cpw.sub_thick.set(250.*Micron);
in_cpw.length.set(100.*Micron);
in_cpw.width.set(80.*Micron);
in_cpw.space.set(61.9*Micron);
out_cpw = in_cpw;
resistor rpad1, rpad2;
rpad2.parallel();
rpad1.R = 30. * Ohm;
rpad2.R = 200. * Ohm;
sdata_interp sterm1(1), sterm2(1), sterm3(1), sterm4(1), sterm5(1), sterm6(1);
sterm1.touchstone("Lsource_270x10_250um_4k.s1p");
sterm2.touchstone("Lsource_270x10_250um_4k.s1p");
sterm3.touchstone("Lsource_270x10_250um_4k.s1p");
sterm4.touchstone("Lsource_270x10_250um_4k.s1p");
sterm5.touchstone("Lsource_270x10_250um_4k.s1p");
sterm6.touchstone("Lsource_270x10_250um_4k.s1p");
// Set initial values for amplifier components.
rg1.touchstone("res_1k_241x12_250um_4k.s2p");
rg2.touchstone("res_1k_241x12_250um_4k.s2p");
rg3.touchstone("res_1k_241x12_250um_4k.s2p");
gsc1a.touchstone("cap_200x200_250um_4k_parallel.s2p");
gsc2a.touchstone("cap_200x200_250um_4k_parallel.s2p");
gsc3a.touchstone("cap_200x200_250um_4k_parallel.s2p");
dsc1a.touchstone("cap_340x300_250um_4k_parallel.s2p");
dsc2a.touchstone("cap_300x439_250um_4k_parallel.s2p");
dsc3a.touchstone("cap_320x420_250um_4k_parallel.s2p");
g50ohm1.R = 50. * Ohm;
g50ohm2.R = 50. * Ohm;
g50ohm3.R = 50. * Ohm;
d50ohm1.R = 50. * Ohm;
d50ohm2.R = 50. * Ohm;
d50ohm3.R = 50. * Ohm;
gsc1b.touchstone("cap_300x300_250um_4k_parallel.s2p");
gsc2b.touchstone("cap_300x300_250um_4k_parallel.s2p");
gsc3b.touchstone("cap_300x300_250um_4k_parallel.s2p");
dsc1b.touchstone("cap_300x300_250um_4k_parallel.s2p");
dsc2b.touchstone("cap_300x300_250um_4k_parallel.s2p");
dsc3b.touchstone("cap_300x300_250um_4k_parallel.s2p");
spiral1.touchstone("spiral6_5_250um_4k.s2p");
spiral2.touchstone("spiral4_5_250um_4k.s2p");
spiral3.touchstone("spiral3_5_250um_4k.s2p");
ld1.touchstone("drainline_240x5_250um_4k.s2p");
ld2.touchstone("drainline_240x5_250um_4k.s2p");
ld3.touchstone("drainline_240x5_250um_4k.s2p");
dcblock2.touchstone("cap_10pF_250um_4k.s2p");
dcblock3.touchstone("cap_10pF_250um_4k.s2p");
dcblock4.touchstone("cap_10pF_250um_4k.s2p");
dcblock5.touchstone("cap_10pF_250um_4k.s2p");
// Specify the input port.
intamp.add_port(in_bond, 1);
// Assemble the amplifier.
intamp.connect(in_bond, 2, in_cpw, 1);
intamp.connect(in_cpw, 2, dcblock2, 1);
intamp.connect(dcblock2, 2, bg1, 1);
intamp.connect(bg1, 3, rg1, 1);
intamp.connect(rg1, 2, gsc1a, 1);
intamp.connect(gsc1a, 2, g50ohm1, 1);
intamp.connect(g50ohm1, 2, gsc1b, 1);
intamp.connect(gsc1b, 2, got1, 1);
intamp.connect(bg1, 2, spiral1, 1);
intamp.connect(spiral1, 2, t1, 1);
intamp.connect(t1, 3, sterm1, 1);
intamp.connect(t1, 4, sterm2, 1);
intamp.connect(t1, 2, ld1, 1);
intamp.connect(ld1, 2, bd1, 1);
intamp.connect(bd1, 3, rd1, 1);
intamp.connect(rd1, 2, dsc1a, 1);
intamp.connect(dsc1a, 2, d50ohm1, 1);
intamp.connect(d50ohm1, 2, dsc1b, 1);
intamp.connect(dsc1b, 2, dot1, 1);
intamp.connect(bd1, 2, dcblock3, 1);
intamp.connect(dcblock3, 2, bg2, 1);
intamp.connect(bg2, 3, rg2, 1);
intamp.connect(rg2, 2, gsc2a, 1);
intamp.connect(gsc2a, 2, g50ohm2, 1);
intamp.connect(g50ohm2, 2, gsc2b, 1);
intamp.connect(gsc2b, 2, got2, 1);
intamp.connect(bg2, 2, spiral2, 1);
intamp.connect(spiral2, 2, t2, 1);
intamp.connect(t2, 3, sterm3, 1);
intamp.connect(t2, 4, sterm4, 1);
intamp.connect(t2, 2, ld2, 1);
intamp.connect(ld2, 2, bd2, 1);
intamp.connect(bd2, 3, rd2, 1);
intamp.connect(rd2, 2, dsc2a, 1);
intamp.connect(dsc2a, 2, d50ohm2, 1);
intamp.connect(d50ohm2, 2, dsc2b, 1);
intamp.connect(dsc2b, 2, dot2, 1);
intamp.connect(bd2, 2, dcblock4, 1);
intamp.connect(dcblock4, 2, bg3, 1);
intamp.connect(bg3, 3, rg3, 1);
intamp.connect(rg3, 2, gsc3a, 1);
intamp.connect(gsc3a, 2, g50ohm3, 1);
intamp.connect(g50ohm3, 2, gsc3b, 1);
intamp.connect(gsc3b, 2, got3, 1);
intamp.connect(bg3, 2, spiral3, 1);
intamp.connect(spiral3, 2, t3, 1);
intamp.connect(t3, 3, sterm5, 1);
intamp.connect(t3, 4, sterm6, 1);
intamp.connect(t3, 2, ld3, 1);
intamp.connect(ld3, 2, bd3, 1);
intamp.connect(bd3, 3, rd3, 1);
intamp.connect(rd3, 2, dsc3a, 1);
intamp.connect(dsc3a, 2, d50ohm3, 1);
intamp.connect(d50ohm3, 2, dsc3b, 1);
intamp.connect(dsc3b, 2, dot3, 1);
intamp.connect(bd3, 2, dcblock5, 1);
intamp.connect(dcblock5, 2, rpad1, 1);
intamp.connect(rpad1, 2, rpad2, 1);
intamp.connect(rpad2, 2, out_cpw, 1);
intamp.connect(out_cpw, 2, out_bond, 1);
// Specify the output port.
intamp.add_port(out_bond, 2);
// Set the global temperature to liquid He.
device::T = 4.2 * Kelvin;
complex::out_degree();
cout << fixed << right;
cout << " Freq S21(dB) S11(dB) S22(dB) Tn(K)"
<< " |delta| K" << endl << endl;
ampdata sd;
for(double freq = 4.0; freq <=8.1; freq += 0.5) {
device::f = freq * GHz;
sd = intamp.get_data();
cout << setw(6) << setprecision(3)
<< freq << " " << setw(8)
<< sd.SdB(2,1) << " " << setw(8)
<< sd.SdB(1,1) << " " << setw(8)
<< sd.SdB(2,2) << " " << setw(8)
if(sd.unconditionally_stable()) cout << " Stable";
cout << endl;
} }