summaryrefslogtreecommitdiff
path: root/Microwave_Devices_And_Circuits_by_S._Y._Liao/chapter9.ipynb
blob: c95c984b5466689c4a00d1e6a878b26ddde3e052 (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
{

 "metadata": {

  "name": "",

  "signature": "sha256:060fdcfe827769d224d6e050c45932130de9317b1c6afbcd45de118cee9f7fb4"

 },

 "nbformat": 3,

 "nbformat_minor": 0,

 "worksheets": [

  {

   "cells": [

    {

     "cell_type": "heading",

     "level": 1,

     "metadata": {},

     "source": [

      "Chapter9:MICROWAVE LINEAR-BEAM TUBES(O TYPE)"

     ]

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Eg9.2.1:pg-377"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#(a) Calculate the input gap voltage to give maximum voltage V2\n",

      "\n",

      "#For maximum V2, J1(X) must be maximum.This means J1(X)=0.582 at X=1.841.  \n",

      "X=1.841   #bunching parameter\n",

      "J1X=0.582 \n",

      "V0=10**3  #dc voltage in Volt\n",

      "v0=0.593*(10**6)*(sqrt(V0)) #The electron velocity just leaving the cathode\n",

      "f=3*(10**9)                 #operating frequency in Hertz\n",

      "d=1*(10**-3)                #Gap spacing in either cavity in meter\n",

      "w=(2*math.pi*f)             #angular frequency in Hertz\n",

      "Og=(w*d)/v0                 #calculation of gap transit angle in radians\n",

      "Bi=(math.sin(Og/2))/(Og/2)  #value of Bi is wrong in book because of calculation mistake\n",

      "Bo=Bi                       #value of Bo is wrong in book\n",

      "L=4*(10**-2)                #Spacing between the two cavities in meter\n",

      "O0=(w*L)/v0                 #DC transit angle between the cavaties in radians\n",

      "V1max=(2*V0*X)/(round(Bi,3)*int(O0)) \n",

      "print\"The maximum input voltage V1 (in Volts) is =\",round(V1max,1),\"V\" #value of Bi used in book for calculation of V1 is wrong so answer is wrong in book  \n",

      "\n",

      "#(b) Calculate the voltage gain\n",

      "R0=40*(10**3)             #in Ohms\n",

      "Rsh=30*(10**3)            #Effective shunt impedance excluding beam loading in Ohms\n",

      "Av=((round(Bo,3)**2)*int(O0)*J1X*Rsh)/(R0*X) #voltage gain\n",

      "print\"The voltage gain,neglecting the beam loading in the output cavity is =\",round(Av,3) #answer is wrong in book as the value of Bo used is wrong       \n",

      "\n",

      "#(c)Calculate the efficiency of the  amplifier\n",

      "I0=25*(10**-3)    #in ampere\n",

      "I2=2*I0*J1X \n",

      "V2=round(Bo,3)*I2*Rsh \n",

      "efficiency=(round(Bo,3)*I2*int(V2))/(2*I0*V0) \n",

      "efficiency=100*efficiency \n",

      "print\"The efficiency of the  amplifier,neglecting beam loading =\",round(efficiency,1),\"%\" #calculation mistake in book    \n",

      "\n",

      "#(d)Calculate the beam loading conductance\n",

      "G0=25*(10**-6)    #G0=I0/V0 is the DC beam conductance in mho\n",

      "Og=round(Og)\n",

      "GB=(G0/2)*((round(Bo,3)**2)-(round(Bo,3)*math.cos(Og/2))) \n",

      "print\"The beam loading conductance GB (in mho) is =\",\"{:.1e}\".format(GB),\"mho\" #answer is wrong in book as the value of Bo in book is wrong\n",

      "RB=1/GB \n",

      "print\"Then the beam loading resistance RB (ohm)is =\",\"{:.2e}\".format(RB),\"ohms\"\n",

      "print('In comparasion with RL and Rsho or the effective shunt resistance Rsh,the beam loading resistance is like an open circuit and thus can be neglected in the preceding calculations') "

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The maximum input voltage V1 (in Volts) is = 96.1 V\n",

        "The voltage gain,neglecting the beam loading in the output cavity is = 8.704\n",

        "The efficiency of the  amplifier,neglecting beam loading = 46.6 %\n",

        "The beam loading conductance GB (in mho) is = 9.6e-07 mho\n",

        "Then the beam loading resistance RB (ohm)is = 1.04e+06 ohms\n",

        "In comparasion with RL and Rsho or the effective shunt resistance Rsh,the beam loading resistance is like an open circuit and thus can be neglected in the preceding calculations\n"

       ]

      }

     ],

     "prompt_number": 4

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Eg9.3.1:pg-385"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#(a) Calculate the dc electron velocity\n",

      "V0=14.5*(10**3)            #beam voltage in Volt\n",

      "v0=0.593*(10**6)*sqrt(V0)  #dc electron velocity \n",

      "print\"The dc electron velocity(in m/s)is =\",\"{:.2e}\".format(v0),\"m/s\"\n",

      "\n",

      "#(b) Calculate the dc phase constant\n",

      "f=(10*(10**9))          #operating frequency in Hertz\n",

      "Be=(2*math.pi*f)/v0     #angular frequency in Hertz    \n",

      "print\"The dc phase constant(in rads/m) is =\",\"{:.2e}\".format(Be),\"rads/m\"\n",

      "\n",

      "#(c)Calculate the plasma frequency\n",

      "po=1*(10**-6)          #dc electron charge density in C/m**3\n",

      "wp=sqrt((1.759*(10**11)*po)/(8.854*(10**-12))) \n",

      "print\"The plasma frequency(in rad/s)is =\",\"{:.2e}\".format(wp),\"rad/s\"\n",

      "\n",

      "#(d) Calculate the reduced plasma frequency for R=0.4\n",

      "R=0.4 \n",

      "wq=R*wp \n",

      "print\"The reduced plasma frequency for R=0.4 (in rad/s) is =\",\"{:.2e}\".format(wq),\"rad/s\" \n",

      "\n",

      "#(e)Calculate the dc beam current density\n",

      "J0=po*v0 \n",

      "print\"The dc beam current density(in A/m2) is =\",round(J0,1),\"A/m2\" \n",

      "\n",

      "#(f) Calculate the instantaneous beam current density\n",

      "p=1*(10**-8)       #RF charge density in C/m**3\n",

      "v=1*(10**5)        #velocity perturbation in m/s\n",

      "J=(p*v0)-(po*v) \n",

      "print\"The instantaneous beam current density (in A/m2) is =\",round(J,3),\"A/m2\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The dc electron velocity(in m/s)is = 7.14e+07 m/s\n",

        "The dc phase constant(in rads/m) is = 8.80e+02 rads/m\n",

        "The plasma frequency(in rad/s)is = 1.41e+08 rad/s\n",

        "The reduced plasma frequency for R=0.4 (in rad/s) is = 5.64e+07 rad/s\n",

        "The dc beam current density(in A/m2) is = 71.4 A/m2\n",

        "The instantaneous beam current density (in A/m2) is = 0.614 A/m2\n"

       ]

      }

     ],

     "prompt_number": 6

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Eg9.3.2:pg-386"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#(a) Calculate the dc electron velocity\n",

      "V0=18*(10**3)              #beam voltage in Volt\n",

      "v0=0.593*(10**6)*sqrt(V0) \n",

      "print\"The dc electron velocity(in m/s)is =\",\"{:.2e}\".format(v0),\"m/s\" \n",

      "\n",

      "#(b) Calculate the dc electron phase constant\n",

      "f=(10*(10**9))            #Operating frequency in Hertz\n",

      "w=2*math.pi*f             #angular frequency in Hertz\n",

      "Be=w/v0 \n",

      "print\"The dc electron phase constant(in rads/m) is =\",\"{:.3e}\".format(Be),\"rads/m\" \n",

      "\n",

      "#(c) Calculate the plasma frequency\n",

      "po=1*(10**-8)            #dc electron beam current density in C/m**3\n",

      "wp=sqrt((1.759*(10**11)*po)/(8.854*(10**-12))) \n",

      "print\"The plasma frequency(in rad/s) is =\",\"{:.2e}\".format(wp),\"rad/s\"\n",

      "\n",

      "#(d) Calculate the reduced plasma frequency for R=0.5\n",

      "R=0.5 \n",

      "wq=R*wp \n",

      "print\"The reduced plasma frequency for R=0.5 (in rad/s)is =\",\"{:.2e}\".format(wq),\"rad/s\" \n",

      "\n",

      "#(e) Calculate the reduced plasma phase constant\n",

      "Bq=wq/v0 \n",

      "print\"The reduced plasma phase constant(in rad/m) is =\",round(Bq,3),\"rad/m\"\n",

      "\n",

      "#(f) Calculate the transit time across the input gap\n",

      "d=1*(10**-2)            #gap distance in m\n",

      "t=d/v0 \n",

      "t=t*(10**9) \n",

      "print\"The transit time across the input gap(in ns) is =\",round(t,4),\"ns\" \n",

      "\n",

      "#(g) Calculate the electron velocity leaving the input gap\n",

      "V1=10              #signal voltage in Volt\n",

      "Bi=1.0             #beam coupling coefficient\n",

      "Vt1=v0*(1+(((Bi*V1)/(2*V0))*math.sin(w*round(t,4)*(10**-9)))) \n",

      "print\"the electron velocity leaving the input gap(in m/s)is =\",\"{:.2e}\".format(v0),\"+\",\"{:.2e}\".format(v0*(((Bi*V1)/(2*V0))*math.sin(w*round(t,4)*(10**-9)))),\"m/s =\",\"{:.2e}\".format(Vt1),\"m/s\"                                "

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The dc electron velocity(in m/s)is = 7.96e+07 m/s\n",

        "The dc electron phase constant(in rads/m) is = 7.897e+02 rads/m\n",

        "The plasma frequency(in rad/s) is = 1.41e+07 rad/s\n",

        "The reduced plasma frequency for R=0.5 (in rad/s)is = 7.05e+06 rad/s\n",

        "The reduced plasma phase constant(in rad/m) is = 0.089 rad/m\n",

        "The transit time across the input gap(in ns) is = 0.1257 ns\n",

        "the electron velocity leaving the input gap(in m/s)is = 7.96e+07 + 2.21e+04 m/s = 7.96e+07 m/s\n"

       ]

      }

     ],

     "prompt_number": 7

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Eg9.3.3:pg-388"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#(a)Calculate the plasma frequency\n",

      "po=1*(10**-6)               #dc electron beam current density in C/m**3\n",

      "e0=8.854*(10**-12)          #permittivity of free space in F/m\n",

      "wp=sqrt((1.759*(10**11)*po)/e0) \n",

      "print\"The plasma frequency(in rad/s)is =\",\"{:.2e}\".format(wp),\"rad/s\"\n",

      "\n",

      "#(b) Calculate the reduced plasma frequency for R=0.5\n",

      "R=0.5 \n",

      "f=8*(10**9)          #operating frequency in Hertz\n",

      "w=2*math.pi*f        #angular frequency in Hertz\n",

      "wq=R*wp \n",

      "print\"The reduced plasma frequency for R=0.5(in rad/s)is =\",\"{:.2e}\".format(wq),\"rad/s\" \n",

      "\n",

      "#(c) Calculate the induced current in the output cavity\n",

      "V0=20*(10**3)        #beam voltage in Volt\n",

      "I0=2                 #beam current in ampere\n",

      "V1=10                #Signal voltage in Volt\n",

      "Bo=1                 #Beam coupling coefficient\n",

      "I2=(I0*w*(Bo**2)*V1)/(2*V0*wq) \n",

      "print\"The induced current in the output cavity(in Ampere)is =\",round(I2,4),\"A\" \n",

      "\n",

      "#(d) Calculate the induced voltage in the output cavity\n",

      "Rshl=30*(10**3)      #total shunt resistance including load in Volt\n",

      "V2=round(I2,3)*Rshl \n",

      "V2=V2/1000           #in KV\n",

      "print\"The induced voltage in the output cavity(in KV)is =\",V2,\"KV\"\n",

      "\n",

      "#(e) Calculate the output power delivered to the load\n",

      "Rsh=10*(10**3)       #shunt resistance of the cavity\n",

      "Rshl=30*(10**3)      #total shunt resistance including load\n",

      "Pout=(round(I2,3)**2)*Rshl \n",

      "Pout=Pout/1000 \n",

      "print\"The output power delivered to the load(in KW)is =\",round(Pout,2),\"KW\"\n",

      "\n",

      "#(f) Calculate the power gain\n",

      "powergain=(((I0*w)**2)*(Bo**4)*Rsh*Rshl)/(4*((V0*wq)**2)) \n",

      "powergain=10*math.log10(powergain)      #powergain in dB\n",

      "print\"The power gain is =\",round(powergain,1),\"dB\"\n",

      "\n",

      "#(g) Calculate the electronic efficiency\n",

      "n=(Pout*1000)/(I0*V0) \n",

      "n=n*100 \n",

      "print\"The electronic efficiency (in %)is =\",round(n,1),\"%\" "

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The plasma frequency(in rad/s)is = 1.41e+08 rad/s\n",

        "The reduced plasma frequency for R=0.5(in rad/s)is = 7.05e+07 rad/s\n",

        "The induced current in the output cavity(in Ampere)is = 0.3566 A\n",

        "The induced voltage in the output cavity(in KV)is = 10.71 KV\n",

        "The output power delivered to the load(in KW)is = 3.82 KW\n",

        "The power gain is = 55.8 dB\n",

        "The electronic efficiency (in %)is = 9.6 %\n"

       ]

      }

     ],

     "prompt_number": 8

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Eg9.3.4:pg-390"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#(a) Calculate the plasma frequency\n",

      "po=5*(10**-5)          #dc electron beam current density in C/m**3\n",

      "wp=sqrt((1.759*(10**11)*po)/(8.854*(10**-12))) \n",

      "print\"The plasma frequency(in rad/s)is =\",\"{:.2e}\".format(wp),\"rad/s\" \n",

      "\n",

      "#(b) Calculate the reduced plasma frequency for R=0.6\n",

      "R=0.6 \n",

      "f=4*(10**9)        #operating frequency in Hertz\n",

      "w=2*math.pi*f      #angular frequency in Hertz\n",

      "wq=R*wp \n",

      "print\"The reduced plasma frequency for R=0.6(in rad/s)is =\",\"{:.2e}\".format(wq),\"rad/s\" \n",

      "\n",

      "#(c) Calculate the induced current in the output cavity\n",

      "Rsh=10*(10**3)    #shunt resistance of the cavity in Ohms\n",

      "Rshl=5*(10**3)    #total shunt resistance including load in Ohms\n",

      "V0=10*(10**3)     #beam voltage in volt\n",

      "I0=0.7            #beam current in ampere\n",

      "V1=2              #Signal voltage in volt\n",

      "Bo=1              #Beam coupling coefficient\n",

      "I4=(((I0*w)**3)*(Bo**6)*V1*(Rsh**2))/(8*((V0*wq)**3)) \n",

      "print\"The induced current in the output cavity(in Ampere)is =\",round(I4,4),\"A\"\n",

      "\n",

      "#(d) Calculate the induced voltage in the output cavity\n",

      "V4=I4*Rshl \n",

      "V4=V4/1000      #in KV\n",

      "print\"The induced voltage in the output cavity(in KV)is =\",round(V4,2),\"KV\"\n",

      "\n",

      "#(e) Calculate the output power delivered to the load\n",

      "Pout=(I4**2)*Rshl \n",

      "Pout=Pout/1000    #in KW\n",

      "print\"The output power delivered to the load(in KW)is =\",round(Pout,2),\"KW\" "

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The plasma frequency(in rad/s)is = 9.97e+08 rad/s\n",

        "The reduced plasma frequency for R=0.6(in rad/s)is = 5.98e+08 rad/s\n",

        "The induced current in the output cavity(in Ampere)is = 0.6366 A\n",

        "The induced voltage in the output cavity(in KV)is = 3.18 KV\n",

        "The output power delivered to the load(in KW)is = 2.03 KW\n"

       ]

      }

     ],

     "prompt_number": 9

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Eg9.4.1:pg-399"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#(a) Calculate the value of the repeller voltage\n",

      "V0=600           #beam voltage in volt\n",

      "n=2              #mode=2\n",

      "fr=9*(10**9)     #operating frequency in Hertz\n",

      "w=2*math.pi*fr   #angular frequency in Hertz\n",

      "L=1*(10**-3)     #in meter\n",

      "em=1.759*(10**11)   #em=e/m is the charge to mass ratio of electron\n",

      "x=((em)*(((2*math.pi*n)-(math.pi/2))**2))/(8*(w**2)*(L**2)) #x=V0/(V0+Vr)**2\n",

      "y=V0/x           #y=(V0+Vr)**2\n",

      "z=sqrt(y)        #z=V0+Vr\n",

      "Vr=z-V0 \n",

      "print\"The value of the repeller voltage(volts)is =\",int(round(Vr)),\"V\" \n",

      "\n",

      "#(b)Calculate the direct current necessary to give a microwave gap voltage of 200V\n",

      "        #Assume that Bo=1\n",

      "        #V2 = I2*Rsh = 2*I0*J1(X)*Rsh   \n",

      "V2=200    #gap voltage in volt\n",

      "Rsh=15*(10**3) #shunt resistance of te cavity in ohms\n",

      "X=1.841         #bunching parameter\n",

      "J1X=0.582 \n",

      "I0 = V2/(2*J1X*Rsh) \n",

      "I0=I0*1000   #in mA\n",

      "print\"The direct current necessary to give a microwave gap voltage of 200V(in mA)is =\",round(I0,2),\"mA\" \n",

      "\n",

      "#(c) Calculate the electronic efficiency \n",

      "efficiency=(2*X*J1X)/((2*math.pi*n)-(math.pi/2)) \n",

      "efficiency=efficiency*100 \n",

      "print\"The electronic efficiency(in %)is =\",round(efficiency,2),\"%\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The value of the repeller voltage(volts)is = 250 V\n",

        "The direct current necessary to give a microwave gap voltage of 200V(in mA)is = 11.45 mA\n",

        "The electronic efficiency(in %)is = 19.49 %\n"

       ]

      }

     ],

     "prompt_number": 10

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Eg9.5.1:pg-415"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "import math\n",

      "#(a) Calculate the gain parameter\n",

      "I0=30*(10**-3)     #Beam current in ampere\n",

      "V0=3*(10**3)       #Beam voltage in volt\n",

      "Z0=10              #characteristic impedance of the helix in ohms\n",

      "C=(((I0*Z0)/(4*V0))**(1/3.0)) \n",

      "print\"The gain parameter is =\",\"{:.2e}\".format(C) \n",

      "\n",

      "#(b) Calculate the output power gain in dB\n",

      "N=50             #Crcular length\n",

      "Ap=-9.54+(47.3*N*round(C,4)) \n",

      "print\"The output power gain (in dB) is =\",round(Ap,2),\"dB\"\n",

      "\n",

      "#(c) Calculate the four propagation constants\n",

      "f=10*(10**9)     #frequency in Hertz\n",

      "V0=3*(10**3)     #beam voltage in volt\n",

      "w=2*(math.pi)*f  #nagular frequency in Hertz\n",

      "v0=0.593*(10**6)*sqrt(V0) \n",

      "Be=w/v0 \n",

      "Be=int(Be/10)\n",

      "Be=Be*10\n",

      "r1=(-1*Be*round(C,4)*(round((sqrt(3)/2),2)))+1j*Be*(1+(round(C,4)/2)) \n",

      "X=round(r1.real,2)\n",

      "Y=int(r1.imag)\n",

      "r1=X+1j*Y\n",

      "print\"The four propagation constants are:\"\n",

      "print\"\\nThe first propagtaion constant is =\",r1    #value of imaginary part is wrong in book\n",

      "r2=(Be*round(C,4)*(round((sqrt(3)/2),2)))+1j*Be*(1+(round(C,4)/2))\n",

      "X=round(r2.real,2)\n",

      "Y=int(r2.imag)\n",

      "r2=X+1j*Y\n",

      "print\"The second propagtaion constant is =\",r2   #value of imaginary part is wrong in book\n",

      "r3=1j*Be*(1-round(C,4)) \n",

      "print\"The third propagtaion constant is =\",r3    #answer is wrong in book\n",

      "r4=(-1*1j*Be*(1-((C**3)/4)))\n",

      "r4=0+1j*round(r4.imag)\n",

      "print\"The fourth propagtaion constant is =\",r4"

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The gain parameter is = 2.92e-02\n",

        "The output power gain (in dB) is = 59.52 dB\n",

        "The four propagation constants are:\n",

        "\n",

        "The first propagtaion constant is = (-49.03+1958j)\n",

        "The second propagtaion constant is = (49.03+1958j)\n",

        "The third propagtaion constant is = 1873.644j\n",

        "The fourth propagtaion constant is = -1930j\n"

       ]

      }

     ],

     "prompt_number": 15

    },

    {

     "cell_type": "heading",

     "level": 2,

     "metadata": {},

     "source": [

      "Eg9.7.1:pg-427"

     ]

    },

    {

     "cell_type": "code",

     "collapsed": false,

     "input": [

      "#(a) Calculate the number of electrons returned per second\n",

      "Ir=0.85         #returned current in ampere\n",

      "q=1.6*(10**-19) #electronic charge in C\n",

      "Nr=Ir/q \n",

      "print\"The number of electrons returned (per second)  is =\",\"{:.2e}\".format(Nr),\"electrons/s\" \n",

      "\n",

      "#(b)Calculate the Energy associated with these returning electrons in 20ms\n",

      "V=-11*(10**3)   #overdepreesion collector voltage in volt\n",

      "V=-1*V\n",

      "t=20*(10**-3)   #in seconds\n",

      "W=V*Nr*t \n",

      "print\"The Energy associated with these returning electrons in 20ms(in eV) is =\",\"{:.3e}\".format(W),\"eV\"\n",

      "\n",

      "#(c) Calculate the Power for returning electrons\n",

      "P=V*Ir \n",

      "P=P/1000   #in KW\n",

      "print\"The Power for returning electrons(in KW)is =\",P,\"KW\" \n",

      "\n",

      "#(d) Calculate the Heat in calories associated with the returning electrons(a factor for converting joules to calories is 0.238)\n",

      "t=20*(10**-3)  #in seconds\n",

      "H=0.238*P*1000*t \n",

      "print\"The Heat associated with the returning electrons(in calories)is =\",round(H,2),\"calories\"\n",

      "\n",

      "#(e) Calculate the temperature\n",

      "mass=250*(10**-3)    #mass of heated iron pole piece in gram\n",

      "specific_heat=0.108 \n",

      "T=round(H,2)/(mass*specific_heat) \n",

      "print\"The temperature(in degree Celsius)is =\",round(T,2),\"degree celsius\"\n",

      "\n",

      "#(f) Calculate whether the output iron pole piece is melted\n",

      "print\"The output iron pole piece is melted\""

     ],

     "language": "python",

     "metadata": {},

     "outputs": [

      {

       "output_type": "stream",

       "stream": "stdout",

       "text": [

        "The number of electrons returned (per second)  is = 5.31e+18 electrons/s\n",

        "The Energy associated with these returning electrons in 20ms(in eV) is = 1.169e+21 eV\n",

        "The Power for returning electrons(in KW)is = 9.35 KW\n",

        "The Heat associated with the returning electrons(in calories)is = 44.51 calories\n",

        "The temperature(in degree Celsius)is = 1648.52 degree celsius\n",

        "The output iron pole piece is melted\n"

       ]

      }

     ],

     "prompt_number": 16

    }

   ],

   "metadata": {}

  }

 ]

}