"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"",
"import math",
"f_c_ol=100.0;",
"A_ol_mid=100000.0;",
"f=0.0;",
"A_ol=A_ol_mid/(math.sqrt(1+(f/f_c_ol)**2))",
"print('open loop gain when f=0Hz is %f'%A_ol);",
"f=10.0;",
"A_ol=A_ol_mid/(math.sqrt(1+(f/f_c_ol)**2))",
"print('open loop gain when f=10Hz is %f'%A_ol)",
"f=100.0;",
"A_ol=A_ol_mid/(math.sqrt(1+(f/f_c_ol)**2))",
"print('open loop gain when f=100Hz is %f'%A_ol)",
"f=1000.0;",
"A_ol=A_ol_mid/(math.sqrt(1+(f/f_c_ol)**2))",
"print('open loop gain when f=1000Hz is %f'%A_ol)"
],
"language": "python",
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"open loop gain when f=0Hz is 100000.000000",
"open loop gain when f=10Hz is 99503.719021",
"open loop gain when f=100Hz is 70710.678119",
"open loop gain when f=1000Hz is 9950.371902"
]
}
],
"prompt_number": 8
},
{
"cell_type": "markdown",
"source": [
"
Example 12.9,Page Number: 413
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"",
"import math",
"f_c=100.0;",
"f=1.0;",
"theta_rad=-math.atan((f/f_c))",
"theta=theta_rad*180/math.pi;",
"print('phase lag when f=1Hz = %f degrees'%theta)",
"",
"f=10.0;",
"theta_rad=-math.atan((f/f_c))",
"theta=theta_rad*180/math.pi;",
"print('phase lag when f=10Hz = %f degrees'%theta)",
"f=100.0;",
"theta_rad=-math.atan((f/f_c))",
"theta=theta_rad*180/math.pi; ",
"print('phase lag when f=100Hz = %f degrees'%theta)",
"f=1000.0;",
"theta_rad=-math.atan((f/f_c))",
"theta=theta_rad*180/math.pi;",
"print('phase lag when f=1000Hz = %f degrees'%theta)",
"f=10000.0;",
"theta_rad=-math.atan((f/f_c))",
"theta=theta_rad*180/math.pi;",
"print('phase lag when f=10000Hz = %f degrees'%theta)"
],
"language": "python",
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"phase lag when f=1Hz = -0.572939 degrees",
"phase lag when f=10Hz = -5.710593 degrees",
"phase lag when f=100Hz = -45.000000 degrees",
"phase lag when f=1000Hz = -84.289407 degrees",
"phase lag when f=10000Hz = -89.427061 degrees"
]
}
],
"prompt_number": 9
},
{
"cell_type": "markdown",
"source": [
"
Example 12.10, Page Number: 415
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"",
"import math",
"A_v1=40.0; #all gains are in decibels",
"A_v2=32.0;",
"A_v3=20.0;",
"f_c1=2*10**3;",
"f_c2=40*10**3;",
"f_c3=150*10**3;",
"f=f_c1;",
"A_ol_mid=A_v1+A_v2+A_v3;",
"#theta 1",
"theta_rad1=-math.atan((f/f_c1))",
"theta1=theta_rad1*180/math.pi;",
"",
"#theta 2",
"theta_rad2=-math.atan((f/f_c2))",
"theta2=theta_rad2*180/math.pi;",
"",
"#theta 3",
"theta_rad3=-math.atan((f/f_c3))",
"theta3=theta_rad3*180/math.pi;",
"",
"theta_tot=theta1+theta2+theta3;",
"print('open loop midrange gain in decibels is %d'%A_ol_mid)",
"print('total phase lag in degrees is %d'%theta_tot)"
],
"language": "python",
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"open loop midrange gain in decibels is 92",
"total phase lag in degrees is -45"
]
}
],
"prompt_number": 10
},
{
"cell_type": "markdown",
"source": [
"