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
|
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "heading",
"level": 1,
"metadata": {},
"source": [
"Chapter 14 : Stability and Oscillators"
]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 14.1a, Page No 529"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#initialisation of variables\n",
"s1 = -46.2*(10**5)\n",
"s2 = -45.9*(10**6)\n",
"s3 = -11.4*(10**8)\n",
"s4 = -30.4*(10**8)\n",
"\n",
"#Calculations\n",
"#Zeros\n",
"s5 = 16.65*(10**9)\n",
"s6 = 15.4*(10**8)\n",
"s7 = -22.55*(10**8)\n",
"s = 6.28*(10**6)\n",
"B = 0.040\n",
"Ai = 410.0 #Gain\n",
"\n",
"n = s2/s1\n",
"print(\"The value of n= %.2f \" %n)\n",
"Q = (n*(1+(B*Ai)))**0.5/(n+1)\n",
"print(\"The value of Q = %.2f \" %Q)\n",
"k = 1.0/(2*Q)\n",
"print(\"The value of K = %.2f \" %K)\n",
"\n",
"s1f = s1*((n+1)/2)*(1-%i*((4*Q*Q)-1)**0.5)\n",
"\n",
"#Results\n",
"print(\"The first pole is = %.2f \" %s1f)\n",
"s2f = s1*((n+1)/2)*(1+%i*((4*Q*Q)-1)**0.5)\n",
"print(\"The second pole is = %.2f \" %s2f)\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (<ipython-input-1-fb03b3d691c3>, line 24)",
"output_type": "pyerr",
"traceback": [
"\u001b[1;36m File \u001b[1;32m\"<ipython-input-1-fb03b3d691c3>\"\u001b[1;36m, line \u001b[1;32m24\u001b[0m\n\u001b[1;33m s1f = s1*((n+1)/2)*(1-%i*((4*Q*Q)-1)**0.5)\u001b[0m\n\u001b[1;37m ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m invalid syntax\n"
]
}
],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Example 14.2a, Page No 529"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"import math\n",
"#initialisation of variables\n",
"Q=1.20\n",
"w1=45.9\n",
"w2=4.62\n",
"k=0.417\n",
"w0=Q*(w1+w2)\n",
"\n",
"#Calculations\n",
"fpeak=(w0/6.28)*math.sqrt(1.0-(2.0*(k**2.0)))\n",
"m=1.0/(2.0*k*(math.sqrt(1-(2.0*(k**2.0)))))\n",
"m2=20*math.log(m,10)\n",
"\n",
"#Results\n",
"print(\"The value of fpeak = %.2f MHZ\" %fpeak)\n",
"print(\"The value of overshoot = %.2f dB\" %m)\n",
"\n"
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"The value of fpeak = 7.80 MHZ\n",
"The value of overshoot = 1.48 dB\n"
]
}
],
"prompt_number": 2
}
],
"metadata": {}
}
]
}
|