{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Ch:29 Gearbox"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 29-1 - Page 749"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ratio for third gear is 1.471    \n",
      "\n",
      "ratio for second gear is -0.2857   \n",
      "\n",
      "ratio for first gear is 4.5   \n",
      "\n",
      "ratio for reverse gear is -6.000   \n"
     ]
    }
   ],
   "source": [
    "from __future__ import division\n",
    "from math import sqrt, pi\n",
    "Ts1=16#\n",
    "Ts2=18#\n",
    "Ts3=20#\n",
    "Ts4=25#\n",
    "Tr1=64#\n",
    "Tr2=63#\n",
    "Tr3=70#\n",
    "Tr4=50#\n",
    "#Let Nr1/Nr2=G1\n",
    "G1=1+(Ts1/Tr1)#\n",
    "#Let Nr1/Ni=G2\n",
    "G2=(Ts2/(Tr2*(1-(1/G1)+(Ts2/Tr2))))#\n",
    "#Let Ni/No=G3 (third gear)\n",
    "G3=(1+(Ts3/Tr3))/((Ts3/Tr3)+G2)#\n",
    "\n",
    "#Let Ni/Nr1=G4\n",
    "#The ratio calculations are done as above\n",
    "G4=1.2857/0.2857#\n",
    "#Let Ni/No =G5(second gear)\n",
    "G5=-20/70#\n",
    "#Let Ni/No=G6(first gear)\n",
    "G6=1.2857/0.2857#\n",
    "#Let Ni/No=G7(reverse gear)\n",
    "G7=-1.7143/0.2857#\n",
    "print \"ratio for third gear is %0.3f    \"%(G3)#\n",
    "print \"\\nratio for second gear is %0.4f   \"%(G5)#\n",
    "print \"\\nratio for first gear is %0.1f   \"%(G6)#\n",
    "print \"\\nratio for reverse gear is %0.3f   \"%(G7)#\n",
    "  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 29-2 - Page 751"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "T1 is 20    \n",
      "\n",
      "T2 is 33    \n",
      "\n",
      "T3 is 50    \n",
      "\n",
      "T4 is 37    \n",
      "\n",
      "T5 is 47    \n",
      "\n",
      "T6 is 23    \n",
      "\n",
      "T7 is 18    \n",
      "\n",
      "G1 is 5.109    \n",
      "\n",
      "G2 is 2.291    \n",
      "\n",
      "G3 is 1.0    \n",
      "\n",
      "R is 5.676    \n"
     ]
    }
   ],
   "source": [
    "#Let reverse speed gear be RSG\n",
    "RSG=5.5#\n",
    "#Let T5/T6 = Z1\n",
    "T1=2#\n",
    "#Let T3/T7 = Z2\n",
    "Z2=2.75#\n",
    "T7=18#\n",
    "T3=Z2*T7#\n",
    "T3=50#\n",
    "#Let T3/T1 =Z3\n",
    "Z3=2.5#\n",
    "T1=T3/Z3#\n",
    "#Let T4/T2 = Z4\n",
    "Z4=2.25/2#\n",
    "T2=(T1+T3)/(Z4+1)#\n",
    "T4=T1+T3-T2#\n",
    "#Let T5/T6=Z5\n",
    "Z5=2#\n",
    "T6=(T1+T3)/3#\n",
    "T5=(T1+T3)-T6#\n",
    "T7=18#\n",
    "#let first gear ratio is G1\n",
    "G1=50*47/(20*23)#\n",
    "\n",
    "#Let 2nd gear ratio is G2\n",
    "G2=37*47/(33*23)#\n",
    "#Let 3rd gear ratio is G3\n",
    "G3=1#\n",
    "#Let reverse gear ratio is R\n",
    "R=50*47/(18*23)#\n",
    "print \"T1 is %0.0f    \"%(T1)#\n",
    "print \"\\nT2 is %0.0f    \"%(T2)#\n",
    "print \"\\nT3 is %0.0f    \"%(T3)#\n",
    "print \"\\nT4 is %0.0f    \"%(T4)#\n",
    "print \"\\nT5 is %0.0f    \"%(T5)#\n",
    "print \"\\nT6 is %0.0f    \"%(T6)#\n",
    "print \"\\nT7 is %0.0f    \"%(T7)#\n",
    "print \"\\nG1 is %0.3f    \"%(G1)#\n",
    "print \"\\nG2 is %0.3f    \"%(G2)#\n",
    "print \"\\nG3 is %0.1f    \"%(G3)#\n",
    "print \"\\nR is %0.3f    \"%(R)#\n",
    "  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## exa 29-3 - Page 752"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "T1 is 23    \n",
      "\n",
      "T2 is 46    \n",
      "\n",
      "T3 is 32    \n",
      "\n",
      "T4 is 37    \n",
      "\n",
      "T5 is 27    \n",
      "\n",
      "T6 is 42    \n",
      "\n",
      "T7 is 18    \n",
      "\n",
      "T8 is 51    \n",
      "\n",
      "T9 is 18    \n",
      "\n",
      "G1 is 5.667    \n",
      "\n",
      "G2 is 3.114    \n",
      "\n",
      "G3 is 1.000    \n",
      "\n",
      "G4 is -5.667    \n"
     ]
    }
   ],
   "source": [
    "#Let the constant gear ratio be G\n",
    "G=2#\n",
    "x=5.5**(1/3)#\n",
    "G1=1#\n",
    "G2=x#\n",
    "G3=x*x#\n",
    "G4=x**3#\n",
    "T7=18#\n",
    "T8=T7*(x**3)/2#\n",
    "T8=51#\n",
    "T5=69/2.558#\n",
    "T6=69-27#\n",
    "T4=69/1.8825#\n",
    "T3=69-T4#\n",
    "T1=23#\n",
    "T2=46#\n",
    "T9=18#\n",
    "G1=T2*T8/(T1*T7)#\n",
    "G2=T2*T6/(T1*T5)#\n",
    "G3=1#\n",
    "G4=-T2*T8/(T1*T9)#\n",
    "print \"T1 is %0.0f    \"%(T1)#\n",
    "print \"\\nT2 is %0.0f    \"%(T2)#\n",
    "print \"\\nT3 is %0.0f    \"%(T3)#\n",
    "print \"\\nT4 is %0.0f    \"%(T4)#\n",
    "print \"\\nT5 is %0.0f    \"%(T5)#\n",
    "print \"\\nT6 is %0.0f    \"%(T6)#\n",
    "print \"\\nT7 is %0.0f    \"%(T7)#\n",
    "print \"\\nT8 is %0.0f    \"%(T8)#\n",
    "print \"\\nT9 is %0.0f    \"%(T9)#\n",
    "print \"\\nG1 is %0.3f    \"%(G1)#\n",
    "print \"\\nG2 is %0.3f    \"%(G2)#\n",
    "print \"\\nG3 is %0.3f    \"%(G3)#\n",
    "print \"\\nG4 is %0.3f    \"%(G4)#"
   ]
  }
 ],
 "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
}