"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Vmax = 282.8;# in Volts\n",
"w = 314;# in rad/sec\n",
"t = 0.004;# in sec\n",
"\n",
"#calculation:\n",
"#for a sine wave\n",
"Vrms = 0.707*Vmax\n",
"f = w/(2*math.pi)\n",
"v = Vmax*math.sin(w*t)\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)rms value = \",round(Vrms,2),\" V\\n\"\n",
"print \"\\n (b)frequency f = \",round(f,2),\" Hz\\n\"\n",
"print \"\\n (c)instantaneous value of voltage at 4 ms = \",round(v,2),\" V\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)rms value = 199.94 V\n",
"\n",
"\n",
" (b)frequency f = 49.97 Hz\n",
"\n",
"\n",
" (c)instantaneous value of voltage at 4 ms = 268.9 V"
]
}
],
"prompt_number": 8
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 10, page no. 202
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Vmax = 75;# in Volts\n",
"w = 200*math.pi;# in rad/sec\n",
"t = 0.004;# in sec\n",
"phi = 0.25;# in radians\n",
"\n",
"#calculation:\n",
"#for a sine wave\n",
"Vptp = 2*Vmax\n",
"Vrms = 0.707*Vmax\n",
"f = w/(2*math.pi)\n",
"T = 1/f\n",
"v = Vmax*math.sin(w*t)\n",
"phid = phi*180/math.pi\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a) Amplitude, or peak value = \",Vmax,\" V\\n\"\n",
"print \"\\n (b) Peak-to-peak value = \",Vptp,\" V\\n\"\n",
"print \"\\n (c)rms value = \",Vrms,\" V\\n\"\n",
"print \"\\n (d)periodic time, T = \",T,\" sec\\n\"\n",
"print \"\\n (e)frequency f = \",f,\" Hz\\n\"\n",
"print \"\\n (f)phase angle = \",round(phid,2),\"deg lagging\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a) Amplitude, or peak value = 75 V\n",
"\n",
"\n",
" (b) Peak-to-peak value = 150 V\n",
"\n",
"\n",
" (c)rms value = 53.025 V\n",
"\n",
"\n",
" (d)periodic time, T = 0.01 sec\n",
"\n",
"\n",
" (e)frequency f = 100.0 Hz\n",
"\n",
"\n",
" (f)phase angle = 14.32 deg lagging\n"
]
}
],
"prompt_number": 6
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 11, page no. 202
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Vmax = 40;# in Volts\n",
"T = 0.01;# in sec\n",
"v = -20;# when t = 0sec, in volts\n",
"t = 0;# in secs\n",
"\n",
"#calculation:\n",
"#for a sine wave\n",
"w = 2*math.pi/T\n",
"phir = math.asin(v/Vmax)\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n instantaneous voltage v = \", Vmax,\" sin(\",round(w,2),\"t\",round(phir,2),\") V\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" instantaneous voltage v = 40 sin( 628.32 t -0.52 ) V"
]
}
],
"prompt_number": 1
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"
Example 12, page no. 203
"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"\n",
"from __future__ import division\n",
"import math\n",
"#initializing the variables:\n",
"Imax = 120;# in Amperes\n",
"w = 100*math.pi;# in rad/sec\n",
"phi = 0.36;# in rad\n",
"t1 = 0;# in secs\n",
"t2 = 0.008;# in secs\n",
"i = 60;# in amperes\n",
"\n",
"#calculation:\n",
"#for a sine wave\n",
"f = w/(2*math.pi)\n",
"T = 1/f\n",
"phid = phi*180/math.pi\n",
"i0 = Imax*math.sin((w*t1)+phi)\n",
"i8 = Imax*math.sin((w*t2)+phi) \n",
"ti = (math.asin(i/Imax) - phi)/w\n",
"tm1 = (math.asin(Imax/Imax) - phi)/w\n",
"\n",
"\n",
"#Results\n",
"print \"\\n\\n Result \\n\\n\"\n",
"print \"\\n (a)Peak value = \", Imax,\" A, Periodic time T = \", T,\" sec, \"\n",
"print \" Frequency, f = \", f,\" Hz Phase angle = \",round(phid,2),\"deg leading\\n\"\n",
"print \"\\n (b) When t = 0, i = \",round(i0,2),\" A\\n\"\n",
"print \"\\n (c)When t = 8 ms = \", round(i8,2),\" A\\n\"\n",
"print \"\\n (d)When i is 60 A, then time t = \",round((ti/1E-3),2),\" ms\\n\"\n",
"print \"\\n (e)When the current is a maximum, time, t = \", round((tm1/1E-3),2),\" ms\\n\""
],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
"text": [
"\n",
"\n",
" Result \n",
"\n",
"\n",
"\n",
" (a)Peak value = 120 A, Periodic time T = 0.02 sec, \n",
" Frequency, f = 50.0 Hz Phase angle = 20.63 deg leading\n",
"\n",
"\n",
" (b) When t = 0, i = 42.27 A\n",
"\n",
"\n",
" (c)When t = 8 ms = 31.81 A\n",
"\n",
"\n",
" (d)When i is 60 A, then time t = 0.52 ms\n",
"\n",
"\n",
" (e)When the current is a maximum, time, t = 3.85 ms\n",
"\n"
]
}
],
"prompt_number": 3
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"