{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Describing motion using Python" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### References\n", "The Feynman Lectures in Physics - Volume 1; Chapter 8" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We will use python programming language to describe motion of a one-dimensional object. For this we will first import some modules " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Computer program\n", "We will think of a computer program as a set of instruction that a computer can follow." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from pylab import *" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "pylab is a set of scripts or programs that have already been written, specially for plotting." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Plotting Tables" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We would like to plot the motion of a one dimensional object (see Fig. 8-1 in Feynman Lectures in Physics - Volume 1)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We are observing the motion at regular time intervals." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "T = array([0,1,2,3,4,5,6,7,8,9])\n", "t = array([0,0,0,0,0,0,0,0,0,0])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The function **array** which is defined in **pylab** converts our measurment into a row-vector " ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Result of our measurements are." ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "X = array([0, 120, 400, 900, 950, 960, 1300, 1800, 2350, 2400 ])" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Plotting\n", "**pyplot** defines a fucntion **plot** for plotting which takes our time and distance array as arguments and plots it. The function **plot** also takes some optional arguments to make the plot more descreptive." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY4AAAEKCAYAAAAFJbKyAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/A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1p4s1bu/gJhLhJmNh24yt1Lo/OjgdfcvW/qe6Il0fsCh7r7+iiJtanL50l+Uo1D8s06YE7Kv9bPAh5p5DP/Dqw0sxPqcO/D0WcCHA28QZg0Vp1yYBowuJHx1aYrsNzd1wO4+3J3z+vldiSeEofkownAgGip9M1suybZFSlNOS/X8Zk3AdfX4b65QJdoYbyBUSxxbgGujPaLaQrfqdJUtRcwBehhZh+b2d1m9t0m+ixpptRUJfnoeeBXwGfAxGqu17epCnd/zcwws+/U4fbHCWte9QEuruW5n5jZ28DZVS9Vd3sdPnubpioAM/sv4DuEprOJZjbc3R+sw/MkD6nGIXkn6i+YBVxJWP23qYwm9HXUZgIhcU1197rs73EzcC2V/76uAHZOOd8FWF7HOLfh7pvdfbq7jwIuAc5s6LOk+VPikHz1O+DaqFO9SUSb9+xM2Eo17r5FhARzdx2f+xFh9dnUmsJ04JxoNVYI/SB1bVarxMz2NbNeKUUHAwsb8izJD2qqkrwUrXxc0+rHV1TZiKe/uy+o46NHA0/W4fPvrePzUp/7Tsp5MfB14O9m5kApcF0dnvOdlNWOIfTNfAL8IRp2vIkw8mtoPeOTPKLVcUVEpF7UVCUiIvWixCEiIvWixCEiIvWixCEiIvWixCEiIvWixCEiIvWixCEiIvWixCEiIvXyfw1deb4gNrylAAAAAElFTkSuQmCC\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "#plot(t, X, marker = 'o', color = 'g')\n", "plot(T, X, marker = 'o', linestyle = '-', color = 'b') # Defined in pylab\n", "xlabel('TIME IN MINUTES') # Defined in pylab\n", "ylabel('DISTANCE TRAVELLED IN FEET') # Defined in pylab\n", "savefig('motion.png')" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Describing motion given by the formula $s = \\frac{1}{2}9.8 t^2$" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Python allows us to obtain a distance array from the time array using the above formula in a very simple manner." ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "S = 0.5 * 9.8 * T**2" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEKCAYAAAAIO8L1AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvnQurowAAIABJREFUeJzt3XmYFNW5x/Hvy7A4IDCAoLK7ECKKio6IEo2ABncRY9QQ9yve6xKXSJSgUaMoCSroNdHgcl2CuBLEJaIRl7ihIAhuRAKCDEZBxA2Uxff+cWpCz9BTs9DT1T39+zxPP1N9qrrqnRHnnapzznvM3REREamsUdIBiIhIblKCEBGRtJQgREQkLSUIERFJSwlCRETSUoIQEZG0lCBERCQtJQgREUlLCUJERNJqnHQAm2Orrbby7t27Jx2GiEhemTVr1gp3b1/dcXmdILp3787MmTOTDkNEJK+Y2eKaHKdHTCIikpYShIiIpKUEISIiaSlBiIhIWkoQIiKSVs4lCDM72Mzmm9kCM7sk0+d/Y/TN/LvN1nxvjfh3m615Y/TNmb6EiEiDkFMJwsyKgD8ChwC9gBPMrFemzv/G6JvZ5cqL2GbVpzTC2WbVp+xy5UVKEiIiaeRUggD6AgvcfaG7rwXuB47K1Mm7XHcVxeu+q9BWvO47drj2MpgxAz74AFauhA0bMnVJEZG8lWsT5ToBH6W8XwrsnXqAmQ0HhgN07dq1VifvsGp52va236yCfv1SLwJt2kDbttCuXfiaul3V19atw2drYuJEGDUKliyBrl1h9GgYNqxW34+ISH3KtQSR7rerV3jjPgGYAFBaWuppjq/Sv1u3p+MXn27SvqJFG7Z68C/w2WfhDqL8a/n28uXw/vvh/RdfVH2BoqKQWKpLJHPmwPjx8O234XOLF8Pw4WFbSUJEckSuJYilQJeU952BZZk6+f8OOpXLpo6n+fqNj5lWN27G9YOHc+2hh9bsJOvWwap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LunwLDgXOixLMtUJayf767f1dNrFKAlCCkIbofOD4q3b2BTWttXZDyqOe5Gp7zauDSao4ZB8w3s7+a2ZmVFpQ5rtIjpmJgF6CqwoA7p9k3M2ov9zUhSVS7yJO7LyT8/94h+szFZvaqmV1tZj2q+7wUJiUIaYieAg4CTgAeSLN/nLvvHr0G1OSE7v4PADPbL+aY3wGlwNOEu4OnUnY/kHLN3d19TTWXNNJXGa7cdhNwcrR2Q3UsinMOoZT3WKAt8IaZ7VSDz0uBUYKQBidaCGoW4fn8Ixk89WhCX0Tctf/l7rcQirntZmbtYg5/B9gzZl9ppbY9qVQsL1rA5z7grLi4zGx7wt3Up9Hnvnb3ye5+FvAX4NC4z0thUoKQhup64OKoczsjogVi2hCW3tyEmR0WPeMH6EH4hRy3Att9wL5mdljKOQ42s96EZXFPMbPyjuZ2wO+BP6Q5zw3AmVQx6MTM2gO3Aje7u5tZ/2h9A6IifL2AxTFxSoHSKCZpkKIKvVVV6b3AKi72MsTdP6zhqUcDj1ax70RgXDTsdj0wzN03RDnjODP7UcqxZ7n7KxYWKRpvZuMJI4nmAue5+ydRjLeZWUvC46HxqR3aKd/rCjP7K3BBSnNxVJ23SRTLvYREArADcEuUzBoRRlJl8k5LGghVcxURkbT0iElERNJSghARkbSUIEREJC0lCBERSUsJQkRE0lKCEBGRtJQgREQkLSUIERFJ6/8BwPFtWKRgNqEAAAAASUVORK5CYII=\n", "text/plain": [ "
" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "plot(t, S, marker = 'o')\n", "plot(T, S, marker = 'o', linestyle = '-', color = 'r')\n", "xlabel('TIME IN SECONDS')\n", "ylabel('DISTANCE TRAVELLED IN METER')\n", "plt.gca().invert_yaxis() # invert y axis\n", "savefig('Falling Body')\n", "show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Speed\n", "We want answer the question what is the speed of a falling object at, say 1 second?" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Function in Python" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Python allows us to define formulas or functions" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "def y(t, a):\n", " return 0.5 * a * t**2" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "##### Keywords\n", "def\n", "return" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "g = 9.8" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Repeated tasks in Pythin" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "We can repeat a task using for loop" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Velocity at t = 0 with Delta T = 0.001 0.0049\n", "Velocity at t = 0 with Delta T = 0.0001 0.00049\n", "Velocity at t = 0 with Delta T = 1e-05 4.9e-05\n", "Velocity at t = 0 with Delta T = 1e-06 5e-06\n", "Velocity at t = 0 with Delta T = 1e-07 0.0\n", "Velocity at t = 0 with Delta T = 1e-08 0.0\n" ] } ], "source": [ "for deltaT in [0.001, 0.0001, 0.00001, 0.000001,0.0000001, 0.00000001]:\n", " v = (y(deltaT, g) - y(0,g))/deltaT\n", " print(\"Velocity at t = 0 with Delta T = \", deltaT,\" \" , round(v, 6))" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Distance" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Table of velocity" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "t = 0 velocity = 0.0\n", "t = 1 velocity = 9.8\n", "t = 2 velocity = 19.6\n", "t = 3 velocity = 29.400000000000002\n", "t = 4 velocity = 39.2\n", "t = 5 velocity = 49.0\n", "t = 6 velocity = 58.800000000000004\n", "t = 7 velocity = 68.60000000000001\n", "t = 8 velocity = 78.4\n", "t = 9 velocity = 88.2\n" ] } ], "source": [ "for t in range(0,10):\n", " print(\"t = \", t, \" velocity = \", g * t)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Velocity function for a falling body which starts at rest" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "def velocity(t):\n", " return 9.8 * t" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Calculating the position from the velocity function" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "First we will use $$y(t) = y(t-\\Delta t) + v(t-\\Delta t) \\times \\Delta t$$" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [], "source": [ "deltaT = 0.000001\n", "N = int(4.0/deltaT)\n", "y = float(0.0)" ] }, { "cell_type": "code", "execution_count": 18, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "T = 4.0 y = 78.4 Number of steps = 4000000\n" ] } ], "source": [ "y = float(0.0)\n", "for i in range(1,N+1):\n", " t = (i-1) * deltaT\n", " v = velocity(t)\n", " deltaY = v * deltaT\n", " y += deltaY\n", " #print(\"t = \", t+deltaT, \" y = \", round(y, 3))\n", "print(\"T = \", round(t+deltaT,3), \"y = \", round(y,3), \" Number of steps = \", N)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "#### Midpoint method" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "$$y(t+\\Delta t) = y(t) + v(t+\\Delta t /2) \\times \\Delta t $$" ] }, { "cell_type": "code", "execution_count": 14, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4.0 78.4\n" ] } ], "source": [ "deltaT = 0.00001\n", "N = int(4.0/deltaT)\n", "y = float(0.0)\n", "for i in range(1,N+1):\n", " t = (i-1) * deltaT\n", " v = velocity(t+deltaT)\n", " deltaY = v * deltaT\n", " y += deltaY\n", " #print(t+deltaT, v, y\n", "print(round(t+deltaT,3), round(y,3))" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "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.6.8" } }, "nbformat": 4, "nbformat_minor": 2 }