Fundamentals / Numerical mathematics / Numerical linear algebra

Search directions and modes

Use trial directions, preconditioners and shifted inverses to control which components of a discrete model survive an iteration.

One exact line minimisation

For \(A=\operatorname{diag}(2,8)\), \(b=(2,2)^T\) and \(x_0=0\), find the first CG step and residual. Verify residual orthogonality and determine the final exact solution without performing another matrix-vector product.

Worked solution

With \(p_0=(2,2)^T\), \(p_0^Tr_0=8\) and \(p_0^TAp_0=40\), so \(\alpha_0=0.2\). Then \(x_1=(0.4,0.4)^T\) and \(r_1=(1.2,-1.2)^T\). Its dot product with \(p_0\) is zero, as minimisation along that direction requires.

The exact solution follows by division: \(x_\star=(1,0.25)^T\). One remaining conjugate search direction suffices because two distinct eigenvalues occur. From this starting vector both eigendirections are present.

Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.

Select a preconditioner

Let \(A=\left(\begin{smallmatrix}100&5\\5&1\end{smallmatrix}\right)\). Show that it is positive definite. With the diagonal preconditioner \(M=\operatorname{diag}(100,1)\), form the symmetric transformed matrix and find its condition number. Is diagonal scaling an exact inverse in this case?

Worked solution

The leading minors are 100 and 75, both positive. Multiplying left and right by \(\operatorname{diag}(0.1,1)\) gives \(\left(\begin{smallmatrix}1&0.5\\0.5&1\end{smallmatrix}\right)\). Its symmetric and antisymmetric modes have eigenvalues 1.5 and 0.5, giving condition number 3.

The scaling removes the difference between diagonal stiffnesses while retaining the off-diagonal coupling. The transformed matrix is distinct from the identity; a general right-hand side can therefore require two CG steps in exact arithmetic.

Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.

Locate a vibration mode

A mass-normalised operator has eigenvalues 9, 16 and 25 s⁻². Which natural angular frequencies do they represent? With shift \(15\ \mathrm{s^{-2}}\), give the transformed eigenvalues for inverse iteration and identify the selected mode for a generic initial vector. Finally, specify the units and meaning of a unit-vector Rayleigh residual of 0.01 s⁻².

Worked solution

Taking square roots gives angular frequencies 3, 4 and 5 rad/s. The transformed eigenvalues are \(1/(9-15)=-1/6\), \(1/(16-15)=1\) and \(1/(25-15)=1/10\) in s². The middle mode has the largest magnitude and dominates if it has nonzero initial overlap.

For a symmetric operator at least one squared frequency lies within 0.01 s⁻² of the Rayleigh quotient. Near \(16\ \mathrm{s^{-2}}\), the corresponding frequency uncertainty is about \(0.01/(2\cdot4)=0.00125\) rad/s, from differentiating the square root. This last expression is a local linear estimate.

Explore the related calculation with adjustable inputs. Change the parameters in the corresponding calculation and compare its independently recomputed values with the equation derived in this solution.

Compare two shifts on the same symmetric operator

For \(A=\left(\begin{smallmatrix}2&1\\1&2\end{smallmatrix}\right)\), compute one unshifted QR step using a positively oriented orthogonal basis. Then use shift one and choose any orthonormal completion if the shifted matrix loses rank. Explain why a singular shifted matrix causes no division by an eigenvalue in this method.

Worked solution

The first unshifted column gives

\[q_1=(2,1)^T/\sqrt5,\ q_2=(-1,2)^T/\sqrt5.\]

Their Rayleigh values are \(14/5\) and \(6/5\), and \(q_2^TAq_1=3/5\). The trailing coordinate still has residual 0.6.

With shift one the first shifted column is \((1,1)^T\). Its normalised direction and the perpendicular direction are already the two eigenvectors. The updated matrix is diagonal with entries 3 and 1, so deflation is exact. A zero last pivot in the QR factor is allowed because the algorithm multiplies factors and never solves with the singular matrix \(A-I\).

Explore the related calculation with adjustable inputs. Compare unshifted spectral convergence as the gap narrows; the explicit shifted QR identity in this exercise supplies the separate exact shift check.

Revisit chapter 6 · Follow the whole spectrum by QR iteration.

Bound the effect of stopping a linear solve early

On the common ten-cell mesh the direct and loose-tolerance CG peak temperatures are 0.05708900 and 0.05620782 K. The maximum pointwise difference over all nodes is reported as \(8.8\times10^{-4}\) K to two significant figures. Derive a bound for the difference between maxima even if the two peak nodes differ. Evaluate it here. Does it bound the continuum error?

Work through the solution

For any nodes \(i\),

\[u_i\le v_i+\lVert u-v\rVert_\infty.\]

Maximise both sides, then interchange \(u,v\), to obtain

\[|\max u-\max v|\le\lVert u-v\rVert_\infty.\]

The two listed peaks differ by 0.00088118 K, consistent with the rounded all-node bound. The argument compares solutions sampled on one mesh. It cannot bound the continuous peak error because neither discretisation nor off-node sampling is included.

Use the OneSimulation laboratory to check your answer