Units & Dates

Estimate Acceleration of Gravity

The acceleration of gravity can be obtained by measuring a pendulum's period and its length using . The uncertainty in the average of five repeated measurements of the period is modeled with a BatesDistribution.

In[1]:=
Click for copyable input
\[Mu]T = Quantity[2, "Seconds"]; \[CapitalDelta]T = Quantity[0.01, "Seconds"]; period\[ScriptCapitalD] = BatesDistribution[ 5, {\[Mu]T - \[CapitalDelta]T/2, \[Mu]T + \[CapitalDelta]T/2}]
Out[1]=

The pendulum's length has been measured using a ruler with resolution of 1 mm, so its uncertainty is modeled with a UniformDistribution.

In[2]:=
Click for copyable input
\[Mu]len = Quantity[1, "Meters"]; \[CapitalDelta]len = UnitConvert[Quantity[1, "mm"], "Meters"]; len\[ScriptCapitalD] = UniformDistribution[{\[Mu]len - \[CapitalDelta]len/ 2., \[Mu]len + \[CapitalDelta]len/2.}]
Out[2]=

The uncertainty in the measurement of the acceleration of gravity.

In[3]:=
Click for copyable input
g\[ScriptCapitalD] = TransformedDistribution[ (2 \[Pi])^2 len/T^2, {len \[Distributed] len\[ScriptCapitalD], T \[Distributed] period\[ScriptCapitalD]}]
Out[3]=

Compare to the linear approximation.

In[4]:=
Click for copyable input
lin[e_, {x_, x0_}, {y_, y0_}] := Block[{f = Function @@ {{x, y}, e}}, f[x0, y0] + \!\(\*SuperscriptBox[\(f\), TagBox[ RowBox[{"(", RowBox[{"1", ",", "0"}], ")"}], Derivative], MultilineFunction->None]\)[x0, y0] (x - x0) + \!\(\*SuperscriptBox[\(f\), TagBox[ RowBox[{"(", RowBox[{"0", ",", "1"}], ")"}], Derivative], MultilineFunction->None]\)[x0, y0] (y - y0)]
In[5]:=
Click for copyable input
lin\[ScriptCapitalD][\[ScriptCapitalD]_] := NormalDistribution[Mean[\[ScriptCapitalD]], StandardDeviation[\[ScriptCapitalD]]]
In[6]:=
Click for copyable input
gApprox\[ScriptCapitalD] = TransformedDistribution[ lin[(2 Pi)^2 len/ T^2, {len, \[Mu]len}, {T, \[Mu]T}], {len \[Distributed] lin\[ScriptCapitalD][len\[ScriptCapitalD]], T \[Distributed] lin\[ScriptCapitalD][period\[ScriptCapitalD]]}]
Out[6]=

Compute the average acceleration using the exact and the linearized distributions.

In[7]:=
Click for copyable input
{\[Mu]g, \[Mu]gApprox} = {NExpectation[g, g \[Distributed] g\[ScriptCapitalD]], NExpectation[g, g \[Distributed] gApprox\[ScriptCapitalD]]}
Out[7]=

Compute the scales of uncertainty.

In[8]:=
Click for copyable input
{\[Sigma]g, \[Sigma]gApprox} = {Sqrt[ NExpectation[(g - \[Mu]g)^2, g \[Distributed] g\[ScriptCapitalD]]], StandardDeviation[gApprox\[ScriptCapitalD]]}
Out[8]=

Find the sampling estimate of the 90% confidence interval for the measured acceleration.

In[9]:=
Click for copyable input
confidenceInterval = Quantile[RandomVariate[g\[ScriptCapitalD], 10^6], {0.05, 0.95}]
Out[9]=
In[10]:=
Click for copyable input
NProbability[First[confidenceInterval] < x < Last[confidenceInterval], x \[Distributed] g\[ScriptCapitalD]]
Out[10]=

Related Examples

de es fr ja ko pt-br ru zh