pub enum InitState {
Named(String),
Explicit {
vbe: f64,
vce: f64,
},
NodeVoltage {
v: f64,
},
}Expand description
Named or explicit initial state for one NL device in an init { ... } block.
Named states expand to physics-based voltages at compile time:
- BJT NPN:
saturated→ [Vbe=0.75, Vce=0.1],cutoff→ [Vbe=0.0, Vce=supply],active→ [Vbe=0.65, Vce=supply/2] - Diode:
forward→ Vd=0.7,reverse→ Vd=-supply/2 - PNP signs are flipped automatically.
Variants§
Named(String)
A human-readable alias: “saturated”, “cutoff”, “active”, “forward”, “reverse”.
Explicit
Explicit per-terminal operating-point seed from the optional op { } block.
For a BJT these are the two nonlinear-port voltages the grouped-NR solves
over: base-emitter (vbe) and collector-emitter (vce). This is a pure
warm-start seed (v_prev); it never folds device Jacobians or changes the
stage’s DC source term. Used to test whether an externally-derived
operating point (e.g. ngspice’s .op) is a stable WDF fixed point.
NodeVoltage
Explicit node voltage seed from the optional op { nodes { ... } }
sub-block. device_label carries the circuit node NAME (a pin name like
Q3.base, or a reserved node like in/out/vcc), and v is its DC
voltage. Used to seed reactive (capacitor) ports at a full operating
point: each cap’s stored DC voltage is V(node_a) − V(node_b). Like
Explicit, it is a pure warm-start seed — it never changes the stage’s
DC source term.