summaryrefslogtreecommitdiff
path: root/basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter4_QnODdtI.ipynb
diff options
context:
space:
mode:
authorTrupti Kini2016-11-24 23:30:37 +0600
committerTrupti Kini2016-11-24 23:30:37 +0600
commit3727ade10dd304eb7a596cac7adb00302953e402 (patch)
tree664e414e47c97a577af8ede629a1026f4c5c97b9 /basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter4_QnODdtI.ipynb
parente2984baaac8ec023123503a40110435e68d62756 (diff)
downloadPython-Textbook-Companions-3727ade10dd304eb7a596cac7adb00302953e402.tar.gz
Python-Textbook-Companions-3727ade10dd304eb7a596cac7adb00302953e402.tar.bz2
Python-Textbook-Companions-3727ade10dd304eb7a596cac7adb00302953e402.zip
Added(A)/Deleted(D) following books
A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter11.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter12.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter13.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter14.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter15.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter16.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter18.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter19.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter2.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter20.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter21.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter22.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter23.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter5.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter6.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter8.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/Chapter9.ipynb A Electrical_&_Electronic_Systems_by_Neil_Storey/screenshots/pic1.png A Electrical_&_Electronic_Systems_by_Neil_Storey/screenshots/pic2.png A Electrical_&_Electronic_Systems_by_Neil_Storey/screenshots/pic3.png A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_67BmtXx.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_LGPoR7F.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_PDCS2qh.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_lNjLAte.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_n5s4jXl.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_npy5vv0.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter10_pjpRgex.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_IE4byFL.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_RAQoou9.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_VcicGy5.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_hoqMFBX.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_iBTGbp8.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_k1rTVhh.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_nGrFEGY.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter11_pfzLlc6.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_1FJHa67.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_2wryDDQ.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_BuZVTIP.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_UCsno1y.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_Yd7uN6t.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_bGP3Wsd.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter1_pFJzyF5.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_242icmu.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_Rcy1wii.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_TvxYpxT.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_VU0Vuul.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_Xiz19Ms.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_rAG8C10.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter2_xUN650b.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_0WKL8dM.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_BsRbQCe.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_IF7BAbT.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_Qh2uphO.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_WS64jkH.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_aM1BqRM.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter3_tEQK8Lr.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_0E18xYL.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_4P7HQZZ.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_8GR2j3i.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_KE5ki12.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_LmrwpIC.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_ZuWrQKN.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter4_wUtoaip.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_0Ke5Vhq.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_23aeJMe.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_4a14Khd.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_eftppGy.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_jOQv5Ua.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_m75AW4e.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter5_mZ9916M.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_2OboaPO.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_Cf1Ae70.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_IZI7GIy.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_TRm6El0.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_WfVJQIc.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_Z5dEk19.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter6_z9FlTqT.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_6BR5OK6.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_FV7Jgrb.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_Q79Sp1O.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_Qhj9HPA.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_fBoE3j3.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_mFOxHz2.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter8_zNY63b3.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_039FJN6.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_0AhnrOb.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_8K1gGKx.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_E4M5MRA.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_Ivqhz8T.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_ZSvbidk.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/Chapter9_u7ekl0N.ipynb A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/screenshots/ch1_mHmqCLQ.png A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/screenshots/ch_9_UicjBqW.png A MECHANICS_OF_SOLIDS_by_S.S._Bhavikatti/screenshots/ch_xk3ylh6.png A basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter2_eh02mMg.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter4_QnODdtI.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter5_IwMblyq.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/chapter11_nHcyQSN.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/chapter1_ivpTi0v.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/chapter3.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/chapter6_7Vcvq3x.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/chapter7_Iro5ijO.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/chapter8_dRxKPQv.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/chapter9_QP9exWK.ipynb A basic_electrical_engineering_by_nagsarkar_and_sukhija/screenshots/chap1_gG9EuuG.png A basic_electrical_engineering_by_nagsarkar_and_sukhija/screenshots/chapter2_RW9JXUw.png A basic_electrical_engineering_by_nagsarkar_and_sukhija/screenshots/chapter6_kNIRtlM.png
Diffstat (limited to 'basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter4_QnODdtI.ipynb')
-rw-r--r--basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter4_QnODdtI.ipynb1638
1 files changed, 1638 insertions, 0 deletions
diff --git a/basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter4_QnODdtI.ipynb b/basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter4_QnODdtI.ipynb
new file mode 100644
index 00000000..99569ba7
--- /dev/null
+++ b/basic_electrical_engineering_by_nagsarkar_and_sukhija/Chapter4_QnODdtI.ipynb
@@ -0,0 +1,1638 @@
+{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4:Alternating quantities"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.1:Page number-193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "e(t)=0 V\n",
+ "e(t)= 362.58 V\n",
+ "e(t)= 418.67 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math \n",
+ "#given\n",
+ "b=0.2\n",
+ "a=0.04\n",
+ "n=1000/float(60) #rev/sec\n",
+ "t=500\n",
+ "#case a\n",
+ "#since coil is at right angles ang=0\n",
+ "print \"e(t)=0 V\"\n",
+ "#case b\n",
+ "#when coil is 30deg to the field ang=60\n",
+ "#p=math.sin(60) \n",
+ "p=0.8660254\n",
+ "e=2*3.14*a*n*b*t*p\n",
+ "print \"e(t)=\",format(e,'.2f'),\"V\"\n",
+ "#case c\n",
+ "#when ang=90 that is coil is in the plane of the field\n",
+ "#p=math.sin(90)\n",
+ "p=1\n",
+ "e=2*3.14*b*a*n*p*t\n",
+ "print \"e(t)=\",format(e,'.2f'),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "## Example 4.2:Page number-202"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "t= 0.0167 sec\n",
+ "f= 60.0 Hz\n",
+ "t= -0.0014 sec\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#given\n",
+ "vm=155\n",
+ "omega=377\n",
+ "#case a\n",
+ "t=(2*3.14)/float(omega)\n",
+ "print \"t=\",format(t,'.4f'),\"sec\"\n",
+ "#case b\n",
+ "f=1/float(t)\n",
+ "print \"f=\",format(f,'.1f'),\"Hz\"\n",
+ "#case c\n",
+ "v=109.60 #rms value\n",
+ "#at t=0 -77.5=155*sin(ang)\n",
+ "#therefore, ang=-0.5236 rad\n",
+ "ang=-0.5236\n",
+ "t=ang/omega\n",
+ "print \"t=\",format(t,'.4f'),\"sec\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.3"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "i= 10.0 A\n",
+ "f= 50.0 A\n",
+ "i= 0.15 A\n",
+ "NOTE:Answer calculated wrongly in textbook for i obtained here\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#given\n",
+ "#i=14.14*sin(314t)-->i=im*sin(omega*t)\n",
+ "#case a\n",
+ "im=14.14\n",
+ "i=14.14/1.414 #1.414 is the value of root 2\n",
+ "print \"i=\",format(i,'.1f'),\"A\"\n",
+ "#case b\n",
+ "#omega=314=2*3.14*f\n",
+ "f=314/float(2*3.14)\n",
+ "print \"f=\",format(f,'.1f'),\"A\"\n",
+ "#case c\n",
+ "t=0.002\n",
+ "#i=im*sin(omega*t)\n",
+ "p=0.01096 #value of sin(omega*t)\n",
+ "i=im*p\n",
+ "print \"i=\",format(i,'.2f'),\"A\" \n",
+ "print \"NOTE:Answer calculated wrongly in textbook for i obtained here\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.4:Page number-203"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "I= 24.496 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "i=20\n",
+ "im=i/float(1.414) #that is i*root 2\n",
+ "#the heat produced by i is the sum of heat produced by dc and ac current\n",
+ "p=i**2\n",
+ "q=im**2\n",
+ "r=p+q\n",
+ "I=(r**0.5)\n",
+ "print \"I=\",format(I,'.3f'),\"A\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.5"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "i= 0.2 A\n",
+ "i= 1.4 A\n",
+ "NOTE:The answer given in text is printed wrongly\n",
+ "t= 0.00333 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "f=50\n",
+ "irms=10\n",
+ "im=irms/float(0.707)\n",
+ "#omega*t=2*3.14*f*t here the value for t can be substituted and value for i can be found from i=im*sin(omega*t)\n",
+ "t=0.0025\n",
+ "p=0.0137 #value of sin(314*0.0025)\n",
+ "i=(10*p)/float(0.707)\n",
+ "print \"i=\",format(i,'.1f'),\"A\"\n",
+ "#maximum value is when 314*t=pi/2 (in radians)-->t=0.005\n",
+ "#hence at t=0.005+0.0125=0.0175 the value of i nedds to be found\n",
+ "p=0.0957\n",
+ "i=(10*p)/float(0.707)\n",
+ "print \"i=\",format(i,'.1f'),\"A\"\n",
+ "print \"NOTE:The answer given in text is printed wrongly\"\n",
+ "i=7.07\n",
+ "#7.07=(10*sin314t)/0.707-->t=0.00833 sec\n",
+ "t=0.00833-0.005 #the time at which the instaneous value is 7.07A after positive maximum value is at this time\n",
+ "print \"t=\",format(t,'.5f'),\"A\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.6:Page number-204"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "v= 25.79 V\n",
+ "vavg= 20.0 v\n",
+ "1.28937969582\n",
+ "1.93891683582\n",
+ "rms value for a sin wave with the same peak value is= 35.35 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#from graph \n",
+ "a=0\n",
+ "b=5**2\n",
+ "c=10**2\n",
+ "c=20**2\n",
+ "d=40**2\n",
+ "e=50**2\n",
+ "f=40**2\n",
+ "g=20**2\n",
+ "h=10**2\n",
+ "i=5**2\n",
+ "v=(0.1*(a+b+c+d+e+f+g+h+i))**0.5 #pi and omega values get cancelled\n",
+ "print \"v=\",format(v,'.2f'),\"V\"\n",
+ "vavg=0.1*(0+5+10+20+40+50+40+20+10+5)\n",
+ "print \"vavg=\",format(vavg,'.1f'),\"v\"\n",
+ "ff=v/float(vavg)\n",
+ "print ff\n",
+ "pf=50/float(v) #50 is the maximum value\n",
+ "print pf\n",
+ "v=0.707*50 \n",
+ "print \"rms value for a sin wave with the same peak value is=\",format(v,'.2f'),\"V\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.8:Page number-210"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "vac= 130.77 v\n",
+ "phase position with respect to vbc=60-36.59=23.41\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#from phasor diagram vac=vab+vbc\n",
+ "hcab=60\n",
+ "vcab=60\n",
+ "hcbc=45\n",
+ "vcbc=77.94 #vbc=60*sin(60)\n",
+ "p=(vcab+hcbc)**2\n",
+ "q=vcbc**2\n",
+ "vac=((p+q)**0.5)\n",
+ "print \"vac=\",format(vac,'.2f'),\"v\"\n",
+ "#the angle is given by ang=taninverse(vcbc/(vcab+hcbc))=36.59\n",
+ "print \"phase position with respect to vbc=60-36.59=23.41\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.10:Page number-215"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "a+b=22.72+j2.12\n",
+ "a/b=-0.13+j0.74\n",
+ "Thus (a+b)/(a-b) gives -0.24-j0.81\n",
+ "(a+b*b/(a-b)*a)=-1.01+j0.5\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#a=6.34+j*13.59\n",
+ "#b=20angle(35)\n",
+ "#case a-->(a+b)\n",
+ "#in polar form a=15 at angle 65\n",
+ "#in rectangular form b=16.38-j*11.47\n",
+ "#a+b=6.34+j13.59+16.38-j11.47=22.72+j2.12\n",
+ "print \"a+b=22.72+j2.12\"\n",
+ "#a/b=15angle(65)/20angle(-35)=0.75angle(100)=-0.13+j0.74\n",
+ "print \"a/b=-0.13+j0.74\"\n",
+ "#a-b=-10.04+j25.06\n",
+ "print \"Thus (a+b)/(a-b) gives -0.24-j0.81\"\n",
+ "#(a+b)*b/(a-b)*a\n",
+ "print \"(a+b*b/(a-b)*a)=-1.01+j0.5\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "I=7.5+j4.75. Its value in polar form is obtained as 8.8776 at angle 32.34\n",
+ "instantaneous value of resultant i is 12.5548*sin(314t+32.34)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#i1=20*sin(314t+60),i2=-10*sin(314t),i3=15*sin(314t-45)-->angles are in degrees\n",
+ "#I1=(7.7072+j12.25),I2=(-7.072),I3=7.5-j7.5\n",
+ "#adding phasor currents I1,I2 and I3\n",
+ "#I=7.702+j12.25-7.702+7.5-j7.5=7.5+j4.75\n",
+ "print \"I=7.5+j4.75. Its value in polar form is obtained as 8.8776 at angle 32.34\"\n",
+ "#i=2**0.5*8.8776*sin(314t+32.34)-->instantaneous value of resultant i\n",
+ "print \"instantaneous value of resultant i is 12.5548*sin(314t+32.34)\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "## Example 4.12:Page number-226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "i= 12.35 A\n",
+ "phase angle of current=57.52 lag\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "v=230\n",
+ "f=50\n",
+ "L=50*10**-3\n",
+ "r=10\n",
+ "#case a\n",
+ "xl=2*3.14*f*L\n",
+ "z=complex(r,xl)\n",
+ "#the value of z in polar form is 18.62 ohm\n",
+ "z=18.62\n",
+ "i=v/float(z)\n",
+ "print \"i=\",format(i,'.2f'),\"A\"\n",
+ "#case b\n",
+ "#phy=taninverse(xl/r)=57.52 lag\n",
+ "print \"phase angle of current=57.52 lag\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "v= 279.21 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "vr=150\n",
+ "r=50\n",
+ "l=250*10**-3\n",
+ "f=50\n",
+ "i=vr/r\n",
+ "xl=2*3.14*f*l\n",
+ "vl=i*xl\n",
+ "v=(((vr**2)+(vl**2))**0.5)\n",
+ "print \"v=\",format(v,'.2f'),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "0.6875\n",
+ "power consumed= 500.0 w\n",
+ "power consumed in choke oil= 187.5 W\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "v=200\n",
+ "f=50\n",
+ "r=20\n",
+ "vr=100\n",
+ "vc=144\n",
+ "vl=150\n",
+ "#case a\n",
+ "#from eqn ((vr**2+vl*cos(angle))**2)+((vl*sin(angle))**2)=v**2\n",
+ "#on substituting values in the above eqn the value of angle can be found by isolating cos\n",
+ "#angle=75.52\n",
+ "cos=0.25\n",
+ "pf=(vr+vl*cos)/float(v)\n",
+ "print pf\n",
+ "#case b\n",
+ "i=vr/r\n",
+ "power=i**2*r\n",
+ "print \"power consumed=\",format(power,'.1f'),\"w\"\n",
+ "#case c\n",
+ "power=vl*i*cos\n",
+ "print \"power consumed in choke oil=\",format(power,'.1f'),\"W\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.15:Page number-230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " xc= 31.85 ohm\n",
+ "i= 6.89 A\n",
+ "0.299580587178\n",
+ "phase angle=72.6\n",
+ "v= 68.9 v\n",
+ "v= 219.4 v\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r=10\n",
+ "c=10**-4\n",
+ "v=230\n",
+ "f=50\n",
+ "omega=314\n",
+ "#case a\n",
+ "xc=1/float(omega*c)\n",
+ "print \"xc=\",format(xc,'.2f'),\"ohm\"\n",
+ "#case b\n",
+ "zc=33.38 #zc=10-j31.85 into polar form is 33.38\n",
+ "i=v/zc\n",
+ "print \"i=\",format(i,'.2f'),\"A\"\n",
+ "#case c\n",
+ "pf=r/zc\n",
+ "print pf\n",
+ "#case d\n",
+ "#phase angle=cosinverse(0.3)=72.6\n",
+ "print \"phase angle=72.6\"\n",
+ "#case e\n",
+ "v=r*i\n",
+ "print \"v=\",format(v,'.1f'),\"v\"\n",
+ "v=xc*i\n",
+ "print \"v=\",format(v,'.1f'),\"v\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.16:Page number-230"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "vc= 207.12 v\n",
+ "c= 0.00007688 F\n",
+ "maximum voltage across c= 292.92 V\n",
+ "phase angle=64.2\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "v=230\n",
+ "f=50\n",
+ "#voltage vr across r is in phase with the current i while voltage vc across c lage i by 90\n",
+ "#from phasor diagram v**2=vr**2+vc**2\n",
+ "vr=100\n",
+ "vc=((v**2)-(vr**2))**0.5\n",
+ "print \"vc=\",format(vc,'.2f'),\"v\"\n",
+ "p=500 #power\n",
+ "i=p/vr\n",
+ "c=i/float(2*3.14*f*vc)\n",
+ "print \"c=\",format(c,'.8f'),\"F\"\n",
+ "#case b\n",
+ "v=(2**0.5)*vc\n",
+ "print \"maximum voltage across c=\",format(v,'.2f'),\"V\"\n",
+ "#case c\n",
+ "#phase angle=cosinverse(vr/v)=cosinverse(0.4348)=64.2\n",
+ "print \"phase angle=64.2\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.17:Page number-234"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "xl= 47.1 ohm\n",
+ "xc= 25.48 ohm\n",
+ "complex impedance=8+j21.62 at an impedance angle of 69.7\n",
+ "current= 9.98 A\n",
+ "voltage across coil=446.8 at 10.66 degrees\n",
+ "voltage across capacitor=-254.29 at -159.7 degrees\n",
+ "phase difference between supply and current i is 69.7 lag\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r=8\n",
+ "l=0.15\n",
+ "f=50\n",
+ "v=230\n",
+ "c=125*10**-6\n",
+ "#case a inductive reactance\n",
+ "xl=2*3.14*f*l\n",
+ "print \"xl=\",format(xl,'.1f'),\"ohm\"\n",
+ "#case b capacitance reactance\n",
+ "xc=1/float(2*3.14*f*c)\n",
+ "print 'xc=',format(xc,'.2f'),\"ohm\"\n",
+ "#case c complex impedance\n",
+ "#z=r+j(xl-xc)-->on substituting valuees we get z=8+j21.62\n",
+ "#z=((8**2)+(21.62**2))**0.5\n",
+ "print \"complex impedance=8+j21.62 at an impedance angle of 69.7\"\n",
+ "#impedance angle=taninverse(xl-xr)/r\n",
+ "#case d\n",
+ "v=230\n",
+ "z=23.05\n",
+ "i=v/z\n",
+ "print \"current=\",format(i,'.2f'),\"A\"\n",
+ "#case e\n",
+ "#(r+jxl)*i=446.8 at 10.66 degrees\n",
+ "print \"voltage across coil=446.8 at 10.66 degrees\"\n",
+ "#-j*xc*i=25.48*9.98\n",
+ "print \"voltage across capacitor=-254.29 at -159.7 degrees\"\n",
+ "#case e\n",
+ "print 'phase difference between supply and current i is 69.7 lag'\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.18:Page number-235 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "capacitive reactance= 63.7 ohm\n",
+ "f= 50.0 cycles/sec\n",
+ "power loss in iron cored choke is= 53.69 w\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "c=50*10**-6\n",
+ "i=2.355\n",
+ "#case a\n",
+ "vl=120\n",
+ "vr=70\n",
+ "vac=150\n",
+ "#the phasor sum of vr and vl is OC;the applied voltage v is the phasor sum of vc and OC and is represented by OV\n",
+ "#the theta be the impedance angle of RL combination\n",
+ "#from right angled triangle OCD,theta can be determined as follows:\n",
+ "#(vr+vl*costheta)**2+(vl*costheta)**2=vac**2\n",
+ "#substitute the values then value of costheta can be found\n",
+ "zl=vl/i #impedance of the coil\n",
+ "p=0.981 #value of sin(79)\n",
+ "xl=zl*p\n",
+ "q=0.19 #value of cos(79)\n",
+ "r=zl*q\n",
+ "dc=i*xl\n",
+ "bd=i*r\n",
+ "#from right angled triangle ODB in fig.\n",
+ "v=98.3\n",
+ "xc=vac/i\n",
+ "print \"capacitive reactance=\",format(xc,'.1f'),\"ohm\"\n",
+ "f=1/float(xc*2*3.14*c)\n",
+ "print \"f=\",format(f,'.1f'),\"cycles/sec\"\n",
+ "ploss=i**2*r\n",
+ "print \"power loss in iron cored choke is=\",format(ploss,'.2f'),\"w\"\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.19:Page number-238"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "i= 12.07 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r=20\n",
+ "l=200*10**-3\n",
+ "v=230\n",
+ "f=50\n",
+ "xl=314*l #314 is omega\n",
+ "ir=v/float(r)\n",
+ "il=v/float(xl)\n",
+ "i=((ir**2)+(il**2))**0.5\n",
+ "print \"i=\",format(i,'.2f'),\"A\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.20:Page number-240 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "current with a lead of 57.5 is obtained as= 4.13 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r=100\n",
+ "c=50*10**-6\n",
+ "f=50\n",
+ "v=230\n",
+ "#case a\n",
+ "xc=-1/float(314*c) #314 is omega\n",
+ "ir=v/r #with angle 0\n",
+ "ic=230/float(xc) #with angle of 90 deg\n",
+ "i=((ir**2)+(ic**2))**0.5\n",
+ "print \"current with a lead of 57.5 is obtained as=\",format(i,'.2f'),\"A\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.21:Page number-242"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "current at 56.76 lead= 4.196 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r=100\n",
+ "l=0.1\n",
+ "c=150*10**-6\n",
+ "v=230\n",
+ "f=50\n",
+ "#case a\n",
+ "xl=314*l #at 90 deg\n",
+ "xc=1/float(314*c) #at lag -90 deg\n",
+ "ir=v/r #at 0 deg\n",
+ "il=v/xl\n",
+ "ic=v/xc\n",
+ "#i=ir+ic+il-->2.3+j3.51\n",
+ "i=((2.3**2)+(3.51**2))**0.5\n",
+ "print \"current at 56.76 lead=\",format(i,'.3f'),\"A\"\n",
+ "\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "## Example 4.22:Page number-244"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The value of zbc is 8.159-j9.553\n",
+ "zac=18.159+j5.447(in rectangular form)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "z1=18.03 #z1=10+j15 converted to polar form also it is at angle 56.31\n",
+ "z2=32.02\n",
+ "z3=10.77\n",
+ "#ybc=1/zbc=(1/z2+1/z3)=1/32.02+1/10.77\n",
+ "#on performing the add operation we get the value of zbc as 8.159-j9.553 that is in rectangular form\n",
+ "print \"The value of zbc is 8.159-j9.553\"\n",
+ "#thus total impedance between terminals A and C is given by zac=z1+zbc\n",
+ "print \"zac=18.159+j5.447(in rectangular form)\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.23:Page number-246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "I= 5.76 A\n",
+ "z= 39.91 ohm\n",
+ "R= 36.97 ohm\n",
+ "x= -15.03 ohm\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r1=25\n",
+ "l1=0.159\n",
+ "r2=60\n",
+ "c=125*10**-6\n",
+ "v=230\n",
+ "f=50\n",
+ "#case a\n",
+ "xl=2*3.14*f*l1\n",
+ "z1=((r1**2)+(xl**2))**0.5\n",
+ "i1=v/z1\n",
+ "#phy1=cosinverse(r1/z1)=63.43 lag\n",
+ "xc=1/float(2*3.14**c)\n",
+ "z2=((r2**2)+(xc**2))**0.5\n",
+ "i2=v/z2\n",
+ "#i2 has 23 deg lead calculated similar to i1\n",
+ "#p=cosphy1\n",
+ "#q=cosphy2\n",
+ "p=0.44\n",
+ "q=0.92\n",
+ "I1=i1*p+i2*q\n",
+ "a=-0.89\n",
+ "b=0.39\n",
+ "I2=i1*a+i2*b\n",
+ "I=((I1**2)+(I2**2))**0.5\n",
+ "print \"I=\",format(I,'.2f'),\"A\"\n",
+ "#case b\n",
+ "z=v/I\n",
+ "print \"z=\",format(z,'.2f'),\"ohm\"\n",
+ "R=(z*I1)/I #note the value of I in text is printed wrongly so the result may vary\n",
+ "print \"R=\",format(R,'.2f'),\"ohm\"\n",
+ "x=(z*I2)/I #same note applicable here as well\n",
+ "print \"x=\",format(x,'.2f'),\"ohm\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.24:Page number-247"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "I1=6.78A\n",
+ "I2=13.22A\n",
+ "power loss in z1= 689.53 W\n",
+ "power loss in z2= 1398.15 W\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#given\n",
+ "#z1=15+j20\n",
+ "#z2=8-j10\n",
+ "I=20\n",
+ "z1=25 #in polar form at angle 53.13\n",
+ "z2=12.81 #at angle -51.34\n",
+ "#v=I1z1=I2z2\n",
+ "#I2=1.95I1\n",
+ "#from diagram I**2=(I1cosang1+I2cosang2)**2+(I2sinang2-I1sinang1)**2\n",
+ "#on substituting values in the above eqn and simplifying\n",
+ "I1=6.78\n",
+ "print \"I1=6.78A\"\n",
+ "I2=13.22\n",
+ "#substitute this in I2=1.95I1\n",
+ "print \"I2=13.22A\"\n",
+ "pow1=I1**2*15\n",
+ "pow2=I2**2*8\n",
+ "print \"power loss in z1=\",format(pow1,'.2f'),\"W\"\n",
+ "print \"power loss in z2=\",format(pow2,'.2f'),\"W\"\n",
+ "\n",
+ "\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.25:Page number-248"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "i1= 7.19 A\n",
+ "current lags by voltage 38.66\n",
+ "c= 0.00006218 F\n",
+ "ir= 5.606 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r=25\n",
+ "f=50\n",
+ "xl=20\n",
+ "v=230\n",
+ "#case a\n",
+ "#z1=r+jxl\n",
+ "z1=32 #in polar form\n",
+ "i1=v/float(z1)\n",
+ "print \"i1=\",format(i1,'.2f'),'A'\n",
+ "#case b\n",
+ "print \"current lags by voltage 38.66\"\n",
+ "#case c\n",
+ "p=0.78 #cos value\n",
+ "q=-0.62 #sin value\n",
+ "ir=i1*p\n",
+ "il=i1*q\n",
+ "#from phasor diagram current c is equal to il\n",
+ "ic=il=4.491\n",
+ "c=ic/float(v*2*3.14*50)\n",
+ "print \"c=\",format(c,'.8f'),\"F\"\n",
+ "#case d\n",
+ "print \"ir=\",format(ir,'.3f'),\"A\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.26:Page number-249"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(12.9596827495-2.78255122274j)\n",
+ "the phase angle is -12.11\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "z1=complex(6,-10)\n",
+ "z2=complex(10,15)\n",
+ "z3=complex(18,12)\n",
+ "#z1+z2 is parallel to z3\n",
+ "zab=z1+(z2*z3)/(z2+z3)\n",
+ "print zab\n",
+ "print \"the phase angle is -12.11\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.27:Page number-258"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "current at -63 lag is= 13.05 A\n",
+ "phase angle between supply voltage and current is -63\n",
+ "power= 3002.3 VA\n",
+ "active power= 1351.0 W\n",
+ "reactive power= 2672.0 VAR\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r=8\n",
+ "l=0.05\n",
+ "v=230\n",
+ "f=50\n",
+ "#case a\n",
+ "xl=2*3.14*f*l\n",
+ "zl=complex(r,xl)\n",
+ "zl=17.62\n",
+ "i=v/zl #since v=230 at angle 0 and zl in polar form has 63 deg i has a lag of 63\n",
+ "print \"current at -63 lag is=\",format(i,'.2f'),'A'\n",
+ "#case b\n",
+ "print \"phase angle between supply voltage and current is -63\"\n",
+ "#case c\n",
+ "power=v*i\n",
+ "print \"power=\",format(power,'.1f'),\"VA\"\n",
+ "#case d\n",
+ "p=0.45 #cos63\n",
+ "actpow=v*i*p\n",
+ "print \"active power=\",format(actpow,'.1f'),\"W\"\n",
+ "#case e\n",
+ "q=0.89 #sin63\n",
+ "reapow=v*i*q\n",
+ "print 'reactive power=',format(reapow,'.1f'),\"VAR\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.28:Page number-259"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "input= 13392.86 VA\n",
+ "active component= 40.76 A\n",
+ "reactive component= 41.34 A\n",
+ "reactive power= 9508.9 VAR\n",
+ "c= 0.00006218 F\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "v=230\n",
+ "f=50\n",
+ "pf=0.7\n",
+ "n=0.8\n",
+ "op=7500\n",
+ "#case a\n",
+ "ip=op/float(0.7*0.8)\n",
+ "print \"input=\",format(ip,'.2f'),\"VA\"\n",
+ "#case b\n",
+ "im=ip/v\n",
+ "p=0.71 #sin\n",
+ "activecompo=im*pf\n",
+ "print \"active component=\",format(activecompo,'.2f'),\"A\"\n",
+ "reacompo=p*im\n",
+ "print \"reactive component=\",format(reacompo,'.2f'),\"A\"\n",
+ "#case c\n",
+ "reacpow=p*ip\n",
+ "print \"reactive power=\",format(reacpow,'.1f'),\"VAR\"\n",
+ "#case d\n",
+ "cos=0.95\n",
+ "i=activecompo/cos\n",
+ "isin=13.40 #i*sinang=i*(1-cos**2)**0.5ic=28.18 #since i=ic+im\n",
+ "c=ic/float(2*3.14*f*v)\n",
+ "print \"c=\",format(c,'.8f'),\"F\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.29:Page number-266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "c= 0.00004057\n",
+ "i= 115.0 A\n",
+ "39.25\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#case a\n",
+ "l=0.25\n",
+ "f=50\n",
+ "v=230\n",
+ "r=2\n",
+ "c=1/float(((2*3.14*f)**2)*l)\n",
+ "print \"c=\",format(c,'.8f')\n",
+ "#case b\n",
+ "i=v/r\n",
+ "print \"i=\",format(i,'.1f'),\"A\"\n",
+ "#case c\n",
+ "vl=2*3.14*f*l*i\n",
+ "vc=i/float(c*2*3.14*f)\n",
+ "q=(2*3.14*f*l)/float(r)\n",
+ "print q"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.30:Page number-266"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 17,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "f0= 102.0860 Hz\n",
+ "f1= 101.2898 Hz\n",
+ "f2= 102.8822 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "l=10\n",
+ "r=100\n",
+ "i=1\n",
+ "f=100\n",
+ "i1=0.5\n",
+ "c=1/float(4*(3.14**2)*(r**2)*l)\n",
+ "v=i*r\n",
+ "z=v/i1\n",
+ "#z=100+jX\n",
+ "x=((200**2)-(100**2))**0.5\n",
+ "omega=641.1 #angular frequency in rad/sec\n",
+ "f0=omega/float(2*3.14)\n",
+ "f1=f0-(r/float(4*3.14*l))\n",
+ "f2=f0+(r/float(4*3.14*l))\n",
+ "print \"f0=\",format(f0,'.4f'),\"Hz\"\n",
+ "print \"f1=\",format(f1,'.4f'),\"Hz\"\n",
+ "print \"f2=\",format(f2,'.4f'),\"Hz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.31:Page number-271 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "l= 0.00507 H\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "v=3*10**8\n",
+ "lamb=3000\n",
+ "c=0.0005*10**-6\n",
+ "f=v/lamb\n",
+ "l=1/float(4*3.14*3.14*f**2*c)\n",
+ "print \"l=\",format(l,'.5f'),\"H\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.32:Page number-272"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "c= 0.0000000005599 F\n",
+ "z= 238130.4 ohm\n",
+ "i= 0.0000063 A\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "r=1500\n",
+ "l=0.2\n",
+ "v=1.5\n",
+ "f=15000\n",
+ "#case a\n",
+ "#p=1/0.2c\n",
+ "p=(4*3.14*3.14*f**2)+(r**2)/float(l**2)\n",
+ "c=1/float(0.2*p)\n",
+ "print \"c=\",format(c,'.13f'),\"F\"\n",
+ "#case b\n",
+ "z=l/float(c*r)\n",
+ "print \"z=\",format(z,'.1f'),\"ohm\"\n",
+ "#case c\n",
+ "i=v/float(z)\n",
+ "print \"i=\",format(i,'.7f'),\"A\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.33:Page number-274"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "v1 at -47.63 is= 18.80 V\n",
+ "v2 at -42.30 is= 21.55 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#the eqns are formed using the given diagram\n",
+ "#the derivations from the eqns are obtained as below using matrices for their construction\n",
+ "#the below eqns are in polar form\n",
+ "delta=0.3165\n",
+ "delta1=5.95\n",
+ "delta2=6.82\n",
+ "v1=delta1/delta\n",
+ "print \"v1 at -47.63 is=\",format(v1,'.2f'),\"V\"\n",
+ "v2=delta2/delta\n",
+ "print \"v2 at -42.30 is=\",format(v2,'.2f'),\"V\"\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.34:Page number-275 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "i at -84.21 is= -1.32 V\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#in polar form\n",
+ "z1=10\n",
+ "z2=12.806\n",
+ "z3=13.416\n",
+ "#the mesh currents are written in matrix form\n",
+ "delta=329.31 #in polar form\n",
+ "delta1=360\n",
+ "delta2=793.22\n",
+ "i1=delta1/delta\n",
+ "i2=delta2/delta\n",
+ "i=i1-i2 #answer obtained in text is wrongly printed\n",
+ "print \"i at -84.21 is=\",format(i,'.2f'),\"V\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.35:Page number-276 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(1.638+4.839j)\n",
+ "(0.732-5.144j)\n",
+ "(2.37-0.305j)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#superposition theorem\n",
+ "r=4\n",
+ "#z=4+(8+6j)*(0-j10)/8+j6+0-j10\n",
+ "#z=14-j5\n",
+ "z=14.87\n",
+ "l=40\n",
+ "#I1a=z/l=2.69 in polar form\n",
+ "I1a=complex(2.533,0.904)\n",
+ "I2a=complex(-0.324,-2.67)\n",
+ "#from fig c\n",
+ "z=complex(2.93,-9.47)\n",
+ "I1b=complex(-0.895,3.935)\n",
+ "I2b=complex(1.056,-2.474)\n",
+ "I1=I1a+I1b\n",
+ "print I1\n",
+ "I2=I2a+I2b\n",
+ "print I2\n",
+ "I=I1+I2\n",
+ "print I"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.36:Page number-278"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(3.07692307692+5.38461538462j)\n",
+ "(8.81695846645+9.55403833866j)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#thevenin's theorem\n",
+ "#all the values are derived from the figures\n",
+ "z1=complex(8,-6)\n",
+ "z2=complex(0,5)\n",
+ "zth=(z1*z2)/(z1+z2)\n",
+ "print zth\n",
+ "vth=complex(-17.71,141.54)\n",
+ "zload=complex(4,3)\n",
+ "I=vth/(zth+zload)\n",
+ "print I"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.37:Page number-279"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(8.8178913738+9.55271565495j)\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#norton's theorem\n",
+ "#values derived and calculated from figure\n",
+ "v=complex(230,0)\n",
+ "xl=complex(8,-6)\n",
+ "isc=v/xl\n",
+ "IN=isc\n",
+ "rl=complex(0,5)\n",
+ "zn=(rl*xl)/(rl+xl)\n",
+ "zload=complex(4,3)\n",
+ "I=(IN*zn)/(zn+zload)\n",
+ "print I"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 4.38:Page number-281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "I= 4.51 A\n",
+ "pl= 18.75 w\n"
+ ]
+ }
+ ],
+ "source": [
+ "import math\n",
+ "#all values derived from figure\n",
+ "#zth=complex(0.923,2.615)\n",
+ "#vth=complex(-4.615,-6.923) #derived using formula\n",
+ "#zl=complex(0.923,-2.615)\n",
+ "#z=zl+zth\n",
+ "vth=8.32 #polar form\n",
+ "z=1.846\n",
+ "I=vth/z\n",
+ "print \"I=\",format(I,'.2f'),\"A\"\n",
+ "rl=0.923\n",
+ "pl=(I**2)*rl\n",
+ "print \"pl=\",format(pl,'.2f'),\"w\""
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ },
+ {
+ "cell_type": "code",
+ "execution_count": null,
+ "metadata": {
+ "collapsed": true
+ },
+ "outputs": [],
+ "source": []
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 2",
+ "language": "python",
+ "name": "python2"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 2
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython2",
+ "version": "2.7.5"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}