summaryrefslogtreecommitdiff
path: root/Electric_Power_Distribution_System_Engineering_by_T._Gonen/ch11.ipynb
blob: 3fce23ef6280fe7414d3d0e0012979c2a2ab6823 (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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
{
 "metadata": {
  "name": "",
  "signature": "sha256:12638b4b6feef6ce42affa16d2293ad388bb21932c76952667badfebd6be692b"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 11 : Distribution System Reliability"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.1  Page No : 598"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "Rsys = 0.99         #Minimum Acceptable System Reliabilty\n",
      "n = 15.;         #Number of identical Components\n",
      "\n",
      "# Calculations\n",
      "q = (1-Rsys)/n;         #Probability of component failure\n",
      "Ri = 1-q;         #Approximate value of the component reliability\n",
      "\n",
      "# Results\n",
      "print 'The Approximate Value of The component reliability is %g'%(Ri)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Approximate Value of The component reliability is 0.999333\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.2  Page No : 606"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# Variables\n",
      "L = 4.;         #Total Length of the cable\n",
      "Lov = 3.;        #Length of Overhead Cable\n",
      "Lu = L-Lov;         #Length of Underground Cable\n",
      "Nct = 2.;         #Number of circuit terminations\n",
      "T = 10.;         #No of years for which the record is shown\n",
      "\n",
      "Fov = 2.;         # Faults Per Mile of the Over Head Cable\n",
      "Fu = 1.;         #Faults Per Mile of The Underground cable\n",
      "\n",
      "Ct = 0.3/100        # Cable Termination Fault Rate\n",
      "\n",
      "#Repair Time\n",
      "Tov = 3.;         #Over Head\n",
      "Tu = 28.;         #Underground\n",
      "Tct = 3.;         #Cable Termination\n",
      "\n",
      "# Calculations\n",
      "lamdaFDR =  (Lov*Fov/T)+(Lu*Fu/T)+(2*Ct);         #Total Annual Fault Rate\n",
      "rFDR = ((Tov*Lov*Fov/T)+(Tu*Lu*Fu/T)+(2*Ct*Tct))/lamdaFDR;         #Annual Fault Restoration Time\n",
      "mFDR = 8760-rFDR;         #Annual Mean Time of Failure\n",
      "UFDR = rFDR*100/(rFDR+mFDR);         #Unavailability of Feeder\n",
      "AFDR = 100-UFDR;         #Availability of Feeder\n",
      "\n",
      "# Results\n",
      "print 'a) The Total Annual Fault Rate is %g faults per year'%(lamdaFDR)\n",
      "print 'b) The Annual Fault Restoration Time is %g hours per fault per year'%(rFDR)\n",
      "print 'c) Unavailability of the feeder is %g percent'%(UFDR)\n",
      "print 'd) Availability of the feeder is %g percent'%(AFDR)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The Total Annual Fault Rate is 0.706 faults per year\n",
        "b) The Annual Fault Restoration Time is 6.54108 hours per fault per year\n",
        "c) Unavailability of the feeder is 0.0746698 percent\n",
        "d) Availability of the feeder is 99.9253 percent\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.3  Page No : 608"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "#Annual average Fault rates\n",
      "Fm = 0.08;\n",
      "Fl = 0.2;\n",
      "\n",
      "\n",
      "#Average Repair Times\n",
      "Rm = 3.5;         #Main\n",
      "Rl = 1.5;         #Lateral\n",
      "Rs = 0.75;        #Manual Sections\n",
      "\n",
      "# Dismath.tances of the Lateral Feeders of A,B, and C respectively\n",
      "Lla = 2.;\n",
      "Llb = 1.5;\n",
      "Llc = 1.5;\n",
      "\n",
      "# Dismath.tances of the Main Feeders of A,B, and C respectively\n",
      "Lma = 1.;\n",
      "Lmb = 1.;\n",
      "Lmc = 1.;\n",
      "\n",
      "# Calculations\n",
      "TFm = (Lma*Fm)+(Lmc*Fm)+(Lmb*Fm);         #Annual Fault of the Main Sections\n",
      "\n",
      "def SusInt(y): \n",
      "    return TFm+(Fl*y)\n",
      "\n",
      "#Sustained Interruption Rates for A,B and C\n",
      "IrA = SusInt(Lla);\n",
      "IrB = SusInt(Llb);\n",
      "IrC = SusInt(Llc);\n",
      "\n",
      "#Annual Repair time for A,B and C\n",
      "rA = ((Lma*Fm*Rm)+(Lmb*Fm*Rs)+(Lmc*Fm*Rs)+(Lla*Fl*Rl))/IrA;\n",
      "rB = ((Lma*Fm*Rm)+(Lmb*Fm*Rm)+(Lmc*Fm*Rs)+(Llb*Fl*Rl))/IrB;\n",
      "rC = ((Lma*Fm*Rm)+(Lmb*Fm*Rm)+(Lmc*Fm*Rm)+(Llc*Fl*Rl))/IrC;\n",
      "\n",
      "# Results\n",
      "print 'i The Annual Sustained Interruption Rates for:'\n",
      "print 'Customer A : %g faults per year'%(IrA)\n",
      "print 'Customer B : %g faults per year'%(IrB)\n",
      "print 'Customer C : %g faults per year'%(IrC)\n",
      "print 'ii The Average Annual Repair Time Restoration Time for:'\n",
      "print 'Customer A : %g hours per fault per year'%(rA)\n",
      "print 'Customer A : %g hours per fault per year'%(rB)\n",
      "print 'Customer A : %g hours per fault per year'%(rC)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "i The Annual Sustained Interruption Rates for:\n",
        "Customer A : 0.64 faults per year\n",
        "Customer B : 0.54 faults per year\n",
        "Customer C : 0.54 faults per year\n",
        "ii The Average Annual Repair Time Restoration Time for:\n",
        "Customer A : 1.5625 hours per fault per year\n",
        "Customer A : 1.98148 hours per fault per year\n",
        "Customer A : 2.38889 hours per fault per year\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.4  Page No : 612"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "\n",
      "# Variables\n",
      "Ri = 0.85;\n",
      "\n",
      "def relp(y,z):\n",
      "    return 1-((1-(Ri**y))**z)        #Equal Parallel Combination\n",
      "\n",
      "def rels(y,z):\n",
      "    return (1-((1-Ri)**y))**z         #Equal Series Combination\n",
      "\n",
      "# Calculations\n",
      "#Case 1: 4 elements in series\n",
      "\n",
      "Req1 =  rels(1,4);\n",
      "\n",
      "#Case 2: Two Comination of 4 elements in series, parallel to each other\n",
      "\n",
      "Req2 = relp(4,2);\n",
      "\n",
      "#Case 3 : ((two elements in series)        #(two elements in series))in series with ((two elements in series)        #(two elements in series))\n",
      "\n",
      "#Two Segments\n",
      "R1 = relp(2,2);\n",
      "R2 = relp(2,2);\n",
      "Req3 = R1*R2;\n",
      "\n",
      "#Case 4 : (two elements in parallel)in series with ((three elements in series)        #(three elements in series))\n",
      "\n",
      "#Two Segments\n",
      "R1 = relp(1,2);\n",
      "R2 = relp(3,2);\n",
      "Req4 = R1*R2;\n",
      "\n",
      "#Case 5, 4 groups of (2 elements in parallel) connected in series to each other\n",
      "Req5 = rels(2,4);\n",
      "\n",
      "# Results\n",
      "print 'The Equivalent System reliability for:'\n",
      "print 'a) Configuration A : %g'%(Req1)\n",
      "print 'b) Configuration B : %g'%(Req2)\n",
      "print 'c) Configuration C : %g'%(Req3)\n",
      "print 'd) Configuration D : %g'%(Req4)\n",
      "print 'e) Configuration E : %g'%(Req5)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The Equivalent System reliability for:\n",
        "a) Configuration A : 0.522006\n",
        "b) Configuration B : 0.771522\n",
        "c) Configuration C : 0.851917\n",
        "d) Configuration D : 0.831951\n",
        "e) Configuration E : 0.912992\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.5  Page No : 614"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#To Design the system to meet the given Equivalent System Reliability\n",
      "#Page 614\n",
      "\n",
      "# Variables\n",
      "#Individual System Reliabilities\n",
      "Ra = 0.8;\n",
      "Rb = 0.95;\n",
      "Rc = 0.99;\n",
      "Rd = 0.90;\n",
      "Re = 0.65;\n",
      "\n",
      "# Calculations\n",
      "#When All Are Connected in Series\n",
      "\n",
      "Req = Ra*Rb*Rc*Rd*Re;         #Equivalent System Reliability\n",
      "\n",
      "Rr = 0.8;         #Required\n",
      "\n",
      "Rae = Rr/(Rb*Rc*Rd);\n",
      "\n",
      "#Since Connecting the elements in parallel will increase their reliability\n",
      "def rel(Ri,y,):\n",
      "    return  (1-((1-Ri)**y))         #Equal Only Parallel Combination\n",
      "\n",
      "#Since Connecting the elements in parallel will increase their reliability\n",
      "#Conditions to Find The Number of Elements to be used\n",
      "for i in range(1,11):\n",
      "    L = i;         #Number of Time Element A is used\n",
      "    R1 = rel(Ra,i);\n",
      "    X = R1-Rae;\n",
      "    if(abs(X)+X == 0):\n",
      "        continue;\n",
      "    else:\n",
      "        break;\n",
      "\n",
      "for i in range(1,11):\n",
      "    M = i;        #Number of Time Element E is used\n",
      "    R2 = rel(Re,i);\n",
      "    X = R2-Rae;\n",
      "    if(abs(X)+X == 0):\n",
      "        continue;\n",
      "    else:\n",
      "        break;\n",
      "\n",
      "print 'a) The Equivalent system Reliability is %g'%(Req)\n",
      "print 'b) One Each of B,C and D all connected in series are connected in serieswith the series combination of XComination of\\\n",
      " %g elements of A, \\nAll Connected in Parallel)and YComination of %g elements of E, \\nAll Connected in Parallel) to\\\n",
      "  achieve %g Equivalent System Realibility'%(L,M,Rr)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) The Equivalent system Reliability is 0.440154\n",
        "b) One Each of B,C and D all connected in series are connected in serieswith the series combination of XComination of 2 elements of A, \n",
        "All Connected in Parallel)and YComination of 3 elements of E, \n",
        "All Connected in Parallel) to  achieve 0.8 Equivalent System Realibility\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.6  Page No : 614"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#To Find The Probability on the reliability of transformers\n",
      "#Page 614\n",
      "\n",
      "# Variables\n",
      "#Reliabilities of The Three Transformers\n",
      "Pa = 0.9;\n",
      "Pb = 0.95;\n",
      "Pc = 0.99;\n",
      "\n",
      "#Faliures of Three Transformers\n",
      "Qa = 1-Pa;\n",
      "Qb = 1-Pb;\n",
      "Qc = 1-Pc;\n",
      "\n",
      "# Calculations\n",
      "#Probability of NO Transformer Failing\n",
      "Pnf = Pa*Pb*Pc;\n",
      "\n",
      "PfA = Qa*Pb*Pc        #Probability of Transformer A Failing\n",
      "PfB = Pa*Qb*Pc        #Probability of Transformer B Failing\n",
      "PfC = Pa*Pb*Qc        #Probability of Transformer C Failing\n",
      "\n",
      "PfAB = Qa*Qb*Pc        #Probability of Transformer A and B Failing\n",
      "PfBC = Pa*Qb*Qc        #Probability of Transformer B and C Failing\n",
      "PfCA = Qa*Pb*Qc        #Probability of Transformer C and A Failing\n",
      "\n",
      "Pf = Qa*Qb*Qc;         #Probability of All Transformers failing\n",
      "\n",
      "# Results\n",
      "print 'a) Probability of No Transformer Failing is %g'%(Pnf)\n",
      "print 'b'\n",
      "print 'Probability of Transformer A Failing is %g'%(PfA)\n",
      "print 'Probability of Transformer B Failing is %g'%(PfB)\n",
      "print 'Probability of Transformer C Failing is %g'%(PfC)\n",
      "print 'c'\n",
      "print 'Probability of Transformers A and B Failing is %g'%(PfAB)\n",
      "print 'Probability of Transformers B and C Failing is %g'%(PfBC)\n",
      "print 'Probability of Transformers C and A Failing is %g'%(PfCA)\n",
      "print 'd) Probability of All Three Transformers Failing is %g'%(Pf)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a) Probability of No Transformer Failing is 0.84645\n",
        "b\n",
        "Probability of Transformer A Failing is 0.09405\n",
        "Probability of Transformer B Failing is 0.04455\n",
        "Probability of Transformer C Failing is 0.00855\n",
        "c\n",
        "Probability of Transformers A and B Failing is 0.00495\n",
        "Probability of Transformers B and C Failing is 0.00045\n",
        "Probability of Transformers C and A Failing is 0.00095\n",
        "d) Probability of All Three Transformers Failing is 5e-05\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.7  Page No : 619"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#To Determine Probabilities Using Markovian Principle\n",
      "#Page 619\n",
      "\n",
      "# Variables\n",
      "#Conditional Probabilites Present Future\n",
      "Pdd = 2./100;         #Down Down\n",
      "Pud = 5./100;         #Up Down\n",
      "Pdu = 1-Pdd;         #Down up\n",
      "Puu = 1-Pud;         #Up Up\n",
      "\n",
      "# Calculations\n",
      "P = [[Pdd,Pdu],[Pud,Puu]];         #Transition Matrix\n",
      "\n",
      "# Results\n",
      "print 'a The Conditional Probabilites for'\n",
      "print 'Transformers Down in Present and Down in Future is %g'%(Pdd)\n",
      "print 'Transformers Down in Present and Up in Future is %g'%(Pdd)\n",
      "print 'Transformers Up in Present and Down in Future is %g'%(Pdd)\n",
      "print 'Transformers Up in Present and Up in Future is %g'%(Pdd)\n",
      "print 'b The Transition Matrix is',\n",
      "print (P)\n",
      "print 'c The Transition Diagram can be viewed with the result file attached to this code'\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a The Conditional Probabilites for\n",
        "Transformers Down in Present and Down in Future is 0.02\n",
        "Transformers Down in Present and Up in Future is 0.02\n",
        "Transformers Up in Present and Down in Future is 0.02\n",
        "Transformers Up in Present and Up in Future is 0.02\n",
        "b The Transition Matrix is [[0.02, 0.98], [0.05, 0.95]]\n",
        "c The Transition Diagram can be viewed with the result file attached to this code\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.8  Page No : 620"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "#To Determine the Conditional Outage Probabilites\n",
      "#Page 620\n",
      "\n",
      "# Calculations\n",
      "#Conditional Outage Probabilites From The Table Given\n",
      "P11 = 40./100;\n",
      "P12 = 30./100;\n",
      "P13 = 30./100;\n",
      "P21 = 20./100;\n",
      "P22 = 50./100;\n",
      "P23 = 30./100;\n",
      "P31 = 25./100;\n",
      "P32 = 25./100;\n",
      "P33 = 50./100;\n",
      "\n",
      "#Transition Matrix\n",
      "P = [[P11,P12,P13],[P21,P22,P23],[P31,P32,P33]];\n",
      "\n",
      "print \"a The Conditional Outage Probabilites for:\"\n",
      "print \"Presently Outaged Feeder is 1, Next Outaged Feeder is 1 is %g\"%(P11)\n",
      "print \"Presently Outaged Feeder is 1, Next Outaged Feeder is 2 is %g\"%(P12)\n",
      "print \"Presently Outaged Feeder is 1, Next Outaged Feeder is 3 is %g\"%(P13)\n",
      "print \"Presently Outaged Feeder is 2, Next Outaged Feeder is 1 is %g\"%(P21)\n",
      "print \"Presently Outaged Feeder is 2, Next Outaged Feeder is 2 is %g\"%(P22)\n",
      "print \"Presently Outaged Feeder is 2, Next Outaged Feeder is 3 is %g\"%(P23)\n",
      "print \"Presently Outaged Feeder is 3, Next Outaged Feeder is 1 is %g\"%(P31)\n",
      "print \"Presently Outaged Feeder is 3, Next Outaged Feeder is 2 is %g\"%(P32)\n",
      "print \"Presently Outaged Feeder is 3, Next Outaged Feeder is 3 is %g\"%(P33)\n",
      "print \"b Transition Matrix is\"\n",
      "print (P)\n",
      "print \"c The Transition figure is print layed in the result file attached to this code\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a The Conditional Outage Probabilites for:\n",
        "Presently Outaged Feeder is 1, Next Outaged Feeder is 1 is 0.4\n",
        "Presently Outaged Feeder is 1, Next Outaged Feeder is 2 is 0.3\n",
        "Presently Outaged Feeder is 1, Next Outaged Feeder is 3 is 0.3\n",
        "Presently Outaged Feeder is 2, Next Outaged Feeder is 1 is 0.2\n",
        "Presently Outaged Feeder is 2, Next Outaged Feeder is 2 is 0.5\n",
        "Presently Outaged Feeder is 2, Next Outaged Feeder is 3 is 0.3\n",
        "Presently Outaged Feeder is 3, Next Outaged Feeder is 1 is 0.25\n",
        "Presently Outaged Feeder is 3, Next Outaged Feeder is 2 is 0.25\n",
        "Presently Outaged Feeder is 3, Next Outaged Feeder is 3 is 0.5\n",
        "b Transition Matrix is\n",
        "[[0.4, 0.3, 0.3], [0.2, 0.5, 0.3], [0.25, 0.25, 0.5]]\n",
        "c The Transition figure is print layed in the result file attached to this code\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 11.9  Page No : 624"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import math \n",
      "from numpy import array\n",
      "\n",
      "# Variables\n",
      "P = array([[0.6,0.4],[0.3,0.7]]);         #One Step Transition Matrix\n",
      "\n",
      "Po = array([0.8,0.2]);         #Initial State Probability Vector\n",
      "\n",
      "# Calculations\n",
      "#Funtion to determine the Vector of State Probability\n",
      "def VSP(y): \n",
      "    return (Po*(P**y))\n",
      "\n",
      "P1 = VSP(1);         #Vector of State Probability at Time t1\n",
      "P4 = VSP(4);         #Vector of State Probability at Time t4\n",
      "P8 = VSP(8);         #Vector of State Probability at Time t8\n",
      "\n",
      "# Results\n",
      "print 'a The Vector of State Probability at time t1 is',\n",
      "print (P1)\n",
      "print 'a The Vector of State Probability at time t4 is',\n",
      "print (P4)\n",
      "print 'a The Vector of State Probability at time t8 is',\n",
      "print (P8)\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "a The Vector of State Probability at time t1 is [[ 0.48  0.08]\n",
        " [ 0.24  0.14]]\n",
        "a The Vector of State Probability at time t4 is [[ 0.10368  0.00512]\n",
        " [ 0.00648  0.04802]]\n",
        "a The Vector of State Probability at time t8 is [[  1.34369280e-02   1.31072000e-04]\n",
        " [  5.24880000e-05   1.15296020e-02]]\n"
       ]
      }
     ],
     "prompt_number": 16
    }
   ],
   "metadata": {}
  }
 ]
}