import numpy as np
def g(l,t):
'''Function giving "little g" from the measured length and
period of a simple pendulum'''
return 4*np.pi**2*l/t**2
l = 0.96 # length of pendulum in meters
t = 1.970 # period of pendulum in seconds
delta_t = 0.004 # uncertainty of the period in seconds
g_best = g(l,t)
g_plus = g(l, t + delta_t)
g_minus = g(l, t - delta_t)
print('g_best = ',g_best)
print('uncertainty with plus sign:', g_plus - g_best)
print('uncertainty with minus sign:', g_minus - g_best)
Since I'm only going to use one significant figure in in my uncertainty, these two values are equivalent, and my result is
$$ g = 9.77 \pm 0.04\, \mbox{m/s$^2$}. $$If $\Delta T$ is large enough that the first order linear approximation
$$ g(L,T\pm \Delta T)\simeq g(L,T) \pm \frac{\partial g}{\partial T}\, \Delta T $$breaks down, then the two uncertainties will not be the same. For example, if $\Delta t= 0.3\,\mbox{s}$, the two uncertaintiels are not equal:
alpha_t = 0.3
g_best = g(l,t)
g_plus = g(l, t + alpha_t)
g_minus = g(l, t - alpha_t)
print('g_best = ',g_best)
print('uncertainty with plus sign:', g_plus - g_best)
print('uncertainty with minus sign:', g_minus - g_best)
We can be a liitle more quantitative about this by considering higher order terms in our Taylor's series expansions of $g(L,T)$:
\begin{eqnarray*} g(L,T+\Delta T) &\simeq& g(L,T) + \frac{\partial g}{\partial T} \, \Delta T + \frac{1}{2}\frac{\partial^2 g}{\partial T^2} \Delta T^2\\ g(L,T-\Delta T) &\simeq& g(L,T) - \frac{\partial g}{\partial T}\, \Delta T + \frac{1}{2}\frac{\partial^2 g}{\partial T^2}\, \Delta T^2. \end{eqnarray*}These expressions will have the same magnitude when the terms quadratic in $\Delta T$ are small compared to the linear terms, i.e.,
$$ \frac{1}{2}\frac{\partial^2 g}{\partial T^2} \Delta T^2 \ll \frac{\partial g}{\partial T} \, \Delta T. $$Rearranging this gives the condition on $\Delta T$:
$$ \Delta T \ll 2\frac{\frac{\partial g}{\partial T}}{\frac{\partial^2 g}{\partial T^2}} $$In this problem we have
$$ \frac{\partial g}{\partial T} = -\frac{8\pi^2 L}{T^3}\quad\mbox{and}{\quad} \frac{\partial^2 g}{\partial T^2} = \frac{24\pi^2L}{T^4} $$so our condition on the size of $\Delta T$ becomes
$$ \Delta T \ll \frac{2}{3}T. $$This means that in this problem the two uncertainties will be the same when $\Delta T\ll 4/3\, \mbox{s}$, or when $\Delta T$ is, say, less than a tenth of 4/3 ($\simeq 0.13)$.
version_information
is from J.R. Johansson (jrjohansson at gmail.com); see Introduction to scientific computing with Python for more information and instructions for package installation.
version_information
is installed on the linux network at Bucknell
%load_ext version_information
%version_information