conjugate-gradient-methods

← ~/visualizations

conjugate-gradient-methods #

Shows CG as iterative minimization of an SPD quadratic: left panel draws elliptical level sets and the step-by-step path using A-conjugate search directions (contrasted with a preconditioned variant). Right panel tracks residual norms ||r_k|| and a meter for the A-conjugacy condition p_k^T A p_{k-1}≈0, illustrating independent 1-D minimizations over expanding Krylov subspaces.

canvasclick to interact

⏮◀◀▶▶STEP0.25x1xZOOM

t=0s

practical uses #

technical notes #

Implements a fixed 2D SPD quadratic (A,b) and precomputes a few CG/PCG iterates. Animation interpolates along the current segment (eased) and alternates highlighting CG vs PCG each half-cycle. Contours are drawn via coarse grid sampling for a retro blocky look; all geometry is snapped to a pixel grid sized from scale.

← rlhfactivation-functions →