{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Ch:16 Power screws"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 16-1 - Page 450"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Ttr is 110.148 Nm     \n"
     ]
    }
   ],
   "source": [
    "from math import atan, pi, sqrt, tan\n",
    "d=30#\n",
    "W=20*10**3#\n",
    "r1=8#\n",
    "r2=16#\n",
    "p=6#\n",
    "u1=0.2#\n",
    "u2=0.15#\n",
    "dm=d-(p/2)#\n",
    "alpha=atan(p/(pi*dm))#\n",
    "phi=atan(u1)#\n",
    "rm=(r1+r2)/2#\n",
    "Ttr=W*((dm*tan(alpha+phi)/2)+(u2*rm))#\n",
    "Ttr=Ttr*10**-3#\n",
    "print \"Ttr is %0.3f Nm     \"%(Ttr)#\n",
    "#The answer to Ttr is slightly different than in the book due to rounding-off of values."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 16-2 - Page 451"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Tr is 187.49 Nm     \n",
      "\n",
      " Te is 51.691 Nm     \n",
      "\n",
      " n is 0.3489      \n",
      "\n",
      " Ph is 624.96 N     \n"
     ]
    }
   ],
   "source": [
    "from math import cos,pi,atan,tan\n",
    "d=50#\n",
    "W=20*10**3#\n",
    "r1=10#\n",
    "r2=30#\n",
    "p=7#\n",
    "u1=0.12/cos(15*pi/180)#\n",
    "u2=0.15#\n",
    "dm=d-(p/2)#\n",
    "alpha=atan(3*p/(pi*dm))#\n",
    "phi=atan(u1)#\n",
    "rm=(r1+r2)/2#\n",
    "Tr=W*((dm*tan(alpha+phi)/2)+(u2*rm))#\n",
    "Tr=Tr*10**-3#\n",
    "Te=W*((dm*tan(phi-alpha)/2)+(u2*rm))#\n",
    "Te=Te*10**-3#\n",
    "n=dm/2*tan(alpha)/(dm*tan(alpha+phi)/2+(u2*rm))#\n",
    "L=0.30#\n",
    "Ph=Tr/L#\n",
    "print \" Tr is %0.2f Nm     \"%(Tr)#\n",
    "print \"\\n Te is %0.3f Nm     \"%(Te)#\n",
    "print \"\\n n is %0.4f      \"%(n)#\n",
    "print \"\\n Ph is %0.2f N     \"%(Ph)#\n",
    "#The answers to Tr, Te and Ph is slightly different than in the book due to rounding-off of values."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 16-3 - Page 452"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " Tr1 is 31.456 Nm     \n",
      "\n",
      " n1 is 0.1265      \n",
      "\n",
      " T1 is 23.307 Nm     \n",
      "\n",
      " n2 is 0.1707      \n",
      "\n",
      " Tr2 is 17.156 Nm     \n",
      "\n",
      " n3 is 0.2319      \n",
      "\n",
      " Te is 9.007 Nm     \n",
      "\n",
      " n4 is 0.4418      \n"
     ]
    }
   ],
   "source": [
    "from math import sqrt, pi, atan,tan\n",
    "d=30#\n",
    "W=5*10**3#\n",
    "p=5#\n",
    "rm=45/2#\n",
    "u1=0.15/cos(14.5*pi/180)#\n",
    "u2=0.15#\n",
    "dm=d-(p/2)#\n",
    "alpha=atan(p/(pi*dm))#\n",
    "phi=atan(u1)#\n",
    "Tr1=W*((dm*tan(alpha+phi)/2)+(u2*rm))#\n",
    "Tr1=Tr1*10**-3#\n",
    "n1=dm/2*tan(alpha)/(dm*tan(alpha+phi)/2+(u2*rm))#\n",
    "T1=W*((dm*tan(phi-alpha)/2)+(u2*rm))#\n",
    "T1=T1*10**-3#\n",
    "n2=dm/2*tan(alpha)/(dm*tan(phi-alpha)/2+(u2*rm))#\n",
    "u2=0.02#\n",
    "Tr2=W*((dm*tan(alpha+phi)/2)+(u2*rm))#\n",
    "Tr2=Tr2*10**-3#\n",
    "n3=dm/2*tan(alpha)/(dm*tan(alpha+phi)/2+(u2*rm))#\n",
    "Te=W*((dm*tan(phi-alpha)/2)+(u2*rm))#\n",
    "Te=Te*10**-3#\n",
    "n4=dm/2*tan(alpha)/(dm*tan(phi-alpha)/2+(u2*rm))#\n",
    "print \" Tr1 is %0.3f Nm     \"%(Tr1)#\n",
    "print \"\\n n1 is %0.4f      \"%(n1)#\n",
    "print \"\\n T1 is %0.3f Nm     \"%(T1)#\n",
    "print \"\\n n2 is %0.4f      \"%(n2)#\n",
    "print \"\\n Tr2 is %0.3f Nm     \"%(Tr2)#\n",
    "print \"\\n n3 is %0.4f      \"%(n3)#\n",
    "print \"\\n Te is %0.3f Nm     \"%(Te)#\n",
    "print \"\\n n4 is %0.4f      \"%(n4)#\n",
    "  \n",
    "  #The answer to T1 is misprinted in the book."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 16-4 - Page 453"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "F is 7.299 kN     \n"
     ]
    }
   ],
   "source": [
    "from math import tan,atan,pi\n",
    "d=28#\n",
    "P=300#\n",
    "L=180#\n",
    "p=8#\n",
    "r1=16#\n",
    "r2=46#\n",
    "rm=(r1+r2)/2#\n",
    "u1=0.12#\n",
    "u2=0.15#\n",
    "dm=d-(p/2)#\n",
    "alpha=atan(p/(pi*dm))#\n",
    "phi=atan(u1)#\n",
    "T=P*L#\n",
    "F=T/((dm*tan(alpha+phi)/2)+(u2*rm))#\n",
    "F=F*10**-3#\n",
    "print \"F is %0.3f kN     \"%(F)#"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 16-5 - Page 453"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "P is 23.6 kN     \n"
     ]
    }
   ],
   "source": [
    "from math import sqrt, pi, atan,tan\n",
    "d=25#\n",
    "p=8#\n",
    "F=392.4#\n",
    "L=250#\n",
    "l=p*2#\n",
    "u=0.14#\n",
    "dm=d-(p/2)#\n",
    "alpha=atan(l/(pi*dm))#\n",
    "phi=atan(u)#\n",
    "T=dm*tan(alpha+phi)/2#\n",
    "M=F*L#\n",
    "P=M/T*10**-3#\n",
    "print \"P is %0.1f kN     \"%(P)#"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 16-6 - Page 454"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "P is 0.07 KW     \n",
      "\n",
      "n is 0.1659      \n"
     ]
    }
   ],
   "source": [
    "from math import sqrt, pi,atan,tan\n",
    "d=52#\n",
    "W=2.2*10**3#\n",
    "p=8#\n",
    "r1=15#\n",
    "r2=30#\n",
    "rm=(r1+r2)/2#\n",
    "u1=0.15/cos(14.5*pi/180)#\n",
    "dm=d-(p/2)#\n",
    "alpha=atan(p/(pi*dm))#\n",
    "phi=atan(u1)#\n",
    "Ts=W*dm*tan(alpha+phi)/2#\n",
    "u2=0.12#\n",
    "Tc=u2*W*rm#\n",
    "T=10**-3*(Ts+Tc)#\n",
    "N=40#\n",
    "w=2*pi*N/60#\n",
    "P=T*w*10**-3#\n",
    "To=W*dm/2*tan(alpha)#\n",
    "n=To/(T*10**3)#\n",
    "print \"P is %0.2f KW     \"%(P)#\n",
    "print \"\\nn is %0.4f      \"%(n)#"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 16-7 - Page 455"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "d is 24 mm     \n",
      "\n",
      "p is 5 mm     \n"
     ]
    }
   ],
   "source": [
    "from math import sqrt, pi,atan,tan\n",
    "alpha=atan(2*0.2/(pi*0.9))#\n",
    "u1=0.15#\n",
    "phi=atan(u1)#\n",
    "P=200#\n",
    "L=250#\n",
    "Tt=P*L#\n",
    "W=10*10**3#\n",
    "u2=0.15#\n",
    "x=Tt/W#\n",
    "d=x/0.1716#\n",
    "d=30#\n",
    "p=6#\n",
    "dr=0.8*d#\n",
    "d=24#\n",
    "p=5#\n",
    "dr=d-p#\n",
    "dm=d-(p/2)#\n",
    "print \"d is %0.0f mm     \"%(d)#\n",
    "print \"\\np is %0.0f mm     \"%(p)#"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 16-8 - Page 456"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      " T is 145.242 Nm     \n",
      "\n",
      " n is 0.4751      \n",
      "\n",
      " a is 0.04894 mm      \n"
     ]
    }
   ],
   "source": [
    "from math import sqrt, pi,atan,tan\n",
    "FOS=3#\n",
    "sigut=380#\n",
    "Ta=0.577*sigut/FOS#\n",
    "d=25#\n",
    "Tus=460#\n",
    "Ps=pi*d*Tus#\n",
    "siga=127#\n",
    "dr=sqrt(Ps*4/(pi*siga))#\n",
    "d=30#\n",
    "p=6#\n",
    "dr=d-p#\n",
    "dm=d-(p/2)#\n",
    "u1=0.15#\n",
    "alpha=atan(p*2/(pi*dm))#\n",
    "phi=atan(u1)#\n",
    "T=Ps*dm*tan(alpha+phi)/2#\n",
    "T1=16*T/(pi*dr**3)#\n",
    "sigc=4*Ps/(pi*dr**2)#\n",
    "sigmax=sigc/2+sqrt((sigc/2**2)+(T1**2))#\n",
    "Tmax=sqrt((sigc/2**2)+(T1**2))#\n",
    "n=tan(alpha)/tan(alpha+phi)#\n",
    "Uo=Ps/2#\n",
    "Ui=Uo/n#\n",
    "wav=pi/2#\n",
    "wmax=2*wav#\n",
    "I=Ui*2/wmax**2#\n",
    "k=0.4#\n",
    "Ir=0.9*I*10**-3#\n",
    "m=Ir/k**2#\n",
    "R=0.4#\n",
    "rho=7200#\n",
    "a=sqrt(m/(2*pi*R*rho))#\n",
    "T=T*10**-3#\n",
    "print \" T is %0.3f Nm     \"%(T)#\n",
    "print \"\\n n is %0.4f      \"%(n)#\n",
    "print \"\\n a is %0.5f mm      \"%(a)#\n",
    "  \n",
    "#The difference in the answers of T is due to rounding-off of values."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}