* Diode I–V curve via .dc source sweep
Vs a 0 DC 0
R1 a d 100
D1 d 0 DMOD
.model DMOD D(IS=1e-14 N=1)
.dc Vs 0 1 0.05
.control
  run
  meas dc vd_1v FIND v(d)   AT=1.0
  meas dc id_1v FIND i(vs)  AT=1.0
.endc
.end
