summaryrefslogtreecommitdiff
path: root/Microwave_and_Radar_Engineering_by_M._Kulkarni/chapter03.ipynb
blob: 5e391149b71ec24e1575d5601a5a8e87701edfa2 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:4bd6c8c288e718d72cee337cd9fe483874c85b5eb4a00b0ee5d5f593b823861e"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "chapter03:Transmission Lines"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 3.1, Page number 47"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate Terminating impedance\n",
      "#Variable declaration\n",
      "Zo = 100       #o/p impedance(Ohms)\n",
      "s = 5          #VSWR\n",
      "\n",
      "#Calculations\n",
      "Zmax = Zo*s\n",
      "\n",
      "#Results\n",
      "print \"Terminating impedance = \",Zmax,\"Ohms\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Terminating impedance =  500 Ohms\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.2, Page number 47"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate Characteristic impedance,Attenuation constant,Phase constant,Power delivered to the load\n",
      "import math\n",
      "import cmath\n",
      "\n",
      "#Varaible declaration \n",
      "R = 8             #resistance(Ohms)\n",
      "L = 2*10**-3      #inductance(H/km)\n",
      "C = 0.002*10**-6  #capacitance(F)\n",
      "G = 0.07*10**-6   #conductance(s/km)\n",
      "f = 2*10**3       #frequency(Hz)\n",
      "Vs = 2            #input signal(V)\n",
      "l = 500.          #line length(km)\n",
      "\n",
      "#Calculations\n",
      "w = 2*math.pi*f\n",
      "x = complex(R,w*L)\n",
      "y = complex(G,w*C)\n",
      "Zo = cmath.sqrt(x/y)\n",
      "gamma = cmath.sqrt(x*y)\n",
      "Is = Vs/Zo.real\n",
      "Il = Is*cmath.exp(-1*gamma*l)\n",
      "P = Il**2*Zo.real\n",
      "\n",
      "#Results\n",
      "print \"Characteristic impedance =\",Zo,\"Ohms\"\n",
      "print \"Attenuation constant =\",round(gamma.real,6),\"NP/km\"\n",
      "print \"Phase constant =\", round(gamma.imag,6),\"rad/km\"\n",
      "print \"\\ncalculation error in the textbook\"\n",
      "print \"\\nPower delivered to the load =\", round((abs(P)/1E-6),1), \"uW\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Characteristic impedance = (1012.50018135-155.813417548j) Ohms\n",
        "Attenuation constant = 0.003987 NP/km\n",
        "Phase constant = 0.025436 rad/km\n",
        "\n",
        "calculation error in the textbook\n",
        "\n",
        "Power delivered to the load = 73.3 uW\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.3, Page number 48"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate Phase velocity\n",
      "import math\n",
      "\n",
      "#Varaible declaration\n",
      "f = 2*10**3       #frequency(Hz)\n",
      "B = 0.02543       #phase constant(rad/km)\n",
      "\n",
      "#Calculations\n",
      "w = 2*math.pi*f\n",
      "Vp = w/B\n",
      "\n",
      "#Results\n",
      "print \"Phase velocity =\",round((Vp/1E+3),2),\"km/sec\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Phase velocity = 494.16 km/sec\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.4, Page number 48"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate Current drawn from generator,Power delivered to the load,Current flowing through the load\n",
      "\n",
      "import cmath\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "f = 37.5*10**6       #frequency(Hz)\n",
      "V = 200              #Voltage signal(Vrms)\n",
      "r = 200              #internal resistance(Ohms)\n",
      "Zo = 200             #characteristic impedance(Ohms)\n",
      "l = 10               #line length(m)\n",
      "Zl = 100             #resistive load(Ohms)\n",
      "c = 3*10**8          #velocity of propagation(m/s)\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "lamda = c/f\n",
      "Bl = (5*math.degrees(math.pi))/4\n",
      "x = complex(Zl,(Zo*math.tan(Bl)))\n",
      "y = complex(Zo,(Zl*math.tan(Bl)))\n",
      "Zi = Zo*(x/y)\n",
      "Vs = (Zi.real*Zo)/(Zi.real+Zo)\n",
      "Is = Zo/(Zi.real+Zo)\n",
      "\n",
      "#Part b\n",
      "P = Vs*Is\n",
      "\n",
      "#Part c\n",
      "Il = math.sqrt(P/Zl)\n",
      "\n",
      "#Results\n",
      "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
      "print \"Current drawn from generator is\",round(Is,3),\"A\" \n",
      "print \"Power delivered to the load is\",round(P,2),\"W\"\n",
      "print \"Current flowing through the load is\",round(Il,3),\"A\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
        "\n",
        "Current drawn from generator is 0.413 A\n",
        "Power delivered to the load is 48.47 W\n",
        "Current flowing through the load is 0.696 A\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.5, Page number 50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate Reflection co-efficient, VSWR\n",
      "import cmath\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "zo = 50              #characteristic impedance(Ohms)\n",
      "f = 300*10**6        #frequency(Hz)\n",
      "zl = complex(50,50)  #terminating load(Ohms)\n",
      "c = 3*10**8          #velocity of propagation(m/s)\n",
      "\n",
      "#Calculations\n",
      "lamda = c/f\n",
      "rho = (zl-zo)/(zl+zo)\n",
      "phi = cmath.phase(rho)\n",
      "s = (1+abs(rho))/(1-abs(rho))\n",
      "\n",
      "#Results\n",
      "print \"Reflection co-efficient =\",round(abs(rho),4),\"with phase =\",round(math.degrees(phi),1)\n",
      "print \"VSWR =\",round(s,2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reflection co-efficient = 0.4472 with phase = 63.4\n",
        "VSWR = 2.62\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.6, Page number 50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate position of the stub,Length of stub \n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Zl = 100.           #load resistance(Ohms)\n",
      "Zo = 600.           #characteristic impedance(Ohms)\n",
      "f = 100*10**6       #frequency(Hz)\n",
      "c = 3*10**8         #velocity of propagation(m/s)\n",
      "\n",
      "#Calculations\n",
      "lamda = c/f\n",
      "l = (lamda*math.atan(math.sqrt(Zl/Zo)))/(2*math.pi)\n",
      "l_dash = (lamda*math.atan(math.sqrt((Zl*Zo)/(Zo-Zl))))/(2*math.pi)\n",
      "\n",
      "#Results\n",
      "print \"The position of the stub is\", round(l,3),\"m\\n\"\n",
      "print \"Please note that the solution for l_dash given in the textbook is incorrect\"\n",
      "print \"Length of stub is\",round(l_dash,3),\"m\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The position of the stub is 0.185 m\n",
        "\n",
        "Please note that the solution for l_dash given in the textbook is incorrect\n",
        "Length of stub is 0.707 m\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.7, Page number 50"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate Terminating impedance\n",
      "import cmath\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "s = 3.2            #VSWR\n",
      "Xmin = 0.237       #minimum voltage(V)\n",
      "Zo = 50            #characteristic impedance(Ohms)\n",
      "\n",
      "#Calculations\n",
      "q = math.tan(math.degrees(2*math.pi*Xmin))\n",
      "x = complex(1,-(s*q))\n",
      "y = complex(s, -q)\n",
      "Zl = Zo*(x/y)\n",
      "\n",
      "#Result\n",
      "print \"Please note that the solution given in the textbook is incorrect.Hence the difference in answers\\n\"\n",
      "print \"Terminating impedance =\", Zl,\"Ohms\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Please note that the solution given in the textbook is incorrect.Hence the difference in answers\n",
        "\n",
        "Terminating impedance = (19.6572514629-23.7885950214j) Ohms\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.8, Page number 51"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate VSWR,First Vmax is loacted at load and first Vmin is located at,Vmin,Impedance at Vmin\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Zo = 50.               #characteristic impedance(Ohms)\n",
      "Zl = 100.              #load resistance(Ohms)\n",
      "f = 300*10**3          #frequency(Hz)\n",
      "Pl = 50*10**-3         #load power(W)\n",
      "c = 3*10**8            #velocity of propagation(m/s)\n",
      "\n",
      "#Calculations\n",
      "lamda = c/f\n",
      "\n",
      "#Part a\n",
      "rho = (Zl-Zo)/(Zl+Zo)\n",
      "s = (1+abs(rho))/(1-abs(rho))\n",
      "\n",
      "#Part b\n",
      "#Since real Zl>Zo, first Vmax is located at the load\n",
      "Vmin_pos = lamda/4\n",
      "\n",
      "#Part c\n",
      "Vmax = math.sqrt(Pl*Zl)\n",
      "Vmin = Vmax/s\n",
      "\n",
      "#Part d\n",
      "Zin_at_Vmin = Zo/s\n",
      "Zin_at_Vmax = Zo*s\n",
      "\n",
      "#Results\n",
      "print \"VSWR = \", s\n",
      "print \"First Vmax is loacted at load and first Vmin is located at=\", Vmin_pos,\"m from the load\"\n",
      "print \"Vmax = \",round(Vmax,2),\"V\",\"\\nVmin = \",round(Vmin,2),\"V\"\n",
      "print \"Impedance at Vmin is \", Zin_at_Vmin,\"Ohm and impedance at Vmax is\",Zin_at_Vmax,\"Ohm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "VSWR =  2.0\n",
        "First Vmax is loacted at load and first Vmin is located at= 250 m from the load\n",
        "Vmax =  2.24 V \n",
        "Vmin =  1.12 V\n",
        "Impedance at Vmin is  25.0 Ohm and impedance at Vmax is 100.0 Ohm\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.9, Page number 52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate Reflection loss, transmission loss, return loss\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Zo = 600.           #characteristic impedance(Ohms)\n",
      "Zs = 50             #source impedance(Ohms)\n",
      "l = 200             #length of line(m)\n",
      "Zl = 500.           #load resistance(Ohms)\n",
      "\n",
      "#Calculations\n",
      "rho = (Zl-Zo)/(Zl+Zo)\n",
      "\n",
      "#Part a\n",
      "ref_l = math.log10(1/(1-((abs(rho))**2)))\n",
      "\n",
      "#Part b\n",
      "#Since, the line is lossless,\n",
      "att_l = 0\n",
      "trans_l = ref_l+att_l\n",
      "\n",
      "#Part c\n",
      "ret_l = math.log10(abs(rho))\n",
      "\n",
      "#Results\n",
      "print \"Reflection loss =\",round(ref_l,4),\"dB\"\n",
      "print \"Transmission loss =\",round(trans_l,4),\"dB\"\n",
      "print \"Return loss =\",round(ret_l,3),\"dB (Calculation error in the textbook)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Reflection loss = 0.0036 dB\n",
        "Transmission loss = 0.0036 dB\n",
        "Return loss = -1.041 dB (Calculation error in the textbook)\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 3.10, Page number 52"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#calculate Characteristic impedance,Phase velocity \n",
      "\n",
      "import cmath\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "l = 10 #length of line(km)\n",
      "zsc = complex(1895.47,2234.29)  \n",
      "zoc = complex(216.99,-143.37)\n",
      "f = 1*10**3  #frequency(Hz)\n",
      "\n",
      "#Calculations\n",
      "zo = cmath.sqrt(zsc*zoc)\n",
      "x = cmath.sqrt(zsc/zoc)\n",
      "t = (1+x)/(1-x)\n",
      "gamma = cmath.log(t)/(l*2)\n",
      "B = gamma.imag\n",
      "w = 2*math.pi*f\n",
      "Vp = w/B\n",
      "\n",
      "#Results\n",
      "print \"There is calculation mistake throughout the problem in the textbook\\n\"\n",
      "print \"Characteristic impedance =\",zo,\"Ohms\"\n",
      "print \"Phase velocity =\",round((Vp/1E+3),3),\"*10^3 m/sec\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "There is calculation mistake throughout the problem in the textbook\n",
        "\n",
        "Characteristic impedance = (864.190238563+123.274392427j) Ohms\n",
        "Phase velocity = 45.994 *10^3 m/sec\n"
       ]
      }
     ],
     "prompt_number": 10
    }
   ],
   "metadata": {}
  }
 ]
}