1 * switch as negative resistance oscillator
2 * Spice netlister for gnetlist
6 .MODEL SWITCH1 SW VT=2.5 VH=2.475 RON=1 ROFF=10MEG
8 *>.print tran + r(SW1) iter(0) input(sw1) timef(sw1) control(0)
11 .tran 10e-6 200e-6 uic trace all
12 *>.measure t2=cross("v(1)" cross=2 fall last)
13 *>.measure t1=cross("v(1)" cross=2 fall last before=t2)
14 *>.measure t0=cross("v(1)" cross=2 fall last before=t1)
15 *>.measure tmin0=min("v(1)" arg last after=t0 before=t1)
16 *>.measure tmin1=min("v(1)" arg last after=t1 before=t2)
17 *>.measure tmax1=max("v(1)" arg last before=t1 after=t0)
18 *>.param falltime=tmin1-tmax1
19 *>.param risetime=tmax1-tmin0