Module solver
Expand description
Shared Newton-Raphson solver and numerical utilities for nonlinear WDF roots.
Structs§
- NrWorkspace
- Pre-allocated workspace for the multi-port NR solver. Eliminates per-sample heap allocations by reusing buffers across calls.
- Single
Port Group Adapter - Adapts a single-port
NlDeviceIvinto a 1-portNlDeviceGroupIv. - Solver
Stats Snapshot - Solver
Trace Entry - A single entry in the solver trace buffer, recorded per NR solve call.
Enums§
- Solver
Method - Per-instance diode solver method selector.
Constants§
- LEAKAGE_
CONDUCTANCE - Minimum conductance returned by nonlinear element derivative functions when a device is in cutoff or reverse-bias.
- NR_
MAX_ ITER - Default maximum Newton-Raphson iterations for nonlinear device solvers. Higher values reduce convergence failures (waveform discontinuities) at the cost of increased CPU usage per sample.
Traits§
- NlDevice
Group Iv - Trait for multi-port nonlinear WDF devices with internally coupled I-V.
- NlDevice
Iv - Trait for nonlinear WDF devices that provide their I-V characteristic.
Functions§
- disable_
grouped_ residual_ log - Disable per-iteration residual logging and return the accumulated residuals.
- disable_
solver_ trace - Disable per-solve tracing and return the accumulated trace entries. Returns an empty vec if tracing was not enabled.
- enable_
grouped_ residual_ log - Enable per-iteration residual logging for the grouped solver (std + test
diagnostic). Each grouped-NR iteration appends its residual norm so callers
can assert the Armijo line search produces a monotone non-increasing
residual. Call
disable_grouped_residual_logto retrieve the buffer. - enable_
solver_ trace - Enable per-solve tracing. Each NR solve will append a
SolverTraceEntryto an internal buffer pre-allocated withcapacityentries. Calldisable_solver_trace()to retrieve and consume the buffer. - multi_
port_ nr_ solve - Multi-port Newton-Raphson solver for coupled nonlinear WDF elements.
- multi_
port_ nr_ solve_ grouped - Multi-port Newton-Raphson solver for devices with cross-coupled I-V.
- multi_
port_ nr_ solve_ grouped_ into - Like
multi_port_nr_solve_grouped, but writes results intows.b_nlto avoid allocation. - multi_
port_ nr_ solve_ into - Like
multi_port_nr_solve, but writes results intows.b_nlto avoid allocation. - newton_
raphson_ solve - Unified Newton-Raphson solver for all WDF nonlinear root elements.
- reset_
solver_ stats - softplus
- Numerically stable softplus:
ln(1 + exp(x)). - solve_
small_ linear - Solve a small N×N linear system
A·x = bin-place. - solver_
stats_ snapshot