{
 "metadata": {
  "name": "",
  "signature": "sha256:543241e2957635d03b859da9db1a20b76f4037f0de553827d6103edb92a77b0c"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Ch-15, New Energy Sources"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.1 Page 345"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a=0.1  #plate area\n",
      "b=3    #flux density\n",
      "d=0.5  #distence between plates\n",
      "v=1000  #average gas velosity\n",
      "c=10    #condectivity\n",
      "e=b*v*d\n",
      "ir=d/(c*a)  #internal resistence\n",
      "mapo=e**2/(4*ir) #maximum power output\n",
      "print \"E=%dV \\ninternal resistence %.1fohm \\nmaximum power output %dW =%.3fMW\"%(e,ir,mapo,mapo/10**6)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "E=1500V \n",
        "internal resistence 0.5ohm \n",
        "maximum power output 1125000W =1.125MW\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.2 Page 345"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b=4.2 #flux density\n",
      "v=600  #gas velocity\n",
      "d=0.6  #dimension of plate\n",
      "k=0.65  #constent\n",
      "e=b*v*d #open circuit voltage\n",
      "vg=e/d  #voltage gradient\n",
      "v=k*e   #voltage across load\n",
      "vgg=v/d  #voltage gradient due to load voltage\n",
      "print \" voltage E=%dV \\n voltage gradient %dV/m \\n voltage across load %.1fV \\n voltage gradient due to load voltage %dv\"%(e,vg,v,vgg)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " voltage E=1512V \n",
        " voltage gradient 2520V/m \n",
        " voltage across load 982.8V \n",
        " voltage gradient due to load voltage 1638v\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.3 Page 346"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b=4.2 #flux density\n",
      "v=600  #gas velocity\n",
      "d=0.6  #dimension of plate\n",
      "k=0.65  #constent\n",
      "sl=0.6  #length given\n",
      "sb=0.35  #breath given\n",
      "sh=1.7   #height given\n",
      "c=60     #given condectivity\n",
      "e=b*v*d #open circuit voltage\n",
      "vg=e/d  #voltage gradient\n",
      "v=k*e   #voltage across load\n",
      "vgg=v/d  #voltage gradient due to load voltage\n",
      "rg=d/(c*sb*sh)\n",
      "vd=e-v #voltage drop in duct\n",
      "i=vd/rg  #current due to voltage drop in duct\n",
      "j=i/(sb*sh) #current density\n",
      "si=e/(rg)  #short circuit current\n",
      "sj=si/(sb*sh)  #short circuit current density\n",
      "pd=j*vg     #power density\n",
      "p=pd*sl*sh*sb #power \n",
      "pp=e*i  #also power\n",
      "pde=v*i  #power delevered is V*i\n",
      "los=p-pde  #loss\n",
      "eff=pde/p  #efficiency\n",
      "maxp=e**2/(4*rg)\n",
      "print \" resistence of duct %fohms \\n voltage drop in duct %.1fV \\n current %.1fA \\n current density %fA/m**2 \\n short circuit current %.1fA \\n short current density %fA/m**2 \\n power %fMW \\n power delivered to load %fW \\n loss in duct %fW \\n efficiency is %f \\n maximum power delivered to load %dMW\"%(rg,vd,i,j,si,sj,p/10**6,pde/10**6,los/10**6,eff,maxp/10**6) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " resistence of duct 0.016807ohms \n",
        " voltage drop in duct 529.2V \n",
        " current 31487.4A \n",
        " current density 52920.000000A/m**2 \n",
        " short circuit current 89964.0A \n",
        " short current density 151200.000000A/m**2 \n",
        " power 47.608949MW \n",
        " power delivered to load 30.945817W \n",
        " loss in duct 16.663132W \n",
        " efficiency is 0.650000 \n",
        " maximum power delivered to load 34MW\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.4 Page 347"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "c=50 #conduntance\n",
      "a=0.2 #area\n",
      "d=0.24 #distence between electrodes\n",
      "v=1800 #gas velosity\n",
      "b=1 #flux density\n",
      "k=0.7 \n",
      "ov=k*b*v*d\n",
      "tp=c*d*a*b**2*v**2*(1-k)\n",
      "eff=k\n",
      "op=eff*tp\n",
      "e=b*v*d\n",
      "rg=d/(c*a)\n",
      "si=e/rg\n",
      "maxp=e**2/(4*rg)\n",
      "print \" output voltage %.1fV \\n total power %.4fMW \\n efficiency %.1f \\n output power %fMW \\n open circuit voltage %dV \\n internal resistence %.3fohm \\n short circuit current %dA \\n maximum power output is %.3fMW\"%(ov,tp/10**6,eff,op/10**6,e,rg,si,maxp/10**6)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " output voltage 302.4V \n",
        " total power 2.3328MW \n",
        " efficiency 0.7 \n",
        " output power 1.632960MW \n",
        " open circuit voltage 432V \n",
        " internal resistence 0.024ohm \n",
        " short circuit current 18000A \n",
        " maximum power output is 1.944MW\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.5 Page 363"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import cos, pi\n",
      "a=100 #area\n",
      "spd=0.7 #sun light power density\n",
      "m=1000  #weight of water collector\n",
      "tp=30  #temperature of water\n",
      "th2=60  #angle of incidence\n",
      "cp=4186 #specific heat of water\n",
      "sp=spd*cos(th2*pi/180)*a #solar power collected by collector\n",
      "ei=sp*3600*10**3  #energy input in 1 hour\n",
      "temp=ei/(cp*10**3)\n",
      "tw=tp+temp\n",
      "print \" solar power collected by collector %dkW \\n energy input in one hour %e J \\n rise in temperature is %.1f`C \\n temperature of water %.1f`c\"%(sp,ei,temp,tw)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " solar power collected by collector 35kW \n",
        " energy input in one hour 1.260000e+08 J \n",
        " rise in temperature is 30.1`C \n",
        " temperature of water 60.1`c\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.6 Page 364"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt, ceil\n",
      "vo=100 #motor rated voltage\n",
      "efm=0.4 #efficiency of motor pump\n",
      "efi=0.85 #efficiency of inverter\n",
      "h=50 #head of water\n",
      "v=25 #volume of water per day\n",
      "ov=18 #pv pannel output module\n",
      "pr=40 #power rating\n",
      "ao=2000 #annual output of array\n",
      "dw=1000 #density of water\n",
      "en=v*dw*h*9.81 #energy needed to pump water every day\n",
      "enkw=en/(3.6*10**6)  #energy in kilo watt hour\n",
      "oe=efm*efi  #overall efficiency\n",
      "epv=round(enkw/oe)  #energy out of pv system\n",
      "de=ao/365  #daily energy output\n",
      "pw=epv*10**3/de  #peak wattage of pv array\n",
      "rv=vo*(pi)/sqrt(2)  #rms voltage\n",
      "nm=rv/ov  #number of modules in series\n",
      "nm=ceil(nm)\n",
      "rpp=nm*pr #rated peak power output\n",
      "np=pw/rpp #number of strings in parallel\n",
      "np=round(np)\n",
      "print \" energy needed o pump water every day %fkWh/day \\n overall efficiency %.2f \\n energy output of pv system %dkWh/day \"%(enkw,oe,epv)\n",
      "print \"\\n annual energy out of array %dWh/Wp \\n daily energy output of array %.3fWh/Wp \\n peak wattage of pv array %.2fWp \\n rms output voltage %.2fV\\n number of modules in series %d \\n rated peak power output of each string %.2fW \\n number of strings in parallel %d\"%(epv,de,pw,rv,nm,rpp,np)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " energy needed o pump water every day 3.406250kWh/day \n",
        " overall efficiency 0.34 \n",
        " energy output of pv system 10kWh/day \n",
        "\n",
        " annual energy out of array 10Wh/Wp \n",
        " daily energy output of array 5.000Wh/Wp \n",
        " peak wattage of pv array 2000.00Wp \n",
        " rms output voltage 222.14V\n",
        " number of modules in series 13 \n",
        " rated peak power output of each string 520.00W \n",
        " number of strings in parallel 4\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.7 Page 373"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from __future__ import division\n",
      "ws=20 #wind speed\n",
      "rd=10 #rotor diameter\n",
      "ros=30 #rotor speed\n",
      "ad=1.293 #air density\n",
      "mc=0.593 #maximum value of power coefficient\n",
      "p1=0.5*ad*(pi)*(rd**2)*(ws**3)/4 #power\n",
      "p=p1/10**3\n",
      "pd=p/((pi)*(rd/2)**2)  #power density\n",
      "pm=p*(mc)  #maximum power\n",
      "mt=(pm*10**3)/((pi)*rd*(ros/60))\n",
      "print \" power %.fkW \\n power density %.3fkW/m**3 \\n maximum power %fkW \\n maximum torque %.1fN-m\"%(p,pd,pm,mt)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " power 406kW \n",
        " power density 5.172kW/m**3 \n",
        " maximum power 240.881303kW \n",
        " maximum torque 15335.0N-m\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.8 Page 373"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "cp=0.593\n",
      "d=1.293\n",
      "s=15\n",
      "a=2/3\n",
      "dp=2*d*(s**2)*a*(1-a)\n",
      "dlp=760*dp/(101.3*10**3) #760 mmhg=101.3*10**3pascal then pressure in mm of hg\n",
      "dpa=dlp/760 #pressure in atmosphere\n",
      "print \"pressure in pascal %.1fpascal \\npressure in height of mercury %.2fmm-hg \\npressure in atmosphere %.5fatm\"%(dp,dlp,dpa)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "pressure in pascal 129.3pascal \n",
        "pressure in height of mercury 0.97mm-hg \n",
        "pressure in atmosphere 0.00128atm\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.9 Page 385"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import floor\n",
      "ng=50 #number of generator\n",
      "r=30  #rated power \n",
      "mah=10 #maximum head\n",
      "mih=1  #minimum head\n",
      "tg=12  #duration of generation\n",
      "efg=0.9  #efficiency of generated\n",
      "g=9.81   #gravity\n",
      "le=5   #lenght of embankment\n",
      "ro=1025 #density\n",
      "ti=r/(0.9)**2\n",
      "q=ti*10**(6)/(ro*g*mah) #maximum input\n",
      "q=floor(q*10**2)/10**2\n",
      "qw=q*ng  #total quantity of water\n",
      "tcr=qw*tg*3600/2  #total capacity of resevoir\n",
      "sa=tcr/mah   #surface area \n",
      "wbe=sa/(le*10**6)  #wash behind embankment\n",
      "avg=r/2\n",
      "te=avg*tg*365*ng  #total energy output\n",
      "print \"quantity of water for maximum output %fm**3-sec \"%(q)\n",
      "print \"\\nsurface area of reservoir %fkm**3 \"%(sa/10**6)\n",
      "print \"\\nwash behind embankment %fkm \\ntotal energy output %eMWh\"%(wbe,te) \n",
      "\n",
      "print \"area of reservoir %fkm**3 \"%(sa/10**6)\n",
      "print \"\\nwash behind embankment %fkm \\ntotal energy output %eMWh\"%(wbe,te) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "quantity of water for maximum output 368.330000m**3-sec \n",
        "\n",
        "surface area of reservoir 39.779640km**3 \n",
        "\n",
        "wash behind embankment 7.955928km \n",
        "total energy output 3.285000e+06MWh\n",
        "area of reservoir 39.779640km**3 \n",
        "\n",
        "wash behind embankment 7.955928km \n",
        "total energy output 3.285000e+06MWh\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 15.10 Page 385"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "tc=2100  #total capacity of plant\n",
      "n=60     #number of generaed\n",
      "p=35     #power of generated by each generator\n",
      "h=10     #head of water\n",
      "d=12     #duration of generation\n",
      "cee=2.1  #cost of electrical energy per kWh\n",
      "efft=0.85 #efficiency of turbine\n",
      "effg=0.9  #efficiency of generator\n",
      "g=9.81   #gravity\n",
      "ro=1025   #density\n",
      "acc=0.7   #assuming coal conumotion\n",
      "pi=p/(efft*effg) #power input\n",
      "q=pi*10**6/(h*g*ro) #quantity of water\n",
      "tqr=q*n*d*3600/2  #total quantity of water in reservoir\n",
      "avp=tc/2 #average output during 12h\n",
      "toe=avp*d  #total energy in 12 hours\n",
      "eg=toe*365 #energy generated for totel year\n",
      "coe=eg*cee*10**3 #cost of electrical energy generated\n",
      "sc=eg*10**3*acc #saving cost \n",
      "print \"total quantity of water in reservoir %em**3 \\nenergy generated per year %eMW \\ncost of electrical energy Rs%e \\nsaving in cost Rs.%e \"%(tqr,eg,coe,sc)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "total quantity of water in reservoir 5.896832e+08m**3 \n",
        "energy generated per year 4.599000e+06MW \n",
        "cost of electrical energy Rs9.657900e+09 \n",
        "saving in cost Rs.3.219300e+09 \n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}