diff options
author | hardythe1 | 2015-06-17 11:14:34 +0530 |
---|---|---|
committer | hardythe1 | 2015-06-17 11:14:34 +0530 |
commit | afcd9e5397e3e1bde0392811d0482d76aac391dc (patch) | |
tree | 228eab879488f9e1fb3250347e225c2ceee6f6a3 /sample_notebooks/KumarRaju/Chapter12.ipynb | |
parent | 251a07c4cbed1a5a960f5ed416ce6ac13c8152b7 (diff) | |
download | Python-Textbook-Companions-afcd9e5397e3e1bde0392811d0482d76aac391dc.tar.gz Python-Textbook-Companions-afcd9e5397e3e1bde0392811d0482d76aac391dc.tar.bz2 Python-Textbook-Companions-afcd9e5397e3e1bde0392811d0482d76aac391dc.zip |
add books
Diffstat (limited to 'sample_notebooks/KumarRaju/Chapter12.ipynb')
-rwxr-xr-x | sample_notebooks/KumarRaju/Chapter12.ipynb | 647 |
1 files changed, 647 insertions, 0 deletions
diff --git a/sample_notebooks/KumarRaju/Chapter12.ipynb b/sample_notebooks/KumarRaju/Chapter12.ipynb new file mode 100755 index 00000000..d309457b --- /dev/null +++ b/sample_notebooks/KumarRaju/Chapter12.ipynb @@ -0,0 +1,647 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:2259086c8cee958c316a471676c823626713e37889548ae1aff2070252fca121"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12:Power System Transients"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E1 - Pg 30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "rc=.5e-2;\n",
+ "rs=1.5e-2;\n",
+ "u=4\n",
+ "\n",
+ "L=2e-7 * math.log(rs/rc);\n",
+ "print '%s %.2f %s' %(\"\\nL=\",L*1e7,\"e-7H/m\")\n",
+ "C=u*1e-9/(18 * math.log(rs/rc))\n",
+ "print '%s %.2f %s' %(\"\\nC=\", C*1e9,\"e-9F/m\")\n",
+ "v=1/math.sqrt(L*C);\n",
+ "print '%s %.2f %s' %(\"\\nv=\", v*1e-8,\"e8m/s\")\n",
+ "Zc=math.sqrt(L/C)\n",
+ "print '%s %.2f %s' %(\"\\nZc=\",Zc,\"ohm\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "L= 2.20 e-7H/m\n",
+ "\n",
+ "C= 0.20 e-9F/m\n",
+ "\n",
+ "v= 1.50 e8m/s\n",
+ "\n",
+ "Zc= 32.96 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E2 - Pg 32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "ef=100.;\n",
+ "Zc=400.;\n",
+ "Z=50.;\n",
+ "et=2.*ef*Z/(Z+Zc)\n",
+ "print '%s %.2f %s' %(\"Surge transmitted=\",et,\"kV\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Surge transmitted= 22.22 kV\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E3 - Pg 32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "ef=200.;\n",
+ "Zc=400.;\n",
+ "Z1=500.;\n",
+ "Z2=300.;\n",
+ "et=2.*ef*(Z1*Z2/(Z1+Z2))/((Z1*Z2/(Z1+Z2))+Zc)\n",
+ "print '%s %.2f %s' %(\"\\nSurge Voltage transmitted=\",et,\"kV\\n\")\n",
+ "it1=et/Z1;\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current transmitted=\",it1,\"kA\\n\")\n",
+ "it2=et/Z2;\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current transmitted=\",(it2*100.)/100.,\"kA\\n\")\n",
+ "er=et-ef;\n",
+ "print '%s %.2f %s' %(\"\\nSurge Voltage Reflected=\",er,\"kV\\n\")\n",
+ "ir=it1+it2-(ef/Zc)\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current Reflected=\",ir,\"kA\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Surge Voltage transmitted= 127.66 kV\n",
+ "\n",
+ "\n",
+ "Surge Current transmitted= 0.26 kA\n",
+ "\n",
+ "\n",
+ "Surge Current transmitted= 0.43 kA\n",
+ "\n",
+ "\n",
+ "Surge Voltage Reflected= -72.34 kV\n",
+ "\n",
+ "\n",
+ "Surge Current Reflected= 0.18 kA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E4 - Pg 35"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "E=100.\n",
+ "Zc=400.\n",
+ "L=4000.\n",
+ "\n",
+ "print '%s %.2f %s %.2f' %(\"et=\",2*E,\"math.exp( - %.1f t) KV\\n\",Zc/L)\n",
+ "print '%s %.2f %s %.2f' %(\"er=\",E,\"(2*math.exp( - %.1f t) -1) KV\\n\",Zc/L)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "et= 200.00 math.exp( - %.1f t) KV\n",
+ " 0.10\n",
+ "er= 100.00 (2*math.exp( - %.1f t) -1) KV\n",
+ " 0.10\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E7 - Pg 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "V=300e3\n",
+ "R=400.\n",
+ "k=1.5e-27\n",
+ "\n",
+ "E=10.\n",
+ "x=1.\n",
+ "e=1e-5\n",
+ "while (E>e):\n",
+ " f=(k*R*x**6.) +x -(2.*V)\n",
+ " df=(6.* k*R*x**5.) +1.\n",
+ " x1=x-(f/df)\n",
+ " E=abs(x1-x)\n",
+ " x=x1\n",
+ "eA=round(x)\n",
+ "IA=k*eA**6.\n",
+ "\n",
+ "print '%s %.2f %s %.2f' %(\"eA=\",eA,\"Ia=\",IA)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eA= 97101.00 Ia= 1257.28\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E8 - Pg 36"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "V=300e3\n",
+ "R1=400.\n",
+ "R2=50.\n",
+ "R=1.+(400./50.)\n",
+ "k=1.5e-27\n",
+ "\n",
+ "E=10.\n",
+ "x=1.\n",
+ "e=1e-5\n",
+ "while (E>e) :\n",
+ " f=(k*R1*x**6.) +(R*x) -(2.*V)\n",
+ " df=(6.* k*R1*x**5.) +R\n",
+ " x1=x-(f/df)\n",
+ " E=abs(x1-x)\n",
+ " x=x1\n",
+ "eA=round(x)\n",
+ "IA=k*eA**6.\n",
+ "\n",
+ "print '%s %.2f %s %.2f' %(\"eA=\",eA,\"Ia=\",IA)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "eA= 62640.00 Ia= 90.62\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E9 - Pg 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "\n",
+ "ef=3000.;\n",
+ "Zc=300.;\n",
+ "ea=1700.;\n",
+ "iF=ef/Zc\n",
+ "print '%s %.2f %s' %(\"\\nCurrent in line=\",iF,\"kA\\n\")\n",
+ "Ia=((2.*ef)-ea)/Zc\n",
+ "print '%s %.2f %s' %(\"\\nCurrent through Arrester=\",Ia,\"kA\\n\")\n",
+ "Ia=round(Ia *1000.)/1000.\n",
+ "R=ea/Ia\n",
+ "print '%s %.2f %s' %(\"\\nresistance of arrester=\",R,\"ohm\\n\")\n",
+ "er=ea-ef;\n",
+ "print '%s %.2f %s' %(\"\\nSurge Voltage Reflected=\",er,\"kV\\n\")\n",
+ "Cr=er/ef;\n",
+ "CR=ea/ef;\n",
+ "print '%s %.2f %s %.2f' %(\"\\nCoeff of Reflection =\",Cr,\"Coeff of Refraction=\",CR)\n",
+ "Cr=(R-Zc)/(R+Zc);\n",
+ "CR=(R*2)/(R+Zc);\n",
+ "print '%s %.2f %s %.2f' %(\"\\nVerification: Coeff of Reflection =\",Cr,\"Coeff of Refraction=\",CR)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Current in line= 10.00 kA\n",
+ "\n",
+ "\n",
+ "Current through Arrester= 14.33 kA\n",
+ "\n",
+ "\n",
+ "resistance of arrester= 118.61 ohm\n",
+ "\n",
+ "\n",
+ "Surge Voltage Reflected= -1300.00 kV\n",
+ "\n",
+ "\n",
+ "Coeff of Reflection = -0.43 Coeff of Refraction= 0.57\n",
+ "\n",
+ "Verification: Coeff of Reflection = -0.43 Coeff of Refraction= 0.57\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E10 - Pg 45"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "ef=10000.;\n",
+ "Zc=400.;\n",
+ "iF=ef/Zc\n",
+ "print '%s %.2f' %(\"\\n(a)\\nIncident Wave magnitude= A\",iF)\n",
+ "\n",
+ "R=1000\n",
+ "et=ef*(R*2)/(R+Zc);\n",
+ "it=et/R;\n",
+ "er=et-ef;\n",
+ "print '%s %.2f' %(\"\\n(b)\\nSurge Voltage Reflected= KV\",er/1000)\n",
+ "ir=-1*er/Zc\n",
+ "print '%s %.2f' %(\"\\nSurge Current Reflected= A\",ir)\n",
+ "edr=et*it;\n",
+ "print '%s %.2f' %(\"\\nRate of dissipation of energy= KW\",edr/1000)\n",
+ "err=er*-ir;\n",
+ "print '%s %.2f' %(\"\\nRate of reflection of energy= KW\",err/1000)\n",
+ "\n",
+ "print '%s %.2f' %(\"\\n(c)\\nfor complete dissipation, R=Zc= ohm\",Zc);\n",
+ "\n",
+ "R=50\n",
+ "et=ef*(R*2)/(R+Zc);\n",
+ "print '%s %.2f' %(\"\\n(d)\\nSurge Voltage Transmitted= KV\",et/1000)\n",
+ "it=et/R;\n",
+ "print '%s %.2f' %(\"\\nSurge Current Transmitted= A\",it)\n",
+ "er=et-ef;\n",
+ "print '%s %.2f' %(\"\\nSurge Voltage Reflected= kV\",er/1000)\n",
+ "ir=-1*er/Zc\n",
+ "print '%s %.2f' %(\"\\nSurge Current Reflected= A\",ir)\n",
+ "edr=et*it;\n",
+ "print '%s %.2f' %(\"\\nRate of dissipation of energy= KW\",edr/1000)\n",
+ "err=er*-ir;\n",
+ "print '%s %.2f' %(\"\\nRate of reflection of energy= KW\",err/1000)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(a)\n",
+ "Incident Wave magnitude= A 25.00\n",
+ "\n",
+ "(b)\n",
+ "Surge Voltage Reflected= KV 4.29\n",
+ "\n",
+ "Surge Current Reflected= A -10.71\n",
+ "\n",
+ "Rate of dissipation of energy= KW 204.08\n",
+ "\n",
+ "Rate of reflection of energy= KW 45.92\n",
+ "\n",
+ "(c)\n",
+ "for complete dissipation, R=Zc= ohm 400.00\n",
+ "\n",
+ "(d)\n",
+ "Surge Voltage Transmitted= KV 2.22\n",
+ "\n",
+ "Surge Current Transmitted= A 44.44\n",
+ "\n",
+ "Surge Voltage Reflected= kV -7.78\n",
+ "\n",
+ "Surge Current Reflected= A 19.44\n",
+ "\n",
+ "Rate of dissipation of energy= KW 98.77\n",
+ "\n",
+ "Rate of reflection of energy= KW 151.23\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E11 - Pg 46"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "Zc=400.\n",
+ "ef=20.\n",
+ "z1=150.;\n",
+ "z2=200.\n",
+ "z=round((z1*z2/(z1+z2))*100.)/100.\n",
+ "\n",
+ "et=2*ef*z/(Zc+z)\n",
+ "print '%s %.2f %s' %(\"\\nSurge Voltage Transmitted=\",et,\"kV\\n\")\n",
+ "\n",
+ "it1=et*1000./z1;\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current Transmitted in line 1=\",it1,\"A\\n\")\n",
+ "\n",
+ "it2=et*1000./z2;\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current Transmitted in line 2=\",it2,\"A\\n\")\n",
+ "\n",
+ "er=et-ef\n",
+ "print '%s %.2f %s' %(\"\\nSurge Voltage Reflected=\",er,\"kV\\n\")\n",
+ "ir=-1*er*1000./Zc\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current Reflected=\",ir,\"A\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Surge Voltage Transmitted= 7.06 kV\n",
+ "\n",
+ "\n",
+ "Surge Current Transmitted in line 1= 47.06 A\n",
+ "\n",
+ "\n",
+ "Surge Current Transmitted in line 2= 35.29 A\n",
+ "\n",
+ "\n",
+ "Surge Voltage Reflected= -12.94 kV\n",
+ "\n",
+ "\n",
+ "Surge Current Reflected= 32.35 A\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E12 - Pg 49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "ef=100.\n",
+ "Zc=400.\n",
+ "z=50.\n",
+ "R=z+Zc;\n",
+ "E=(2.*ef/(Zc+z+R))**2. *R\n",
+ "E=round(E*100.)/100.\n",
+ "print '%s %.2f %s %s %.2f %s' %(\"\\n(a)Energy transfer max when R=\",R,\"ohm\\n\",\"energy=\",E,\"KW\\n\");\n",
+ "etB=2.*ef*z/(z+Zc+R);\n",
+ "etB=round(etB*100.)/100.\n",
+ "print '%s %.2f %s' %(\"\\n(b)Surge Voltage Transmitted=\",etB,\"kV\\n\")\n",
+ "it=etB*1000./z;\n",
+ "it=round(it*100.)/100.\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current Transmitted =\",it,\"A\\n\")\n",
+ "etA=2.*ef*(z+R)/(z+Zc+R);\n",
+ "etA=round(etA*100.)/100.\n",
+ "erA=etA-ef\n",
+ "print '%s %.2f %s' %(\"\\n(c)Surge Voltage Reflected=\",erA,\"kV\\n\")\n",
+ "irA=-1.*erA*1000./Zc\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current Reflected=\",irA,\"A\\n\")\n",
+ "iF=ef*1000./Zc\n",
+ "Pi=ef*iF\n",
+ "print '%s %.2f %s' %(\"\\n(d)Power Incident=\",Pi,\"kW\\n\")\n",
+ "Pr=erA*-irA\n",
+ "print '%s %.2f %s' %(\"\\nPower Reflected=\",Pr,\"kW\\n\")\n",
+ "Pt=erA*it\n",
+ "print '%s %.2f %s' %(\"\\nPower Transmitted=\",Pt,\"kW\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "(a)Energy transfer max when R= 450.00 ohm\n",
+ " energy= 22.22 KW\n",
+ "\n",
+ "\n",
+ "(b)Surge Voltage Transmitted= 11.11 kV\n",
+ "\n",
+ "\n",
+ "Surge Current Transmitted = 222.20 A\n",
+ "\n",
+ "\n",
+ "(c)Surge Voltage Reflected= 11.11 kV\n",
+ "\n",
+ "\n",
+ "Surge Current Reflected= -27.77 A\n",
+ "\n",
+ "\n",
+ "(d)Power Incident= 25000.00 kW\n",
+ "\n",
+ "\n",
+ "Power Reflected= 308.58 kW\n",
+ "\n",
+ "\n",
+ "Power Transmitted= 2468.64 kW\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E14 - Pg 50"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "I=5.;\n",
+ "z1=400.\n",
+ "z2=50.\n",
+ "V=I * z1* z2/(z2+z1)\n",
+ "print '%s %.2f %s' %(\"\\nSurge Voltage Transmitted=\",V,\"kV\\n\")\n",
+ "ic=V/z2\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current Transmitted in cable=\",ic,\"kA\\n\")\n",
+ "\n",
+ "io=-V/z1;\n",
+ "print '%s %.2f %s' %(\"\\nSurge Current Transmitted in OH line=\",io,\"kA\\n\")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Surge Voltage Transmitted= 222.22 kV\n",
+ "\n",
+ "\n",
+ "Surge Current Transmitted in cable= 4.44 kA\n",
+ "\n",
+ "\n",
+ "Surge Current Transmitted in OH line= -0.56 kA\n",
+ "\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example E16 - Pg 51"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math \n",
+ "i=100.\n",
+ "L=4e-3\n",
+ "C=300e-12\n",
+ "E=i* math.sqrt(L/C)\n",
+ "T=1./ math.sqrt(L*C)\n",
+ "print '%s %.2f %s %.2f' %(\"e=\",E/1e3,\"*1e3 sin( %.3f *1e6 t) kV\",T/1e6)\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "e= 365.15 *1e3 sin( %.3f *1e6 t) kV 0.91\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |