DekEn

อัปเดต 2026-09-07

Convergence honesty guards (head-sanity + anti-hunting)

no fake convergence

Two numerical-honesty traps inside the Newton solver: a head-sanity gate rejects a 'converged' state with a physically impossible head (e.g. thousands of metres negative) instead of accepting it, and an anti-hunting freeze locks a valve's open/closed status if it flips for 5 consecutive iterations instead of looping forever or converging on a fake oscillation.

เมื่อไรจึงใช้
  • A solve reports non-convergence and you want to know it's because the state was genuinely nonsensical, not just slow to settle.
  • A network with control/check valves is failing to converge and you suspect valve status is oscillating rather than settling.
  • You're hardening a new iterative solver path (transient, gas-network) and want the pattern for numerical-honesty guards worth copying.
คำนวณอย่างไร

Head-sanity: a hard bound check on the solved head vector before declaring convergence, independent of the residual norm. Anti-hunting: tracks each valve's status across iterations and freezes it once a flip-flop pattern is detected, trading a small bias for guaranteed termination on a real answer rather than a numerically 'converged' impossible one.

ข้อควรระวัง
noteA frozen valve status is a deliberate approximation for that solve, not a bug — it means the true state may be right at the switching boundary; treat a frozen-valve result as a note to re-check with a finer approach, not as fully resolved physics.
noteHead-sanity firing usually means the underlying model is genuinely wrong (bad boundary condition, degenerate topology) rather than a solver limitation — it's a diagnostic signal pointing back at the model, not just noise to suppress.
ที่เกี่ยวข้อง