Last active
August 29, 2015 14:01
-
-
Save brianjp93/093660ed5848f9d46432 to your computer and use it in GitHub Desktop.
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
{ | |
"metadata": { | |
"name": "2.56 Micrometer Trap Force Brian Computation" | |
}, | |
"nbformat": 3, | |
"nbformat_minor": 0, | |
"worksheets": [ | |
{ | |
"cells": [ | |
{ | |
"cell_type": "heading", | |
"level": 1, | |
"metadata": {}, | |
"source": "Optical Tweezers Trap Force Measurement" | |
}, | |
{ | |
"cell_type": "heading", | |
"level": 4, | |
"metadata": {}, | |
"source": "May 15th, 2014 </br>\nBrian Perrett, Kyle Eichenberger, Samuel Estrella </br>\nAdvanced Projects Lab" | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "<table>\n <tr>\n <td>\n <strong>Microsphere Size</strong>\n </td>\n <td>\n $2.56\\mu m$\n </td>\n </tr>\n <tr>\n <td>\n <strong>Beam Strength</strong>\n </td>\n <td>\n $4.6mW$\n </td>\n </tr>\n <tr>\n <td>\n <strong>Measurements Per Second</strong>\n </td>\n <td>\n $200$\n </td>\n </tr>\n <tr>\n <td>\n <strong>$\\Delta t$ between measurements</strong>\n </td>\n <td>\n $.005s$\n </td>\n </tr>\n</table>" | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "Import Data from .csv file... Add them to arrays." | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "x_pos = []\ny_pos = []\n\n###########################\nimport csv\nwith open('C:/Users/Brian/Google Drive/Sophomore/Physics/Advanced Projects Lab 491/2.56 micrometer tracking 5-14-14/2.56 micrometer parsed.csv') as f:\n reader = csv.reader(f)\n for row in reader:\n x_pos.append(float(row[0]))\n y_pos.append(float(row[1]))\n###########################\n\n# convert lists to arrays for simplified calculations\nx_pos = array(x_pos)\ny_pos = array(y_pos)", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 2 | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "Convert from $\\mu m$ to $m$" | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "x_pos = x_pos*10**(-6)\ny_pos = y_pos*10**(-6)", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 3 | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "$\\frac {1}{2} k_b T = \\frac {1}{2} k <x^2>$" | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "<ul>\n<li>\nUsing the equipartition Theorem and equating it to the potential energy of the trap, we can solve for k\n</li>\n</ul>" | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "to compute the variance we must solve..." | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "$variance=\\overline{(x_{mean}-x_t)^2}$" | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "x_mean = mean(x_pos)\ny_mean = mean(y_pos)", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 4 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "x_var = mean((x_mean - x_pos)**2)\ny_var = mean((y_mean - y_pos)**2)", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 5 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "print(\"The x variation is \" + str(x_var))\nprint(\"The y variation is \" + str(y_var))", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"output_type": "stream", | |
"stream": "stdout", | |
"text": "The x variation is 6.92133033795e-16\nThe y variation is 2.57011754526e-15\n" | |
} | |
], | |
"prompt_number": 6 | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "<table>\n<tr>\n <td>\n x var\n </td>\n <td>\n 6.92133E-16 m\n </td>\n</tr>\n<tr>\n <td>\n y var\n </td>\n <td>\n 2.57012E-15\n </td>\n</tr>\n</table>" | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "$\\ \\frac {k_b T}{<x^2>} = k $" | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "kb = 1.3806488e-23\nT = 298", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 7 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "x_strength = (kb*T)/x_var\ny_strength = (kb*T)/y_var", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 8 | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "Let's convert from standard units to piconewtons per micrometer" | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "x_strength = x_strength*(10**12)/(10**6)\ny_strength = y_strength*(10**12)/(10**6)", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 9 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "x_strength # piconewtons/micrometer", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"metadata": {}, | |
"output_type": "pyout", | |
"prompt_number": 10, | |
"text": "5.9444257434757573" | |
} | |
], | |
"prompt_number": 10 | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "y_strength # piconewtons/micrometer", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [ | |
{ | |
"metadata": {}, | |
"output_type": "pyout", | |
"prompt_number": 11, | |
"text": "1.6008347289755338" | |
} | |
], | |
"prompt_number": 11 | |
}, | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": "<table>\n<th>\n direction\n</th>\n<th>\n k\n</th>\n<tr>\n <td>\n x trap strength\n </td>\n <td>\n $5.94 \\frac {pN}{\\mu m}$\n </td>\n</tr>\n<tr>\n <td>\n y trap strength\n </td>\n <td>\n $1.60 \\frac {pN}{\\mu m}$\n </td>\n</tr>\n</table>" | |
}, | |
{ | |
"cell_type": "code", | |
"collapsed": false, | |
"input": "", | |
"language": "python", | |
"metadata": {}, | |
"outputs": [], | |
"prompt_number": 11 | |
} | |
], | |
"metadata": {} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment