Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
CompMech01-Getting-started/notebooks/03_Numerical_error.ipynb
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1139 lines (1139 sloc)
95 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"###### Content modified under Creative Commons Attribution license CC-BY 4.0, code under BSD 3-Clause License © 2020 R.C. Cooper" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"# Numerical Error\n", | |
"## Freefall Model Computational solution\n", | |
"\n", | |
"<img src=\"../images/freefall.png\" style=\"width: 200px;\"/> \n", | |
"\n", | |
"Here is our first computational mechanics model. \n", | |
"\n", | |
"An object falling is subject to the force of \n", | |
"\n", | |
"- gravity ($F_g$=mg) and \n", | |
"- drag ($F_d=cv^2$)\n", | |
"\n", | |
"Acceleration of the object:\n", | |
"\n", | |
"$\\sum F=ma=F_g-F_d=mg - cv^2 = m\\frac{dv}{dt}$\n", | |
"\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"### Define constants and analytical solution (meters-kilogram-sec)\n", | |
"\n", | |
"We define parameters for our problem as the acceleration due to gravity, g, drag coefficient, c, and mass of the object, m. Once we have defined these parameters, we have a single variable whose derivative $\\frac{dv}{dt}$ is equal to a function of itself $v$ i.e. $\\frac{dv}{dt} = f(v,~parameters)$. \n", | |
"\n", | |
"**parameters:**\n", | |
"\n", | |
"g=9.81 m/s$^2$, c=0.25 kg/m, m=60 kg\n", | |
"\n", | |
"**function:**\n", | |
"\n", | |
"$\\frac{dv}{dt} = g-\\frac{c}{m}v^2$\n", | |
"\n", | |
"We can solve for the analytical solution in this case. First, consider the speed of the falling object when acceleration is $\\frac{dv}{dt}=0$, this is called the terminal velocity, $v_{terminal}$. \n", | |
"\n", | |
"$v_{terminal}=\\sqrt{\\frac{mg}{c}}$\n", | |
"\n", | |
"Now, substitute this terminal velocity into the equation and integrate to get the analytical solution v(t):\n", | |
"\n", | |
"$v(t)=v_{terminal}\\tanh{\\left(\\frac{gt}{v_{terminal}}\\right)}$. \n", | |
"\n", | |
"## Exercise:\n", | |
"\n", | |
"Calculate the terminal velocity for the given parameters, g=9.81 m/s$^2$, c=0.25 kg/m, m=60 kg.\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 306, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "fragment" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"c=0.25 \n", | |
"m=60\n", | |
"g=9.81 \n", | |
"\n", | |
"\n", | |
"def v_analytical(t,m,g,c):\n", | |
" '''Analytical solution for the velocity of an object released from rest subject to \n", | |
" the force of gravity and the force of drag with drag coefficient, c\n", | |
" \n", | |
" Arguments \n", | |
" ---------\n", | |
" t: time, the independent variable\n", | |
" m: mass of the object\n", | |
" g: acceleration due to gravity\n", | |
" c: drag coefficient\n", | |
" \n", | |
" Returns\n", | |
" -------\n", | |
" v: the speed of the object at time t'''\n", | |
" \n", | |
" v_terminal=np.sqrt(m*g/c)\n", | |
" v= v_terminal*np.tanh(g*t/v_terminal)\n", | |
" return v" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Inside the curly brackets—the placeholders for the values we want to print—the `f` is for `float` and the `.4` is for four digits after the decimal dot. The colon here marks the beginning of the format specification (as there are options that can be passed before). There are so many tricks to Python's string formatter that you'll usually look up just what you need.\n", | |
"Another useful resource for string formatting is the [Python String Format Cookbook](https://mkaz.blog/code/python-string-format-cookbook/). Check it out!" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"If we print these values using the string formatter, with a total length of `5` and only printing 2 decimal digits, we can display our solution in a human-readable way.\n", | |
"\n", | |
"```python\n", | |
"{:5.2f}\n", | |
"```\n", | |
"where \n", | |
"\n", | |
"- `:5` prints something with whitespace that is 5 spaces total\n", | |
"- `.2` prints 2 significant figures after the decimal\n", | |
"- `f` tells `format` that the input is a floating point number to print\n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 347, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "fragment" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"at time 0.00 s, speed is 0.00 m/s\n", | |
"at time 2.00 s, speed is 18.62 m/s\n", | |
"at time 4.00 s, speed is 32.46 m/s\n", | |
"at time 6.00 s, speed is 40.64 m/s\n", | |
"at time 8.00 s, speed is 44.85 m/s\n", | |
"at time 10.00 s, speed is 46.85 m/s\n", | |
"at time 12.00 s, speed is 47.77 m/s\n" | |
] | |
} | |
], | |
"source": [ | |
"for t in range(0,14,2):\n", | |
" print('at time {:5.2f} s, speed is {:5.2f} m/s'.format(t,v_analytical(t,m,g,c)))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Analytical vs Computational Solution\n", | |
"\n", | |
"The analytical solution above gives us an exact function for $v(t)$. We can input any time, `t`, and calculate the speed, `v`.\n", | |
"\n", | |
"In many engineering problems, we cannot find or may not need an exact mathematical formula for our design process. It is always helpful to compare a computational solution to an analytical solution, because it will tell us if our computational solution is correct. Next, we will develop the **Euler approximation** to solve the same problem." | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"# Define numerical method\n", | |
"## Finite difference approximation\n", | |
"\n", | |
"Computational models do not solve for functions e.g. v(t), but rather functions at given points in time (or space). In the given freefall example, we can approximate the derivative of speed, $\\frac{dv}{dt}$, as a finite difference, $\\frac{\\Delta v}{\\Delta t}$ as such,\n", | |
"\n", | |
"\n", | |
"$\\frac{v(t_{i+1})-v(t_{i})}{t_{i+1}-t_{i}}=g-\\frac{c}{m}v(t_{i})^2$.\n", | |
"\n", | |
"\n", | |
"Then, we solve for $v(t_{i+1})$, which is the velocity at the next time step\n", | |
"\n", | |
"$v(t_{i+1})=v(t_{i})+\\left(g-\\frac{c}{m}v(t_{i})^2\\right)(t_{i+1}-t_{i})$\n", | |
"\n", | |
"or\n", | |
"\n", | |
"$v(t_{i+1})=v(t_{i})+\\frac{dv_{i}}{dt}(t_{i+1}-t_{i})$\n", | |
"\n", | |
"Now, we have function that describes velocity at the next timestep in terms of a current time step. This finite difference approximation is the basis for a number of computational solutions to ordinary and partial differential equations. \n", | |
"\n", | |
"Therefore, when we solve a computational problem we have to choose which points in time we want to know the velocity. To start, we define time from 0 to 12 seconds\n", | |
"\n", | |
"t=[0,2,4,6,8,10,12]" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 352, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "fragment" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"import numpy as np\n", | |
"#t=np.array([0,2,4,6,8,10,12])\n", | |
"# or \n", | |
"t=np.linspace(0,12,7)" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Now, we create a `for`-loop to solve for `v_numerical` at times 2, 4, 6, 8, 10, and 12 sec. We don't need to solve for `v_numerical` at time 0 seconds because this is the initial velocity of the object. In this example, the initial velocity is v(0)=0 m/s." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 353, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "subslide" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"array([ 0. , 19.62 , 36.03213 , 44.8328434 , 47.702978 ,\n", | |
" 48.35986042, 48.49089292])" | |
] | |
}, | |
"execution_count": 353, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"v_numerical=np.zeros(len(t));\n", | |
"for i in range(1,len(t)):\n", | |
" v_numerical[i]=v_numerical[i-1]+((g-c/m*v_numerical[i-1]**2))*2;\n", | |
"\n", | |
"v_numerical" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"Let's print the time, velocity (analytical) and velocity (numerical) to compare the results in a table. We'll use the `print` and `format` commands to look at the results. " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 354, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "fragment" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"time (s)|vel analytical (m/s)|vel numerical (m/s)\n", | |
"-----------------------------------------------\n", | |
" 0.0 | 0.00 | 0.00\n", | |
"\n", | |
" 2.0 | 18.62 | 19.62\n", | |
"\n", | |
" 4.0 | 32.46 | 36.03\n", | |
"\n", | |
" 6.0 | 40.64 | 44.83\n", | |
"\n", | |
" 8.0 | 44.85 | 47.70\n", | |
"\n", | |
" 10.0 | 46.85 | 48.36\n", | |
"\n", | |
" 12.0 | 47.77 | 48.49\n", | |
"\n" | |
] | |
} | |
], | |
"source": [ | |
"print('time (s)|vel analytical (m/s)|vel numerical (m/s)')\n", | |
"print('-----------------------------------------------')\n", | |
"for i in range(0,len(t)):\n", | |
" print('{:7.1f} | {:18.2f} | {:15.2f}\\n'.format(t[i],v_analytical(t[i],m,g,c),v_numerical[i]));" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"## Compare solutions (plotting)\n", | |
"\n", | |
"We can compare solutions in a figure in a number of ways:\n", | |
"\n", | |
"1. plot the values, e.g. $v_{analytical}$ and $v_{numerical}$\n", | |
"\n", | |
"2. plot the difference between the values (the absolute error) e.g. $v_{numerical}-v_{analytical}$\n", | |
"\n", | |
"3. plot the ratio of the values e.g. $\\frac{v_{numerical}}{v_{analytical}}$ (useful in finding bugs, unit analysis, etc.)\n", | |
"\n", | |
"4. plot the ratio of the error to the best estimate (the relative error) e.g. $\\frac{v_{numerical}-v_{analytical}}{v_{analytical}}$\n", | |
"\n", | |
"Let's start with method (1) to compare our analytical and computational solutions.\n", | |
"\n", | |
"Import `pyplot` and update the default plotting parameters." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 358, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "fragment" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"import matplotlib.pyplot as plt\n", | |
"\n", | |
"plt.rcParams.update({'font.size': 22})\n", | |
"plt.rcParams['lines.linewidth'] = 3" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 360, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "subslide" | |
} | |
}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Text(0, 0.5, 'velocity (m/s)')" | |
] | |
}, | |
"execution_count": 360, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZgAAAEaCAYAAAAsQ0GGAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nOzdd3hUxfrA8e9sGiSBJJTQQgcpkQDSQQXEQpduVwQEBcu9V0WRCyp6FeWqFxRQVATrT4xILyJIB2lq6L0TehJSSLLJzu+Ps9lNTzbZ3bT38zz77M6c2XMmbd/MnClKa40Q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80uR9tbnAdcCzkjYAz5IWBryNdFPoo8DX6/RZST73NhmDlYwTjBncQpqsvpx0N/6r8vFP0Xhpb8dExAvAByTdSZr7OBc4A9gNPE3aNeBe4PEWul0JfBpYLGl5voelum4/aXL/NOC1pCS7hTQHc0dE7K7T54eBF6mffMy82aVZWeRVYlcD72x082QLfZ1OulF0VUQsGon4rP84wZiVhKQTgMeADRExt82+fgy8F5gVEZsP1d7KyZP8ZiURETtIl/3mtPtES9JGnF9xcrEiPoMxM7OO8BmMmZl1hBOMmZl1hBOMmZl1hBOMmZl1hBOMmZl1hBOMmZl1xP8A+Ervg7n5dOIAAAAASUVORK5CYII=\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.plot(t,v_analytical(t,m,g,c),'-',label='analytical')\n", | |
"plt.plot(t,v_numerical,'o-',label='numerical')\n", | |
"plt.legend()\n", | |
"plt.xlabel('time (s)')\n", | |
"plt.ylabel('velocity (m/s)')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"**Note:** In the above plot, the numerical solution is given at discrete points connected by lines, while the analytical solution is drawn as a line. This is a helpful convention. We plot discrete data such as numerical solutions or measured data as points and lines while analytical solutions are drawn as lines. \n", | |
"\n", | |
"## Exercise\n", | |
"\n", | |
"Play with the values of `t` (defined above as `t=np.linspace(0,12,7)`). \n", | |
"\n", | |
"If you increase the number of time steps from 0 to 12 seconds what happens to v_analytical? to v_numerical?\n", | |
"\n", | |
"What happens when you decrease the number of time steps?" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"# Errors in Numerical Modeling\n", | |
"\n", | |
"## 1 - Truncation\n", | |
"## 2 - Roundoff " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"# 1- Truncation error\n", | |
"## Freefall is example of \"truncation error\"\n", | |
"### Truncation error results from approximating exact mathematical procedure\n", | |
"\n", | |
"We approximated the derivative as $\\frac{d v}{d t}\\approx\\frac{\\Delta v}{\\Delta t}$\n", | |
"\n", | |
"Can reduce error in two ways\n", | |
"\n", | |
"1. Decrease step size -> $\\Delta t$=`delta_time`\n", | |
"\n", | |
"2. Increase the accuracy of the approximation" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Truncation error as a Taylor series \n", | |
"\n", | |
"The freefall problem solution used a first-order Taylor series approximation\n", | |
"\n", | |
"Taylor series:\n", | |
"$f(x)=f(a)+f'(a)(x-a)+\\frac{f''(a)}{2!}(x-a)^{2}+\\frac{f'''(a)}{3!}(x-a)^{3}+...$\n", | |
"\n", | |
"First-order approximation:\n", | |
"$f(x_{i+1})=f(x_{i})+f'(x_{i})h$\n", | |
"\n", | |
"\n", | |
"We can increase accuracy in a function by adding Taylor series terms:\n", | |
"\n", | |
"|Approximation | formula |\n", | |
"|---|-----------------------------|\n", | |
"|$0^{th}$-order | $f(x_{i+1})=f(x_{i})+R_{1}$ |\n", | |
"|$1^{st}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+R_{2}$ |\n", | |
"|$2^{nd}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+\\frac{f''(x_{i})}{2!}h^{2}+R_{3}$|\n", | |
"|$n^{th}$-order | $f(x_{i+1})=f(x_{i})+f'(x_{i})h+\\frac{f''(x_{i})}{2!}h^{2}+...\\frac{f^{(n)}}{n!}h^{n}+R_{n}$|\n", | |
"\n", | |
"Where $R_{n}=O(h^{n+1})$ is the error associated with truncating the approximation at order $n$." | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "subslide" | |
} | |
}, | |
"source": [ | |
"In the .gif below, the error in the function is reduced by including higher-order terms in the Taylor series approximation. \n", | |
"\n", | |
"![3](https://media.giphy.com/media/xA7G2n20MzTOw/giphy.gif)\n", | |
"\n", | |
"$n^{th}$-order approximation equivalent to \n", | |
"an $n^{th}$-order polynomial. " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "subslide" | |
} | |
}, | |
"source": [ | |
"# 2- Roundoff\n", | |
"\n", | |
"## Just storing a number in a computer requires rounding\n", | |
"\n", | |
"In our analytical solution, $v(t) = v_{terminal}\\tanh{\\left(\\frac{gt}{v_{terminal}}\\right)}$, we can solve for velocity, $v$ at any given time, $t$ by hand to avoid roundoff error, but this is typically more trouble than its worth. Roundoff error comes in two forms:\n", | |
"\n", | |
"1. digital representation of a number is rarely exact\n", | |
"\n", | |
"2. arithmetic (+,-,/,\\*) causes roundoff error" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "subslide" | |
} | |
}, | |
"source": [ | |
"1. digital representation of $\\pi$ \n", | |
"\n", | |
"[Consider the number $\\pi$](https://www.piday.org/million/). How many digits can a floating point number in a computer accurately represent?" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 369, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "fragment" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"double precision 64 bit pi = 3.141592653589793115997963469\n", | |
"single precision 32 bit pi = 3.141592741012573242187500000\n", | |
"First 27 digits of pi = 3.141592653589793238462643383\n" | |
] | |
} | |
], | |
"source": [ | |
"pi=np.pi\n", | |
"\n", | |
"double=np.array([pi],dtype='float64')\n", | |
"single=np.array([pi],dtype='float32')\n", | |
"print('double precision 64 bit pi = {:1.27f}'.format(double[0])) # 64-bit\n", | |
"print('single precision 32 bit pi = {:1.27f}'.format(single[0])) # 32-bit\n", | |
"print('First 27 digits of pi = 3.141592653589793238462643383')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"In order to store the number in a computer you can only use so many bits, shown below is the [64-bit standard for floating point numbers](https://en.wikipedia.org/wiki/Double-precision_floating-point_format):\n", | |
"\n", | |
"<img src=\"../images/1236px-IEEE_754_Double_Floating_Point_Format.png\" style=\"width: 400px;\"/> \n", | |
"\n", | |
"Where the sign is either + or -, the exponent is a power of two as in, $2^{exponent}$, and the fraction (or base) is the binary representation of the number, $1+\\sum_{i=1}^{52}b_i2^{-i}$. We examine the floating point number representation to highlight that any number you store in a computer is an approximation of the real number you are trying to save. With 64-bit floating point numbers, these approximations are **extremely** good. \n", | |
"\n", | |
"2. Floating point arithmetic \n", | |
"\n", | |
"Each time you use an operation, e.g. `+ - / *` you lose some precision as well. \n", | |
"\n", | |
"Consider $\\pi$ again, but this time we will use a for loop to multiply $\\pi$ by a 1e-16 then divide by 1e-16, then multiply by 2e-16 and divide by 2e-16, and so on until we reach 10e-16. If we do these calculations by hand, we see that each step in the for loop returns $\\pi$, but due to floating point arithmetic errors we accumulate some error. \n" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 374, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
" 0 operations 64 bit pi = 3.14159265358979311599796347\n", | |
"\n", | |
"20 operations 64 bit pi = 3.14159265358979089555191422\n", | |
"\n", | |
"First 26 digits of pi = 3.14159265358979323846264338\n" | |
] | |
} | |
], | |
"source": [ | |
"double=np.array([pi],dtype='float64')\n", | |
"double_operated=double\n", | |
"for i in range(0,10):\n", | |
" double_operated=double_operated*(i+1)*1.0e-16\n", | |
" double_operated=double_operated*1/(i+1)*1.0e16\n", | |
"print(' 0 operations 64 bit pi = %1.26f\\n'%double) # 64-bit\n", | |
"print('20 operations 64 bit pi = %1.26f\\n'%double_operated) # 64-bit after 1000 additions and 1 subtraction\n", | |
"print('First 26 digits of pi = 3.14159265358979323846264338')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"In the previous block of code, we see $\\pi$ printed for 3 cases:\n", | |
"\n", | |
"1. the 64-bit representation of $\\pi$\n", | |
"\n", | |
"2. the value of $\\pi$ after it has gone through 20 math operations ($\\times (0..10)10^{-16}$, then $\\times 1/(0..10)10^{16}$)\n", | |
"\n", | |
"3. the actual value of $\\pi$ for the first 26 digits\n", | |
"\n", | |
"All three (1-3) have the same first 14 digits after the decimal, then we see a divergence between the actual value of $\\pi$ (3), and $\\pi$ as represented by floating point numbers. \n", | |
"\n", | |
"We can get an idea for computational limits using some built-in functions:\n", | |
"\n", | |
"- `np.info('float64').max`: the largest floating point 64-bit number the computer can represent\n", | |
"\n", | |
"- `np.info('float64').tiny`: the smallest non-negative 64-bit number the computer can represent\n", | |
"\n", | |
"- `np.info('float64').eps`: the smallest number that can be added to 1" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 20, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"realmax = 1.79769313486231570815e+308\n", | |
"\n", | |
"realmin = 2.22507385850720138309e-308\n", | |
"\n", | |
"maximum relative error = 2.22044604925031308085e-16\n", | |
"\n" | |
] | |
} | |
], | |
"source": [ | |
"print('realmax = %1.20e\\n'%np.finfo('float64').max)\n", | |
"print('realmin = %1.20e\\n'%np.finfo('float64').tiny)\n", | |
"print('maximum relative error = %1.20e\\n'%np.finfo('float64').eps)\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"## Machine epsilon\n", | |
"\n", | |
"The smallest number that can be added to 1 and change the value in a computer is called \"machine epsilon\", $eps$. If your numerical results are supposed to return 0, but instead return $2eps$, have a drink and move on. You won't get any closer to your result. \n", | |
"\n", | |
"In the following example, we will add $eps/2$ 1,000$\\times$ to the variable s, set to 1. The result should be $s=1+500\\cdot eps$, but because $eps/2$ is smaller than floating point operations can track, we will get a different result depending upon how we do the addition.\n", | |
"\n", | |
"a. We make a `for`-loop and add $eps/2$ 1000 times in the loop\n", | |
"\n", | |
"b. We multiply $1000*eps/2$ and add it to the result" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 29, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "fragment" | |
} | |
}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"summation 1+eps/2 over 1000 minus 1 = 0.0\n", | |
"500.0 *eps= 1.11022302463e-13\n" | |
] | |
} | |
], | |
"source": [ | |
"s1=1;\n", | |
"N=1000\n", | |
"eps=np.finfo('float64').eps\n", | |
"for i in range(1,N):\n", | |
" s1+=eps/2;\n", | |
"\n", | |
"s2=1+500*eps\n", | |
"print('summation 1+eps/2 over ',N,' minus 1 =',(s-1))\n", | |
"print(N/2,'*eps=',(s2-1))" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Exercise\n", | |
"\n", | |
"1. Try adding $2eps$ to 1 and determine the result of the previous exercise. \n", | |
"\n", | |
"2. What is machine epsilon for a 32-bit floating point number?" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "slide" | |
} | |
}, | |
"source": [ | |
"# Freefall Model (revisited)\n", | |
"\n", | |
"In the following example, we judge the **convergence** of our solution with the new knowledge of truncation error and roundoff error. \n", | |
"\n", | |
"**The definition for convergence in mathematics is the limit of a sequence exists.** \n", | |
"\n", | |
"In the case of the Euler approximation, the sequence is smaller timesteps, $\\Delta t$, should converge to the analytical solution. \n", | |
"\n", | |
"Define time from 0 to 12 seconds with `N` timesteps \n", | |
"function defined as `freefall`\n", | |
"\n", | |
"m=60 kg, c=0.25 kg/m" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": { | |
"slideshow": { | |
"slide_type": "subslide" | |
} | |
}, | |
"source": [ | |
"## Freefall example\n", | |
"\n", | |
"Estimated the function with a $1^{st}$-order approximation, so \n", | |
"\n", | |
"$v(t_{i+1})=v(t_{i})+v'(t_{i})(t_{i+1}-t_{i})+R_{1}$\n", | |
"\n", | |
"$v'(t_{i})=\\frac{v(t_{i+1})-v(t_{i})}{t_{i+1}-t_{i}}-\\frac{R_{1}}{t_{i+1}-t_{i}}$\n", | |
"\n", | |
"$\\frac{R_{1}}{t_{i+1}-t_{i}}=\\frac{v''(\\xi)}{2!}(t_{i+1}-t_{i})$\n", | |
"\n", | |
"or the truncation error for a first-order Taylor series approximation is\n", | |
"\n", | |
"$R_{1}=O(\\Delta t^{2})$\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Computer model error = truncation + roundoff\n", | |
"\n", | |
"In the function `freefall(N)`, the speed of a 60-kg object is predicted in two ways:\n", | |
"\n", | |
"1. The analytical 64-bit representation, \n", | |
"$v(t)=v_{terminal}\\tanh{\\left(\\frac{gt}{v_{terminal}}\\right)}$\n", | |
"\n", | |
"2. The numerical 32-bit$^{+}$ Euler approximation for `N`-steps from 0 to 2 seconds\n", | |
"\n", | |
"$^{+}$Here, we use a 32-bit representation to observe the transition from truncation error to floating point error in a reasonable number of steps. \n", | |
"\n", | |
"We can reduce truncation error by decreasing the timestep, $\\Delta t$. Here, we consider the speed from 0 to 2 seconds, so `N=3` means $\\Delta t$= 1 s and `N=21` means $\\Delta t$=0.1 s\n", | |
"\n", | |
"|N= | $\\Delta t$=|\n", | |
"|---|---|\n", | |
"|3 | 1 s|\n", | |
"|21| 0.1 s|\n", | |
"|201| 0.01 s|\n", | |
"|??| 0.05 s|\n", | |
"|?? | 0.001 s|\n", | |
"\n", | |
"What is N for 0.05 s and 0.001 s in the table above?\n", | |
"\n", | |
"Answer (0.05 s): <span style=\"color:white\"> 41 </span>\n", | |
"\n", | |
"Answer (0.001 s): <span style=\"color:white\"> 2001 </span>\n", | |
"\n", | |
"Highlight lines above for answer." | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 89, | |
"metadata": { | |
"slideshow": { | |
"slide_type": "subslide" | |
} | |
}, | |
"outputs": [], | |
"source": [ | |
"def freefall(N):\n", | |
" ''' help file for freefall(N)\n", | |
" computes the velocity as a function of time, t, for a\n", | |
" 60-kg object with zero initial velocity and drag \n", | |
" coefficient of 0.25 kg/s\n", | |
" N is number of timesteps between 0 and 2 sec\n", | |
" v_analytical is the 64-bit floating point \"true\" solution\n", | |
" v_numerical is the 32-bit approximation of the velocity\n", | |
" t is the timesteps between 0 and 2 sec, divided into N steps'''\n", | |
" t=np.linspace(0,2,N)\n", | |
" c=0.25\n", | |
" m=60\n", | |
" g=9.81\n", | |
" v_terminal=np.sqrt(m*g/c)\n", | |
"\n", | |
" v_analytical = v_terminal*np.tanh(g*t/v_terminal);\n", | |
" v_numerical=np.empty(len(t),dtype=np.float32)\n", | |
" delta_time =np.diff(t)\n", | |
" for i in range(0,len(t)-1):\n", | |
" v_numerical[i+1]=v_numerical[i]+(g-c/m*v_numerical[i]**2)*delta_time[i];\n", | |
" \n", | |
" return v_analytical,v_numerical,t\n", | |
" " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"We can visualize how the approximation approaches the exact solution with this method. The process of approaching the \"true\" solution is called **convergence**. \n", | |
"\n", | |
"First, we solve for `n=2` steps, so t=[0,2]. We can time the solution to get a sense of how long the computation will take for larger values of `n`. " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 226, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"CPU times: user 288 µs, sys: 3 µs, total: 291 µs\n", | |
"Wall time: 303 µs\n" | |
] | |
} | |
], | |
"source": [ | |
"%%time\n", | |
"n=2\n", | |
"\n", | |
"v_analytical,v_numerical,t=freefall(n);" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The block of code above assigned three variables from the function `freefall`. \n", | |
"\n", | |
"1. `v_analytical` = $v_{terminal}\\tanh{\\left(\\frac{gt}{v_{terminal}}\\right)}$\n", | |
"\n", | |
"2. `v_numerical` = Euler step integration of $\\frac{dv}{dt}= g - \\frac{c}{m}v^2$\n", | |
"\n", | |
"3. `t` = timesteps from 0..2 with `n` values, here t=np.array([0,2])\n", | |
"\n", | |
"All three variables have the same length, so we can plot them and visually compare `v_analytical` and `v_numerical`. This is the comparison method (1) from above. " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 227, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import matplotlib.pyplot as plt\n", | |
"%matplotlib inline" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 228, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"<matplotlib.legend.Legend at 0x7f131d486c90>" | |
] | |
}, | |
"execution_count": 228, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEWCAYAAAB8LwAVAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3dd5hTZfbA8e9hZugoXWkDqKgUqUMREEGkCKis6M+CbS1Y0N21FywsNhTsuIvIKrbV3bULCIKKIIIIAqICotQBpPc65fz+eO+QZEiGzJDkTjmf58lDcm47uRNycsv7vqKqGGOMMbmV8jsBY4wxhZMVCGOMMWFZgTDGGBOWFQhjjDFhWYEwxhgTlhUIY4wxYVmBMDEnIqkisltEk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" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.plot(t,v_numerical,'o',label=str(n)+' Euler steps')\n", | |
"plt.plot(t,v_analytical,label='analytical')\n", | |
"plt.title('First 2 seconds of freefall')\n", | |
"plt.xlabel('time (s)')\n", | |
"plt.ylabel('speed (m/s)')\n", | |
"plt.legend()" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Exercise\n", | |
"\n", | |
"Try adjusting `n` in the code above to watch the solution converge. You should notice the Euler approximation becomes almost indistinguishable from the analytical solution as `n` increases. " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## Convergence of a numerical model\n", | |
"\n", | |
"You should see that the more time steps we use, the closer the Euler approximation resembles the analytical solution. This is true only to a point, due to **roundoff error**. In our `freefall` function, the numerical result is saved as a 32-bit floating point array. Our best approximation of the freefall function is the 64-bit analytical equation `v_terminal*np.tanh(g*t/v_terminal)`.$^{+}$ \n", | |
"\n", | |
"In the next plot, we consider the relative error for the velocity at t=2 s, as a function of `N`. \n", | |
"\n", | |
"$^+$ Note: In practice, there is no reason to restrict the precision of our floating point numbers. The function was written this way to highlight the effect of roundoff error without significant computational resources. You would need significantly more timesteps to observe floating point error with 64-bit floating point numbers. " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 232, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"N=100\n", | |
"error=np.zeros(N) # initialize an N-valued array of relative errors\n", | |
"n=np.logspace(2,5,N) # create an array from 10^2 to 10^5 with N values\n", | |
"for i in range(0,N):\n", | |
" v_an,v_num,t=freefall(n[i]) # return the analytical and numerical solutions to our equation\n", | |
" error[i]=(v_num[-1]-v_an[-1])/v_an[-1] #calculate relative error in velocity at final time t=2 s\n", | |
"\n", | |
" " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 233, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/plain": [ | |
"Text(0.5, 1.0, 'Truncation and roundoff error \\naccumulation in log-log plot')" | |
] | |
}, | |
"execution_count": 233, | |
"metadata": {}, | |
"output_type": "execute_result" | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYoAAAEpCAYAAACN9mVQAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjEsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8QZhcZAAAgAElEQVR4nO3de5xcdX3/8debEGQBycpFbZZggNAoiiWan/ZHtAVqBSuXSNFApS0q0Npii22poVpRa00qtkXFSkElRRS5GFMCSKoEykVUEhO5Gq5BshGQy4bbKiF8+sf5DpkMM2fO7M7s3N7Px2Mf2TlzzpnP7NnMZ8/38vkqIjAzM6tlq3YHYGZmnc2JwszMcjlRmJlZLicKMzPL5URhZma5nCjMzCyXE4V1NUn/KOmsdseRR9LWkkLS9HbHUqnR2CQtlPSopHXp8VGS1kl6StK+rYzV2keeR2GSnip7uB3wa2BTevxnEfGNiY/qxSS9DfhKRExvdyyNkLQ1sBHYIyLWtjmcLTQSm6Q9gNuA3SPikbTtfuAvIuLyVsdq7bN1uwOw9ouIHUrfS1oLHB8R36+1v6StI+K5iYit30jaCiAinm93LFW8Cni4LElsBUwjSx7jJmlSRGyqt63OOfy72QJuerK6JH1a0oWSLpD0JHCspPMlfaJsn7elJFN6vE7S30i6RdKGdOxLyp4/UtJqSU9IulvS29P24yXdIelJSfdIOj5tnwIsBXZPzRxPSXp5im1R2XnnSrpN0oik5ZJmFo2p4j3vLenq1MzyiKSvpxiKvr/5kh6UNAz8aZ2f7/WS/knSjcDT6T3uJukySY9JukvS+8v2H+/PvmZskgbT+X8paa2kU5U5BPhu2c//XOAJQMBtktbUeG/7SPp+eh8/k/SHFe/jS5KulPQ08NYa26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FoMvBVYVeQN1rA0IkLSLcBDEXFLOvdtZD+D3ciakm6QBNmH941kSeVXwFckXQ5cVnnidOexP3BxOha2XMTmosjWjrhL0r3Aq9O5PyppN2BxRNxVI+5NwOnAqcB3x/jercM5UVin+XXZ95uAgfT9c2xuKt0255jnyx4/z5a/45WFzYLsr/g/jIg15U9IejPwdI0Yq9X+H6/ymCvfz9ZkP4vvRcQxLwoma0b7PbKKoScBB1XsshUwEhH71XjtF/1cIuKbkn4EvBNYJun4iFhe4/ivkyUKFwbsUe6jsG6xlqzJB7ImjrGYByDpLcCGiNhAVm3zQ0p/akuaVeA81wJzJW0naXvgXcB1dY55kqx5bKx+CMyRNCPFuZ2k30x3C1Mi4grgZLJmqi1eLyKeAO6T9O50rCT9Vtm53y1pK0l7kfWxrJG0J3BvZAt3XcqWd2ZbiIiNpGa+cbw/62BOFNYtPgd8UNIPyNrrx+LxdPxZwAfStn8CJgM3S7o1Pc4V2drpi4AfAz8CvhIR9Zqdrgb2KXVmNxp4RPySrF/jAkk3kyWOV5Mlg8vStv8FSp3o3wJOSR30e5GtLf4BST8l+8v/iLLTr0nHfpesf+dXZEn1Vkmr0+ucVyfEr+IWip7lMuNmfSyNqrosIi5pdyzWuXxHYWZmuXxHYWZmuXxHYWZmuZwozMwslxOFmZnlcqIwM7NcThRmZpbLicLMzHL9HxFBxpFJKiBxAAAAAElFTkSuQmCC\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.loglog(n,error,'o')\n", | |
"plt.xlabel('number of timesteps N')\n", | |
"plt.ylabel('relative error')\n", | |
"plt.title('Truncation and roundoff error \\naccumulation in log-log plot')" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"In the above plot \"Truncation and roundoff error accumulation in log-log plot\", we see that around N=20,000 steps we stop decreasing the error with more steps. This is because we are approaching the limit of how precise we can store a number using a 32-bit floating point number. \n", | |
"\n", | |
"In any computational solution, there will be some point of similar diminishing in terms of accuracy (error) and computational time (in this case, number of timesteps). If you were to attempt a solution for N=1 billion, the solution could take $\\approx$(1 billion)*(200 $\\mu$s\\[cpu time for n=2\\])$\\approx$55 hours, but would not increase the accuracy of the solution. " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"## What we've learned\n", | |
"\n", | |
"* Numerical integration with the Euler approximation\n", | |
"* The source of truncation errors\n", | |
"* The source of roundoff errors\n", | |
"* How to time a numerical solution or a function\n", | |
"* How to compare solutions\n", | |
"* The definition of absolute error and relative error\n", | |
"* How a numerical solution converges" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Problems\n", | |
"\n", | |
"1. The growth of populations of organisms has many engineering and scientific applications. One of the simplest\n", | |
"models assumes that the rate of change of the population p is proportional to the existing population at any time t:\n", | |
"\n", | |
" $\\frac{dp}{dt} = k_g p$\n", | |
"\n", | |
" where $t$ is time in years, and $k_g$ is growth rate in \\[1/years\\]. \n", | |
" \n", | |
" The world population has been increasing dramatically, let's make a prediction based upon the [following data](https://worldpopulationhistory.org/map/2020/mercator/1/0/25/) saved in [world_population_1900-2020.csv](../data/world_population_1900-2020.csv):\n", | |
" \n", | |
" |year| world population |\n", | |
" |---|---|\n", | |
" |1900|1,578,000,000|\n", | |
" |1950|2,526,000,000|\n", | |
" |2000|6,127,000,000|\n", | |
" |2020|7,795,482,000|\n", | |
" \n", | |
" a. Calculate the average population growth, $\\frac{\\Delta p}{\\Delta t}$, from 1900-1950, 1950-2000, and 2000-2020\n", | |
" \n", | |
" b. Determine the average growth rates. $k_g$, from 1900-1950, 1950-2000, and 2000-2020\n", | |
" \n", | |
" c. Use a growth rate of $k_g=0.013$ [1/years] and compare the analytical solution (use initial condition p(1900) = 1578000000) to the Euler integration for time steps of 20 years from 1900 to 2020 (Hint: use method (1)- plot the two solutions together with the given data) \n", | |
" \n", | |
" d. Discussion question: If you decrease the time steps further and the solution converges, will it converge to the actual world population? Why or why not? \n", | |
"\n", | |
"**Note: We have used a new function `np.loadtxt` here. Use the `help` or `?` to learn about what this function does and how the arguments can change the output. In the next module, we will go into more details on how to load data, plot data, and present trends.**" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 12, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"years= [1900. 1950. 2000. 2020.]\n", | |
"population = [1.578000e+09 2.526000e+09 6.127000e+09 7.795482e+09]\n" | |
] | |
} | |
], | |
"source": [ | |
"import numpy as np\n", | |
"year,pop=np.loadtxt('../data/world_population_1900-2020.csv',skiprows=1,delimiter=',',unpack=True)\n", | |
"print('years=',year)\n", | |
"print('population =', pop)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"2. In the freefall example we used smaller time steps to decrease the **truncation error** in our Euler approximation. Another way to decrease approximation error is to continue expanding the Taylor series. Consider the function f(x)\n", | |
"\n", | |
" $f(x)=e^x = 1+x+\\frac{x^2}{2!}+\\frac{x^3}{3!}+\\frac{x^4}{4!}+...$\n", | |
"\n", | |
" We can approximate $e^x$ as $1+x$ (first order), $1+x+x^2/2$ (second order), and so on each higher order results in smaller error. \n", | |
" \n", | |
" a. Use the given `exptaylor` function to approximate the value of exp(1) with a second-order Taylor series expansion. What is the relative error compared to `np.exp(1)`?\n", | |
" \n", | |
" b. Time the solution for a second-order Taylor series and a tenth-order Taylor series. How long would a 100,000-order series take (approximate this, you don't have to run it)\n", | |
" \n", | |
" c. Plot the relative error as a function of the Taylor series expansion order from first order upwards. (Hint: use method (4) in the comparison methods from the \"Truncation and roundoff error accumulation in log-log plot\" figure)" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 1, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"from math import factorial\n", | |
"def exptaylor(x,n):\n", | |
" '''Taylor series expansion about x=0 for the function e^x\n", | |
" the full expansion follows the function\n", | |
" e^x = 1+ x + x**2/2! + x**3/3! + x**4/4! + x**5/5! +...'''\n", | |
" if n<1:\n", | |
" print('lowest order expansion is 0 where e^x = 1')\n", | |
" return 1\n", | |
" else:\n", | |
" ex = 1+x # define the first-order taylor series result\n", | |
" for i in range(1,n):\n", | |
" ex+=x**(i+1)/factorial(i+1) # add the nth-order result for each step in loop\n", | |
" return ex\n", | |
" " | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [] | |
} | |
], | |
"metadata": { | |
"celltoolbar": "Slideshow", | |
"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.7.5" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |