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.
1096 lines (1096 sloc)
51.7 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": 13, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"import matplotlib.pyplot as plt\n", | |
"import numpy as np\n", | |
"import pandas as pd\n", | |
"import math\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": 14, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"text/html": [ | |
"<div>\n", | |
"<style scoped>\n", | |
" .dataframe tbody tr th:only-of-type {\n", | |
" vertical-align: middle;\n", | |
" }\n", | |
"\n", | |
" .dataframe tbody tr th {\n", | |
" vertical-align: top;\n", | |
" }\n", | |
"\n", | |
" .dataframe thead th {\n", | |
" text-align: right;\n", | |
" }\n", | |
"</style>\n", | |
"<table border=\"1\" class=\"dataframe\">\n", | |
" <thead>\n", | |
" <tr style=\"text-align: right;\">\n", | |
" <th></th>\n", | |
" <th>throw #</th>\n", | |
" <th>x position (m)</th>\n", | |
" <th>y position (m)</th>\n", | |
" <th>picture x position (pixel)</th>\n", | |
" <th>picture y position (pixel)</th>\n", | |
" <th>target x position (pixel)</th>\n", | |
" <th>target y position (pixel)</th>\n", | |
" <th>image #</th>\n", | |
" </tr>\n", | |
" </thead>\n", | |
" <tbody>\n", | |
" <tr>\n", | |
" <th>0</th>\n", | |
" <td>0</td>\n", | |
" <td>-0.466403</td>\n", | |
" <td>-0.304000</td>\n", | |
" <td>1260.855114</td>\n", | |
" <td>990.599432</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>1</th>\n", | |
" <td>1</td>\n", | |
" <td>-0.206978</td>\n", | |
" <td>-0.448126</td>\n", | |
" <td>1702.673295</td>\n", | |
" <td>745.144886</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>2</th>\n", | |
" <td>2</td>\n", | |
" <td>-0.091677</td>\n", | |
" <td>-0.457734</td>\n", | |
" <td>1899.036932</td>\n", | |
" <td>728.781250</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>3</th>\n", | |
" <td>3</td>\n", | |
" <td>0.153336</td>\n", | |
" <td>-0.510580</td>\n", | |
" <td>2316.309659</td>\n", | |
" <td>638.781250</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>4</th>\n", | |
" <td>4</td>\n", | |
" <td>0.364720</td>\n", | |
" <td>-0.597055</td>\n", | |
" <td>2676.309659</td>\n", | |
" <td>491.508523</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>5</th>\n", | |
" <td>5</td>\n", | |
" <td>-0.120502</td>\n", | |
" <td>-0.227133</td>\n", | |
" <td>1849.946023</td>\n", | |
" <td>1121.508523</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>6</th>\n", | |
" <td>6</td>\n", | |
" <td>-0.091677</td>\n", | |
" <td>-0.255959</td>\n", | |
" <td>1899.036932</td>\n", | |
" <td>1072.417614</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>7</th>\n", | |
" <td>7</td>\n", | |
" <td>-0.096482</td>\n", | |
" <td>-0.179092</td>\n", | |
" <td>1890.855114</td>\n", | |
" <td>1203.326705</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>8</th>\n", | |
" <td>8</td>\n", | |
" <td>-0.192565</td>\n", | |
" <td>-0.044575</td>\n", | |
" <td>1727.218750</td>\n", | |
" <td>1432.417614</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>9</th>\n", | |
" <td>9</td>\n", | |
" <td>-0.082069</td>\n", | |
" <td>-0.025358</td>\n", | |
" <td>1915.400568</td>\n", | |
" <td>1465.144886</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>10</th>\n", | |
" <td>10</td>\n", | |
" <td>0.162944</td>\n", | |
" <td>-0.313609</td>\n", | |
" <td>2332.673295</td>\n", | |
" <td>974.235795</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>11</th>\n", | |
" <td>11</td>\n", | |
" <td>0.249419</td>\n", | |
" <td>-0.332825</td>\n", | |
" <td>2479.946023</td>\n", | |
" <td>941.508523</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>12</th>\n", | |
" <td>12</td>\n", | |
" <td>0.441586</td>\n", | |
" <td>-0.371259</td>\n", | |
" <td>2807.218750</td>\n", | |
" <td>876.053977</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>13</th>\n", | |
" <td>13</td>\n", | |
" <td>0.038035</td>\n", | |
" <td>-0.006141</td>\n", | |
" <td>2119.946023</td>\n", | |
" <td>1497.872159</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>14</th>\n", | |
" <td>14</td>\n", | |
" <td>0.076469</td>\n", | |
" <td>-0.058987</td>\n", | |
" <td>2185.400568</td>\n", | |
" <td>1407.872159</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>15</th>\n", | |
" <td>15</td>\n", | |
" <td>0.134119</td>\n", | |
" <td>-0.073400</td>\n", | |
" <td>2283.582386</td>\n", | |
" <td>1383.326705</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>16</th>\n", | |
" <td>16</td>\n", | |
" <td>0.134119</td>\n", | |
" <td>-0.159875</td>\n", | |
" <td>2283.582386</td>\n", | |
" <td>1236.053977</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>17</th>\n", | |
" <td>17</td>\n", | |
" <td>0.162944</td>\n", | |
" <td>-0.020554</td>\n", | |
" <td>2332.673295</td>\n", | |
" <td>1473.326705</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>18</th>\n", | |
" <td>18</td>\n", | |
" <td>0.278244</td>\n", | |
" <td>-0.073400</td>\n", | |
" <td>2529.036932</td>\n", | |
" <td>1383.326705</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>19</th>\n", | |
" <td>19</td>\n", | |
" <td>0.302265</td>\n", | |
" <td>-0.097421</td>\n", | |
" <td>2569.946023</td>\n", | |
" <td>1342.417614</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>20</th>\n", | |
" <td>20</td>\n", | |
" <td>0.210986</td>\n", | |
" <td>0.094747</td>\n", | |
" <td>2414.491477</td>\n", | |
" <td>1669.690341</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>21</th>\n", | |
" <td>21</td>\n", | |
" <td>0.331090</td>\n", | |
" <td>0.157201</td>\n", | |
" <td>2619.036932</td>\n", | |
" <td>1776.053977</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>22</th>\n", | |
" <td>22</td>\n", | |
" <td>0.114902</td>\n", | |
" <td>0.224459</td>\n", | |
" <td>2250.855114</td>\n", | |
" <td>1890.599432</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>23</th>\n", | |
" <td>23</td>\n", | |
" <td>0.134119</td>\n", | |
" <td>0.339760</td>\n", | |
" <td>2283.582386</td>\n", | |
" <td>2086.963068</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>24</th>\n", | |
" <td>24</td>\n", | |
" <td>-0.154132</td>\n", | |
" <td>0.186026</td>\n", | |
" <td>1792.673295</td>\n", | |
" <td>1825.144886</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>25</th>\n", | |
" <td>25</td>\n", | |
" <td>-0.173348</td>\n", | |
" <td>0.157201</td>\n", | |
" <td>1759.946023</td>\n", | |
" <td>1776.053977</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>26</th>\n", | |
" <td>26</td>\n", | |
" <td>-0.307865</td>\n", | |
" <td>0.142788</td>\n", | |
" <td>1530.855114</td>\n", | |
" <td>1751.508523</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>27</th>\n", | |
" <td>27</td>\n", | |
" <td>-0.312670</td>\n", | |
" <td>0.373389</td>\n", | |
" <td>1522.673295</td>\n", | |
" <td>2144.235795</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>28</th>\n", | |
" <td>28</td>\n", | |
" <td>-0.490424</td>\n", | |
" <td>0.397410</td>\n", | |
" <td>1219.946023</td>\n", | |
" <td>2185.144886</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>29</th>\n", | |
" <td>29</td>\n", | |
" <td>-0.711416</td>\n", | |
" <td>0.334955</td>\n", | |
" <td>843.582386</td>\n", | |
" <td>2078.781250</td>\n", | |
" <td>2055.169256</td>\n", | |
" <td>1508.331047</td>\n", | |
" <td>1</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>30</th>\n", | |
" <td>30</td>\n", | |
" <td>-0.291312</td>\n", | |
" <td>-0.127198</td>\n", | |
" <td>1412.218750</td>\n", | |
" <td>1254.974432</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>31</th>\n", | |
" <td>31</td>\n", | |
" <td>-0.126406</td>\n", | |
" <td>-0.303884</td>\n", | |
" <td>1755.855114</td>\n", | |
" <td>886.792614</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>32</th>\n", | |
" <td>32</td>\n", | |
" <td>-0.197080</td>\n", | |
" <td>-0.158609</td>\n", | |
" <td>1608.582386</td>\n", | |
" <td>1189.519886</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>33</th>\n", | |
" <td>33</td>\n", | |
" <td>-0.232417</td>\n", | |
" <td>-0.076155</td>\n", | |
" <td>1534.946023</td>\n", | |
" <td>1361.338068</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>34</th>\n", | |
" <td>34</td>\n", | |
" <td>-0.118553</td>\n", | |
" <td>-0.044744</td>\n", | |
" <td>1772.218750</td>\n", | |
" <td>1426.792614</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>35</th>\n", | |
" <td>35</td>\n", | |
" <td>-0.071437</td>\n", | |
" <td>-0.107566</td>\n", | |
" <td>1870.400568</td>\n", | |
" <td>1295.883523</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>36</th>\n", | |
" <td>36</td>\n", | |
" <td>-0.043952</td>\n", | |
" <td>-0.190020</td>\n", | |
" <td>1927.673295</td>\n", | |
" <td>1124.065341</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>37</th>\n", | |
" <td>37</td>\n", | |
" <td>0.011017</td>\n", | |
" <td>-0.146830</td>\n", | |
" <td>2042.218750</td>\n", | |
" <td>1214.065341</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>38</th>\n", | |
" <td>38</td>\n", | |
" <td>0.038501</td>\n", | |
" <td>-0.315663</td>\n", | |
" <td>2099.491477</td>\n", | |
" <td>862.247159</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>39</th>\n", | |
" <td>39</td>\n", | |
" <td>0.093470</td>\n", | |
" <td>-0.131124</td>\n", | |
" <td>2214.036932</td>\n", | |
" <td>1246.792614</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>40</th>\n", | |
" <td>40</td>\n", | |
" <td>0.168071</td>\n", | |
" <td>-0.170388</td>\n", | |
" <td>2369.491477</td>\n", | |
" <td>1164.974432</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>41</th>\n", | |
" <td>41</td>\n", | |
" <td>0.226966</td>\n", | |
" <td>-0.244988</td>\n", | |
" <td>2492.218750</td>\n", | |
" <td>1009.519886</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>42</th>\n", | |
" <td>42</td>\n", | |
" <td>0.603896</td>\n", | |
" <td>-0.319589</td>\n", | |
" <td>3277.673295</td>\n", | |
" <td>854.065341</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>43</th>\n", | |
" <td>43</td>\n", | |
" <td>0.305493</td>\n", | |
" <td>-0.013334</td>\n", | |
" <td>2655.855114</td>\n", | |
" <td>1492.247159</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>44</th>\n", | |
" <td>44</td>\n", | |
" <td>0.195556</td>\n", | |
" <td>-0.068303</td>\n", | |
" <td>2426.764205</td>\n", | |
" <td>1377.701705</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>45</th>\n", | |
" <td>45</td>\n", | |
" <td>0.117028</td>\n", | |
" <td>-0.036892</td>\n", | |
" <td>2263.127841</td>\n", | |
" <td>1443.156250</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>46</th>\n", | |
" <td>46</td>\n", | |
" <td>0.018870</td>\n", | |
" <td>0.088752</td>\n", | |
" <td>2058.582386</td>\n", | |
" <td>1704.974432</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>47</th>\n", | |
" <td>47</td>\n", | |
" <td>0.164145</td>\n", | |
" <td>0.100531</td>\n", | |
" <td>2361.309659</td>\n", | |
" <td>1729.519886</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>48</th>\n", | |
" <td>48</td>\n", | |
" <td>0.289788</td>\n", | |
" <td>0.167279</td>\n", | |
" <td>2623.127841</td>\n", | |
" <td>1868.610795</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>49</th>\n", | |
" <td>49</td>\n", | |
" <td>0.525369</td>\n", | |
" <td>0.069120</td>\n", | |
" <td>3114.036932</td>\n", | |
" <td>1664.065341</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>50</th>\n", | |
" <td>50</td>\n", | |
" <td>-0.126406</td>\n", | |
" <td>0.363596</td>\n", | |
" <td>1755.855114</td>\n", | |
" <td>2277.701705</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>51</th>\n", | |
" <td>51</td>\n", | |
" <td>-0.244196</td>\n", | |
" <td>0.402860</td>\n", | |
" <td>1510.400568</td>\n", | |
" <td>2359.519886</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>52</th>\n", | |
" <td>52</td>\n", | |
" <td>-0.212785</td>\n", | |
" <td>0.563840</td>\n", | |
" <td>1575.855114</td>\n", | |
" <td>2694.974432</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" <tr>\n", | |
" <th>53</th>\n", | |
" <td>53</td>\n", | |
" <td>-0.232417</td>\n", | |
" <td>0.288996</td>\n", | |
" <td>1534.946023</td>\n", | |
" <td>2122.247159</td>\n", | |
" <td>2019.261556</td>\n", | |
" <td>1520.031972</td>\n", | |
" <td>2</td>\n", | |
" </tr>\n", | |
" </tbody>\n", | |
"</table>\n", | |
"</div>" | |
], | |
"text/plain": [ | |
" throw # x position (m) y position (m) picture x position (pixel) \\\n", | |
"0 0 -0.466403 -0.304000 1260.855114 \n", | |
"1 1 -0.206978 -0.448126 1702.673295 \n", | |
"2 2 -0.091677 -0.457734 1899.036932 \n", | |
"3 3 0.153336 -0.510580 2316.309659 \n", | |
"4 4 0.364720 -0.597055 2676.309659 \n", | |
"5 5 -0.120502 -0.227133 1849.946023 \n", | |
"6 6 -0.091677 -0.255959 1899.036932 \n", | |
"7 7 -0.096482 -0.179092 1890.855114 \n", | |
"8 8 -0.192565 -0.044575 1727.218750 \n", | |
"9 9 -0.082069 -0.025358 1915.400568 \n", | |
"10 10 0.162944 -0.313609 2332.673295 \n", | |
"11 11 0.249419 -0.332825 2479.946023 \n", | |
"12 12 0.441586 -0.371259 2807.218750 \n", | |
"13 13 0.038035 -0.006141 2119.946023 \n", | |
"14 14 0.076469 -0.058987 2185.400568 \n", | |
"15 15 0.134119 -0.073400 2283.582386 \n", | |
"16 16 0.134119 -0.159875 2283.582386 \n", | |
"17 17 0.162944 -0.020554 2332.673295 \n", | |
"18 18 0.278244 -0.073400 2529.036932 \n", | |
"19 19 0.302265 -0.097421 2569.946023 \n", | |
"20 20 0.210986 0.094747 2414.491477 \n", | |
"21 21 0.331090 0.157201 2619.036932 \n", | |
"22 22 0.114902 0.224459 2250.855114 \n", | |
"23 23 0.134119 0.339760 2283.582386 \n", | |
"24 24 -0.154132 0.186026 1792.673295 \n", | |
"25 25 -0.173348 0.157201 1759.946023 \n", | |
"26 26 -0.307865 0.142788 1530.855114 \n", | |
"27 27 -0.312670 0.373389 1522.673295 \n", | |
"28 28 -0.490424 0.397410 1219.946023 \n", | |
"29 29 -0.711416 0.334955 843.582386 \n", | |
"30 30 -0.291312 -0.127198 1412.218750 \n", | |
"31 31 -0.126406 -0.303884 1755.855114 \n", | |
"32 32 -0.197080 -0.158609 1608.582386 \n", | |
"33 33 -0.232417 -0.076155 1534.946023 \n", | |
"34 34 -0.118553 -0.044744 1772.218750 \n", | |
"35 35 -0.071437 -0.107566 1870.400568 \n", | |
"36 36 -0.043952 -0.190020 1927.673295 \n", | |
"37 37 0.011017 -0.146830 2042.218750 \n", | |
"38 38 0.038501 -0.315663 2099.491477 \n", | |
"39 39 0.093470 -0.131124 2214.036932 \n", | |
"40 40 0.168071 -0.170388 2369.491477 \n", | |
"41 41 0.226966 -0.244988 2492.218750 \n", | |
"42 42 0.603896 -0.319589 3277.673295 \n", | |
"43 43 0.305493 -0.013334 2655.855114 \n", | |
"44 44 0.195556 -0.068303 2426.764205 \n", | |
"45 45 0.117028 -0.036892 2263.127841 \n", | |
"46 46 0.018870 0.088752 2058.582386 \n", | |
"47 47 0.164145 0.100531 2361.309659 \n", | |
"48 48 0.289788 0.167279 2623.127841 \n", | |
"49 49 0.525369 0.069120 3114.036932 \n", | |
"50 50 -0.126406 0.363596 1755.855114 \n", | |
"51 51 -0.244196 0.402860 1510.400568 \n", | |
"52 52 -0.212785 0.563840 1575.855114 \n", | |
"53 53 -0.232417 0.288996 1534.946023 \n", | |
"\n", | |
" picture y position (pixel) target x position (pixel) \\\n", | |
"0 990.599432 2055.169256 \n", | |
"1 745.144886 2055.169256 \n", | |
"2 728.781250 2055.169256 \n", | |
"3 638.781250 2055.169256 \n", | |
"4 491.508523 2055.169256 \n", | |
"5 1121.508523 2055.169256 \n", | |
"6 1072.417614 2055.169256 \n", | |
"7 1203.326705 2055.169256 \n", | |
"8 1432.417614 2055.169256 \n", | |
"9 1465.144886 2055.169256 \n", | |
"10 974.235795 2055.169256 \n", | |
"11 941.508523 2055.169256 \n", | |
"12 876.053977 2055.169256 \n", | |
"13 1497.872159 2055.169256 \n", | |
"14 1407.872159 2055.169256 \n", | |
"15 1383.326705 2055.169256 \n", | |
"16 1236.053977 2055.169256 \n", | |
"17 1473.326705 2055.169256 \n", | |
"18 1383.326705 2055.169256 \n", | |
"19 1342.417614 2055.169256 \n", | |
"20 1669.690341 2055.169256 \n", | |
"21 1776.053977 2055.169256 \n", | |
"22 1890.599432 2055.169256 \n", | |
"23 2086.963068 2055.169256 \n", | |
"24 1825.144886 2055.169256 \n", | |
"25 1776.053977 2055.169256 \n", | |
"26 1751.508523 2055.169256 \n", | |
"27 2144.235795 2055.169256 \n", | |
"28 2185.144886 2055.169256 \n", | |
"29 2078.781250 2055.169256 \n", | |
"30 1254.974432 2019.261556 \n", | |
"31 886.792614 2019.261556 \n", | |
"32 1189.519886 2019.261556 \n", | |
"33 1361.338068 2019.261556 \n", | |
"34 1426.792614 2019.261556 \n", | |
"35 1295.883523 2019.261556 \n", | |
"36 1124.065341 2019.261556 \n", | |
"37 1214.065341 2019.261556 \n", | |
"38 862.247159 2019.261556 \n", | |
"39 1246.792614 2019.261556 \n", | |
"40 1164.974432 2019.261556 \n", | |
"41 1009.519886 2019.261556 \n", | |
"42 854.065341 2019.261556 \n", | |
"43 1492.247159 2019.261556 \n", | |
"44 1377.701705 2019.261556 \n", | |
"45 1443.156250 2019.261556 \n", | |
"46 1704.974432 2019.261556 \n", | |
"47 1729.519886 2019.261556 \n", | |
"48 1868.610795 2019.261556 \n", | |
"49 1664.065341 2019.261556 \n", | |
"50 2277.701705 2019.261556 \n", | |
"51 2359.519886 2019.261556 \n", | |
"52 2694.974432 2019.261556 \n", | |
"53 2122.247159 2019.261556 \n", | |
"\n", | |
" target y position (pixel) image # \n", | |
"0 1508.331047 1 \n", | |
"1 1508.331047 1 \n", | |
"2 1508.331047 1 \n", | |
"3 1508.331047 1 \n", | |
"4 1508.331047 1 \n", | |
"5 1508.331047 1 \n", | |
"6 1508.331047 1 \n", | |
"7 1508.331047 1 \n", | |
"8 1508.331047 1 \n", | |
"9 1508.331047 1 \n", | |
"10 1508.331047 1 \n", | |
"11 1508.331047 1 \n", | |
"12 1508.331047 1 \n", | |
"13 1508.331047 1 \n", | |
"14 1508.331047 1 \n", | |
"15 1508.331047 1 \n", | |
"16 1508.331047 1 \n", | |
"17 1508.331047 1 \n", | |
"18 1508.331047 1 \n", | |
"19 1508.331047 1 \n", | |
"20 1508.331047 1 \n", | |
"21 1508.331047 1 \n", | |
"22 1508.331047 1 \n", | |
"23 1508.331047 1 \n", | |
"24 1508.331047 1 \n", | |
"25 1508.331047 1 \n", | |
"26 1508.331047 1 \n", | |
"27 1508.331047 1 \n", | |
"28 1508.331047 1 \n", | |
"29 1508.331047 1 \n", | |
"30 1520.031972 2 \n", | |
"31 1520.031972 2 \n", | |
"32 1520.031972 2 \n", | |
"33 1520.031972 2 \n", | |
"34 1520.031972 2 \n", | |
"35 1520.031972 2 \n", | |
"36 1520.031972 2 \n", | |
"37 1520.031972 2 \n", | |
"38 1520.031972 2 \n", | |
"39 1520.031972 2 \n", | |
"40 1520.031972 2 \n", | |
"41 1520.031972 2 \n", | |
"42 1520.031972 2 \n", | |
"43 1520.031972 2 \n", | |
"44 1520.031972 2 \n", | |
"45 1520.031972 2 \n", | |
"46 1520.031972 2 \n", | |
"47 1520.031972 2 \n", | |
"48 1520.031972 2 \n", | |
"49 1520.031972 2 \n", | |
"50 1520.031972 2 \n", | |
"51 1520.031972 2 \n", | |
"52 1520.031972 2 \n", | |
"53 1520.031972 2 " | |
] | |
}, | |
"execution_count": 14, | |
"metadata": {}, | |
"output_type": "execute_result" | |
} | |
], | |
"source": [ | |
"target_data = pd.read_csv(\"../data/target_data.csv\")\n", | |
"target_data" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 15, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"x_position = target_data[' x position (m)']\n", | |
"y_position = target_data[' y position (m)']" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 57, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"x position mean = 0.01207963411779779\n", | |
"x position standard deviation = 0.25716367278418045\n", | |
"x positon first quartile = -0.16854422326722185\n", | |
"x positon second quartile = 0.028452517775170515\n", | |
"x positon third quartile = 0.1670894539891312\n", | |
"y position mean = -0.047397370492807414\n", | |
"y position standard deviation = 0.2548611138551949\n", | |
"y positon first quartile = -0.21785495681409592\n", | |
"y positon second quartile = -0.070851135369002\n", | |
"y positon third quartile = 0.13222390283592378\n" | |
] | |
} | |
], | |
"source": [ | |
"x_position_mean = np.mean(x_position)\n", | |
"y_position_mean = np.mean(y_position)\n", | |
"\n", | |
"x_position_std = np.std(x_position)\n", | |
"y_position_std = np.std(y_position)\n", | |
"\n", | |
"quartiles_x_position = np.percentile(x_position, q=[25, 50, 75])\n", | |
"\n", | |
"quartiles_y_position = np.percentile(y_position, q=[25, 50, 75])\n", | |
"\n", | |
"print('x position mean =', x_position_mean)\n", | |
"print('x position standard deviation =', x_position_std)\n", | |
"print('x positon first quartile = {}'.format(quartiles_x_position[0]))\n", | |
"print('x positon second quartile = {}'.format(quartiles_x_position[1]))\n", | |
"print('x positon third quartile = {}'.format(quartiles_x_position[2]))\n", | |
"\n", | |
"print('y position mean =', y_position_mean)\n", | |
"print('y position standard deviation =', y_position_std)\n", | |
"print('y positon first quartile = {}'.format(quartiles_y_position[0]))\n", | |
"print('y positon second quartile = {}'.format(quartiles_y_position[1]))\n", | |
"print('y positon third quartile = {}'.format(quartiles_y_position[2]))" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 567, | |
"metadata": {}, | |
"outputs": [], | |
"source": [ | |
"def montecarlo_impact(d,g,z_0):\n", | |
" \n", | |
" v = np.random.rand(100)\n", | |
" v_mean = 8\n", | |
" v_std = 0.65\n", | |
" v_0 = np.random.normal(v_mean, v_std, size = 100)\n", | |
" \n", | |
" theta1 = np.random.rand(100)\n", | |
" theta = (np.pi/12)*theta1\n", | |
" \n", | |
" z_impact = (d/np.cos(theta))*(np.sin(theta) - ((g*d))/(2*(v_0**2)*np.cos(theta))) + z_0\n", | |
" \n", | |
" mean_z_impact = np.mean(z_impact)\n", | |
" \n", | |
" std_z_impact = np.std(z_impact)\n", | |
" \n", | |
" quartiles_z_impact = np.percentile(z_impact, q=[25,50,75])\n", | |
" \n", | |
" quartile_1_z_impact = quartiles_z_impact[0]\n", | |
" \n", | |
" quartile_2_z_impact = quartiles_z_impact[1]\n", | |
" \n", | |
" quartile_3_z_impact = quartiles_z_impact[2]\n", | |
" \n", | |
" return mean_z_impact, std_z_impact, quartile_1_z_impact, quartile_2_z_impact, quartile_3_z_impact, z_impact" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 556, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"name": "stdout", | |
"output_type": "stream", | |
"text": [ | |
"The mean z impact = -0.03894498659012225\n", | |
"The standard deviation of z impact = 0.265877291067583\n", | |
"The first quartile of z impact = -0.21589858377598303\n", | |
"The second quartile of z impact = -0.045878680967034124\n", | |
"The third quartile of z impact = 0.13898905980733506\n" | |
] | |
} | |
], | |
"source": [ | |
"d = 3\n", | |
"g = 9.81\n", | |
"z_0 = 0.3\n", | |
"\n", | |
"print('The mean z impact =',montecarlo_impact(d,g,z_0)[0])\n", | |
"print('The standard deviation of z impact =', montecarlo_impact(d,g,z_0)[1])\n", | |
"print('The first quartile of z impact =', montecarlo_impact(d,g,z_0)[2])\n", | |
"print('The second quartile of z impact =', montecarlo_impact(d,g,z_0)[3])\n", | |
"print('The third quartile of z impact =', montecarlo_impact(d,g,z_0)[4])" | |
] | |
}, | |
{ | |
"cell_type": "code", | |
"execution_count": 570, | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"data": { | |
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZUAAAD9CAYAAAB0i+q4AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjIsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy8li6FKAAAX9UlEQVR4nO3de5SlVX3m8e8jKF4SYrdKdFRoLoYICzWxzCLqKLJ0ICOCxhsq3gVjxltmXEsJiUEwCtGA8TbSTkYi7UQFb3gJqNDDMmobq1EMjSIwtJd4a+3m0iCNl9/88b4lh9Onqk5V79NFd38/a51Vdfa79/vut/utemrv/Z5zUlVIktTCnZa6A5KknYehIklqxlCRJDVjqEiSmjFUJEnN7L7UHVhK9773vWvFihVL3Q1J2qGsXbv2p1V1n1HbdulQWbFiBdPT00vdDUnaoST5zmzbnP6SJDVjqEiSmjFUJEnNGCqSpGYMFUlSM4aKJKkZQ0WS1IyhIklqZpd+8aOknUuSBbfxM6XaMlQk7TRmC4gkhsd24vSXJKkZQ0WS1IzTX1qQxcxZg/PW0q7CUNGCzBUOzltLmuj0V5IHJjkvyfVJbkjy0SR7j9m2Znk8bKjenZKcmGR9kluSXJbkqZM5I0nSXCY2Uklyd+BiYAvwfKCANwKrkzykqm4aYzdnA2cNlX176PmpwGuAk4C1wLHAuUmOqqrPLP4MJEkLNcnpr+OB/YADq+pqgCTfAK4CXgqcMcY+/qOq1sy2McledIFyWlW9tS9eneQA4DTAUJGk7WiS019HA2tmAg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RZLUjKEiSWrGUJEkNWOoSJKa+f+Tg9roXRug9wAAAABJRU5ErkJggg==\n", | |
"text/plain": [ | |
"<Figure size 432x288 with 1 Axes>" | |
] | |
}, | |
"metadata": { | |
"needs_background": "light" | |
}, | |
"output_type": "display_data" | |
} | |
], | |
"source": [ | |
"plt.boxplot([montecarlo_impact(d,g,z_0)[5], y_position], labels=['z impact', 'y position']);" | |
] | |
}, | |
{ | |
"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 | |
} |