This subroutine isn't as accurate a way of calculating the period as the energy-based one we used in the undamped case, since it only checks whether the mass turned around at some point during the tim...This subroutine isn't as accurate a way of calculating the period as the energy-based one we used in the undamped case, since it only checks whether the mass turned around at some point during the time interval \(\Delta{}t\). A subtle point here is that although the maximum of \(A\) and the maximum of \(A^2\) must occur at the same frequency, the maximum energy does not occur, as we might expect, at the same frequency as the maximum of \(A^2\).