Use final r[-1] in a unit test:
r[-1]
def test_convergence_rates(): r = convergence_rates(m=5, num_periods=8) # Accept rate to 1 decimal place nt.assert_almost_equal(r[-1], 2.0, places=1)
Complete code in vib_undamped.py.