Notice that our original approach in section \ref{219511} of explicitly calculating the uncertainty in \(V_{pd}\) from Eq. \ref{eq:delta_V_Malus} and this new approach of using the uncertainties
package give equivalent results, but that in both cases we needed a good estimate of \(V_0\pm\delta V_0\) to determine \(V_{pd}\pm\delta V_{pd}\) at each value of \(\theta\).
In general, either of these two approaches will be sufficient for most of our work with data, but notice that because both involve linear expansions of functions about their nominal values, both yield an unrealistically low uncertainty of zero for small variations in \(V_0\) and \(\phi\) (neglecting \(\delta V_1\) for now) at \(\phi=\ \theta-\ \theta_0=0\) . This is because an Taylor expansion of \(\cos\left(\phi\right)\) around \(\phi=0\) yields \(\cos\left(0\pm\delta\phi\right)=\ 0\ +\ 0\ \cdot\delta\phi+\ \frac{1}{2}\cdot\left(\delta\phi\right)^2+\ ...\ =\ 0\) in the linear approximation limit (which treats terms of order \(\left(\delta\phi\right)^2\) and higher as being negligibly small).
If you need still more advanced approaches to
propagation of uncertainty, the author of
uncertainties recommends looking at
soerp and
mcerp. According to the uncertainties website, "the
soerp package performs
second-order error propagation: this is still quite fast, but the standard deviation of higher-order functions like f(x) = x
3 for x = 0±0.1 is calculated as being exactly zero (as with
uncertainties
). The
mcerp package performs Monte-Carlo calculations, and can in principle yield very precise results, but calculations are much slower than with approximation schemes."
Installing Python
This section is only relevant if you are planning on running Python on your own computer. If you are running Python within a Jupyter notebook on a webserver or a computer account which has already been configured for your use (such as
https://jove.smith.edu for Smith College physics) , this section can be skipped.
Python distributions
Our focus in this article is on the use of Python to expedite the analysis of your experimental data and not, for example, the specifics of various Python distributions and their relative merits for computational physics in terms of speed, accuracy, and memory requirements.
We therefore recommend that if you need to install a Python distribution for scientific data analysis in physics on your own computer, you choose an installer that will automatically install
Python, interactive Python (
iPython) and
Jupyter notebooks, scientific python development environments (editing, testing, debugging) such as
Spyder or
Canopy, and essential
Scientific Python packages (such as
numpy,
matplotlib and
scipy) in a single step, rather than building this from scratch. This provides ease of installation, ease of use, and a comprehensive curated set of preinstalled and easily added packages.