{ "metadata": { "name": "", "signature": "sha256:b75473f9f4345efd6ca0ec6782f30e07c9e95389ed3851945260a1b3129ea6b2" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "heading", "level": 1, "metadata": {}, "source": [ "Ch-10, Economic Operations of Steam Plants" ] }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example 10.2 Page 193" ] }, { "cell_type": "code", "collapsed": false, "input": [ "mp=250 #from example 10.1\n", "def unit1(p1):\n", " ic=0.2*p1+30\n", " return ic\n", "def unit2(p2):\n", " ic=0.15*p2+40\n", " return ic\n", "mil=20\n", "ttt=225\n", "def un(ic):\n", " p1=(ic-30)/0.2\n", " p2=(ic-40)/0.15\n", " return [p1, p2]\n", "from numpy import arange\n", "for x in arange(40,61,5):\n", " [e,r]=un(x)\n", " if ttt==e+r:\n", " print \"for the same incremental costs unit1 should supply %dMW and unit 2 shold supply %dMW,for equal sharing each unit should supply %3.1fMW\"%(e,r,ttt/2)\n", " break\n", " \n", "\n", "opo=ttt/2\n", "from sympy.mpmath import quad\n", "u1=quad(unit1,[opo,e])\n", "u2=quad(unit2,[r,opo])\n", "uuu=(u1+u2)*8760\n", "print \"\\nyearly extra cost is (%3.2f-%3.2f)8760 =%dper year\"%(u1,u2,uuu)\n", "print \"\\nthis if the load is equally shared by the two units an extra cost of Rs.%d will be incurred.in other words economic loading would result in saving of Rs.%dper year\"%(uuu,uuu)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "for the same incremental costs unit1 should supply 125MW and unit 2 shold supply 100MW,for equal sharing each unit should supply 112.0MW\n", "\n", "yearly extra cost is (698.10-670.80)8760 =11991564per year\n", "\n", "this if the load is equally shared by the two units an extra cost of Rs.11991564 will be incurred.in other words economic loading would result in saving of Rs.11991564per year\n" ] } ], "prompt_number": 13 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example 10.3 Page 198" ] }, { "cell_type": "code", "collapsed": false, "input": [ "def unit1(p1):\n", " ic=0.2*p1+30\n", " return ic\n", "def unit2(p2):\n", " ic=0.15*p2+40\n", " return ic\n", "tol=400\n", "pd=50\n", "u1c=5\n", "u2c=1/0.15#from example10_1\n", "p1pd=u1c/(u1c+u2c)\n", "p2pd=u2c/(u1c+u2c)\n", "pi=p1pd*pd\n", "pt=p2pd*pd\n", "print \"p1=%1.5fMW\\np2=%1.5fMW\"%(pi,pt)\n", "p11=pi+tol/2\n", "p22=pt+tol/2\n", "up1=unit1(p11)\n", "up2=unit2(p22)\n", "print \"\\nthe total load on 2 units would be %3.2fMW and %3.2fMW respectevily. it is easy to check that incremental cost will be same for two units at these loading.\\n incremental cost of unit1 is %3.2fRs.MW,\\n incremantal cost of unit 2 is %3.2fRs./MW\"%(p11,p22,up1,up2)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "p1=21.42857MW\n", "p2=28.57143MW\n", "\n", "the total load on 2 units would be 221.43MW and 228.57MW respectevily. it is easy to check that incremental cost will be same for two units at these loading.\n", " incremental cost of unit1 is 74.29Rs.MW,\n", " incremantal cost of unit 2 is 74.29Rs./MW\n" ] } ], "prompt_number": 14 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example10.5 Page 200" ] }, { "cell_type": "code", "collapsed": false, "input": [ "i1=0.8\n", "i2=1.0\n", "l1=complex(0.04,0.12)\n", "l2=complex(0.03,0.1)\n", "l3=complex(0.03,0.12)\n", "vl=1\n", "\n", "i3=i1+i2\n", "v1=vl+i3*(l1)+i1*(l2)\n", "v2=vl+i3*(l1)+i2*(l3)\n", "p1=(i1*v1).real\n", "p2=(i2*v2).real\n", "cos1=(v1).real/abs(v1)\n", "cos2=(v2).real/abs(v2)\n", "b11=abs(((l1).real+(l2).real)/(v1**2*cos1**2))\n", "b22=abs(((l1).real+(l3).real)/(v2**2*cos2**2))\n", "b12=abs(((l1).real/(v1*v2*cos1*cos2)))\n", "pl=(p1**2)*b11+(p2**2)*b22+2*p1*p2*b12\n", "print \"i1+i3=%dpu\\nv1=%1.3f+%1.3fp.u\\nv2=%1.3f+%1.3fp.u\\np1=%1.3fp.u\\np2=%1.3fp.u\\ncos(ph1)=%1.3f\\ncos(ph2)=%1.3f\\nb11=%1.5fp.u\\nb22=%1.5fp.u\\nb12=%1.5fp.u\\npl=%1.6fp.u\"%(i3,v1.real,(v1).imag,v2.real,(v2).imag,p1,p2,cos1,cos2,b11,b22,b12,pl)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "i1+i3=1pu\n", "v1=1.096+0.296p.u\n", "v2=1.102+0.336p.u\n", "p1=0.877p.u\n", "p2=1.102p.u\n", "cos(ph1)=0.965\n", "cos(ph2)=0.957\n", "b11=0.05827p.u\n", "b22=0.05764p.u\n", "b12=0.03312p.u\n", "pl=0.178800p.u\n" ] } ], "prompt_number": 15 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example10.7 Page 206" ] }, { "cell_type": "code", "collapsed": false, "input": [ "from math import atan, cos\n", "za=complex(0.03,0.09)\n", "zb=complex(0.1,0.3)\n", "zc=complex(0.03,0.09)\n", "zd=complex(0.04,0.12)\n", "ze=complex(0.04,0.12)\n", "ia=complex(1.5,-0.4)\n", "ib=complex(0.5,-0.2)\n", "ic=complex(1,-0.1)\n", "id=complex(1,-0.2)\n", "ie=complex(1.5,-0.3)\n", "il1=.4\n", "il2=.6\n", "na1=1 ;nb1=0.6; nc1=0; nd1=.4; ne1=.6\n", "na2=0 ;nb2=-0.4; nc2=1 ;nd2=.4; ne2=.6\n", "vl=1\n", "#some thing is messed\n", "v1=vl+za*ia\n", "v2=vl-zb*ib+zc*ic\n", "a1=atan((ia).imag/(ia).real)\n", "a2=atan((ic).imag/(ic).real)\n", "cosa=cos(a1-a2)\n", "cosph1=cos(atan((v1).imag/(v1).real)-a1)\n", "cosph2=cos(atan((v2).imag/(v2).real)-a2)\n", "b11=(na1**2*(za).real+nb1**2*(zb).real+nc1**2*(zc).real+nd1**2*(zd).real+ne1**2*(ze).real)/(abs(v1)**2*cosph1)\n", "b22=(na2**2*(za).real+nb2**2*(zb).real+nc2**2*(zc).real+nd2**2*(zd).real+ne2**2*(ze).real)/((abs(v2)**2)*cosph2)\n", "bb12=(abs(v1)*abs(v2)*cosph1*cosph2)\n", "ab12=(na2*na1*(za).real+nb2*nb1*(zb).real+nc1*nc2*(zc).real+nd2*nd1*(zd).real+ne2*ne1*0.03)\n", "b12=cosa*ab12/bb12\n", "print \"bus voltages at 2 buses are \\nv1=%1.3f+i%1.3f,\\nv2=%1.3f+i%1.3f\"%((v1).real,(v1).imag,(v2).real,(v2).imag)\n", "print \"\\nloss coffecients are \\nb11=%1.5fp.u\\nb22=%1.5fp.u\\nb12=%1.5fp.u \\n\"%(b11,b22,b12)\n", "print \"loss coffecients in actual values is \\nb11=%eM(W)-1\\nb22=%eM(W)-1\\nb12=%eM(W)-1\\n\"%(b11/100,b22/100,b12/100)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "bus voltages at 2 buses are \n", "v1=1.081+i0.123,\n", "v2=0.929+i-0.043\n", "\n", "loss coffecients are \n", "b11=0.07877p.u\n", "b22=0.07735p.u\n", "b12=-0.00714p.u \n", "\n", "loss coffecients in actual values is \n", "b11=7.877236e-04M(W)-1\n", "b22=7.734557e-04M(W)-1\n", "b12=-7.136298e-05M(W)-1\n", "\n" ] } ], "prompt_number": 16 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example 10.8 Page 207" ] }, { "cell_type": "code", "collapsed": false, "input": [ "r1=22 ;r2=30 ;q1=0.2 ;q2=0.15\n", "b22=0; b12=0 ;p1=100 ;pl=15#transmission losses are 0\n", "b11=pl/(p1)**2\n", "def power(x): #mathematical computation\n", " p1=(x-r1)/(q1+2*b11*x)\n", " p2=(x-r2)/q2\n", " return [p1, p2]\n", "[a,b]=power(60)\n", "print \"l1=1/(1-%.3f*p1)\\nl2=[1/(1-0)]=1\\ngiven lamda=60\\nsince ic1*l1=lamda ic2*l2=lamda\\ntotal load=%dMW\"%(b11*2,a+b-(b11*a**2))" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "l1=1/(1-0.000*p1)\n", "l2=[1/(1-0)]=1\n", "given lamda=60\n", "since ic1*l1=lamda ic2*l2=lamda\n", "total load=390MW\n" ] } ], "prompt_number": 17 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example 10.9 Page 208" ] }, { "cell_type": "code", "collapsed": false, "input": [ "r1=22 ;r2=30 ;q1=0.2 ;q2=0.15\n", "b22=0; b12=0 ;p1=100 ;pl=15#transmission losses are 0\n", "b11=pl/(p1)**2\n", "def power(x): #mathematical computation\n", " p1=(x-r1)/(q1+2*b11*x)\n", " p2=(x-r2)/q2\n", " return [p1,p2]\n", "[a,b]=power(60)\n", "pt=a+b-(b11*a**2)\n", "from sympy.mpmath import quad\n", "#z=quad('q1*u+r1','u',a,161.80)\n", "z=quad(lambda u:q1*u+r1,[a,161.80])\n", "#y=quad('q2*v+r2','v',b,162.5)\n", "y=quad(lambda v:q2*v+r2,[b,162.5])\n", "m=z+y\n", "print \"net change in cost =Rs.%dper hour\"%(m)\n", "print \"\\nthus scheduling the generation by taking transmission losses into account would mean a saving of Rs.%dper hour in fuel cost\"%(m)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "net change in cost =Rs.-3757per hour\n", "\n", "thus scheduling the generation by taking transmission losses into account would mean a saving of Rs.-3757per hour in fuel cost\n" ] } ], "prompt_number": 18 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example 10.10 Page 208" ] }, { "cell_type": "code", "collapsed": false, "input": [ "b11=0.001\n", "b12=-0.0005\n", "b22=0.0024\n", "q1=0.08\n", "r1=16\n", "q2=0.08\n", "r2=12\n", "lamda=20\n", "\n", "p2=0\n", "for x in range(1,5):\n", " p1=(1-(r1/lamda)-(2*p2*b12))/((q1/lamda)+2*b11)\n", " p2=(1-(r2/lamda)-(2*p1*b12))/((q2/lamda)+2*b22)\n", "\n", "pl=b11*p1**2+2*b12*p1*p2+b22*p2**2\n", "pr=p1+p2-pl\n", "print \"p1=%2.1fMW,p2=%2.1fMW\\npl=%1.1fMW\\npower recevied %2.1fMW\"%(p1,p2,pl,pr)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "p1=189.2MW,p2=135.1MW\n", "pl=54.1MW\n", "power recevied 270.3MW\n" ] } ], "prompt_number": 19 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example 10.11 Page 209" ] }, { "cell_type": "code", "collapsed": false, "input": [ "a1=561 ;b1=7.92 ;c1=0.001562\n", "a2=310 ;b2=7.85 ;c2=0.00194\n", "ce=c1*c2/(c1+c2)\n", "print \"ce=%e\"%(ce)\n", "be=((b1/c1)+(b2/c2))*ce\n", "print \"be=%1.4f\"%(be)\n", "ae=a1-((b1**2)/4*c1)+a2-((b2**2)/4*c2)+((be**2)/4*ce)\n", "print \"ae=%3.3f \\ncost characteristics of composite unit for demand pt is \\nct=%3.3f+%1.4f*p1+%ep1**2\"%(ae,ae,be,ce)" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "ce=8.652998e-04\n", "be=7.8888\n", "ae=870.959 \n", "cost characteristics of composite unit for demand pt is \n", "ct=870.959+7.8888*p1+8.652998e-04p1**2\n" ] } ], "prompt_number": 20 }, { "cell_type": "heading", "level": 2, "metadata": {}, "source": [ "example 10.12 Page 210" ] }, { "cell_type": "code", "collapsed": false, "input": [ "a1=7700 ;b1=52.8 ;c1=5.5*10**-3\n", "a2=2500; b2=15 ;c2=0.05#given eqution\n", "plo=200 ;pup=800\n", "ct=1000\n", "l=[500,900,1200,500] ;t=[6, 16 ,20 ,24]#from given graph\n", "def cost(y):\n", " p1=(2*c2*y-(b1-b2))/(2*(c1+c2))\n", " p2=y-p1\n", " return [p1,p2]\n", "ma=max(l)\n", "mi=min(l)\n", "for x in range(0,3):\n", " [e ,g]=cost(l[x])\n", " if epup or g>pup:\n", " if emi[i]:\n", " pp[i]=ma[i]\n", " \n", "\n", "pp[1] = tl-pp[0] - pp[2]\n", "print \"\\nloads on generating station under critical conditions p1=%dMW p2=%dMW p3=%dMW\"%(pp[0],pp[1],pp[2])" ], "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "\n", "loads on generaating station by economic creatirian method isp1=669.734705MW,p2=116.134272MW,p3=14.131023MW\n", "\n", "loads on generating station under critical conditions p1=600MW p2=150MW p3=50MW\n" ] } ], "prompt_number": 25 } ], "metadata": {} } ] }