Files

copied
Last update 6 years 11 months by Andy
FilesSoftware
..
hardware
libraries
syringePump
launch notebook_mac
launch notebook_windows.bat
resolution calculation.ipynb
resolution calculation.ipynb
{ "cells": [ { "cell_type": "markdown", "metadata": { "deletable": true, "editable": true }, "source": [ "## Resolution Calculation" ] }, { "cell_type": "code", "execution_count": 9, "metadata": { "collapsed": false, "deletable": true, "editable": true, "scrolled": true }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "2.655 μL resolution\n" ] } ], "source": [ "from math import pi\n", "from __future__ import print_function\n", "\n", "#Acme rod specs\n", "pitch = 2 #millimeters\n", "numStarts = 4\n", "lead = numStarts*pitch/10.0 #cm\n", "\n", "#Syringe specs\n", "syringeDiameter = 26 #millimeters\n", "syringeArea = pi*(syringeDiameter/10.0)**2/4.0 #cm^2\n", "\n", "#Motor specs\n", "numSteps = 200*8 #200 steps with 1/8 microstepping\n", "\n", "#Result\n", "resolution = lead*syringeArea/numSteps #mL\n", "print (u\"{:0.3f} \\u03bcL resolution\".format(resolution*1000))\n", "\n", "def computeRewardTime(desiredVolume): #desired volume in mL\n", " volumePerStep = resolution #mL\n", " msPerStep = 2 #ms\n", " stepsNeeded = desiredVolume/volumePerStep #steps\n", " return round(stepsNeeded*msPerStep,2)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": { "collapsed": false }, "outputs": [ { "data": { "text/plain": [ "75.34" ] }, "execution_count": 12, "metadata": {}, "output_type": "execute_result" } ], "source": [ "computeRewardTime(0.100)" ] } ], "metadata": { "anaconda-cloud": {}, "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.0" } }, "nbformat": 4, "nbformat_minor": 1 }
Report a bug