summaryrefslogtreecommitdiff
path: root/Microwave_and_Radar_Engineering/Chapter_8.ipynb
blob: 7dc18da5c5c840e56a7c0fd54f27da960bea17ef (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
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
{
 "metadata": {
  "name": "",
  "signature": "sha256:35777e633db88a5618cd88c47986862d4ccaaacc3cda8478283a81851ed8d31c"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "Chapter 8: Microwave Tubes and Circuits"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.1, Page number 336"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vo = 14.5*10**3      #beam voltage(V)\n",
      "i = 1.4              #beam current(A)\n",
      "f = 10*10**9         #frequency(Hz)\n",
      "rho_o = 10**-6       #dc electron charge density(c/m^3)\n",
      "rho = 10**-8         #RF charge density(c/m^3)\n",
      "V = 10**5            #velocity perturbations(m/s)\n",
      "eo = 8.854*10**-12\n",
      "R = 0.4\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "vo = 0.593*10**6*math.sqrt(Vo)        #dc electron velocity\n",
      "\n",
      "#Part b\n",
      "w = 2.*math.pi*f\n",
      "ip = w/vo                             #dc phase current\n",
      "\n",
      "#Part c\n",
      "wp = math.sqrt((1.759*10**11*rho_o)/eo)\n",
      "\n",
      "#Part d\n",
      "wq = R*wp\n",
      "\n",
      "#Part e\n",
      "Jo = rho_o * vo\n",
      "\n",
      "#Part f\n",
      "J = rho*vo+rho_o*V\n",
      "\n",
      "#Results\n",
      "print \"dc electron velocity =\",round((vo/1E+8),3),\"*10**8 m/sec\"\n",
      "print \"dc phase curent =\",round(ip,2),\"rad/sec (Calculation mistake in the textbook)\"\n",
      "print \"plasma frequency =\",round((wp/1E+8),2),\"*10**8 rad/sec\"\n",
      "print \"Reduced plasma frequency =\",round((wq/1E+8),3),\"*10**8 rad/sec\"\n",
      "print \"dc beam current density =\",round(Jo,2), \"A/m^2\"\n",
      "print \"instantaeneous beam current density =\",round(J,3),\"A/m^2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "dc electron velocity = 0.714 *10**8 m/sec\n",
        "dc phase curent = 879.92 rad/sec (Calculation mistake in the textbook)\n",
        "plasma frequency = 1.41 *10**8 rad/sec\n",
        "Reduced plasma frequency = 0.564 *10**8 rad/sec\n",
        "dc beam current density = 71.41 A/m^2\n",
        "instantaeneous beam current density = 0.814 A/m^2\n"
       ]
      }
     ],
     "prompt_number": 73
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.2, Page number 337"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Av = 15.              #voltage gain(dB)\n",
      "Pin = 5*10**-3       #input power(W)\n",
      "Rsh_in = 30*10**3    #Rsh of input cavity(Ohms)\n",
      "Rsh_out = 20.*10**3   #Rsh of output cavity(Ohms)\n",
      "Rl = 40*10**4        #load impedance(Ohms)\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "V1 = math.sqrt(Pin*Rsh_in)       #input rms voltage\n",
      "\n",
      "#Part b\n",
      "#Av = 20log(V2/V1) db\n",
      "V2 = V1*10**(Av/20)             #deriving V2 from above equation\n",
      "\n",
      "#Part c\n",
      "Pout = (V2**2)/Rsh_out           #output power\n",
      "\n",
      "#Results\n",
      "print \"input rms voltage =\",round(V1,2),\"V\"\n",
      "print \"output rms voltage =\",round(V2,2),\"V\"\n",
      "print \"output power =\",round((Pout/1E-3),2),\"mW\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "input rms voltage = 12.25 V\n",
        "output rms voltage = 68.87 V\n",
        "output power = 237.17 mW\n"
       ]
      }
     ],
     "prompt_number": 50
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.3, Page number 338"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "n = 2               #no. of modes\n",
      "Vo = 300            #beam voltage(V)\n",
      "Io = 20*10**-3      #beam current(A)\n",
      "J1X = 1.25\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "Pdc = Vo*Io         #input power\n",
      "\n",
      "#Part b\n",
      "Pac = (2*Pdc*J1X)/(2*math.pi*n-(math.pi/2))\n",
      "\n",
      "#Part c\n",
      "N = (Pac/Pdc)*100.  #efficiency\n",
      "\n",
      "\n",
      "#Results\n",
      "print \"Input power =\",round(Pdc,2),\"W\"\n",
      "print \"Output power =\",round(Pac,2),\"W\"\n",
      "print \"Efficiency =\",round(N,2),\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Input power = 6.0 W\n",
        "Output power = 1.36 W\n",
        "Efficiency = 22.74 %\n"
       ]
      }
     ],
     "prompt_number": 60
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.4, Page number 338"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Varaible declaration\n",
      "Vo = 900           #beam voltage(V)\n",
      "Io = 30*10**-3     #beam current(A)\n",
      "f = 8*10**9        #frequency(Hz)\n",
      "d = 1*10**-3       #gap spacing in either cavity(m)\n",
      "L = 4*10**-2       #spacing between centers of cavities(m)\n",
      "Rsh = 40*10**3     #effective shunt impedance(Ohms)\n",
      "J1X = 0.582\n",
      "X = 1.841\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "vo = 0.593*10**6*math.sqrt(Vo)\n",
      "\n",
      "#Part b\n",
      "To = L/vo\n",
      "\n",
      "#Part c\n",
      "w = 2*math.pi*f\n",
      "theta_o = w*To\n",
      "theta_g = (w*d)/vo\n",
      "Bo = math.sin(theta_g/2)/(theta_g/2)\n",
      "V1_max = (Vo*3.68)/(Bo*theta_o)\n",
      "\n",
      "#Part d\n",
      "Ro = Vo/Io\n",
      "Av = ((Bo**2)*theta_o*J1X*Rsh)/(Ro*X)\n",
      "\n",
      "#Results\n",
      "print \"Electron velocity =\",round((vo/1E+6),2),\"*10**6 m/sec\"\n",
      "print \"dc transit time of electrons =\",round((To/1E-8),3),\"*10**-8 sec\"\n",
      "print \"Maximum input voltage =\",round(V1_max,3),\"V\"\n",
      "print \"Volatge gain =\",round(Av,3),\"V\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Electron velocity = 17.79 *10**6 m/sec\n",
        "dc transit time of electrons = 0.225 *10**-8 sec\n",
        "Maximum input voltage = 41.923 V\n",
        "Volatge gain = 23.278 V\n"
       ]
      }
     ],
     "prompt_number": 86
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.5, Page number 339"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vo = 1200.         #beam voltage(V)\n",
      "Io = 28*10**-3     #beam current(A)\n",
      "f = 8*10**9        #frequency(Hz)\n",
      "d = 1*10**-3       #gap spacing in either cavity(m)\n",
      "L = 4.*10**-2      #spacing between centers of cavities(m)\n",
      "Rsh = 40*10**3     #effective shunt impedance(Ohms)\n",
      "J1X = 0.582\n",
      "X = 1.841\n",
      "Go = 23.3*10**-6\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "vo = 0.593*10**6*math.sqrt(Vo)\n",
      "w = 2*math.pi*f\n",
      "theta_o = (w*L)/vo\n",
      "theta_g = (w*d)/vo\n",
      "Bo = math.sin(theta_g/2)/(theta_g/2)\n",
      "V1_max = (Vo*3.68)/(Bo*theta_o)\n",
      "\n",
      "#Part b\n",
      "Ro = Vo/Io\n",
      "Av = ((Bo**2)*theta_o*J1X*Rsh)/(Ro*X)\n",
      "\n",
      "#Part c\n",
      "V2 = 2*Io*J1X*Bo*Rsh\n",
      "N = ((0.58*V2)/Vo)*100\n",
      "\n",
      "#Part d\n",
      "Gb = (Go*((Bo**2)-(Bo*math.cos(theta_g))))/2\n",
      "Rb = 1/Gb\n",
      "\n",
      "#Results\n",
      "print \"The input microwave voltage V1 in order to generate maximum output voltage is\",round(V1_max,2),\"V\"\n",
      "print \"The voltage gain (reflecting beam loading in the output cavity) is\",round(Av,3)\n",
      "print \"The efficiency of the amplifier neglecting beam loading is\",round(N,3),\"%\" \n",
      "print \"The beam loading conductance is\",round((Rb/1E+3),2),\"K Ohms (Calculation mistake in the textbook)\"\n",
      "print \"The value of\",round((Rb/1E+3),2),\"K Ohms is very much comparable to Rsh and cannot be neglected because theta_g is quite high\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The input microwave voltage V1 in order to generate maximum output voltage is 58.71 V\n",
        "The voltage gain (reflecting beam loading in the output cavity) is 17.058\n",
        "The efficiency of the amplifier neglecting beam loading is 48.427 %\n",
        "The beam loading conductance is 72.68 K Ohms (Calculation mistake in the textbook)\n",
        "The value of 72.68 K Ohms is very much comparable to Rsh and cannot be neglected because theta_g is quite high\n"
       ]
      }
     ],
     "prompt_number": 111
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.6, Page number 341"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vo = 500.          #beam voltage(V)\n",
      "Rsh = 20*10**3     #effective shunt impedance(Ohms)\n",
      "f = 8*10**9        #frequency(Hz)\n",
      "L = 1.*10**-3      #spacing between centers of cavities(m)\n",
      "n = 2\n",
      "e_m = 1.759*10**11\n",
      "V1 = 200\n",
      "J1X = 0.582\n",
      "\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "w = 2*math.pi*f\n",
      "x = (e_m*((2*math.pi*n)-(math.pi/2))**2)/(8*(w**2)*(L**2))\n",
      "y = math.sqrt(Vo/x)\n",
      "Vr = y+Vo\n",
      "\n",
      "#Part b\n",
      "Bo = 1              #Assumption\n",
      "Io = V1/(2*J1X*Rsh)\n",
      "\n",
      "#Part c\n",
      "vo = 0.593*10**6*math.sqrt(Vo)\n",
      "theta_o = (w*2*L*vo)/(e_m*(Vr+Vo))\n",
      "Bi = 1                             #Assumption\n",
      "X_dash = (V1*theta_o)/(2*Vo)\n",
      "X = 1.51                           #from graph\n",
      "J1X = 0.84\n",
      "N = ((2*J1X)/((2*math.pi*n)-(math.pi/2)))*100\n",
      "\n",
      "#Results\n",
      "print \"The value of repeller voltage is\",round(Vr,2),\"V (Calculation mistake in the textbook)\"\n",
      "print \"The dc necesaary to give the microwave gap of voltage of 200V is\",round((Io/1E-3),2),\"mA\"\n",
      "print \"The elctron efficiency is\", round(N,2),\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The value of repeller voltage is 1189.36 V (Calculation mistake in the textbook)\n",
        "The dc necesaary to give the microwave gap of voltage of 200V is 8.59 mA\n",
        "The elctron efficiency is 15.28 %\n"
       ]
      }
     ],
     "prompt_number": 41
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.7, Page number 342"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "n = 1               #no. of modes\n",
      "Pdc = 40*10**-3     #input power(W)\n",
      "V1_Vo = 0.278          #ratio\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "N = (V1_Vo*3*math.pi)/4\n",
      "\n",
      "#Part b \n",
      "Pout = (8.91*Pdc)/100\n",
      "\n",
      "#Part c\n",
      "Pl = (Pout*80)/100\n",
      "\n",
      "#Results\n",
      "print \"The efficiency of the reflex klystron is\",round(N,3)\n",
      "print \"The total power output is\",round((Pout/1E-3),2),\"W\"\n",
      "print \"The power delivered to the load is\",round((Pl/1E-3),2),\"W\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        " The efficiency of the reflex klystron is 0.655\n",
        "The total power output is 3.56 W\n",
        "The power delivered to the load is 2.85 W\n"
       ]
      }
     ],
     "prompt_number": 23
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.8, Page number 343"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "a = 0.15            #inner raddius(m)\n",
      "b = 0.45            #outer radius(m)\n",
      "Bo = 1.2*10**-3     #magnetic flux density(Wb/m^2)\n",
      "Vo = 6000.          #beam voltage(V)\n",
      "e = 1.759*10**11\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "V = (e*Bo*(b**2)*(1-(a**2/b**2))**2)/8\n",
      "\n",
      "#Part b\n",
      "Bc = math.sqrt(8*Vo)/(e**2)*b*(1-(a**2/b**2))**2\n",
      "\n",
      "#Part c\n",
      "wc = (e*Bo)/(math.pi*2)\n",
      "\n",
      "\n",
      "#Results\n",
      "print \"Please note that here are calculation errors in this problem. Hence, the difference in answers\\n\"\n",
      "print \"Hull cut-off voltage =\",round((V/1E+3),2),\"kV\"\n",
      "print \"Cut-off magnetic flux density =\",((Bc/1E-3)),\"mwb/m^2\"\n",
      "print \"Cyclotron frequency =\",round(wc,2),\"Hz\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Please note that here are calculation errors in this problem. Hence, the difference in answers\n",
        "\n",
        "Hull cut-off voltage = 4221.6 kV\n",
        "Cut-off magnetic flux density = 2.51765610822e-18 mwb/m^2\n",
        "Cyclotron frequency = 33594425.39 Hz\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.9, Page number 343"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "d = 2*10**-3         #diameter of helical TWT(m)\n",
      "n = 50.              #no. of turns per cm\n",
      "v = 3*10**8          #velocity of light(m/s)\n",
      "m = 9.1*10**-31      #mass of electron\n",
      "e = 1.6*10**-19      #charge on electron\n",
      "\n",
      "#Calculations\n",
      "p = 1/n*10**-2       #pitch(m)\n",
      "c = math.pi*d        #circumference(m)\n",
      "Vp = (v*p)/c     \n",
      "\n",
      "Vo = (m*(Vp**2))/(2*e)\n",
      "\n",
      "#Results\n",
      "print \"Axial phase velociity =\",round(Vp,2),\"m/sec\"\n",
      "print \"Anode voltage =\",round(Vo,2),\"V(Calculation mistake in the textbook)\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Axial phase velociity = 9549296.59 m/sec\n",
        "Anode voltage = 259.32 V(Calculation mistake in the textbook)\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.10, Page number 344"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vo = 900              #beam voltage(V)\n",
      "Io = 30.*10**-3       #beam current(A)\n",
      "f = 8.*10**9          #frequency(Hz)\n",
      "d = 1.*10**-3         #gap spacing in either cavity(m)\n",
      "L = 4.*10**-2         #spacing between centres of cavity(m)\n",
      "Rsh = 40.*10**3       #effective shunt impedance(Ohms)\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "vo = 0.593*10**6*math.sqrt(Vo)\n",
      "\n",
      "#Part b\n",
      "Tt = d/vo\n",
      "\n",
      "#Part c\n",
      "w = 2*math.pi*f\n",
      "theta_g = (w*d)/vo\n",
      "Bo = math.sin(theta_g/2)/(theta_g/2)   #Beam coupling coefficient\n",
      "theta_o = (w*L)/vo                     #dc transit angle\n",
      "#For maximum o/p volltage,\n",
      "J1X = 0.582\n",
      "X = 1.841\n",
      "V1max = (2*Vo*X)/(Bo*theta_o)\n",
      "\n",
      "#Part d\n",
      "Av = (Bo**2*theta_o*J1X*Rsh)/(Io*X)\n",
      "\n",
      "#Results\n",
      "print \"dc electron velocity =\",round((vo/1E+7),1),\"*10**7 m/sec\"\n",
      "print \"Transit time =\",round((Tt/1E-10),2),\"*10^-10 s\"\n",
      "print \"Input voltage for maximum output voltage =\",round(V1max,2),\"V\"\n",
      "print \"Voltage gain =\",round((Av/1E+6),2),\"dB\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "dc electron velocity = 1.8 *10**7 m/sec\n",
        "Transit time = 0.56 *10^-10 s\n",
        "Input voltage for maximum output voltage = 41.95 V\n",
        "Voltage gain = 23.28 dB\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.11, Page number 345"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vo = 20*10**3        #beam voltage(V)\n",
      "Io = 2               #beam current(A)\n",
      "f = 9*10**9          #frequency(Hz)\n",
      "rho_o = 10**-6       #dc electron charge density(c/m^3)\n",
      "rho = 10**-8         #RF charge density(c/m^3)\n",
      "V = 10**5            #velocity perturbations(m/s)\n",
      "eo = 8.854*10**-12\n",
      "R = 0.5\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "vo = 0.59*10**6*math.sqrt(Vo)\n",
      "\n",
      "#Part b\n",
      "w = 2.*math.pi*f\n",
      "ip = w/vo                             #dc phase current\n",
      "\n",
      "#Part c\n",
      "wp = math.sqrt((1.759*10**11*rho_o)/eo)\n",
      "\n",
      "#Part d\n",
      "wq = R*wp\n",
      "\n",
      "#Part e\n",
      "Jo = rho_o * vo\n",
      "\n",
      "#Part f\n",
      "J = rho*vo-rho_o*V\n",
      "\n",
      "#Results\n",
      "print \"dc electron velocity =\",round((vo/1E+7),3),\"*10**7 m/sec\"\n",
      "print \"dc phase constant =\",round(ip,2),\"rad/sec (Calculation mistake in the textbook)\"\n",
      "print \"plasma frequency =\",round((wp/1E+8),2),\"*10**8 rad/sec\"\n",
      "print \"Reduced plasma frequency =\",round((wq/1E+8),3),\"*10**8 rad/sec\"\n",
      "print \"dc beam current density =\",round(Jo,2), \"A/m^2\"\n",
      "print \"instantaeneous beam current density =\",round(J,2),\"A/m^2\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "dc electron velocity = 8.344 *10**7 m/sec\n",
        "dc phase constant = 677.73 rad/sec (Calculation mistake in the textbook)\n",
        "plasma frequency = 1.41 *10**8 rad/sec\n",
        "Reduced plasma frequency = 0.705 *10**8 rad/sec\n",
        "dc beam current density = 83.44 A/m^2\n",
        "instantaeneous beam current density = 0.73 A/m^2\n"
       ]
      }
     ],
     "prompt_number": 71
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.12, Page number 345"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "f = 5*10**9         #frequency(Hz)\n",
      "Vo = 1000           #operating voltage(V)\n",
      "n = 1.75            #no. of turns\n",
      "Vr = -500           #repeller voltage(V)\n",
      "d = 2*10**-3        #cavity gap(m)\n",
      "\n",
      "#Calculations\n",
      "w = 2*math.pi*f\n",
      "uo = 5.93*10**5*math.sqrt(Vo)\n",
      "theta_g = (w*d)/uo\n",
      "\n",
      "#Results\n",
      "print \"Transit angle =\",round(theta_g,2),\"radians\"\n",
      "print \"\\nThe length of drift region cannot be computed as the value of F is not given\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Transit angle = 3.35 radians\n",
        "\n",
        "The length of drift region cannot be computed as the value of F is not given\n"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.13, Page number 346"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "f = 10*10**9         #frequency(Hz)\n",
      "Vo = 1200            #beam voltage(V)\n",
      "Io = 30*10**-3       #beam current(A)\n",
      "d = 1*10**-3         #diameter(m)\n",
      "Rsh = 40*10**3       #shunt resistance(Ohms)\n",
      "L = 4*10**-2         #length(m)\n",
      "X = 1.84\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "vo = 0.59*10**6*math.sqrt(Vo)\n",
      "w = 2*math.pi*f\n",
      "theta_o = (w*L)/vo\n",
      "V1 = (2*X*Vo)/theta_o\n",
      "theta_g = (theta_o*d)/L\n",
      "Bi = (math.sin(theta_g/2))/(theta_g/2)\n",
      "V1max = V1/Bi\n",
      "\n",
      "#Part b\n",
      "J1X = 0.58      #from table\n",
      "I2 = 2*Io*J1X\n",
      "V2 = Bi*I2*Rsh\n",
      "A = V2/V1\n",
      "Av = 20*math.log10(A)\n",
      "\n",
      "#Part c\n",
      "N = ((0.58*V2)/Vo)*100\n",
      "\n",
      "#Results\n",
      "print \"Input RF voltage is\",round(V1max,2),\"V\" \n",
      "print \"Voltage gain is\",round(Av,2),\"dB\"\n",
      "print \"efficiency is\",round(N,2),\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Input RF voltage is 55.23 V\n",
        "Voltage gain is 28.03 dB\n",
        "efficiency is 43.75 %\n"
       ]
      }
     ],
     "prompt_number": 17
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.14, Page number 347"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "Vo = 30*10**3        #beam voltage(V)\n",
      "Io = 80              #beam current(A)\n",
      "Bo = 0.01            #Wb/m**2\n",
      "a = 4*10**-2         #length of magnetron(m)\n",
      "b = 8*10**-2         #breadth of magnetron(m)\n",
      "e = 1.6*10**-19      #charge on electron(C)\n",
      "m = 9.1*10**-31      #mass of electron\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "w = (e*Bo)/m\n",
      "\n",
      "#Part b\n",
      "Vhc = (e*(Bo**2)*(b**2)*((1-((a/b)**2))**2))/(8*m)\n",
      "\n",
      "#PArt c\n",
      "Bc = ((8*Vo*(m/e))**0.5)/(b*(1-((a/b)**2)))\n",
      "\n",
      "#Results\n",
      "print \"Cyclotron angular frequency =\",round((w/1E+9),3),\"*10**9 rad/s\"\n",
      "print \"Hull cut-off voltage =\",round((Vhc/1E+3),3),\"kV\"\n",
      "print \"Cut-off magnetic flux density =\",round((Bc/1E-3),3),\"mWb/m**2\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Cyclotron angular frequency = 1.758 *10**9 rad/s\n",
        "Hull cut-off voltage = 7.912 kV\n",
        "Cut-off magnetic flux density = 19.472 mWb/m**2\n"
       ]
      }
     ],
     "prompt_number": 26
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.15, Page number 348"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "n = 2            #mode\n",
      "Vo = 280         #beam volatge(V)\n",
      "Io = 22*10**-3   #beam current(A)\n",
      "V1 = 30          #signal voltage(V)\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "Pdc = Vo*Io\n",
      "\n",
      "#Part b\n",
      "J1X = 1.25       #from table\n",
      "Pac = (2*Pdc*J1X)/((2*n*math.pi)-(math.pi/2))\n",
      "\n",
      "#Part c\n",
      "N = (Pac/Pdc)*100\n",
      "\n",
      "#Results\n",
      "print \"Input power =\",round(Pdc,2),\"W\"\n",
      "print \"Output power =\",round(Pac,2),\"W\"\n",
      "print \"Efficiency =\",round(N,2),\"%\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Input power = 6.16 W\n",
        "Output power = 1.4 W\n",
        "Efficiency = 22.74 %\n"
       ]
      }
     ],
     "prompt_number": 28
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example 8.16, Page number 348"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "f = 8*10**9        #frequency(Hz)\n",
      "Vo = 300           #beam voltage(V)\n",
      "Rsh = 20*10**3     #shunt resistance(Ohms)\n",
      "L = 1*10**-3       #length(m)\n",
      "V1 = 200           #gap voltage(V)\n",
      "e_m = 1.759*10**11\n",
      "n = 2              #mode\n",
      "\n",
      "#Calculations\n",
      "#Part a\n",
      "w = 2*math.pi*f\n",
      "x = (e_m*((2*math.pi*n)-(math.pi/2))**2)/(8*(w**2)*(L**2))\n",
      "y = math.sqrt(Vo/x)\n",
      "Vr = y+Vo\n",
      "\n",
      "#Part b\n",
      "Bo = 1             #assumption\n",
      "J1X = 0.582        #from table\n",
      "Io = V1/(2*J1X*Rsh)\n",
      "\n",
      "#Results\n",
      "print \"Repeller voltage =\",round(Vr,3),\"V\"\n",
      "print \"Beam current =\",round((Io/1E-3),2),\"mA\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Repeller voltage = 833.98 V\n",
        "Beam current = 8.59 mA\n"
       ]
      }
     ],
     "prompt_number": 37
    }
   ],
   "metadata": {}
  }
 ]
}