{
 "metadata": {
  "name": "",
  "signature": "sha256:446aceff980b12efb55c191333cfc1afc3a816c084c4cb1a989aad4ec192647e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter13-Thermo Electric Power"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.2.1-pg707"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex13.2.1.;Peltier heats absorbed and rejected\n",
      "##peltier coefficients at these junctions are aplha_p_1-2=alpha_s_1-2*T\n",
      "##Let A=alpha_s_1-2 at 373 k=55*10^-6 v/degree_k and B=alpha_s_1-2 at 273 k=50*10^-6 v/degree_k\n",
      "A=(55*10**-6);\n",
      "B=(50*10**-6);\n",
      "T1=373.;##k\n",
      "T2=273.;##k\n",
      "I=10*10**-3;##current;unit=Ampere\n",
      "alpha_p_1_2_at_373k=A*T1;\n",
      "alpha_p_1_2_at_273k=B*T2;\n",
      "print'%s %.2f %s  %.2f %s'%(\" alpha_p_1_2_at_373k=\",alpha_p_1_2_at_373k,\" W/amp\"and \" \\n alpha_p_1_2_at_273k=\",alpha_p_1_2_at_273k,\" W/amp\");\n",
      "##Peltier heats absorned and rejected to be\n",
      "q2_peltier=alpha_p_1_2_at_373k*I;\n",
      "q1_peltier=alpha_p_1_2_at_273k*I;\n",
      "print'%s %.2e %s %.2e %s '%(\"\\n q2_peltier=\",q2_peltier,\" w \" and\"\\n q1_peltier=\",q1_peltier,\" W\");\n",
      "c=q2_peltier-q1_peltier;\n",
      "print(\"\\n If no other heat transfer were involved,the difference between these vaues,\");\n",
      "print'%s %.2e %s %.2e %s %.2e %s '%(\"\\n \",q2_peltier,\" \"and \"\",q1_peltier,\" W\"and  \"\\n,would be supplied as electric power\",c,\"\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " alpha_p_1_2_at_373k= 0.02  \n",
        " alpha_p_1_2_at_273k=  0.01  W/amp\n",
        "\n",
        " q2_peltier= 2.05e-04 \n",
        " q1_peltier= 1.36e-04  W \n",
        "\n",
        " If no other heat transfer were involved,the difference between these vaues,\n",
        "\n",
        "  2.05e-04  1.36e-04 \n",
        ",would be supplied as electric power 6.87e-05  \n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.3.2-pg708"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex.13.3.2.;Find the thomson heat transferred\n",
      "import  math\n",
      "import scipy\n",
      "from scipy import integrate\n",
      "\n",
      "##Let D=dalpha_s1/dT;\n",
      "D=5.4*10**-3;##unit=micro V/degree k^2\n",
      "T1=273;##unit=k\n",
      "T2=373;##unit=k\n",
      "I=10*10**-3;##unit=A\n",
      "##Thomson coefficient sigma,varies with temp. \n",
      "##sigma_1_of_T=-T*D;unit=V/degree k\n",
      "##The thomson heat is given by equation\n",
      "##qth=I*Integration of sigma_1_of_T  w.r.t. T\n",
      "def fun(T):\n",
      "    y=T\n",
      "    return y\n",
      "Integration = scipy.integrate.quad(fun,T1,T2);\n",
      "qth=I*D*Integration[0];\n",
      "print'%s %.2f %s'%(\"The THOMSON HEAT=\",qth,\" micro W\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The THOMSON HEAT= 1.74  micro W\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.4.1-pg715"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex13.4.1.;Determine the efficiency of the thermoelectric generator.what will be its carnot efficiency\n",
      "import math\n",
      "TH=600.;##degree k;##temperature of the hot reservior of source\n",
      "TC=300.;##degree k;##temperature of the sink\n",
      "Z=2*(10**-3);##1/degree k;##Figure of merit for the material\n",
      "M_optimum=(1.+((Z/2.)*(TH+TC)))**0.5;\n",
      "print'%s %.2f %s'%(\" M_optimum=\",M_optimum,\"\");\n",
      "##Efficiency of the thermoelectric generator is n=(((TH-TC)/TH)*((M_optimum-1)/(M_optimum+(TC/TH)))*100;\n",
      "a=((TH-TC)/TH);\n",
      "b=(M_optimum-1)/(M_optimum+(TC/TH));\n",
      "n=a*b*100;\n",
      "print'%s %.2f %s'%(\"\\n Efficiency of the thermoelectric generator is n=\",n,\" persent\");\n",
      "##where as efficiency of the carnot cycle (reversible) nc=((TH-TC)/TH)*100\n",
      "nc=a*100;\n",
      "print'%s %.2f %s'%(\"\\n Efficiency of the carnot cycle (reversible) nc=\",nc,\" persent\");\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " M_optimum= 1.38 \n",
        "\n",
        " Efficiency of the thermoelectric generator is n= 10.07  persent\n",
        "\n",
        " Efficiency of the carnot cycle (reversible) nc= 50.00  persent\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.4.2-pg716"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex13.4.12.;Calculare maximum generator efficiency and the efficiency for maximum power,power output\n",
      "import math\n",
      "##seedbeck coefficient(alpha_s);unit=volts/degree celcius\n",
      "alpha_s1=-190.*10**-6;##n-type\n",
      "alpha_s2=190.*10**-6;##p-type\n",
      "##Specific resistivity(p);unit=Ohm-cm\n",
      "p1=1.45*10**-3;##n-type\n",
      "p2=1.8*10**-3;##p-type\n",
      "##Figure of merit(Z);unit=degree k**-1\n",
      "Z1=2.*10**-3;##n-type\n",
      "Z2=1.7*10**-3;##p-type\n",
      "\n",
      "\n",
      "##conductivity (n-type), \n",
      "k1=(alpha_s1**2.)/(p1*Z1);\n",
      "##similarly\n",
      "k2=(alpha_s2**2.)/(p2*Z2);\n",
      "print'%s %.2f %s %.2f %s'%(\" Conductivity k1=\",k1,\" W/cm degree celcius\" and \" \\n Conductivity k2=\",k2,\" W/cm degree celcius\");\n",
      "##Z_opt=((alpha_s1-alpha_s2)**2)/[(p1*k1)**2+(p2*k2)**2];\n",
      "##let\n",
      "a=(alpha_s1-alpha_s2)\n",
      "b=(p1*k1)\n",
      "c=(p2*k2)\n",
      "A=math.sqrt(b)\n",
      "B=math.sqrt(c)\n",
      "C=(A+B);\n",
      "##/therefore\n",
      "Z_opt=(a/C)**2.;\n",
      "print'%s %.2f %s'%(\"\\n Z_opt=\",Z_opt,\" degree k\");\n",
      "##Thermal conductance\n",
      "A1=2.3;##cm**2\n",
      "A2=1.303;##cm**2\n",
      "l1=1.5;##cm\n",
      "l2=0.653;##cm\n",
      "K=((k1*A1)/l1)+((k2*A2)/l2)\n",
      "print'%s %.2f %s'%(\"\\n Thermal conductance K=\",K,\" W/degree celcius\");\n",
      "##R=Resistance of the generator=R1+R2\n",
      "R=((p1*l1)/A1)+((p2*l2)/A2);\n",
      "print'%s %.2f %s'%(\"\\n Resistance of the generator R=\",R,\" ohm\");\n",
      "TH=923.;##unit=k\n",
      "TC=323.;##unit=k\n",
      "M_opt=(1.+((Z_opt/2.)*(TH+TC)))**0.5;\n",
      "print'%s %.2f %s'%(\"\\n M_opt=\",M_opt,\" ohm\");\n",
      "RL=M_opt*R;\n",
      "print'%s %.2f %s'%(\"\\n RL=\",RL,\" ohms\");\n",
      "##Optimum efficiency n_opt=(((TH-TC)/TH)*((M_opt-1)/(M_opt+(TC/TH)))*100;\n",
      "aa=((TH-TC)/TH);\n",
      "##taking M_opt=1.43\n",
      "b=(1.43-1.)/(1.43+(TC/TH));\n",
      "n_opt=aa*b*100.;\n",
      "print'%s %.2f %s'%(\"\\n Optimum efficiency n_opt=\",n_opt,\" persent\");\n",
      "##efficiency for max. power output n= (TH-TC)/TH)*m/[((1+m)**2/TH)*(KR/alpha_s_12**2)+(1+m)-(TH-TC)/2TH)]\n",
      "##Efficiency power output\n",
      "##RL=R i.e. m=1\n",
      "## let ab=(1+m)**2/TH;ac=(KR/alpha_s_12**2);ad=(TH-TC)/2TH\n",
      "m=1.;\n",
      "ab=4./TH;\n",
      "ac=1./Z_opt;\n",
      "ad=aa/2.;\n",
      "n_max=(aa/(ab*ac+2.-ad))*100.;\n",
      "print'%s %.2f %s'%(\"\\n max. power output n_max \",n_max,\" persent\")\n",
      "##Power output P_opt=I**2*RL=alpha_s12**2(TH-TC)*RL/(R+RL)**2=alpha_s12**2(TH-TC)/(1+M_opt)**2*RL\n",
      "##let at=alpha_s12**2(TH-TC);mi=(1+M_opt)**2*RL\n",
      "at=a*a*(TH-TC)*(TH-TC);\n",
      "ml=(1.+1.43)*(1.+1.43)*2.63*10**-3\n",
      "P_opt=at/ml;\n",
      "print'%s %.2f %s'%(\"\\n Power output P_opt=\",P_opt,\" watts\");\n",
      "##for max. power P_max (RL=R)\n",
      "##P_max=alpha_s12**2(TH-TC)*RL/(r+RL)**2=alpha_s12**2(TH-TC)RL*4RL\n",
      "P_max=at/(4.*1.84*10**-3);\n",
      "print'%s %.2f %s'%(\"\\n max. power P_max=\",P_max,\" watts\");\n",
      "\n",
      "\n",
      "##Many calcuating mistak are there in a following example,which is corrected in program.\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Conductivity k1= 0.01  \n",
        " Conductivity k2= 0.01  W/cm degree celcius\n",
        "\n",
        " Z_opt= 0.00  degree k\n",
        "\n",
        " Thermal conductance K= 0.04  W/degree celcius\n",
        "\n",
        " Resistance of the generator R= 0.00  ohm\n",
        "\n",
        " M_opt= 1.47  ohm\n",
        "\n",
        " RL= 0.00  ohms\n",
        "\n",
        " Optimum efficiency n_opt= 15.70  persent\n",
        "\n",
        " max. power output n_max  16.13  persent\n",
        "\n",
        " Power output P_opt= 3.35  watts\n",
        "\n",
        " max. power P_max= 7.06  watts\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 13.4.3-pg718"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "##Ex.13.4.3;maximum efficiency,no. of thermocouple in series,open ckt voltage,heat i/p and reject at full load.\n",
      "import  math\n",
      "kA=0.02;##unit=watt/cm degree kelvin\n",
      "kB=0.03;##unit=watt/cm degree kelvin\n",
      "pA=0.01;##unit=ohm cm\n",
      "pB=0.012;##unit=ohm cm\n",
      "TH=1500.;##unit=degree kelvin\n",
      "TC=1000;##unit=degree kelvin\n",
      "AA=43.5;##unit=cm**2\n",
      "AB=48.6;##unit=cm**2\n",
      "LA=0.49;##unit=cm\n",
      "LB=0.49;##unit=cm\n",
      "I=20.*48.6;##Current density in the element limited to,I=20 amp/cm**2\n",
      "output=100.;##unit=kW\n",
      "##alpha_SAB at 1250 degree kelvin=0.0012 volt/degree kelvin=alpha_SA-alpha_SB\n",
      "alpha_SAB=0.0012;##unit=volt/degree kelvin\n",
      "##let\n",
      "b=(pA*kA);\n",
      "c=(pB*kB);\n",
      "A=math.sqrt(b);\n",
      "B=math.sqrt(c);\n",
      "C=(A+B);\n",
      "##figure of merit\n",
      "Z=(alpha_SAB/C)**2.;\n",
      "print'%s %.2f %s'%(\" Z=\",Z,\" degree k^-1\");\n",
      "M=(1+((Z/2.)*(TH+TC)))**0.5;\n",
      "print'%s %.2f %s'%(\"\\n M=\",M,\"\");\n",
      "##let\n",
      "aa=((TH-TC)/TH);\n",
      "bb=(M-1)/(M+(TC/TH));\n",
      "##1] MAx. efficiency of a thermoelectric converter is given by n_max=((TH-TC)/TH)*[(M-1)/(M+(TC/TH))]*100;\n",
      "n_max=aa*bb*100.;\n",
      "print'%s %.2f %s'%(\"\\n Maximum efficiency n_max=\",n_max,\" persent\");\n",
      "##2] No. of thermocouple in series\n",
      "V=alpha_SAB*(TH-TC);\n",
      "print'%s %.2f %s'%(\"\\n V=\",V,\" volt\");\n",
      "R=((pA*LA)/AA)+((pB*LB)/AB);##since  R=RA+RB=((pA*LA)/AA)+((pB*LB)/AB);\n",
      "print'%s %.2f %s'%(\"\\n R=\",R,\" ohm\");\n",
      "VL=V-(R*I);\n",
      "print'%s %.2f %s'%(\"\\n VL=\",VL,\" volt\");\n",
      "##NTCS=total voltage required/voltage required by one couple\n",
      "NTCS=115./VL;\n",
      "print'%s %.2f %s'%(\"\\n No. of thermocouple in series=\",NTCS,\"\");\n",
      "##3] Open circuit voltage\n",
      "OCV=V*309.;\n",
      "print'%s %.2f %s'%(\"\\n Open circuit voltage=\",OCV,\" volt\")\n",
      "##4] Heat input and reject at full load.\n",
      "##Heat input at full load.=output/efficency=100/0.091\n",
      "HIFL=output/n_max;\n",
      "print'%s %.2f %s'%(\"\\n Heat input at full load=\",HIFL,\" kW\")\n",
      "## Heat reject at full load. =Heat input-Work output\n",
      "HRFL=HIFL-output;\n",
      "print'%s %.2f %s'%(\"\\n Heat reject at full load=\",HRFL,\"kW\")\n",
      "\n",
      "\n",
      "\n",
      "##The value of \"pB\" is misprinted\n",
      "##The values are taken in the text book is approximately equal to calculated values\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " Z= 0.00  degree k^-1\n",
        "\n",
        " M= 1.63 \n",
        "\n",
        " Maximum efficiency n_max= 9.09  persent\n",
        "\n",
        " V= 0.60  volt\n",
        "\n",
        " R= 0.00  ohm\n",
        "\n",
        " VL= 0.37  volt\n",
        "\n",
        " No. of thermocouple in series= 308.39 \n",
        "\n",
        " Open circuit voltage= 185.40  volt\n",
        "\n",
        " Heat input at full load= 11.00  kW\n",
        "\n",
        " Heat reject at full load= -89.00 kW\n"
       ]
      }
     ],
     "prompt_number": 9
    }
   ],
   "metadata": {}
  }
 ]
}