* .disto: harmonic distortion products at a diode node
.model DMOD D(IS=1e-14)
V1 in 0 DC 0.6 AC 1 DISTOF1 1
R1 in a 1k
D1 a 0 DMOD
.disto dec 5 1k 100k
.control
  run
  setplot disto1
  let hd2 = mag(a)
  print hd2[0]
  setplot disto2
  let hd3 = mag(a)
  print hd3[0]
.endc
.end
