Skip to main content

Module solver

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.
SinglePortGroupAdapter
Adapts a single-port NlDeviceIv into a 1-port NlDeviceGroupIv.
SolverStatsSnapshot
SolverTraceEntry
A single entry in the solver trace buffer, recorded per NR solve call.

Enums§

SolverMethod
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§

NlDeviceGroupIv
Trait for multi-port nonlinear WDF devices with internally coupled I-V.
NlDeviceIv
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_log to retrieve the buffer.
enable_solver_trace
Enable per-solve tracing. Each NR solve will append a SolverTraceEntry to an internal buffer pre-allocated with capacity entries. Call disable_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 into ws.b_nl to avoid allocation.
multi_port_nr_solve_into
Like multi_port_nr_solve, but writes results into ws.b_nl to 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 = b in-place.
solver_stats_snapshot