{
 "metadata": {
  "name": "",
  "signature": "sha256:cc924f0db45ef8f074cc8f1d8a1ee198ea5115e6305e3da74ea78f614afb5f88"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Chapter5- Physical Similarity and Dimensional Analysis"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg184"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate The total resistance of the prototype\n",
      "u_p=10.; ## m/s\n",
      "scale=1/25.;  ## l_m/l_p\n",
      "L=125.; ## m\n",
      "meu=1.235*10**(-6); ## m**2/s\n",
      "meu_p=1.188*10**(-6); ## m**2/s\n",
      "rho_p=1025.; ## kg/m**3\n",
      "rho_m=1000.; ## kg/m**3\n",
      "A=3500.; ## wetted surface in m**2\n",
      "\n",
      "u_m=u_p*math.sqrt(scale);\n",
      "\n",
      "d=L*scale;\n",
      "Re=d*u_m/meu; ## Reynolds no.\n",
      "C_F=0.075/(math.log10(Re)-2)**2; ## Skin friction coefficient\n",
      "\n",
      "res_skin=rho_m/2*u_m**2*(A*scale**2)*C_F;\n",
      "\n",
      "res_tot=54.2; ## N\n",
      "\n",
      "F_resid_m=res_tot-res_skin;\n",
      "\n",
      "F_resid_p=F_resid_m*rho_p/rho_m/scale**3;\n",
      "\n",
      "Re_p=u_p*L/meu_p;\n",
      "\n",
      "C_F_p=0.075/(math.log10(Re_p)-2)**2+0.0004;\n",
      "C_F_pnew=1.45*C_F_p;\n",
      "\n",
      "res_friction=rho_p/2*u_p**2*A*C_F_pnew;\n",
      "\n",
      "Resistance=F_resid_p+res_friction;\n",
      "print'%s %.1f %s'%(\"The total resistance of the prototype\",Resistance,\"N\")\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The total resistance of the prototype 809273.4 N\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex4-pg 184"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate Maximum speed of the redesigned torpedo\n",
      "\n",
      "A=0.88; ## ratio of A2 and A1\n",
      "C_D=0.85; ## ratio of C_D2 to C_D1\n",
      "P=1.20; ## ratio of P2 to P1\n",
      "V1=11.; ## m/s\n",
      "\n",
      "V2=V1*(P/A/C_D)**(1/3.);\n",
      "print'%s %.2f %s'%(\"Maximum speed of the redesigned torpedo =\",V2,\"m/s\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Maximum speed of the redesigned torpedo = 12.88 m/s\n"
       ]
      }
     ],
     "prompt_number": 2
    }
   ],
   "metadata": {}
  }
 ]
}