Repository navigation
Enhancement-896: the built-in HICUM's Jacobian is its currents' — ac at 1 Hz was 2.1 % off the dc derivative at the default t0 = 0
Enhancement-896: the built-in HICUM's Jacobian is its currents' — ac at 1 Hz was 2.1 % off the dc derivative at the default t0 = 0
Scope: F2 of the
analyses correctness campaign of 2026-10-16,
and two KLU slips found while checking it. The rest of what the dig found is
E-897 (values), E-898 (pnp) and
E-899 (self-heating robustness).
ngspice:
spicelib/devices/hicum2/hicumL2.cpp: the low-injectionQ_0derivative;calc_rbiand
calc_ibettake their bias-dependent inputs as dual numbers.spicelib/devices/hicum2/hicum2bindCSC.candspicelib/devices/soi3/soi3bindCSC.c: a
matrix pointer bound twice for KLU, once each.
ngspice only.
Suites:
hicum2_examples, new: checks [1] to [6] are this
enhancement's, 16 of 16 per solver. On the E-895 binaries 15 of 16 fail; [6], a scan of
the source tree, passes on any binary.- The full sweep: 592 of 592.
What was wrong
ac at 1 Hz is the derivative of the operating point. The campaign's Family A found the built-in
HICUM (level=8) 9.2e-4 off it, where every other model was within 3.4e-6. The compiled HICUM
L2, with the same card, was within 1e-8.
Four slips, each in a derivative the C++ port computes beside its current:
- The low-injection hole charge. With
t0= 0, its default, the transfer current takes
the branch that skips the inner Newton forQ_pT. The dual seed of that branch's ∂/∂Vbiei
call readQ_0*Vbiei, the charge times the voltage, where every other call passes
Q_0_Vbiei. With onlyc10andqp0given,acwas 2.07 % off. - The internal base resistance.
calc_rbitookQjeiandQfas dual arguments but read
Qjciandibeifrom the enclosing scope as plain numbers. ∂rbi/∂Vbici left out the
conductivity modulation throughQjci. ∂rbi/∂Vbiei and ∂rbi/∂T left out the emitter current
crowding throughibei. Withrbi0= 10: 1.04e-3. - The tunnelling current.
calc_ibetreadCjepandCjeias plain numbers, so ibet's
derivatives left out the capacitances' bias dependence. With the b-e junction reverse biased
by 3 V, the base'sacgain was 71 % off. - KLU.
hicum2bindCSC.cboundHICUMcollTempPtrtwice. The second lookup searched for a
pointer the first had already moved into the CSC matrix, missed, and set the binding to
NULL. Soacnever switched that entry to the complex matrix, and its stamps landed in the
real one. Self-heating withrcxandzetarcxgave 3.6e-3 under KLU, nothing under Sparse.
soi3bindCSC.cdid the same withSOI3TOUT_toutPtr, the thermal node's diagonal.
An SOI3 stage withrtgave −5.29 under KLU against −1.31 under Sparse, with "matrix bindings
are stale" on stderr.
The transient was unaffected: Newton converges on the currents, whatever the Jacobian. noise,
pz and .sp stamp the same matrix as ac.
The change
Q_0+e1*Q_0_Vbieiin the low-injection ∂/∂Vbiei call.calc_rbi(T, Qjei, Qjci, Qf, ibei). Each call seeds the derivative of every argument that
depends on its variable:Qjcifor Vbici,ibeifor Vbiei and T.calc_ibet(Vbiei, Vbpei, T, Cjei, Cjep), seeded the same way.- The second binding of
HICUMcollTempPtr, and ofSOI3TOUT_toutPtr, is gone, in each file's
three binding functions.
The checks
hicum2_examples:
- [1]
t0= 0:acwithin 1e-6 of the central difference of a three-pointdcsweep.
E-895: 2.1e-2. - [2]
rbi0= 10: within 1e-6. E-895: 1.0e-3. - [3] Tunnelling, b-e at −2 V: the base within 1e-6. E-895: 0.43.
- [4] Self-heating with
rcxandzetarcxunder KLU: within 1e-6, and equal to Sparse's
ac. E-895: ngspice exits at thedcsweep that follows theac(E-899's thermal node); the
acalone is 3.6e-3 off under KLU. - [5] SOI3 with
rtunder KLU:acequal to Sparse's, no stale binding. E-895: −5.29
against −1.31. - [6] No device's KLU binding names a matrix pointer twice, unless an
elseseparates the
two. VSRC binds its port and non-port pointers that way.
200 random cards over the model's feature groups (GICCR, base currents, tunnelling, avalanche,
rbi, external resistances, the substrate transistor, every capacitance, transit time, critical
current, vcbar, NQS, lateral spreading, temperature, self-heating), ac against the dc
derivative for both the base drive and the supply, with this and E-897 to E-899 together:
- E-895: 74 cards more than 1e-5 off, 54 more than 1e-3, 5 more than 0.1.
- Now: 4 more than 1e-5. Two are finite-difference noise: gains of 0.002 V/V, and a smaller step
agrees to 1e-6. Two keep 4e-5 and 1e-4 at every step; see Limits.
Limits
Two of the 200 cards keep a steady 4e-5 and 1e-4 gap between ac and the dc derivative, at
every finite-difference step. Both combine GICCR weighting, rbi0, tunnelling and the
peripheral b-e current. The gap is 1/10 to 1/100 of a typical reltol, and its source was not
found.
Write-up: enhancements_doc/Enhancement-896.md