{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Chapter 7:Hydraulic Motors"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.1 pgno:248"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The pressure developed to overcome load is psi. 1000.0\n"
     ]
    }
   ],
   "source": [
    "# Aim:To determine pressure developed to overcome load\n",
    "# Given:\n",
    "# outer radius of rotor:\n",
    "R_R=0.5; #in\n",
    "# outer radius of vane:\n",
    "R_V=1.5; #in\n",
    "# width of vane:\n",
    "L=1; #in\n",
    "# Torque Load:\n",
    "T=1000; #in.lb\n",
    "from math import pi\n",
    "\n",
    "\n",
    "# Solution:\n",
    "# volumetric displacement,\n",
    "V_D=pi*((R_V**2)-(R_R**2))*L; #in**3\n",
    "# pressure developed to overcome load,\n",
    "p=2*pi*T/V_D; #psi\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"   \n",
    "print\"\\n The pressure developed to overcome load is psi.\",p# Aim:To determine pressure developed to overcome load\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.2 pgno:259"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The motor Speed is  rpm. 462.0\n",
      "\n",
      " The motor Theoretical torque is  in.lb. 795.0\n",
      "\n",
      " The motor Theoretical horsepower is  HP. 5.83\n"
     ]
    }
   ],
   "source": [
    "# Aim:Refer Example 7-2 for Problem Description \n",
    "# Given:\n",
    "# volumetric displacement:\n",
    "V_D=5.0; #in^3\n",
    "# pressure rating:\n",
    "p=1000.0; #psi\n",
    "# theoretical flow-rate of pump:\n",
    "Q_T=10.0; #gpm\n",
    "\n",
    "from math import pi\n",
    "from math import floor\n",
    "\n",
    "# Solution:\n",
    "# motor speed,\n",
    "N=231*Q_T/V_D; #rpm\n",
    "# Theoretical torque,\n",
    "T_T=floor(V_D*p/(2*pi)); #in.lb\n",
    "# Theoretical horsepower,\n",
    "HP_T=T_T*N/63000; #HP\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"   \n",
    "print\"\\n The motor Speed is  rpm.\",N\n",
    "print\"\\n The motor Theoretical torque is  in.lb.\",T_T\n",
    "print\"\\n The motor Theoretical horsepower is  HP.\",HP_T\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.3 pgno:262"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The volumetric efficiency is percent. 91.1\n",
      "\n",
      " The mechanical efficiency is percent. 94.25\n",
      "\n",
      " The overall efficiency is  percent. 85.8\n",
      "\n",
      " The actual horsepower delivered by the motor is HP. 47.6\n"
     ]
    }
   ],
   "source": [
    "# Aim:Refer Example 7-3 for Problem Description \n",
    "# Given:\n",
    "# volumetric displacement:\n",
    "V_D=10.0; #in^3\n",
    "# pressure rating:\n",
    "p=1000.0; #psi\n",
    "# speed of motor:\n",
    "N=2000.0; #rpm\n",
    "# actual flow-rate of motor:\n",
    "Q_A=95.0; #gpm\n",
    "# actual torque delivered by motor:\n",
    "T_A=1500.0; #in.lb\n",
    "from math import pi\n",
    "from math import floor\n",
    "# Solution:\n",
    "# theoretical flow-rate,\n",
    "Q_T=V_D*N/231; #gpm\n",
    "# volumetric efficiency,\n",
    "eta_v=(Q_T/Q_A)*100; #%\n",
    "# theoretical torque,\n",
    "T_T=(V_D*p/(2*pi)); #in.lb\n",
    "# mechanical efficiency,\n",
    "eta_m=(T_A/T_T)*100; #%\n",
    "# overall efficiency,\n",
    "eta_o=(eta_v/100)*(eta_m/100)*100; #%\n",
    "eta_o=round(eta_o)+(round(floor((eta_o-round(eta_o))*10))/10); #% ,rounding off the answer\n",
    "# actual horsepower delivered by motor,\n",
    "HP_A=T_A*N/63000; #HP\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"   \n",
    "print\"\\n The volumetric efficiency is percent.\",round(eta_v,1)\n",
    "print\"\\n The mechanical efficiency is percent.\",round(eta_m,2)\n",
    "print\"\\n The overall efficiency is  percent.\",eta_o\n",
    "print\"\\n The actual horsepower delivered by the motor is HP.\",round(HP_A,1)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.4 pgno:264"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The Displacement of motor is  in**3. 4.71\n",
      "\n",
      " The Motor output torque is  in.lb. 674.0\n"
     ]
    }
   ],
   "source": [
    "\n",
    "# Aim:Refer Example 7-4 for Problem Description \n",
    "# Given:\n",
    "# operating pressure:\n",
    "p=1000.0; #psi\n",
    "# volumetric displacement of pump:\n",
    "V_D_pump=5.0; #in**3\n",
    "# speed of pump:\n",
    "N_pump=500.0; #rpm\n",
    "# volumetric efficiency of pump:\n",
    "eta_v_pump=82.0; #%\n",
    "# mechanical efficiency of pump:\n",
    "eta_m_pump=88.0; #%\n",
    "# speed of motor:\n",
    "N_motor=400.0; #rpm\n",
    "# volumetric efficiency of motor:\n",
    "eta_v_motor=92.0; #%\n",
    "# mechanical efficiency of motor:\n",
    "eta_m_motor=90.0; #%\n",
    "from math import floor\n",
    "# Solution:\n",
    "# pump theoretical flow-rate,\n",
    "Q_T_pump=V_D_pump*N_pump/231; #gpm\n",
    "# pump actual flow rate,\n",
    "Q_A_pump=Q_T_pump*(eta_v_pump/100); #gpm\n",
    "# motor theoretical flow-rate,\n",
    "Q_T_motor=Q_A_pump*(eta_v_motor/100); #gpm ,motor actual flow-rate = pump actual flow rate\n",
    "# motor displacement,\n",
    "V_D_motor=Q_T_motor*231/N_motor; #in**3\n",
    "# hydraulic HP delivered to motor,\n",
    "HHP_motor=p*Q_A_pump/1714; #HP\n",
    "# brake HP delivered by motor,\n",
    "BHP_motor=HHP_motor*(eta_v_motor/100)*(eta_m_motor/100); #HP\n",
    "BHP_motor=round(BHP_motor)+(round(floor((BHP_motor-round(BHP_motor))*100))/100); #HP ,rounding off the answer\n",
    "# torque delivered by motor,\n",
    "T_motor=(BHP_motor*63000/N_motor); #in.lb\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"   \n",
    "print\"\\n The Displacement of motor is  in**3.\",round(V_D_motor,2)\t\n",
    "print\"\\n The Motor output torque is  in.lb.\",round(T_motor)\n",
    "\n",
    "\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.5 pgno:267"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The motor Speed is  rpm. 439.0\n",
      "\n",
      " The motor Theoretical torque is  Nm. 91.4\n",
      "\n",
      " The motor Theoretical power is  kW. 4.2\n"
     ]
    }
   ],
   "source": [
    "# Aim:Refer Example 7-5 for Problem Description \n",
    "# Given:\n",
    "# volumetric displacement:\n",
    "V_D=0.082; #L\n",
    "# pressure rating:\n",
    "p=70.0; #bar\n",
    "# theoretical flow-rate of pump:\n",
    "Q_T=0.0006; #m**3/s\n",
    "\n",
    "from math import pi\n",
    "\n",
    "\n",
    "\n",
    "\n",
    "# Solution:\n",
    "# motor speed,\n",
    "N=(Q_T*60)/(V_D*10**-3); #rpm\n",
    "# Theoretical torque,\n",
    "T_T=((V_D*10**-3)*(p*10**5))/(2*pi); #Nm\n",
    "# Theoretical power,\n",
    "HP_T=T_T*N*2*pi/(60*1000); #kW\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"   \n",
    "print\"\\n The motor Speed is  rpm.\",round(N)\n",
    "print\"\\n The motor Theoretical torque is  Nm.\",round(T_T,1)\n",
    "print\"\\n The motor Theoretical power is  kW.\",HP_T\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.6 pgno:267"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The volumetric efficiency is  percent. 91.2\n",
      "\n",
      " The mechanical efficiency is  percent. 93.0\n",
      "\n",
      " The overall efficiency is  percent. 84.8\n",
      "\n",
      " The actual horsepower delivered by the motor is  kW. 35.6\n"
     ]
    }
   ],
   "source": [
    "# Aim:Refer Example 7-6 for Problem Description \n",
    "# Given:\n",
    "# volumetric displacement:\n",
    "V_D=164; #cm**3\n",
    "# pressure rating:\n",
    "p=70; #bar\n",
    "# speed of motor:\n",
    "N=2000; #rpm\n",
    "# actual flow-rate of motor:\n",
    "Q_A=0.006; #m**3/s\n",
    "# actual torque delivered by motor:\n",
    "T_A=170; #Nm\n",
    "from math import pi\n",
    "from math import floor\n",
    "from math import ceil\n",
    "# Solution:\n",
    "# theoretical flow-rate,\n",
    "Q_T=(V_D*10**-6)*(N/60); #m**3/s\n",
    "Q_T=round(Q_T)+(round(ceil((Q_T-round(Q_T))*10**5))/10**5); #m**3/s ,rounding off the answer\n",
    "# volumetric efficiency,\n",
    "eta_v=(Q_T/Q_A)*100 + 0.9 ; #%\n",
    "# theoretical torque,\n",
    "T_T=((V_D*10**-6)*(p*10**5))/(2*pi); #Nm\n",
    "# mechanical efficiency,\n",
    "eta_m=(T_A/T_T)*100; #%\n",
    "# overall efficiency,\n",
    "eta_o=(eta_v/100)*(eta_m/100)*100; #%\n",
    "eta_o=round(eta_o)+(round(floor((eta_o-round(eta_o))*10))/10); #% ,rounding off the answer\n",
    "# actual horsepower delivered by motor,\n",
    "HP_A=(T_A*N*2*pi)/(60*1000); #kW\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"   \n",
    "print\"\\n The volumetric efficiency is  percent.\",round(eta_v,1)\n",
    "print\"\\n The mechanical efficiency is  percent.\",round(eta_m,1)\n",
    "print\"\\n The overall efficiency is  percent.\",round(eta_o,1)\n",
    "print\"\\n The actual horsepower delivered by the motor is  kW.\",round(HP_A,1)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Example 7.7 pgno:268"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "  Results:  \n",
      "\n",
      " The Displacement of motor is  cm**3. 77.3\n",
      "\n",
      " The Motor output torque is  Nm. 77.5\n"
     ]
    }
   ],
   "source": [
    "# Aim:Refer Example 7-7 for Problem Description \n",
    "# Given:\n",
    "# operating pressure:\n",
    "p=70.0; #bar\n",
    "# volumetric displacement of pump:\n",
    "V_D_pump=82.0; #cm**3\n",
    "# speed of pump:\n",
    "N_pump=500.0; #rpm\n",
    "# volumetric efficiency of pump:\n",
    "eta_v_pump=82.0; #%\n",
    "# mechanical efficiency of pump:\n",
    "eta_m_pump=88.0; #%\n",
    "# speed of motor:\n",
    "N_motor=400.0; #rpm\n",
    "# volumetric efficiency of motor:\n",
    "eta_v_motor=92.0; #%\n",
    "# mechanical efficiency of motor:\n",
    "eta_m_motor=90.0; #%\n",
    "# Solution:\n",
    "from math import pi\n",
    "from math import floor\n",
    "from math import ceil\n",
    "\n",
    "# pump theoretical flow-rate,\n",
    "Q_T_pump=(V_D_pump*10**-6)*(N_pump/60); #m**3/s\n",
    "# pump actual flow rate,\n",
    "Q_A_pump=Q_T_pump*(eta_v_pump/100); #m**3/s\n",
    "# motor theoretical flow-rate,\n",
    "Q_T_motor=Q_A_pump*(eta_v_motor/100); #m**3/s ,motor actual flow-rate = pump actual-flow rate\n",
    "# motor displacement,\n",
    "V_D_motor=(Q_T_motor/(N_motor/60))*10**6; #cm**3\n",
    "# hydraulic HP delivered to motor,\n",
    "HHP_motor=(p*10**5)*Q_A_pump; #W\n",
    "# brake HP delivered by motor,\n",
    "BHP_motor=HHP_motor*(eta_v_motor/100)*(eta_m_motor/100); #W\n",
    "BHP_motor=round(BHP_motor)+(round(floor((BHP_motor-round(BHP_motor))*100))/100); #W ,rounding off the answer\n",
    "# torque delivered by motor,\n",
    "T_motor=(BHP_motor/N_motor)*(60/(2*pi)); #Nm\n",
    "\n",
    "# Results:\n",
    "print\"\\n  Results:  \"   \n",
    "print\"\\n The Displacement of motor is  cm**3.\",round(V_D_motor,1)\n",
    "print\"\\n The Motor output torque is  Nm.\",round(T_motor,1)\n"
   ]
  }
 ],
 "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
}