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
|
{
"metadata": {
"name": "chapter7.ipynb"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 7: Antenna Synthesis and Continuous Sources"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 7.1, Page no. 392"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"#In this example the values of a1,a2,a3,a4 are found\n",
"#the values of z1 z2 z3 are substituted in the equation AF=(z-z1)(z-z2)(z-z3)\n",
"a1=-1\n",
"a2=1\n",
"a3=-1\n",
"a4=1\n",
"print \"The values of a1, a2, a3 and a4 are %d, %d, %d and %d respectively\"%(a1,a2,a3,a4)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The values of a1, a2, a3 and a4 are -1, 1, -1 and 1 respectively\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 7.3, Page no. 398"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import numpy as np\n",
"import scipy.integrate as integrate\n",
"a=np.zeros(11)\n",
"for m in range(0,11):\n",
" a[m]=integrate.quad(lambda x: exp(-1j*m*x) , (-pi/sqrt(2)) , (pi/sqrt(2)))[0]\n",
"maxval = a[0]\n",
"for i in range(0,11):\n",
" if maxval<a[i]:\n",
" maxval = a[i]\n",
"\n",
"print 'Normalized Co-efficients:';\n",
"for i in range(0,11):\n",
" a[i]=a[i]/maxval\n",
" print 'a',i,':',a[i]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"Normalized Co-efficients:\n",
"a 0 : 1.0\n",
"a 1 : 0.358187786013\n",
"a 2 : -0.216954294377\n",
"a 3 : 0.0558163210177\n",
"a 4 : 0.0577652398568\n",
"a 5 : -0.0894712295755\n",
"a 6 : 0.0518110265309\n",
"a 7 : 0.0101104236117\n",
"a 8 : -0.0495750638142\n",
"a 9 : 0.0455187541912\n",
"a 10 : -0.00996721500244\n"
]
}
],
"prompt_number": 26
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
|