Assembles a circuit's linear MNA system (via general-mna, including its 'D' stamp) with
PWL device segments (via pwl-devices) into one Linear Complementarity Problem, solves it
(via lcp-solver), and reports the resolved DC operating point. No Newton-Raphson, no
voltage limiting, anywhere in this crate — see this repository's docs/architecture.md.
The generic Thevenin/LCP fold
general-mna stamps each diode k as a fixed conductance {k}_G plus a per-instance
current-source symbol {k}_Ioff. Fixing {k}_G at the diode's canonical reference slope
g_off (see pwl_devices::IdealDiode::canonical) makes the whole linear system A0 genuinely
fixed — independent of which segment every diode ends up in — with every segment's actual
nonlinearity pushed entirely into the {k}_Ioff terms via each diode's canonical
max(0, ...) (z) decomposition. Since the system is linear in those Ioff terms, each
diode's terminal voltage is an affine function of every diode's z variables:
x(z) = x0 + sum_j w_j * raw_Ioff_j (raw_Ioff_j = delta_on_j*z2_j - delta_br_j*z1_j)
V_k(z) = v0_k + sum_j gamma_kj * raw_Ioff_j (gamma_kj = w_j[p_k] - w_j[n_k])
where x0 = solve(A0, u0) is the baseline operating point with every diode's Ioff = 0,
and w_j = solve(A0, B[:, diode j's input column]) is how much a unit "raw Ioff" on diode
j moves every unknown. Substituting V_k(z) into each diode's guard equations
(w1_k = V_k - v_breakdown_k + z1_k, w2_k = v_th_k - V_k + z2_k) gives exactly the LCP
(M, q) this crate builds and hands to lcp_solver::solve.