{
 "metadata": {
  "name": "",
  "signature": "sha256:0241392dc5003b5a1bdb0f1da1ae62de4660e244f661b15b4862e3c841a68f3b"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter3-Two-dimensional Cascades"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex1-pg77"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the\n",
      "a_l=0.5\n",
      "alpha2=20.\n",
      "theta=30.\n",
      "##function to calculate m and delta\n",
      "m = 0.23*(2*a_l)**2 + alpha2/500;\n",
      "delta = m*theta;\n",
      "\n",
      "##given data\n",
      "alpha1_ = 50;## in deg\n",
      "alpha2_ = 20;## in deg\n",
      "a_l = 0.5;##percentage\n",
      "s_l = 1.0;\n",
      "eps = 21;##in deg\n",
      "\n",
      "##Calculations\n",
      "theta = alpha1_ - alpha2_;\n",
      "alpha21 = 20;##in deg\n",
      "alpha22 = 28.1;##in deg\n",
      "\n",
      "alpha23 = 28.6;##in deg\n",
      "\n",
      "alpha1 = eps + alpha23;\n",
      "i = alpha1 - alpha1_;\n",
      "alpham = (180./math.pi)*math.atan(0.5*(math.tan(alpha1*math.pi/180.) + math.tan(alpha23*math.pi/180.)));\n",
      "CL = 2*(s_l)*math.cos(alpham*math.pi/180.)*(math.tan(alpha1*math.pi/180.) - math.tan(alpha23*math.pi/180.));\n",
      "\n",
      "##Results\n",
      "print'%s %.2f %s'%('The fluid deflection = ',eps,' deg.');\n",
      "print'%s %.2f %s'%('\\n The fluid deviation = ',i,' deg.');\n",
      "print'%s %.2f %s'%('\\n The ideal lift coefficient at the design point = ',CL,'');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The fluid deflection =  21.00  deg.\n",
        "\n",
        " The fluid deviation =  -0.40  deg.\n",
        "\n",
        " The ideal lift coefficient at the design point =  0.95 \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex2-pg78"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "#calculate the\n",
      "\n",
      "##given data\n",
      "s_l = 1.0;\n",
      "alpha1_ = 50.;##in deg\n",
      "alpha2_ = 20.;##in deg\n",
      "eps_ = 21.;##in deg\n",
      "i_ = -0.4;##in deg\n",
      "i = 3.8;##in deg\n",
      "CD = 0.017;\n",
      "eps = 1.15*eps_;\n",
      "\n",
      "##Calculations\n",
      "alpha1 = alpha1_+i;\n",
      "alpha2 = alpha1-eps;\n",
      "alpham = (180./math.pi)*math.atan(0.5*(math.tan(alpha1*math.pi/180.) + math.tan(alpha2*math.pi/180.)));\n",
      "zeta = CD/((s_l)*(math.cos(alpham*math.pi/180.))**3);\n",
      "Cf = 2.*(math.tan(alpha1*math.pi/180.) - math.tan(alpha2*math.pi/180.));\n",
      "eff_D = 1 - zeta/(Cf*math.tan(alpham*math.pi/180.));\n",
      "\n",
      "##Results\n",
      "print'%s %.2f %s'%('The tangential lift force coefficient = ',Cf,'');\n",
      "print'%s %.2f %s'%('\\n The diffuser efficiency =  ',eff_D*100,'percentage.');\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The tangential lift force coefficient =  1.59 \n",
        "\n",
        " The diffuser efficiency =   97.03 percentage.\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Ex3-pg83"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math\n",
      "import numpy\n",
      "#calculate the\n",
      "##given data\n",
      "alpha1 = 58.;##in deg\n",
      "alpha2 = 44.;##in deg\n",
      "AVR = 1.0;\n",
      "\n",
      "##Calculations\n",
      "alpham = (180./math.pi)*math.atan(0.5*(math.tan(alpha1*math.pi/180.) + math.tan(alpha2*math.pi/180.)));\n",
      "zetam = (180./math.pi)*math.atan(math.tan(alpham*math.pi/180.) - 0.213);\n",
      "Cpi = 1.-(math.cos(alpha1*math.pi/180.)/math.cos(alpha2*math.pi/180.))**2;\n",
      "s_l = 9.*(0.567-Cpi);\n",
      "theta = ((zetam-alpha2+1.1*(s_l)**(1/3.))/(0.5-0.31*(s_l)**(1/3.)));\n",
      "delta = alpha2-zetam-0.5*theta;\n",
      "print round(theta,2)\n",
      "print round(s_l,2)\n",
      "##Results\n",
      "\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "21.08\n",
        "0.99\n"
       ]
      }
     ],
     "prompt_number": 4
    }
   ],
   "metadata": {}
  }
 ]
}