Skip to main content

7.4b Tests-before-use labs

Source: Lab ideas from Computational Physics (Landau, Páez, Bordeianu), §7.4. Rewritten as original drills. Continues 7.4 Tests before use.

Pure-Python lists only (no NumPy). Reuse Gauss–Jordan / elimination ideas from 7.3b. Stubs fail until filled; floats are locked below.

Shared test matrix

A=(4−2136−4218),Aanalytic−1=1263(52172−323019−9−830).A=\begin{pmatrix}4&-2&1\\3&6&-4\\2&1&8\end{pmatrix},\qquad A^{-1}_{\mathrm{analytic}}=\frac{1}{263}\begin{pmatrix}52&17&2\\-32&30&19\\-9&-8&30\end{pmatrix}.

Labs​

Activity: Invert AA by Gauss–Jordan

Augment [A∣I][A\mid I], reduce the left half to II, and read A−1A^{-1} from the right. Print the first row of the inverse with 10 decimals, space-separated.

No input.

Write-ups​

0/4 solved
7.4b.W1

Using “residual”, “identity”, and “epsilon”, explain:

Why is max|AA⁻¹ − I| a useful check after computing a numerical inverse?

Minimum 3 words. Your answer must include: “residual”, “identity”, “epsilon”.

0 words/ 3 min

Meet the writing requirements, then you can open the model answer.

Explorers​

Next: 7.5 Two masses on a string.