Solution (source code)

= Solution

For an $s$-stage <Runge-Kutta method> with coefficient <matrix> $A=(a_{ij})$ and weights $b=(b_i)$, put $B=\operatorname{diag}(b_i)$. It is <algebraically stable> when
$$
\boxed{b_i\geq0\quad\text{for every }i,\qquad
M=BA+A^TB-bb^T\succeq0.}
$$
Equivalently, $m_{ij}=b_ia_{ij}+b_ja_{ji}-b_ib_j$ defines a <positive semidefinite> symmetric <matrix>. The condition concerns the full coefficient tableau and nonlinear contractivity, not merely the scalar <stability function>. It is normally used with a consistent <Runge-Kutta method> and stage equations satisfying the necessary <stage solvability of an implicit Runge-Kutta method>.