floatgmin: floating nodes are tied so the OP solves under the default (SPARSE) solver

* (exec-spice "ngspice -b %s")

.model nm nmos level=1 vto=0.7 kp=100u
* SPARSE (default solver)
v1 d 0 2
r1 d dd 1k
vg g 0 1.5
m1 dd g 0 0 nm w=10u l=1u
* a dangling gate (floatg) and an only-bulk MOS (dead1/2/3) -- all float
m2 dd floatg 0 0 nm w=10u l=1u
m3 dead1 dead2 dead3 0 nm w=10u l=1u

.control
define mismatch(a,b,err) abs(a-b)>err
let fail_count = 0

* floatgmin is on by default: the OP must solve. v(dd)=2*1k/(1k+Ron) ~ 1.68 V.
op
if mismatch(v(dd), 1.68, 1e-3)
  let vt = v(dd)
  echo "ERROR: v(dd) = $&vt but should be ~1.68 V"
  let fail_count = fail_count + 1
end

* and floatgmin=0 must make the same deck fail (proves the tie is what solved it)
* -- checked in floatgmin-3; here we only assert the positive case.

if fail_count > 0
  echo "ERROR: $&fail_count of 1 tests failed"
  quit 1
else
  echo "INFO: $&fail_count of 1 tests failed"
  quit 0
end
.endc
.end
