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?
compmech-project02/02_Analyze-data_project.ipynb
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
352 lines (352 sloc)
21.9 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": [ | |
"# Computational Mechanics Project #02 - Create specifications for a projectile robot\n", | |
"\n", | |
"On the first day of class, we threw $2\"\\times~2\"$ dampened paper (spitballs) at a target on the whiteboard. Now, we are going to analyze the accuracy of the class with some cool Python tools and design a robot that has the same accuracy and precision as the class, but we will have the robot move farther away from the target and use a simpler projectile i.e. a tennis ball so we don't need to worry about knuckle-ball physics. \n", | |
"\n", | |
"The goal of this project is to determine the precision of necessary components for a robot that can reproduce the class throwing distibution. We have generated pseudo random numbers using `numpy.random`, but the class target practice is an example of truly random distributions. If we repeated the exercise, there is a vanishingly small probability that we would hit the same points on the target, and there are no deterministic models that could take into account all of the factors that affected each hit on the board. \n", | |
"\n", | |
"<img src=\"../images/robot_design.png\" style=\"height: 250px;\"/>\n" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"Now, we ask ourselves some questions:\n", | |
"\n", | |
"1. How do we quantify the class accuracy and precision?\n", | |
"\n", | |
"2. If we design a robot, what design components can we control?\n", | |
"\n", | |
"3. How can we relate the controlled components to the class accuracy, and specify the component precision?\n", | |
"\n", | |
"The first question, we have some experience from our work in [02_Seeing_Stats](../notebooks/02_Seeing_Stats.ipynb). We can define the mean, standard deviation, measure the first, second, and third quartiles, etc. \n", | |
"\n", | |
"The second question is a physical question. We cannot control the placement of the robot or the target those are chosen for us. We cannot control temperature, mechanical vibrations, etc. We *can* control the desired initial velocity. The initial velocity will have some speed and direction, and both will be subject to random noise. Once the speed and direction are set, the location on the target is determined by kinematic equations for an object in freefall, as such\n", | |
"\n", | |
"$x_{impact} = \\frac{v_x}{v_y}d + x(0)~~~~~~~~~~~~~~~~~~~~(1.a)$\n", | |
"\n", | |
"$z_{impact} = d\\left(\\frac{v_z(0)}{v_y}-\\frac{g}{2v_y^2}d\\right)+ z(0)~~~~~(1.b)$.\n", | |
"\n", | |
"Where the location of impact is at a $y$-distance of $d$ at a point on the target with coordinates $(x_{impact},~z_{impact})$, and the initial velocity is $\\bar{v}=v_x\\hat{i}+v_y\\hat{j}+v_z(0)\\hat{k}$, the object is released at an initial location $\\bar{r}(0)=x(0)\\hat{i}+0\\hat{j}+z(0)\\hat{k}$, and the only acceleration is due to gravity, $\\bar{a}=-g\\hat{k}$. Equation (1) becomes much easier to evaluate if we assume that $v_x=0$, resulting in an evalution of the accuracy of the height of the impact, $z_{impact}$, as such\n", | |
"\n", | |
"$x_{impact} = x(0)~~~~~~~~~~~~~~~~~~~~(2.a)$\n", | |
"\n", | |
"$z_{impact} = \\frac{d}{\\cos{\\theta}}\\left(\\sin{\\theta}-\\frac{g}{2v_0^2\\cos{\\theta}}d\\right)+ z(0)~~~~~(2.b)$.\n", | |
"\n", | |
"Where $\\theta$ is the angle of the initial velocity and $v_0$ is the initial speed. Equation (2) restricts the analysis to height accuracy. You can incorporate the 2D impact analysis if you finish the 1D analysis. " | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"The third question, is how we can relate equation (2) to the measured points of impact? For this, we can use Monte Carlo methods *(There are other methods, but Monte Carlo is one of the most straight-forward)*. Our Monte Carlo approach is as such, if we have a desired initial speed, $v_0$, and desired angle, $\\theta$, we can propagate the uncertainty of our actual speeds and angles into the $z_{impact}$ locations. Then, we can choose distributions in speed and angles that match the distributions in $z_{impact}$ locations. Here are the steps:\n", | |
"\n", | |
"1. Generate random $\\theta_i$ and $v_{0~i}$ variables\n", | |
"\n", | |
"2. Plug into eqn 2 for random $z_{impact~i}$ locations\n", | |
"\n", | |
"3. Compare to our measured $z_{impact}$ location statistics\n", | |
"\n", | |
"4. Repeat 1-3 until the predicted uncertainty matches the desired uncertainty, we can use a number of comparison metrics:\n", | |
" \n", | |
" - standard deviation\n", | |
" \n", | |
" - first, second, and third quartiles\n", | |
" \n", | |
" - visually, with box plots and histograms" | |
] | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# Project Deliverables\n", | |
"\n", | |
"1. Statistical analysis of class accuracy and precision (x- and z-locations) data is in the csv file [../data/target_data.csv](../data/target_data.csv) _Note: if you want to see how I turned the images into data check out the jupyter notebook [process_target_practice](./process_target_practice.ipynb)\n", | |
"\n", | |
"2. A Monte Carlo model to generate impact heights based upon uncertainty in $\\theta_0$ and $v_0$. \n", | |
"\n", | |
"3. The precision required to recreate the class accuracy and precision with a robot. \n", | |
"**You must show some validation of your work**\n", | |
"\n", | |
"4. [BONUS] Repeat 2-3 taking into account the variation in $x_{impact}$ due to misalignment. \n", | |
"\n", | |
"Given constants and constraints:\n", | |
"\n", | |
"- $d=$3 m, distance to target\n", | |
"\n", | |
"- $g=$9.81 m/s$^2$, acceleration due to gravity\n", | |
"\n", | |
"- $z(0)=$0.3 m, the initial height is 0.3 m above the bull's eye\n", | |
"\n", | |
"- 4 m/s$<v_0<$12 m/s, the initial velocity is always higher than 9 mph and less than 27 mph" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 53, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import matplotlib.pyplot as plt\n", | |
"import numpy as np\n", | |
"import pandas as pd\n", | |
"\n", | |
"#Import rcParams to set font styles\n", | |
"from matplotlib import rcParams\n", | |
"\n", | |
"#Set font style and size \n", | |
"rcParams['font.family'] = 'sans'\n", | |
"rcParams['font.size'] = 16\n", | |
"rcParams['lines.linewidth'] = 3" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 81, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"#given parameters\n", | |
"d = 3 #m\n", | |
"g = 9.81 #m/s^2\n", | |
"z0 = 0.3 #m" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 22, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"data = pd.read_csv('../project/Cooper_data/target_data.csv')" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": null, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"data" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 35, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"The x position mean is 0.01207963411779779\n", | |
"The y position mean is -0.047397370492807414\n", | |
"\n", | |
"The x position standard deviation is 0.25716367278418045\n", | |
"The y position standard deviation is 0.2548611138551949\n", | |
"\n", | |
"The first quartile for x position is -0.1685\n", | |
"The second quartile for x position is 0.0285\n", | |
"The third quartile for x position is 0.1671\n", | |
"\n", | |
"The first quartile for y position is -0.2179\n", | |
"The second quartile for y position is -0.0709\n", | |
"The third quartile for y position is 0.1322\n" | |
] | |
} | |
], | |
"source": [ | |
"#Question1\n", | |
"xposition = data[' x position (m)']\n", | |
"yposition = data[' y position (m)']\n", | |
"\n", | |
"xpos_mean = np.mean(xposition)\n", | |
"ypos_mean = np.mean(yposition)\n", | |
"print('The x position mean is', xpos_mean)\n", | |
"print('The y position mean is', ypos_mean)\n", | |
"print()\n", | |
"\n", | |
"xpos_std = np.std(xposition)\n", | |
"ypos_std = np.std(yposition)\n", | |
"print('The x position standard deviation is', xpos_std)\n", | |
"print('The y position standard deviation is', ypos_std)\n", | |
"print()\n", | |
"\n", | |
"quartiles_xpos = np.percentile(xposition, q=[25, 50, 75])\n", | |
"\n", | |
"print('The first quartile for x position is {:.4f}'.format(quartiles_xpos[0]))\n", | |
"print('The second quartile for x position is {:.4f}'.format(quartiles_xpos[1]))\n", | |
"print('The third quartile for x position is {:.4f}'.format(quartiles_xpos[2]))\n", | |
"print()\n", | |
"\n", | |
"quartiles_ypos = np.percentile(yposition, q=[25, 50, 75])\n", | |
"\n", | |
"print('The first quartile for y position is {:.4f}'.format(quartiles_ypos[0]))\n", | |
"print('The second quartile for y position is {:.4f}'.format(quartiles_ypos[1]))\n", | |
"print('The third quartile for y position is {:.4f}'.format(quartiles_ypos[2]))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 205, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"# d, g, x0 given, v_initial ranges from 4 to 12 m/s\n", | |
"def zimpact(d, g, z0):\n", | |
" vi=np.random.rand(100)\n", | |
" th=np.random.rand(100)\n", | |
" \n", | |
" v_mean = 8\n", | |
" v_std = 0.65\n", | |
" v_initial = np.random.normal(v_mean, v_std, size = 100) #normal distribution (99.5% of values from about 6-10 m/s)\n", | |
" \n", | |
" theta = (np.pi/12)*th # scaling theta from 0 to pi/12\n", | |
" \n", | |
" zimpact = ((d/np.cos(theta))*(np.sin(theta) - (g*d/(2*(v_initial**2)*np.cos(theta))))) + z0\n", | |
" \n", | |
" mean_zimpact = np.mean(zimpact)\n", | |
" std_zimpact = np.std(zimpact)\n", | |
" \n", | |
" zimpact_quartiles = np.percentile(zimpact, q=[25, 50, 75])\n", | |
" quartile1 = zimpact_quartiles[0]\n", | |
" quartile2 = zimpact_quartiles[1]\n", | |
" quartile3 = zimpact_quartiles[2]\n", | |
" \n", | |
" return mean_zimpact, std_zimpact, quartile1, quartile2, quartile3, zimpact" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 206, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"The mean is -0.03642074486308339\n", | |
"The standard deviation is 0.26659665763410745\n", | |
"\n", | |
"The first quartile for y position is -0.2132\n", | |
"The second quartile for y position is -0.0054\n", | |
"The third quartile for y position is 0.1696\n" | |
] | |
} | |
], | |
"source": [ | |
"mean = zimpact(d,g,z0)[0]\n", | |
"std = zimpact(d,g,z0)[1]\n", | |
"quartile1 = zimpact(d,g,z0)[2]\n", | |
"quartile2 = zimpact(d,g,z0)[3]\n", | |
"quartile3 = zimpact(d,g,z0)[4]\n", | |
"print('The mean is', mean)\n", | |
"print('The standard deviation is', std)\n", | |
"print('')\n", | |
"print('The first quartile for y position is {:.4f}'.format(quartile1))\n", | |
"print('The second quartile for y position is {:.4f}'.format(quartile2))\n", | |
"print('The third quartile for y position is {:.4f}'.format(quartile3))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 215, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"Comparing zimpact and y position\n", | |
"\n", | |
"For z impact (robot):\n", | |
"The z position mean is -0.0305\n", | |
"The z position standard deviation is 0.2094\n", | |
"The first quartile for z position is -0.2081\n", | |
"The second quartile for z position is -0.0088\n", | |
"The third quartile for z position is 0.2033\n", | |
"\n", | |
"For y position:\n", | |
"The y position mean is -0.0474\n", | |
"The y position standard deviation is 0.2549\n", | |
"The first quartile for y position is -0.2179\n", | |
"The second quartile for y position is -0.0709\n", | |
"The third quartile for y position is 0.1322\n" | |
] | |
}, | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAD9CAYAAAB0i+q4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAX8klEQVR4nO3de5SlVX3m8e8jKF4SYrdCdNSmuRgiLC+JZRZRR5GlAxkRNN5Q8S4YM94yw1pKSAyCUYgGjLeRdjISaScqiIKXgAo9LKO2sRrF0CgCQ3uJqK3dXBqk8fKbP9635HA4VXWqe58uuvv7WeusqrPfvfe73+636qn97veck6pCkqQW7rbYA5Ak7TgMFUlSM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mJC9jaEZSVTclOR54d5KP011Dvwl4FHBrVb2739fPgKOSfBO4Gbi2qn6GFtv76e7q+ynw8QW0m+/8+VWSNwFnJFlJd0fVg4C/pVun+CBAkpPoZjir6O5IezDdzSXfqKr1s+z7O3Q3pbwsyYZ+/1f26zrDTgYOBy5KcirdYvwb6NaTTlrA8e5wnKls/36P7v/xJXR/zQ0+/noRxnMJ8PfAW4GP0l03/pOq+s5AnefR3ar8Xrq7Y34EvG64o6p6D9118QfThcrHgWfRvz6lqn4NvILu8sYX6BZnnzaBY9LCnd1/PbNfmB7XvOdPVa0AXgg8nG795u+AzwNPrKpNfbWv0t0deHq/7dS+76fOtuP+j5FXA4/s634NePQsdb9Jd7fYjcA/0d1osqkfw2ULON4djm/Tomb6F5L9a1Udvdhj0eJKcgzd5abfq6qrx2yzDs+f7Z6XvyQ1k+QAYF/gzcAnxw0U7TgMFUktvY/uNUZfpruUpJ2Ml78kSc24UC9JasZQkSQ1Y6hIkpoxVCRJzRgqkqRm/j/6lU/d5RJ44AAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"mean = zimpact(d,g,z0)[0]\n", | |
"std = zimpact(d,g,z0)[1]\n", | |
"quartile1 = zimpact(d,g,z0)[2]\n", | |
"quartile2 = zimpact(d,g,z0)[3]\n", | |
"quartile3 = zimpact(d,g,z0)[4]\n", | |
"plt.boxplot([zimpact(d,g,z_0)[5], yposition], labels=['z impact', 'y position']);\n", | |
"\n", | |
"print('Comparing zimpact and y position')\n", | |
"print('')\n", | |
"print('For z impact (robot):')\n", | |
"print('The z position mean is {:.4f}'.format(mean))\n", | |
"print('The z position standard deviation is {:.4f}'.format(std))\n", | |
"print('The first quartile for z position is {:.4f}'.format(quartile1))\n", | |
"print('The second quartile for z position is {:.4f}'.format(quartile2))\n", | |
"print('The third quartile for z position is {:.4f}'.format(quartile3))\n", | |
"print('')\n", | |
"print('For y position:')\n", | |
"print('The y position mean is {:.4f}'.format(ypos_mean))\n", | |
"print('The y position standard deviation is {:.4f}'.format(ypos_std))\n", | |
"print('The first quartile for y position is {:.4f}'.format(quartiles_ypos[0]))\n", | |
"print('The second quartile for y position is {:.4f}'.format(quartiles_ypos[1]))\n", | |
"print('The third quartile for y position is {:.4f}'.format(quartiles_ypos[2]))" | |
] | |
}, | |
{ | |
"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.7.3" | |
} | |
}, | |
"nbformat": 4, | |
"nbformat_minor": 4 | |
} |