{ "cells": [ { "cell_type": "markdown", "metadata": { "id": "ujxzieoK9eeu" }, "source": [ "# Uncertainty Calculations" ] }, { "cell_type": "markdown", "metadata": { "id": "q5vV_5Wl9eew" }, "source": [ "The *uncertainties* package allows you to perform calculations on numbers with uncertainties. It handles the propagation of uncertainties for you. The following line can be used to install (or upgrade) the package in Anaconda or Google Colabaoratory." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "FoG0U5Zr9eex" }, "outputs": [], "source": [ "pip install --upgrade uncertainties" ] }, { "cell_type": "markdown", "metadata": { "id": "jFRLQNC89eez" }, "source": [ "## Individual Numbers with Uncertainties" ] }, { "cell_type": "markdown", "metadata": { "id": "-60bF22S9ee0" }, "source": [ "The following import statements make the parts of the package for inidividual numbers available." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "id": "A7bajDpk9ee1" }, "outputs": [], "source": [ "from uncertainties import ufloat, ufloat_fromstr\n", "from uncertainties.umath import *" ] }, { "cell_type": "markdown", "metadata": { "id": "zLklHgVE9ee2" }, "source": [ "There are multiple ways to create a variable like $2.0 \\pm 0.2$. With the **`ufloat`** function, the two arguments are the number and its uncertainty. " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true, "id": "7TJmbRby9ee2", "outputId": "116e0271-c55b-406f-a139-e9bdf8981930" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2.00+/-0.20\n" ] } ], "source": [ "r = ufloat(2.0, 0.2)\n", "print(r)" ] }, { "cell_type": "markdown", "metadata": { "id": "2LTQs4Gl9ee2" }, "source": [ "Using the **`ufloat_fromstr`** function, the the number and its uncertainty are entered as strings (between double quotes). The second example is equivalent to $(4.1 \\pm 0.3)\\times 10^{-4}$." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true, "id": "SE_520Fs9ee4", "outputId": "00ef515d-7155-49c5-ba2c-7dc869076254" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "3.2+/-0.4\n", "0.000410+/-0.000030\n" ] } ], "source": [ "s = ufloat_fromstr(\"3.2 +/- 0.4\")\n", "t = ufloat_fromstr(\"(4.1 +/- 0.3)e-4\") # factored exponential\n", "print(s)\n", "print(t)" ] }, { "cell_type": "markdown", "metadata": { "id": "OWajQUNI9ee5" }, "source": [ "Calculations can be performed just as for ordinary numbers, but the uncertainties are propagated automatically." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true, "id": "ZQ3u4FJX9ee5", "outputId": "1c24ae5e-1681-4294-b333-fcc3e54272df" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4.0+/-0.8\n", "0.00131+/-0.00019\n" ] } ], "source": [ "square = r**2\n", "print(square)\n", "product = s*t\n", "print(product)" ] }, { "cell_type": "markdown", "metadata": { "id": "2dpRBHh99ee6" }, "source": [ "You can also access the number (nominal value) and the uncertainty (standard deviation) separately. " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "VVqobA7r9ee7", "outputId": "6592441c-88c4-4cbe-f065-79cdcfd497c0" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4.0\n", "0.8\n" ] } ], "source": [ "print(square.nominal_value)\n", "print(square.std_dev)" ] }, { "cell_type": "markdown", "metadata": { "id": "DUMkfxxn9ee8" }, "source": [ "It is possible to perform calculations involving mathematical functions (see a list a the end of this tutorial)." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "Tk895bUB9ee9", "outputId": "622b7bfe-0b75-4e01-df1f-a933f453ceea" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-0.96+/-0.23\n" ] } ], "source": [ "print(sin(1+r**2))" ] }, { "cell_type": "markdown", "metadata": { "id": "dYPEznjj9ee9" }, "source": [ "## Arrays of Numbers with Uncertainties" ] }, { "cell_type": "markdown", "metadata": { "id": "CMBFYqcN9ee-" }, "source": [ "The following import statement makes it possible to use arrays of numbers with uncertainties. " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true, "id": "Unwaw1AY9ee-" }, "outputs": [], "source": [ "from uncertainties import unumpy" ] }, { "cell_type": "markdown", "metadata": { "id": "pMy-_0OU9ee_" }, "source": [ "The **`unumpy.uarray`** function takes lists of the nominal values and their uncertainties." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true, "id": "muDTz4Xb9ee_", "outputId": "f0438301-7ae9-4504-e407-69a4e7e4aa6b" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1.0+/-0.1 4.0+/-0.2 9.0+/-0.3 16.0+/-0.4]\n" ] } ], "source": [ "y = unumpy.uarray([1, 4, 9, 16], [0.1, 0.2, 0.3, 0.4])\n", "print(y)" ] }, { "cell_type": "markdown", "metadata": { "id": "4T472xeA9efA" }, "source": [ "The numbers (nominal values) and the uncertainties (standard deviations) can be accessed as follows. " ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true, "id": "VChRQiVJ9efA", "outputId": "084b9024-2d64-417f-8366-17b045f9deca" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[ 1. 4. 9. 16.]\n", "[0.1 0.2 0.3 0.4]\n" ] } ], "source": [ "print(unumpy.nominal_values(y))\n", "print(unumpy.std_devs(y))" ] }, { "cell_type": "markdown", "metadata": { "id": "JhsCOtwy9efA" }, "source": [ "You can perform calculations on the elements of the array. The list of functions that can follow \"unumpy\" are listed at the end of this tutorial." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "X8TPOrmv9efB", "outputId": "6dbf86f1-9189-44b9-b45e-a46fb6357d62" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[1.0+/-0.05 2.0+/-0.05 3.0+/-0.049999999999999996 4.0+/-0.05]\n" ] } ], "source": [ "print(unumpy.sqrt(y))" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": true, "id": "5nytMZkv9efB", "outputId": "38e1fbab-46b3-4159-eeca-235fee424801" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "[0.5403023058681398+/-0.08414709848078966\n", " -0.6536436208636119+/-0.15136049906158566\n", " -0.9111302618846769+/-0.12363554557252697\n", " -0.9576594803233847+/-0.11516132666602613]\n" ] } ], "source": [ "print(unumpy.cos(y))" ] }, { "cell_type": "markdown", "metadata": { "id": "4sCHYRcA9efB" }, "source": [ "It is often useful to find an average (mean) of the elements of an array." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "id": "-OlNNaNs9efB", "outputId": "12199b59-fad8-42a8-9fc9-e0e6ea8a6989" }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "7.50+/-0.14\n" ] } ], "source": [ "print(y.mean())" ] }, { "cell_type": "markdown", "metadata": { "id": "h-dXdKvw9efC" }, "source": [ "As an example, suppose that you have data for variables $x$ and $y$, where there are uncertainties for the values of $y$. It is easy to make a plot of $\\log(y)$ vs. $\\log(x)$ with appropriate error bars." ] }, { "cell_type": "code", "execution_count": null, "metadata": { "scrolled": false, "id": "prkkTSNQ9efD", "outputId": "fef5c2de-5506-467a-8452-33d1db491456" }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8vihELAAAACXBIWXMAAAsTAAALEwEAmpwYAAAQj0lEQVR4nO3dX4xmdX3H8feHXYwFajG7Q7W7bPnTtbo20Ogs/klTMbbKYtKNqQ1/jFC6Zksjpo0xgZtqE9KLXtQaI7hugIA3bi9Eay1KTBvhArA7NICsihmWuAyYMCyogS2Fdb+9mMd1dpyd58zumXlmfr5fySTnd36/Pef7zdn55Ow588ymqpAkrX6njLoASVI/DHRJaoSBLkmNMNAlqREGuiQ1Yu2oTrx+/fo655xzRnV6SVqVHnzwwWeramy+uZEF+jnnnMPExMSoTi9Jq1KSHx1vzkcuktQIA12SGmGgS1IjDHRJaoSBLkmNMNAlqREGuiQ1YmigJ7ktyTNJHj3O/IeSPDL4ui/Jhf2X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OQvYCvwj8IlR13wSfbwTeO1ge9sqvyZn8Mv3TBcAPxh13SfSx6x1/8XMf/b+wVHXfRLX5GLg66OutYc+zgS+B2wajM/q49wr+Q79ImCyqvZX1cvAHmD7nDXbgS/WjAeAM5O8frkL7WBoL1X1TFXtBV4ZRYEddenjvqp6fjB8ANi4zDV21aWXF2rw3QacDqzEnyDo8n0C8DHgy8Azy1ncInXtZaXr0seVwJ1VdQBmvv/7OPFKDvQNwJOzxlODfYtdsxKsljqHWWwfO5j5F9RK1KmXJB9I8gPgP4C/WqbaFmNoH0k2AB8Adi1jXSei69+vdyR5OMk3krx5eUpblC59vAF4bZJvJ3kwyVV9nHhtHwdZIpln39w7pC5rVoLVUucwnftI8m5mAn1FPnemYy9V9RXgK0n+GLgR+JOlLmyRuvTxGeD6qvp5Mt/yFaNLL//DzO8yeSHJpcBXgc1LXdgideljLfBW4D3AbwD3J3mgqn54MideyYE+BZw9a7wRePoE1qwEq6XOYTr1keQC4BZgW1UdXKbaFmtR16Sq7k1yfpL1VbWSfklUlz7GgT2DMF8PXJrkcFV9dVkq7G5oL1X1s1nbdyW5eZVekyng2ap6EXgxyb3AhcBJBfrIXyAs8GJhLbAfOJdfvlh485w17+fYl6L/Peq6T7SXWWv/gZX7UrTLNdkETALvHHW9PfTye/zypehbgKd+MV4pX4v5uzVYfzsr96Vol2vyulnX5CLgwGq8JsCbgP8crD0NeBT4g5M994q9Q6+qw0muA+5m5q3xbVW1L8m1g/ldzLyxv5SZADkEXDOqehfSpZckrwMmgNcAR5L8HTNvxn92vOMut47X5JPAOuDmwR3h4VqBvyWvYy9/DlyV5BXgf4HLavDduFJ07GNV6NjLB4G/SXKYmWty+Wq8JlX1/STfBB4BjgC3VNWjJ3tuP/ovSY1YyT/lIklaBANdkhphoEtSIwx0SWqEgS5JjTDQJakRBrokNeL/AdcCBUtzhF+lAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "import pylab as pl\n", "\n", "x = pl.array([1,2,3,4]) \n", "logx = pl.log10(x)\n", "logy = unumpy.log10(y)\n", "pl.figure()\n", "pl.errorbar(logx, unumpy.nominal_values(logy), unumpy.std_devs(logy), \n", " ls='None', marker='o', ms=4)\n", "pl.show()" ] }, { "cell_type": "markdown", "metadata": { "id": "od2TsKQ89efD" }, "source": [ "## Additional Documentation\n", "More information is available at: \n", "http://pythonhosted.org/uncertainties/ \n", "\n", "A list of the mathematical functions that work on numbers with uncertainties is below. If there is one argument it is called $x$ in the description. If there is a second argument, it is called $y$. \n", "\n", "| Individual Number | Array of Numbers | Function Description |\n", "|:-----:|:-------:|:---------------|\n", "| acos | unumpy.arccos | Return the arc cosine (in radians) | \n", "| acosh | unumpy.arccosh | Return the inverse hyperbolic cosine |\n", "| asin | unumpy.arcsin | Return the arc sine (in radians) |\n", "| asinh | unumpy.asinh | Return the inverse hyperbolic sine |\n", "| atan | unumpy.arctan | Return the arc tangent (in radians) |\n", "| atan2 | unumpy.arctan2 | Return the arc tangent (in radians) of y/x (signs of both x and y are considered) |\n", "| atanh | unumpy.arctanh | Return the inverse hyperbolic tangent |\n", "| ceil | unumpy.ceil | Return the smallest integer >= x |\n", "| copysign | unumpy.copysign | Return a float with the magnitude (absolute value) of x but the sign of y |\n", "| cos | unumpy.cos | Return the cosine of x (measured in radians) |\n", "| cosh | unumpy.cosh | Return the hyperbolic cosine |\n", "| degrees | unumpy.degrees | Convert angle from radians to degrees |\n", "| erf | unumpy.erf | Returns the error function |\n", "| erfc | unumpy.erfc | Returns the complementary error function |\n", "| exp | unumpy.exp | Return e raised to the power of x |\n", "| expm1 | unumpy.expm1 | Return exp(x)-1 avoiding the loss of precision for small x |\n", "| fabs | unumpy.fabs | Return the absolute value of the float x |\n", "| factorial | | Return x! (error if x is negative or non-integer) |\n", "| floor | unumpy.floor | Returns the largest integer <= x |\n", "| fmod | unumpy.fmod | Returns x modulo y |\n", "| frexp | | Return the mantissa (m) and exponent (e) of x such that x = m \\* 2\\*\\*e |\n", "| gamma | unumpy.gamma | Returns the Gamma function |\n", "| hypot | unumpy.hypot | Return the Euclidean distance, sqrt(x\\*x + y\\*y) |\n", "| isinf | unumpy.isinf | Return True if x is a positive or negative infinity, and False otherwise |\n", "| isnan | unumpy.isnan | Return True if x is a NaN (not a number), and False otherwise |\n", "| ldexp | unumpy.ldexp | Return x \\* (2 \\*\\*i) |\n", "| lgamma | unumpy.lgamma | Return the atural logarithm of absolute value of Gamma function |\n", "| log | unumpy.log | Return the logarithm of x to the base y; if the base not specified, returns the natural logarithm (base e) |\n", "| log10 | unumpy.log10 | Return the base 10 logarithm |\n", "| log1p | unumpy.log1p | Return the natural logarithm of 1+x (base e) in a way which is accurate for x near zero |\n", "| modf | unumpy.modf | Return the fractional and integer parts of x |\n", "| pow | unumpy.pow | Return x to the power of y |\n", "| radians | unumpy.radians | Convert angle from degrees to radians |\n", "| sin | unumpy.sin | Return the sine of x (measured in radians) |\n", "| sinh | unumpy.sinh | Return the hyperbolic sine |\n", "| sqrt | unumpy.sqrt | Return the square root |\n", "| tan | unumpy.tan | Return the tangent of x (measured in radians) |\n", "| tanh | unumpy.tanh | Return the hyperbolic tangent |\n", "| trunc | unumpy.trunc | Truncates x to the nearest integer toward 0 |" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" }, "colab": { "name": "Uncertainties.ipynb", "provenance": [], "collapsed_sections": [] } }, "nbformat": 4, "nbformat_minor": 0 }