summaryrefslogtreecommitdiff
path: root/Generation_Of_Electrical_Energy_by_B._R._Gupta/Chapter11.ipynb
blob: 60b1760942983f3a5ef9be9bb1c5d85a07d7ab2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
{
 "metadata": {
  "name": "",
  "signature": "sha256:efee43f3cff9fdca8c69d559c1c84e6f19cd4b3e6da3711c7567d0790f5b7290"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Ch-11, Hydro-Thermal Co-Ordination"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.2 Page 234"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#given\n",
      "l1=700 ;t1=14 ;l2=500; t2=10\n",
      "ac=24 ;bc=0.02#variables of cost equation\n",
      "aw=6 ;bw=0.0025 #variables of watere quantity equation\n",
      "b22=0.0005 #loss coefficient\n",
      "r2=2.5\n",
      "from numpy import arange, mat\n",
      "lam=arange(1,40,0.001)\n",
      "gg=1; q=1\n",
      "for lam in arange(25,4,0.0010):\n",
      "    a=[2*bc, 0, 0, r2*bw*2+2*b22*lam]\n",
      "    b=[lam-ac ,lam-aw*r2]\n",
      "    p=inv(a)*b\n",
      "    g=round(p(1)+p(2))\n",
      "    l=round(l1+b22*p(2)**2)\n",
      "    lq=round(l2+b22*p(2)**2)\n",
      "    if g>=l:\n",
      "        print \"\\nfor load condition %dMW \\n then, \\n \\t lamda %f \\t p1=%fMW \\n \\t p2=%fMW \\t pl=%fMW\"%(l1,lam,p[0],p[1],2*b22*p[1])\n",
      "        break\n",
      "    #end\n",
      "#end\n",
      "for lam in arange(25,40,0.001):\n",
      "    a=mat([[2*bc ,0],[0, r2*bw*2+2*b22*lam]])\n",
      "    b=([[lam-ac] ,[lam-aw*r2]])\n",
      "    pq=(a**-1)*b\n",
      "    \n",
      "    g=round(pq[0]+pq[1])\n",
      "    lq=round(l2+b22*pq[1]**2)\n",
      "\n",
      "    if g>=lq:\n",
      "        print \"\\nfor load condition %dMW \\n then, \\n \\t lamda %f \\t p1=%fMW \\n \\t p2=%fMW \\t pl=%fMW\"%(l2,lam,pq[0],pq[1],2*b22*pq[1])\n",
      "        break\n",
      "    #end\n",
      "#end\n",
      "dwu=[(aw+bw*p)*p*t1+t2*(aw+bw*pq[1])*pq[1]]*3600\n",
      "doc=[(ac+bc*p)*p*t1+(ac+bc*pq[0])*pq[0]*t2]\n",
      "print \"\\ndaily water used %fm**3 \\ndaily operating cost of thermal plant Rs%f\"%(dwu[0],doc[0])\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "for load condition 500MW \n",
        " then, \n",
        " \t lamda 31.705000 \t p1=192.625000MW \n",
        " \t p2=377.898428MW \t pl=0.377898MW\n",
        "\n",
        "daily water used 26664.961210m**3 \n",
        "daily operating cost of thermal plant Rs55337.878125\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "example 11.3 Page "
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from math import sqrt\n",
      "#given \n",
      "p=250#load\n",
      "rt=14 #run time\n",
      "t=24#total time\n",
      "ac=5 ;bc=8; cc=0.05 #variables of cost equation\n",
      "bw=30; cw=0.05 #variables of water per power\n",
      "qw=500#quantity of water\n",
      "lam=bc+cc*2*p #lambda\n",
      "a=-qw*(10**6)/(3600*rt)\n",
      "inn=sqrt(bw**2-4*cw*a)\n",
      "phh1=(-bw+inn)/(2*cw)#solution of quadratic equation\n",
      "phh2=(-bw-inn)/(2*cw)\n",
      "if phh1>0 :\n",
      "    r=lam/(bw+cw*phh1) \n",
      "    print \" hydro plant power is %fMW \\n the cost of water is %fRs.per hour/m**3/sec\"%(phh1,r) \n",
      "\n",
      "if phh2>0 :\n",
      "    r=lam/(bw+cw*phh2) \n",
      "    print \" hydro plant power is %fMW \\n the cost of water is %fRs.per hour/m**3/sec\"%(phh2,r) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " hydro plant power is 237.047484MW \n",
        " the cost of water is 0.788486Rs.per hour/m**3/sec\n"
       ]
      }
     ],
     "prompt_number": 11
    }
   ],
   "metadata": {}
  }
 ]
}