diff options
75 files changed, 24939 insertions, 298 deletions
diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter1-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter1-checkpoint.ipynb new file mode 100755 index 00000000..f5b74a8b --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter1-checkpoint.ipynb @@ -0,0 +1,841 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter1:RELATIVISTIC MECHANICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.1:pg-12" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " the length of bar in is 0.66 m\n" + ] + } + ], + "source": [ + "# example 1\n", + "import math\n", + "#to calculate length of the bar measured by the ststionary observer\n", + "lo =1 #length in metre\n", + "v=0.75*3*10**8 #speed (m/s)\n", + "c=3*10**8 #light speed(m/s)\n", + "l=lo*math.sqrt(1-(v**2/c**2))\n", + "print \"\\n the length of bar in is\",round(l,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.2:pg-12" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " velocity of rocket is v= 4.23e+07 m/s\n" + ] + } + ], + "source": [ + "# example 2\n", + "import math\n", + "#to calculate velocity of rocket \n", + "#lo be the length at rest \n", + "l=99.0/100 #length is 99 per cent of its length at rest is l=(99/100)lo\n", + "c=3*10**8 #light speed(m/s)\n", + "v=c*math.sqrt(1-l**2) #formula is v=c math.sqrt(1-(l/lo)**2)\n", + "print\"\\n velocity of rocket is v=\",\"{:.2e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.4:pg-13" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "percentage contraction of a rod is 8.35 %\n" + ] + } + ], + "source": [ + "import math\n", + "#to percentage contraction of a rod\n", + "c=3*10**8 #light speed(m/s)\n", + "v=0.8*c #velocity(m/s)\n", + "#let lo be the length of the rod in the frame in which it is at rest\n", + "#s' is the frame which is moving with a speed 0.8c in a direction making an angle 60 with x-axis\n", + "#components of lo along perpendicular to the direction of motion are lo cos60 and lo sin60 respectively\n", + "l1=math.cos(math.pi/3)*math.sqrt(1-(v/c)**2) #length of the rod alond the direction of motion =lo math.cos(pi/3)math.sqrt(1-(v/c)**2)\n", + "l2=math.sin(math.pi/3) #length of the rod perpendicular to the direction of motion =lo sin60\n", + "l=math.sqrt(l1**2+l2**2) # length of the moving rod\n", + "per=(1-l)*100/1\n", + "print \"percentage contraction of a rod is\",round(per,2),\"%\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.7:pg-14" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of the circular lamina relative to frame s is v= 2.598e+08 m/s\n" + ] + } + ], + "source": [ + "# example 7\n", + "import math\n", + "#to calculate velocity of the circular lamina \n", + "c=3*10**8 #light speed (m/s)\n", + "#R'=R/2 (radius)\n", + "#R'=R math.sqrt(1-(v/c)**2)\n", + "v=(math.sqrt(3)/2)*c \n", + "print \"velocity of the circular lamina relative to frame s is v=\",\"{:.3e}\".format(v),\"m/s\"\n", + "#answer is given in terms of c in the textbook\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.8:pg-17" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "speed of the clock is = 5.45e+07 m/s\n" + ] + } + ], + "source": [ + "# example 8\n", + "import math\n", + "#to calculate speed of the clock\n", + "#clock should record l=59 minutes for each hour recorded by clocks stationary with respect to the observer\n", + "l=59.0 \n", + "lo=60\n", + "c=3*10**8 #light speed (m/s)\n", + "v=math.sqrt(c**2*(1-l**2/lo**2))\n", + "print \"speed of the clock is =\",\"{:.2e}\".format(v),\"m/s\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.9:pg-17" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance travelled by the beam is d= 20.0 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distance travelled by the beam \n", + "deltat0=2.5*10**-8 #proper half life of pi mesons in (s)\n", + "c=3*10**8 #light speed (m/s)\n", + "v=0.8*c #mesons velocity (m/s)\n", + "deltat=deltat0/math.sqrt(1-(v/c)**2) #half life (s)\n", + "#No=initial flux ,N=flux after time t\n", + "#N=N0 e**(-t/T)\n", + "#N=N0/e**2 (given)=No e(-t/T)\n", + "#t=2 deltat\n", + "d=2*deltat*v #d=vt\n", + "print \"distance travelled by the beam is d=\",d,\"m\" \n", + "#answer is given in the textbook=19.96 m\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.10:pg-17" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance travelled by the particle in this time is d= 20.57 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distance travelled by the particle \n", + "deltat0=2*10**-8 #proper half life to of the particle in (s) \n", + "c=3*10**8 #light speed (m/s)\n", + "v=0.96*c #speed of the particle (m/s)\n", + "deltat=(deltat0)/(math.sqrt(1-(v/c)**2)) #half life in the laboratory frame t in (s) \n", + "#t=deltat (flux of the beam falls to (1/2) times initial flux)\n", + "d=v*deltat #d=vt\n", + "print \"distance travelled by the particle in this time is d=\",round(d,2),\"m\"\n", + "#answer is given wrong in the textbook =20.45 m\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.11:pg-18" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " moving clock appears to lose 4min in 24 hours from the stationary observer is v= 3.0e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate speed\n", + "deltat0=1440 #proper time interval measured by an observer moving with the clock (min)\n", + "deltat=1444 #time interval measured by a stationary observer (min)\n", + "c=3*10**8 #light speed (m/s)\n", + "v=c*math.sqrt(1-(deltat0/deltat)**2)\n", + "print \" moving clock appears to lose 4min in 24 hours from the stationary observer is v=\",\"{:.1e}\".format(v),\"m/s\"\n", + "#answer is given wrong in the book =2.32*10**7 m/s\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.12:pg-18" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " velocity of the beta particle as observed by the experimenter is u= 2.82e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity of beta particle\n", + "c=3*10**8 #light velocity(m/s)\n", + "u1=0.9*c #velocity of the beta particle relative to the atom in the direction of motion\n", + "v=0.25*c #velocity of the radioactive atom relative to an experimenter\n", + "u=(u1+v)/(1+u1*v/c**2) \n", + "print \" velocity of the beta particle as observed by the experimenter is u=\",\"{:.2e}\".format(u),\"m/s\"\n", + "#answer is given in terms of c in the book =0.94c\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.13:pg-18" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " the velocity of B with respect to A (m/s) is -2.93e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity\n", + "c=3*10**8 # light velocity\n", + "v=0.75*c #speed of A\n", + "ux=-0.85*c #speed of B\n", + "ux1=(ux-v)/(1-ux*v/c**2)\n", + "print\"\\n the velocity of B with respect to A (m/s) is\",\"{:.2e}\".format(ux1),\"m/s\"\n", + "#answer is given in terms of c in the book=-0.9771c\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.14:pg-19" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "u=ux i+uy j+uz k\n", + "where\n", + "ux= 2.4e+08 m/s\n", + "uy= 2.4 m/s\n", + "uz= 7.2 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity in the laboratory frame\n", + "c=3*10**8 #light speed (m/s)\n", + "v=0.8*c #velocity relative to laboratory along positive direction of x-axis\n", + "#given that u'=3 i+4 j+12 k (m/s)\n", + "ux1=3 #in (m/s)\n", + "uy1=4 #in (m/s)\n", + "uz1=12 #in (m/s)\n", + "ux=(ux1+v)/(1+v*ux1/c**2)\n", + "uy=(uy1*math.sqrt(1-(v/c)**2))/(1+v*ux1/c**2)\n", + "uz=(uz1*math.sqrt(1-(v/c)**2))/(1+v*ux1/c**2)\n", + "print \"u=ux i+uy j+uz k\"\n", + "print \"where\"\n", + "print \"ux=\",\"{:.1e}\".format(ux),\"m/s\"\n", + "print \"uy=\",round(uy,1),\"m/s\"\n", + "print \"uz=\",round(uz,1),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.17:pg-21" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "resultant velocity as observed by a person in frame s1 is u1=ux1 i+uy1 j\n", + "where\n", + "ux1= 0.0 m/s\n", + "uy1= 0.756 c m/s\n" + ] + } + ], + "source": [ + "import math\n", + "# to calculate velocity of the particle\n", + "c=3*10**8 #light speed (m/s)\n", + "v=0.4*c #velocity of frame s' relative to s along axis x\n", + "ux=0.8*c*(1/2.0) #component of velocity u(=0.8 c) of the particle along x axis ux=0.8 c cos60\n", + "uy=0.8*c*sin (math.pi/3) #component of the velocity u of the particle along y axis \n", + "ux1=(ux-v)/(1-ux*v/c**2)\n", + "uy1=uy*math.sqrt(1-(v/c)**2)/(1-(ux*v/c**2))\n", + "print \"resultant velocity as observed by a person in frame s1 is u1=ux1 i+uy1 j\"\n", + "print \"where\"\n", + "print \"ux1=\",ux1/c,\"m/s\"\n", + "print \"uy1=\",round(uy1/c,3),\"c m/s\"\n", + "#answer is given in terms of c in the book i.e. uy1=0.756c m/s\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.18:pg-25" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass m= 1.41 mo\n", + "momentum p= 3.0e+08 mo\n", + "energy E= 1.27e+17 mo\n", + "kinetic energy K= 3.73e+16 mo\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate mass, momentum,total energy,kinetic energy\n", + "c=3*10**8 #light speed (m/s)\n", + "v=c/sqrt (2) #velocity (m/s)\n", + "#let mo be the rest mass of the particle \n", + "#relativistic mass m of the particle is m=mo/math.sqrt(1-(v/c)**2)\n", + "m=1/sqrt (1-v**2/c**2) #in kg\n", + "print \"mass m=\",round(m,2),\" mo\"\n", + "#momentum p of the particle is p=mv\n", + "p=m*v #in kg-m/s\n", + "print \"momentum p=\",\"{:.1e}\".format(p),\" mo\"\n", + "#total energy E of the particle\n", + "E=m*c**2 #in J\n", + "print \"energy E=\",\"{:.2e}\".format(E),\" mo\"\n", + "#kinetic energy K=E-mo c**2\n", + "K=E-c**2 #in J\n", + "print \"kinetic energy K=\",\"{:.2e}\".format(K),\" mo\"\n", + "#answer is given in terms of m0 and c in the book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.19:pg-26" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of the particle is v= 2.828e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity of the parcticle \n", + "c=3*10**8 #light speed(m/s)\n", + "# we know that E(energy)=mc**2\n", + "# mo=rest mass\n", + "#E=3 moc**2=mc**2 or m=3 mo (given that total energy of the particle is thrice its rest energy) \n", + "m=3.0 # relativistic mass \n", + "#formula is v=c math.sqrt(1-(mo/m)**2)\n", + "v=math.sqrt(c**2*(1-(1/m)**2))\n", + "print \"velocity of the particle is v=\",\"{:.3e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.20:pg-26" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass is m= 3.58e-30 kg \n", + "speed of an electron is v= 2.9e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate mass(m),speed(v) of an electron\n", + "K=1.5*10**6*1.6*10**-19 #kinetic energy(J)\n", + "m0=9.11*10**-31 #rest mass of an electron(kg)\n", + "c=3*10**8 # velocity of light in vacuum(m/s)\n", + "m=(K/c**2)+m0 #relativistic kinetic energy(k=(m-mo)c**2)\n", + "print \"mass is m=\",\"{:.2e}\".format(m),\"kg \"\n", + "v=c*math.sqrt(1-m0**2/m**2)\n", + "print \"speed of an electron is v=\",\"{:.1e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.21:pg-27" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amount of work to be done is w= 3.33e-14 J\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate work to be done \n", + "E=0.5*10**6 #rest energy of electron (MeV) E=m0*c**2\n", + "v1=0.6*3*10**8 #speed of electron in (m/s)\n", + "v2=0.8*3*10**8\n", + "c=3*10**8 #speed of light in (m/s)\n", + "K1=E*((1/math.sqrt(1-v1**2/c**2))-1) #kinetic energy in (eV)\n", + "K2=E*((1/math.sqrt(1-v2**2/c**2))-1)\n", + "w=(K2-K1)*1.6*10**-19\n", + "print \"amount of work to be done is w=\",\"{:.2e}\".format(w),\"J\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.22:pg-27" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " speed is v= 2.69e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate speed\n", + "c=3*10**8 #light speed (m/s)\n", + "m=2.25 #mass m of a body be 2.25 times its rest mass mo i.e. m=2.25m0\n", + "#formula is v=c math.sqrt(1-(m0/m)**2)\n", + "v=c*math.sqrt(1-(1/m)**2)\n", + "print \" speed is v=\",\"{:.2e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.23:pg-27" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "speed of the rocket is v= 4.21e+07 m/s\n", + "speed of an electron is v= 3.00e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate speed of the rocket\n", + "m0=50 #weight of man on the earth(kg)\n", + "m=50.5 #weight of man in rocket ship (kg)\n", + "c=3*10**8 #speed of light(m/s)\n", + "v=c*math.sqrt(1-m0**2/m**2)\n", + "print \"speed of the rocket is v=\",\"{:.2e}\".format(v),\"m/s\" \n", + "#to calculate speed of electron\n", + "m0=9.11*10**-31 #mass of electron =rest mass of proton\n", + "m=1.67*10**-27\n", + "v=c*math.sqrt(1-m0**2/m**2)\n", + "print \"speed of an electron is v=\",\"{:.2e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.24:pg-28" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of a body is v= 2.828e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity\n", + "c=3*10**8 #light speed (m/s)\n", + "#K(kinetic energy)=(m-mo(rest mass))c**2\n", + "#it can also be written as mc**2=K+m0c**2\n", + "#given that K=2m0c**2(rest mass energy)\n", + "#m=3m0\n", + "m=3.0 #relativistic mass\n", + "#formula is v=c math.sqrt(1-(m0/m)**2)\n", + "v=c*math.sqrt(1-(1/m)**2)\n", + "print \"velocity of a body is v=\",\"{:.3e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.25:pg-28" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy is K= 5.12e+06 eV\n", + "momentum is p= 2.99e-21 kg m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate kinetic energy ,momentum of electron\n", + "m0=9.11*10**-31 #its rest mass (kg)\n", + "c=3*10**8 #light velocity in (m/s)\n", + "m=11*m0 #mass of moving electron is 11 times its rest mass\n", + "K=(m-m0)*c**2/(1.6*10**-19) # kinetic energy\n", + "print \"kinetic energy is K=\",\"{:.2e}\".format(K),\"eV\" \n", + "v=c*math.sqrt(1-(m0/m)**2) #velocity(m/s)\n", + "p=m*v #momentum\n", + "print \"momentum is p=\",\"{:.2e}\".format(p),\"kg m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.26:pg-29 " + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "proton gain in mass is delm= 8.89e-28 kg\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate proton gain in mass\n", + "c=3*10**8 #light speed(m/s)\n", + "K=500*10**6*1.6*10**-19 #kinetic energy (J)\n", + "deltam=K/c**2\n", + "print \"proton gain in mass is delm=\",\"{:.2e}\".format(deltam),\"kg\"\n", + "#answer is given wrong in the book=8.89*10**28 kg\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.27:pg-29" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "speed of electron is v= 1.643e+08 m/s\n", + "mass is m= 3.56e-30 kg\n", + "speed is v= 2.90e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate speed of 0.1MeV electron\n", + "E=0.512*10**6 #rest mass energy E=m0*c**2\n", + "c=3*10**8 #velocity of light (m/s)\n", + "K=0.1*10**6 #kinetic energy (MeV)\n", + "v=c*math.sqrt(1-(E/(K+E))**2) \n", + "print \"speed of electron is v=\",\"{:.3e}\".format(v),\"m/s\" \n", + "#to calculate mass and speed of 2MeV electron\n", + "E=2*10**6*1.6*10**-19 #in (J)\n", + "m=E/c**2 \n", + "print \"mass is m=\",\"{:.2e}\".format(m),\"kg\"\n", + "m0=9.11*10**-31 #electron mass (kg)\n", + "v=c*math.sqrt(1-m0**2/m**2)\n", + "print \"speed is v=\",\"{:.2e}\".format(v),\"m/s\"\n", + "\n", + "\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter10-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter10-checkpoint.ipynb new file mode 100755 index 00000000..7e489d37 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter10-checkpoint.ipynb @@ -0,0 +1,295 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter10:MAGNETIC PROPERTIES OF MATERIALS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.1:pg-288" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "permeability is mu= 1.000e-03 N/A**2\n", + "susceptibility is chim= 794.775 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate permeability and susceptibility of the bar\n", + "phi=2.4*10**-5 #magnetic flux in weber\n", + "A=0.2*10**-4 #cross sectional area in m**2\n", + "B=phi/A #magnetic induction in N/Am\n", + "H=1200 #magnetising field in A/m\n", + "mu=B/H\n", + "print \"permeability is mu=\",\"{:.3e}\".format(mu),\"N/A**2\"\n", + "muo=4*math.pi*10**-7 \n", + "chim=(mu/muo)-1\n", + "print \"susceptibility is chim=\",round(chim,3),\"unitless\"\n", + "#the answer is given wrong in the book (round off error) chim=737\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.2:pg-289" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "current is i= 10.0 A\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate current should be sent through the solenoid\n", + "l=.10 #length in m\n", + "N=50 #number of turns\n", + "H=5*10**3 #magnetising field in A/m\n", + "i=H*l/N \n", + "print \"current is i=\",i,\"A\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.3:pg-289" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the magnetic moment of the rod is M= 300.0 A-m**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate magnetic moment of the rod\n", + "#formula is B=muo*(H+I)\n", + "#where H=ni\n", + "n=500.0 #number of turns in turns/m\n", + "i=0.5 #current passed through the solenoid in A\n", + "mur=1200.0 #relative permeability\n", + "I=(mur-1)*n*i #intensity of magnetisation in A/m\n", + "V=10**-3 #volume in m**3\n", + "M=I*V\n", + "print \"the magnetic moment of the rod is M=\",round(M),\"A-m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.4:pg-290" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "flux density is B= 2.000e-02 weber/m**2\n", + "magnetic intensity is H= 300.0 A-turn/m\n", + "permeability is mu= 6.667e-05 weber/A-m\n", + "relative permeability is mur= 53.052 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate flux density,magnetic intensity,permeability of iron\n", + "phi=2.0*10**-6 #flux in the ring in weber\n", + "A=10**-4 #cross-sectional area in m**2\n", + "B=phi/A \n", + "print \"flux density is B=\",\"{:.3e}\".format(B),\"weber/m**2\"\n", + "N=200.0 #number of turns\n", + "i=0.30 #current flows in the windings in A\n", + "l=0.2 #length in m\n", + "H=N*i/l\n", + "print \"magnetic intensity is H=\",H,\"A-turn/m\"\n", + "mu=B/H\n", + "print \"permeability is mu=\",round(mu,8),\"weber/A-m\"\n", + "muo=4*math.pi*10**-7 \n", + "mur=mu/muo\n", + "print \"relative permeability is mur=\",round(mur,3),\"unitless\"\n", + "\n", + "#the answer for H in the book is wrong\n", + "#the answer for mu in book is wrong due to wrong H\n", + "#the answer in book for mur is wrong \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.5:pg-294" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the number of ampere turns is mmf= 153.846 ampere-turns\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of ampere turns\n", + "l=0.5 #length in m\n", + "mu=6.5*10**-3 #permeability of iron in henry/m\n", + "A=2*10**-4 #area of cross-section in m**-4\n", + "R=l/(mu*A) #reluctance in A-turns/weber\n", + "flux=4*10**-4 #in weber\n", + "mmf=flux*R\n", + "print \"the number of ampere turns is mmf=\",round(mmf,3),\"ampere-turns\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.6:pg-294" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative permeability of the medium is mur= 375.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate relative permeability of the medium\n", + "phi=1.5*10**-3 #magnetic flux in weber\n", + "l=math.pi*50*10**-2 #length in m\n", + "A=10*10**-4 #area of cross-section\n", + "N=1000 #number of turns\n", + "i=5 #current in A\n", + "muo=4*math.pi*10**-7\n", + "#phi(magnetic flux)=m.m.f/reluctance\n", + "#phi=N*i*muo*mur*A/l\n", + "#we get,\n", + "mur=phi*l/(N*i*A*muo)\n", + "print \"relative permeability of the medium is mur=\",mur,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.7:pg-295" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "magnetising current is i= 0.274 A\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate magnetising current\n", + "#formula is phi(magnetic flux)=m.m.f/reluctance\n", + "#phi=N*i*mu*A/l--------eq(1)\n", + "#phi=BA------------eq(2)\n", + "B=0.20 #magnetic flux density in weber/m**2\n", + "l=1 #average length of the circuit in m \n", + "N=100 #number of turns\n", + "mu=7.3*10**-3 #in h.m\n", + "#from eq(1)and eq(2),we get\n", + "i=B*l/(N*mu)\n", + "print \"magnetising current is i=\",round(i,3),\"A\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter11-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter11-checkpoint.ipynb new file mode 100755 index 00000000..5a37e945 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter11-checkpoint.ipynb @@ -0,0 +1,68 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter11:ULTRASONICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex11.1:pg-303" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the fundamental frequency is nu= 2729987.214 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate fundemental frequency\n", + "Y=7.9*10**10 #Young modulus for quartz in Nm**-2\n", + "rho=2.65*10**3 #density of quartz in kg/m**3\n", + "#the velocity of longitudinal wave is given by\n", + "v=math.sqrt(Y/rho) #in m/s\n", + "#for fundamental mode of vibration ,thickness is given by lamda/2\n", + "lamda=2*0.001 #wavelength in m\n", + "nu=v/lamda\n", + "print \"the fundamental frequency is nu=\",round(nu,3),\"Hz\"\n", + "#answer is given wrong in the book ,nu=2730 Hz\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter12-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter12-checkpoint.ipynb new file mode 100755 index 00000000..35c30635 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter12-checkpoint.ipynb @@ -0,0 +1,550 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:024efb73c06fed2399cd64a4d2a669b874446e3757757251d146f1996aec28e9"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12:ELECTROMAGNETICS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.1:pg-322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate electric flux\n",
+ "#electric flux through a surface is phi=vector(E)*vector(s)\n",
+ "#where vector E=2i+4j+7k,vector s=10j\n",
+ "E=4 #E=4j\n",
+ "s=10 #s=10j\n",
+ "phi=E*s\n",
+ "print \"electric flux is phi=\",phi,\"units\"\n",
+ "#to calculate flux coming out of any face of the cube\n",
+ "q=1 #charge in coulomb\n",
+ "epsilon0=8.85*10**-12 #permittivity in free space in coul**2/N-m**2\n",
+ "phi1=q/(6*epsilon0)\n",
+ "print \"flux coming out of any face of the cube is phi1=\",\"{:.2e}\".format(phi1),\"N-m**2/coul**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "electric flux is phi= 40 units\n",
+ "flux coming out of any face of the cube is phi1= 1.88e+10 N-m**2/coul**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.2:pg-322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate electric field at a point from centre of the shell\n",
+ "q=0.2*10**-6 #charge\n",
+ "r=3 #radius\n",
+ "epsilon0=8.85*10**-12\n",
+ "E=q/(4*math.pi*epsilon0*r**2)\n",
+ "print \"electric field at a point from centre of the shell is E=\",round(E),\"N/coulomb\"\n",
+ "#to calculate electric field at a point just outside the shell\n",
+ "R=0.25 #radius\n",
+ "E=q/(4*math.pi*epsilon0*R**2)\n",
+ "print \"electric field at a point just outside the shell is E=\",\"{:.2e}\".format(E),\"N/coulomb\"\n",
+ "#to calculate the electric field at a point inside the shell\n",
+ "#when the point is situated inside the spherical shell,the electric field is zero\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "electric field at a point from centre of the shell is E= 200.0 N/coulomb\n",
+ "electric field at a point just outside the shell is E= 2.88e+04 N/coulomb\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.3:pg-323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate electric field at a point on earth vertically below the wire\n",
+ "lamda=10**-4 #wavelength in coulomb/m\n",
+ "r=4 #radius in m\n",
+ "epsilon0=8.854*10**-12\n",
+ "E=2*lamda/(4*math.pi*epsilon0*r)\n",
+ "print \"electric field at a point on earth vertically below the wire is E=\",\"{:.1e}\".format(E),\"N/coulomb\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "electric field at a point on earth vertically below the wire is E= 4.5e+05 N/coulomb\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.4:pg-323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate separation between those equipotential surfaces \n",
+ "V=5 #potential difference\n",
+ "epsilon0=8.85*10**-12 #permittivity of free space\n",
+ "sigma=1*10**-7 #in c/m**2\n",
+ "#electric field due to an infinite sheet of surface charge density is given by E=sigma/(2*epsilon0) eq(1)\n",
+ "#E=V/d eq(2)\n",
+ "#from eq(1) and eq(2),we get \n",
+ "d=(2*epsilon0*V)/sigma\n",
+ "print \"separation between those equipotential surfaces is d=\",\"{:.2e}\".format(d),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "separation between those equipotential surfaces is d= 8.85e-04 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.5:pg-324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate force per unit area\n",
+ "#force of attraction per unit area is given by F=(epsilon0*E**2)/2 eq(1)\n",
+ "#E=V/d eq(2)\n",
+ "epsilon0=8.85*10**-12 #permittivity of free space\n",
+ "d=1*10**-3 #distance\n",
+ "V=100 #potential difference in volts\n",
+ "#from eq(1) and eq(2),we get\n",
+ "F=(epsilon0*V**2)/(2*d**2)\n",
+ "print \"force per unit area is F=\",\"{:.2e}\".format(F),\"N/m**2\"\n",
+ "#answer is given incorrect in the book ,F=4.425*10**-12\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "force per unit area is F= 4.42e-02 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.6:pg-324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate charge\n",
+ "#let charge be q coulomb ,then the surface density of charge i.e. sigma=q/(4*math.pi*r**2)..............eq(1)\n",
+ "#outward pull per unit area =sigma**2/(2*epsilon0)............eq(2)\n",
+ "#put eq(1) in eq(2),we get q**2/(4*math.pi*r**2)**2*(2*epsilon0)..............eq(3)\n",
+ "#pressure due to surface tension =4*T/r............eq(4)\n",
+ "T=27\n",
+ "r=1.5*10**-2\n",
+ "epsilon0=8.85*10**-12\n",
+ "#equate eq(3) and eq(4),we get\n",
+ "q=math.sqrt(4*T*((4*math.pi*r**2)**2)*2*epsilon0/r)\n",
+ "print \"charge is q=\",\"{:.3e}\".format(q),\"coulomb\"\n",
+ "#answer is given wrong in the book,square of 4*math.pi*r**2 is not taken in the solution.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "charge is q= 1.009e-06 coulomb\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.7:pg-325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate increase in radius \n",
+ "q=4.8*10**-8 #charge in coulomb\n",
+ "r=10*10**-2 #radius in m\n",
+ "epsilon0=8.85*10**-12 #C**2/N-m**2\n",
+ "P=10**5 #N/m**2\n",
+ "dr=(q**2)/(96*((math.pi)**2)*(r**3)*epsilon0*P)\n",
+ "print \"increase in radius is dr=\",\"{:.2e}\".format(dr),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "increase in radius is dr= 2.75e-09 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.8:pg-340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#in page no.340,numbering is done wrongly,it should be like ex-8,ex-9,ex-10,ex-11,ex-12,ex-13,ex-14\n",
+ "import math\n",
+ "#to calculate average values of intensities of electric and magnetic fields of radiation\n",
+ "#energy of lamp=1000 J/s\n",
+ "#area illuminated =4*math.pi*r**2=16*math.pi m**2\n",
+ "#energy radiated per unit area per second =1000/16*math.pi\n",
+ "#from poynting theorem |s|=|E*H|=E*H eq(1)\n",
+ "s=1000/(16*math.pi)\n",
+ "muo=4*math.pi*10**-7 #permeability of free space\n",
+ "epsilon0=8.85*10**-12 #permittivity in free space\n",
+ "#E/H=math.sqrt(muo/epsilon0) eq(2)\n",
+ "#from eq(1) and eq(2),we get\n",
+ "E=math.sqrt(s*math.sqrt(muo/epsilon0))\n",
+ "H=s/E\n",
+ "print \"average value of intensity of electric fields of radiation is E=\",round(E,2),\"V/m\"\n",
+ "print \"average value of intensity of magnetic fields of radiation is H=\",round(H,2),\"ampere-turn/m\"\n",
+ "#answer is given wrong in the book E=48.87 V/m,solution of magnetic fields is not given in the book .\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average value of intensity of electric fields of radiation is E= 86.58 V/m\n",
+ "average value of intensity of magnetic fields of radiation is H= 0.23 ampere-turn/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.9:pg-340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate amplitudes of electric and magnetic fields of radiation\n",
+ "#energy received by an electromagnetic wave per sec per unit area is given by poynting vector |s|=|E*H|=E*H*sin 90 (becoz E is perpendicular to H)\n",
+ "#it is given that energy received by earth's surface is\n",
+ "s=1400.0 #|s|=2 cal min**-1 cm**-2\n",
+ "muo=4.0*math.pi*10**-7 #permittivity of free space\n",
+ "epsilon0=8.85*10**-12 #permeability of free space\n",
+ "#E*H=1400 eq(1)\n",
+ "#E/H=math.sqrt(muo/epsilon0) eq(2)\n",
+ "#from eq(1) and eq(2) ,we get\n",
+ "E=math.sqrt(s*math.sqrt(muo/epsilon0))\n",
+ "#from eq(1) ,we get\n",
+ "H=1400.0/E\n",
+ "Eo=E*math.sqrt(2) # at distance 2 m\n",
+ "Ho=H*math.sqrt(2) # at distance 2 m\n",
+ "print \"amplitude of electric field is Eo=\",int(Eo),\"V/m\"\n",
+ "print \"amplitude of magnetic field is Ho=\",round(Ho,3),\"amp-turn/m\"\n",
+ "\n",
+ "# The answers in the textbook are slightly different due to approximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amplitude of electric field is Eo= 1027 V/m\n",
+ "amplitude of magnetic field is Ho= 2.726 amp-turn/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.10:pg-341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# no value to be found out , only equation to be written hence skipped following the TBC guidelines"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.11:pg-341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate skin depth \n",
+ "f=10**8 #frequency\n",
+ "sigma=3*10.0**7 #conductivity of the medium\n",
+ "muo=4*math.pi*10**-7 #permeability of free space\n",
+ "Del=math.sqrt(2/(2*math.pi*f*sigma*muo))\n",
+ "print \"skin depth is Del=\",\"{:.1e}\".format(Del),\"cm\"\n",
+ "\n",
+ "# answer in book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ " skin depth is Del= 9.2e-06 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.12:pg-341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate frequency \n",
+ "muo=4*math.pi*10**-7 #permeability of free space\n",
+ "sigma=4.3 # in mhos/m\n",
+ "Del=0.1 #skin depth in m\n",
+ "f=2/(2*math.pi*muo*Del**2)\n",
+ "print \"frequency is f=\",\"{:.2e}\".format(f),\"Hz\"\n",
+ "#value of frequency is given incorrect in the book \n",
+ "#show that for frequencies less than 10**8 ,it can be considered as good conductor\n",
+ "epsilon=80*8.854*10**-12\n",
+ "f=10**8 #frequency in Hz\n",
+ "sigma=4.3\n",
+ "#formula is sigma/(omega*epsilon)>4.3/(2*math.pi*10**8*80*epsilon)\n",
+ "sigma1=sigma/(2*math.pi*f*epsilon) #where sigma1=sigma/(omega*epsilon)\n",
+ "print \"sigma1=\",round(sigma1,2),\"unitless\"\n",
+ "#the ocean water to be good conductor ,the value of sigma/(omega*epsilon) should be greater than 1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency is f= 2.53e+07 Hz\n",
+ "sigma1= 9.66 unitless\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.13:pg-342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to show that for frequency <10**9 Hz ,a sample of silicon will act like a good conductor\n",
+ "sigma=200 #in mhos/m\n",
+ "omega=2*math.pi*10**9 \n",
+ "epsilon0=8.85*10**-12 #permittivity in free space\n",
+ "epsilon=12*epsilon0 \n",
+ "sigma1=sigma/(omega*epsilon) #sigma1=sigma/(omega*epsilon)\n",
+ "print \"sigma1=\",round(sigma1),\"unitless\"\n",
+ "#if sigma/(omega*epsilon) is greater than 1 , silicon is a good conductor at frequency <10**9 Hz\n",
+ "#to calculate penetration depth\n",
+ "f=10**6 #frequency in Hz\n",
+ "muo=4*math.pi*10**-7 #permeability of free space\n",
+ "sigma=200\n",
+ "Del=math.sqrt(2/(2*math.pi*f*muo*sigma))\n",
+ "print \"penetration depth is del=\",round(Del*100,1),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sigma1= 300.0 unitless\n",
+ "penetration depth is del= 3.6 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.14:pg-343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate conduction current and displacement current densities \n",
+ "sigma=10**-3 #conductivity in mhos/m\n",
+ "E=4*10**-6 #where E=4*10**-6*math.sin(9*10**9t) v/m\n",
+ "J=sigma*E\n",
+ "print \"conduction current density is J=\",J,\"math.sin(9*10**9t) A/m\"\n",
+ "epsilon0=8.85*10**-12 #permittivity in free space\n",
+ "epsilonr=2.45 #relative permittivity\n",
+ "#formula is epsilon0*epsilonr*(delE/delt)\n",
+ "#delE/delt=4*10**-6*9*10**9*math.cos(9*10**9*t)\n",
+ "Jd=epsilon0*epsilonr*4*10**-6*9*10**9\n",
+ "print \"displacement current density is Jd=\",round(Jd,8),\"math.cos(9*10**9*t) A/m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "conduction current density is J= 4e-09 math.sin(9*10**9t) A/m\n",
+ "displacement current density is Jd= 7.8e-07 math.cos(9*10**9*t) A/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 23
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter13-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter13-checkpoint.ipynb new file mode 100755 index 00000000..b7bad40b --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter13-checkpoint.ipynb @@ -0,0 +1,107 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter13:SUPERCONDUCTIVITY" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex13.1:pg-357" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " the value of temperature is 5.039 K\n" + ] + } + ], + "source": [ + "#example 1\n", + "#to calculate value of Temperature\n", + "import math\n", + "Bc=105.0*10**3 #magnetic field in amp/m\n", + "Bo=150.0*10**3 #critical field of the metal in amp/m \n", + "Tc=9.2 #critical temperature of the metal in K\n", + "T=Tc*math.sqrt(1-(Bc/Bo))#temperature\n", + "print\"\\n the value of temperature is\",round(T,3),\"K\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex13.2:pg-357" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " the temperature is 3.983 K\n", + "\n", + " the critical current density at that temperature is 9.000e+06 A/m^2\n" + ] + } + ], + "source": [ + "#example 2\n", + "#to calculate temperature\n", + "import math\n", + "Tc=7.18 #critical temperature in K\n", + "Bc=4.5*10**3 #critical field in A/m\n", + "Bo=6.5*10**3 #critical magnetic field in A/m\n", + "T=Tc*math.sqrt(1-(Bc/Bo))# temperature\n", + "print\"\\n the temperature is\",round(T,3),\"K\"\n", + "#to calculate critical current density at that temperature\n", + "r=1*10**-3 #diameter of the wire in mm\n", + "TJc=(Bc*2*math.pi*r)/(math.pi*r**2)# critical current density\n", + "print\"\\n the critical current density at that temperature is\",\"{:.3e}\".format(TJc),\"A/m^2\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter2-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter2-checkpoint.ipynb new file mode 100755 index 00000000..5d84b658 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter2-checkpoint.ipynb @@ -0,0 +1,1094 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter2:INTERFERENCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.2:pg-41" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of intensity at the maxima and minima in the interference pattern is Imax/Imin=((a1+a2)**2)/((a1-a2)**2)= 2 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate ratio of intensity\n", + "#I1/I2=1/25\n", + "#formula is a1/a2=math.sqrt(I1/I2)=1/5\n", + "a2=5 #a2=5*a1\n", + "a1=1\n", + "I=((1+5)**2)/((1-5)**2)\n", + "print \"ratio of intensity at the maxima and minima in the interference pattern is Imax/Imin=((a1+a2)**2)/((a1-a2)**2)=\",((a1+a2)**2)/((a1-a2)**2),\"unitless\"\n", + "#answer is given in terms of ratio\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.3:pg-42" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " ratio of intensity = 0.8535 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate ratio of intensity at this point to that at the centre of a bright fringe\n", + "#the intensity at any pont is I=a1**2+a2**2+2*a1*a2*cos del\n", + "#let a1=a2=a\n", + "#phase difference del is 0\n", + "#then I0=a**2+a**2+2*a*a*cos 0\n", + "#we get I0=4a**2\n", + "I0=4 #intensity\n", + "#path difference is lemda/8\n", + "#phase difference =2*math.pi/lemda*path difference=math.pi/4\n", + "#I1=a**2+a**2+2a*a*cos math.pi/4\n", + "#I1=3.414a**2\n", + "I1=3.414\n", + "intensity=I1/I0\n", + "print \" ratio of intensity =\",intensity,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.4:pg-42" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the ratio of maximum intensity to minmum intensity in the interference pattern Imax/Imin=((a1+a2)**2)/((a1-a2)**2)= 1 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate ratio of maximum intensity to minimum intensity\n", + "#formula is I1/I2=a1**2/a2**2=100/1\n", + "#a1/a2=10/1\n", + "a1=10 #a1=10*a2\n", + "a2=1\n", + "print \"the ratio of maximum intensity to minmum intensity in the interference pattern Imax/Imin=((a1+a2)**2)/((a1-a2)**2)=\",((a1+a2)**2)/((a1-a2)**2),\"unitless\" \n", + "#answer is given in terms of ratio in the book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.5:pg-43" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the ratio of the intensities of interfering sources is I1/I2=a1**2/a2**2= 1600 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate relative intensities\n", + "#Imax/Imin=(a1+a2)**2/(a1-a2)**2+105/95\n", + "#(a1+a2)/(a1-a2)=1.051\n", + "#we get a1/a2=40 \n", + "a1=40 #a1=40*a2\n", + "a2=1\n", + "print \"the ratio of the intensities of interfering sources is I1/I2=a1**2/a2**2=\",a1**2/a2**2,\"unitless\"\n", + "#answer is given in terms of ratio in the book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.7:pg-52" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the distance between two coherent sources is twod= 0.0005 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distance between the two coherent sources\n", + "lamda=5890*10**-10 #wavelength in m\n", + "omega=9.424*10**-4 #width of the fringes in m\n", + "D=.80 #distance in m\n", + "twod=D*lamda/omega\n", + "print \"the distance between two coherent sources is twod=\",twod,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.8:pg-53" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the fringe width is omega= 0.0001977 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate fringe width \n", + "mu=1.5 #refractive index (unitless)\n", + "alpha=math.pi/180 #refracting angle in radian\n", + "Y1=20*10**-2 #distance between the source and the biprism in m\n", + "Y2=80*10**-2 #distance in m\n", + "D=Y1+Y2 # distance in m\n", + "lamda=6900*10**-10 #wavelength in m\n", + "twod=2*(mu-1)*alpha*Y1 \n", + "omega=D*lamda/twod\n", + "print \"the fringe width is omega=\",round(omega,7),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.9:pg-53" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of light is lamda= 5.9e-07 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of light\n", + "omega=1.888*10**-2/20 #in (m)\n", + "D=1.20 #distance of eye piece from the source in m\n", + "twod=0.00075 #distance between two virtual sources in m\n", + "lamda=omega*twod/D\n", + "print \"the wavelength of light is lamda=\",lamda,\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.10:pg-54" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the thickness of glass plate is t= 3.27e-06 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of glass plate\n", + "n=3\n", + "mu=1.5 #refractive index (unitless)\n", + "lamda=5450*10**-10 #wavelength in m\n", + "t=n*lamda/(mu-1)\n", + "print \"the thickness of glass plate is t=\",t,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.11:pg-54" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the refractive index of the sheet is mu= 1.52 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index of the sheet\n", + "t=6.3*10**-6 #thickness of thin sheet of transparent material in m\n", + "lamda=5460*10**-10 #wavelength in m\n", + "n=6\n", + "mu=(n*lamda/t)+1\n", + "print \"the refractive index of the sheet is mu=\",mu,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.12:pg-54" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the refractive index of mica is mu= 51.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index of mica\n", + "t=1.2*10**-8 #thickness of thin sheet of mica in m\n", + "n=1 \n", + "lamda=6*10**-7 #wavelength in m\n", + "mu=(n*lamda/t)+1\n", + "print \"the refractive index of mica is mu=\",mu,\"unitless\"\n", + "#answer is given wrong in the book=1.50\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.13:pg-54" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the intensity at the centre of the screen is I= 0 unitless\n", + "the lateral shift of the central maximum is x0= 0.0015 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate intensity\n", + "mu=1.5 #refractive index(unitless)\n", + "t=1.5*10**-6 #thickness of thin glass plate in m\n", + "pathdifference=(mu-1)*t # in m\n", + "lamda=5*10**-7 #wavelength in m\n", + "#del=2*math.pi*pathdifference/lamda\n", + "#del=3*math.pi\n", + "a1=1\n", + " #where a1=a2=a\n", + "a2=1\n", + "#formula is I=a1**2+a2**2+2*a1*a2*cos del\n", + "# where cos 3math.pi=-1\n", + "I=a1**2+a2**2+2*a1*a2*(-1) \n", + "print \"the intensity at the centre of the screen is I=\",I,\"unitless\" \n", + "#to calculate lateral shift\n", + "D=1 #distance in m\n", + "twod=5*10**-4 #distance between two slits in m\n", + "mu=1.5 #refractive index (unitless)\n", + "t=1.5*10**-6 #thickness of thin glass plate in m\n", + "x0=D*(mu-1)*t/twod\n", + "print \"the lateral shift of the central maximum is x0=\",x0,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.14:pg-55" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the spacing between the slits is twod= 3.44e-02 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate spacing between the slits\n", + "lamda=6*10**-5 #wavelength in cm\n", + "omegatheta=0.1*math.pi/180 #angular width of a fringe in radians\n", + "twod=lamda/omegatheta\n", + "print \"the spacing between the slits is twod=\",\"{:.2e}\".format(twod),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.15:pg-55" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the distance of the third bright fringe from the central maximum is X3= 0.117 cm\n", + "n= 4.0 unitless\n", + "the distance from the central maximum when the bright fringes due to both wavelengths coincide is Xn= 0.156 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distance of the third bright fringe on the screen from the central maximum \n", + "lamda=6.5*10**-5 #wavelength in cm\n", + "twod=0.2 #distance between the slits in cm\n", + "D=120 #distance between the plane of the slits and the screen in cm\n", + "n=3 \n", + "X3=D*n*lamda/twod\n", + "print \"the distance of the third bright fringe from the central maximum is X3=\",X3,\"cm\"\n", + "#to calculate the least distance from the central maximum \n", + "lamda1=6.5*10**-5 #wavelength in cm\n", + "lamda2=5.2*10**-5 #wavelength in cm\n", + "#Xn=Dnlamda1/2d=D(n+1)lamda2/2d\n", + "#we get,\n", + "n=lamda2/(lamda1-lamda2)\n", + "print \"n=\",n,\"unitless\"\n", + "Xn=D*n*lamda1/twod\n", + "print \"the distance from the central maximum when the bright fringes due to both wavelengths coincide is Xn=\",Xn,\"cm\"\n", + " \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.16:pg-56" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the refractive index of the transparent plate is mu= 1.2 unitless\n", + "the order will be visible is n1= 14.0 unitless\n", + "the distance between the coherent sources is twod= 0.12 cm\n", + "the wavelength of light is lamda= 5e-05 cm\n", + "the wavelength of light is lamda= 5.89e-05 cm\n", + "the changed fringe width is omega1= 0.199 mm\n", + "the thickness of mica sheet is t= 0.0002945 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index \n", + "D=10 #distance in cm\n", + "twod=0.2 #distance detween the slits in cm\n", + "t=0.05 #thickness of transparent plate in cm\n", + "deltaX=0.5 #in cm\n", + "mu=(deltaX*twod/(D*t))+1\n", + "print \"the refractive index of the transparent plate is mu=\",mu,\"unitless\"\n", + "#to calculate order\n", + "n=10 \n", + "lamda=7000*10**-8 #wavelength in cm\n", + "#path difference =n*lamda\n", + "n1=n*lamda/(5000*10**-8) \n", + "print \"the order will be visible is n1=\",n1,\"unitless\"\n", + "#to calculate distance between the two coherent sources\n", + "D=100 #distance in m \n", + "lamda=6000*10**-8 #wavelength in cm\n", + "omega=0.05 #distance between two consecutive bright fringes on the screen in cm\n", + "twod=D*lamda/omega\n", + "print \"the distance between the coherent sources is twod=\",twod,\"cm\"\n", + "#to calculate wavelength\n", + "Xn=1 #distance of fourth bright fringe from the central fringe in cm\n", + "twod=0.02 #distance between the two coherent sources in cm\n", + "n=4 \n", + "D=100 #distance in cm \n", + "lamda=Xn*twod/(n*D)\n", + "print \"the wavelength of light is lamda=\",lamda,\"cm\"\n", + "#to calculate wavelength\n", + "#position of nth bright fringe from the centre of the central fringe is Xn=D*n*lamda/2d----eq(1)\n", + "#fringe width umega=D*lamda/2d---------------------eq(2)\n", + "#from eq(1) and eq(2) we get, Xn=n*omega\n", + "#for 11th bright fringe X11=11*omega\n", + "#position for nth dark fringe Xn'=(2n+1)D*lamda/4d\n", + "#X4'=(7/2)*omega\n", + "#distance between 11th and 4th dark fringe =0.8835 cm\n", + "#we get \n", + "omega=0.1178 #in cm\n", + "twod=0.05 #distance between slis in cm\n", + "D=100 # distance in cm\n", + "lamda=omega*twod/D \n", + "print \"the wavelength of light is lamda=\",lamda,\"cm\"\n", + "#to calculate changed fringe width\n", + "#X10-X0=10*omega\n", + "#given that X10-X0=14.73-12.34=2.39mm \n", + "omega=0.239 #in mm\n", + "lamda=6000 #wavelength in angstrom\n", + "lamda1=5000 #lamda'=5000 angstrom\n", + "omega1=omega*lamda1/lamda\n", + "print \"the changed fringe width is omega1=\",round(omega1,3),\"mm\"\n", + "#to calculate thickness of mica sheet\n", + "n=3\n", + "mu=1.6 #refractive index(unitless)\n", + "lamda=5.89*10**-5 #wavelength in cm\n", + "t=n*lamda/(mu-1)\n", + "print \"the thickness of mica sheet is t=\",t,\"cm\"\n", + "#answer of thickness is given wrong in the book =0.002945 cm\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.17:pg-75" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the smallest thickness of the plate which will appear dark by reflection is t= 3.927e-07 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate the smallest thickness of the plate\n", + "mu=1.5 #refractive index(unitless)\n", + "r=60*math.pi/180 #angle of refraction in radians\n", + "lamda=5890*10**-10 #wavelength in m\n", + "n=1\n", + "#formula is t=n*lamda/(2*mu*cosr) where cosr=0.5\n", + "t=n*lamda/(2*mu*0.5)\n", + "print \"the smallest thickness of the plate which will appear dark by reflection is t=\",\"{:.3e}\".format(t),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.18:pg-75" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the least thickness of the film that will appear black is t= 2.075e-07 m\n", + "the least thickness of the film that will appear bright is t= 1.0375e-07 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate least thickness of the film\n", + "lamda=5893*10**-10#wavelength in m\n", + "r=0 #in degree\n", + "mu=1.42 #refractive index\n", + "n=1\n", + "#the formula is t=n*lamda/(2*mu*cosr), where cos0=1\n", + "t=n*lamda/(2*mu*1)\n", + "print \"the least thickness of the film that will appear black is t=\",t,\"m\"\n", + "t=(2*n-1)*lamda/(2*mu*1*2)\n", + "print \"the least thickness of the film that will appear bright is t=\",t,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.19:pg-76" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the thickness of the film is t= 1.72e-05 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of the film\n", + "lamda1=6.1*10**-7 #wavelength in m\n", + "lamda2=6*10**-7 # wavelength in m\n", + "#the two dark consecutive fringes are overlapping for the wavelength lamda1 and lamda2 respectively\n", + "#then, n*lamda1=(n+1)*lamda2\n", + "#we get,\n", + "n=lamda2/(lamda1-lamda2)\n", + "sini=4.0/5\n", + "mu=4.0/3\n", + "#formula is mu=sini/sinr\n", + "sinr=0.6\n", + "cosr=math.sqrt(1-(sinr)**2)\n", + "t=n*lamda1/(2*mu*cosr)\n", + "print \"the thickness of the film is t=\",\"{:.2e}\".format(t),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.20:pg-77" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the thickness of the film is t= 2.614e-07 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of the film\n", + "mu=1.33 #refractive index of soap film (unitless)\n", + "i=45*math.pi/180\n", + "#the formula is mu=sini/sinr \n", + "sinr=0.5317 \n", + "cosr=math.sqrt(1-(sinr)**2)\n", + "#for destructive interference\n", + "lamda=5890*10**-10 #wavelength in m\n", + "n=1\n", + "t=n*lamda/(2*mu*cosr)\n", + "print \"the thickness of the film is t=\",\"{:.3e}\".format(t),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.21:pg-77" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the angle of the wedge is theta = 1.07e-04 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of the wedge\n", + "lamda=6000*10**-10 #wavelength in m\n", + "mu=1.4 #refractive index in unitless\n", + "omega=2*10.0**-3 #distance in m\n", + "theta=lamda/(2*mu*omega)\n", + "print \"the angle of the wedge is theta =\",\"{:.2e}\".format(theta),\"radians\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.22:pg-77" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of light is lamda= 6790.0 Angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of light \n", + "theta=10*22.0/(7*60*60*180.0) #angle of wedge in radians\n", + "omega=5*10.0**-2 #distance between the successive fringes in m\n", + "mu=1.4 #refractive index\n", + "lamda=2.0*mu*theta*omega/(10e-10)\n", + "print \"the wavelength of light is lamda=\",round(lamda),\"Angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.23:pg-78" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of the monochromatic light is lamda= 5880 Angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of the light\n", + "D15=0.590*10**-2 #diamater of 15th ring in m\n", + "D5=0.336*10**-2 #diameter of 5th ring in m\n", + "p=1 # in m\n", + "R=1 #radius of plano convex lens in m\n", + "#formula is lamda=Dn+p**2-Dn**2/4pR\n", + "lamda=((D15**2)-(D5**2))/(4*p*R)/(10e-10)\n", + "print \"the wavelength of the monochromatic light is lamda=\",int(lamda),\"Angstrom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.24:pg-78" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the refractive index of the liquid is mu= 1.374 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index of the liquid\n", + "n=6\n", + "lamda=6000*10**-10 #wavelength in m\n", + "R=1 #radius of curvature of the curved surface in m\n", + "Dn=3.1*10**-3 #diameter of 6th bright ring in m\n", + "mu=2*(2*n-1)*lamda*R/Dn**2\n", + "print \"the refractive index of the liquid is mu=\",round(mu,3),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.25:pg-78" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the radius of curvature of the lens is R= 1.059 m\n", + "the thickness of the air film is t= 2.95e-06 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate radius of curvature\n", + "lamda=5900*10**-10 #wavelength in m\n", + "n=10\n", + "Dn=5*10**-3 # diameter of 10th dark ring in m\n", + "R=Dn**2/(4*n*lamda)\n", + "print \"the radius of curvature of the lens is R=\",round(R,3),\"m\"\n", + "#to calculate thichness\n", + "t=n*lamda/2\n", + "print \"the thickness of the air film is t=\",t,\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.26:pg-79" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the distance from the apex of the wedge is X= 5.53 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate the distance from the apex of the wedge at which the maximum due to the two wavelengths first coincide\n", + "#condition for maxima for normal incidence air film is 2t=(2n+1)lamda/2\n", + "#let nth order maximum due to lamda1 coincides with (n+1)th order maximum due to lamda2 \n", + "#we get , n=(3lamda2-lamda1)/2(lamda1-lamda2)\n", + "# we also get, 2t=lamda1*lamda2/(lamda1-lamda2)\n", + "#t=X*theta\n", + "lamda1=5896*10**-8 #wavelength in cm\n", + "lamda2=5890*10**-8 #wavelength in cm\n", + "theta=0.3*math.pi/180 #angle of wedge\n", + "X=lamda1*lamda2/(2*(lamda1-lamda2)*theta)\n", + "print \"the distance from the apex of the wedge is X=\",round(X,2),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.27:pg-80" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the radius of curvature of the lens is R= 104.167 cm\n", + "the thickness of the film is t= 3.0e-04 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate radius of curvature \n", + "n=10.0\n", + "Dn=0.50 #diameter of 10th ring in cm\n", + "lamda=6000*10**-8 #wavelength in cm\n", + "R=Dn**2/(4*n*lamda)\n", + "print \"the radius of curvature of the lens is R=\",round(R,3),\"cm\"\n", + "#answer is given wrong in the book =106 cm\n", + "#to calculate thickness of the film\n", + "t=Dn**2/(8*R)\n", + "print \"the thickness of the film is t=\",\"{:.1e}\".format(t),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.28:pg-80" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the diameter of 20th dark ring is D20= 0.9 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate diameter\n", + "#the difference of (n+p)th and nth dark ring is Dn+p**2-Dn**2=4nRlamda\n", + "N=12 #where N=n+p\n", + "n=4\n", + "D12=0.7 #diameter of 12th dark ring in cm\n", + "D4=0.4 #diameter of 4th dark ring in cm\n", + "#D12**2-D4**2=4pRlamda where p=8 ----eq(1)\n", + "#D20**2-D4**2=4pRlamda where p=16 -----eq(2)\n", + "#divide eq(2) by eq(1) ,we get\n", + "D20=math.sqrt((2*D12**2)-D4**2)\n", + "print \"the diameter of 20th dark ring is D20=\",round(D20,1),\"cm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.29:pg-80" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the diameter of nth dark ring for lamda1 is Dn= 0.255 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate diameter \n", + "lamda1=6*10**-5 #wavelength in cm\n", + "lamda2=4.5*10**-5 #wavelength in cm\n", + "R=90 #radius of curvature of the curved surface in cm\n", + "#Dn**2=4nRlamda1 -------eq(1)\n", + "#Dn+1**2=4(n+1)Rlamda2-------eq(2)\n", + "#the nth dark ring due to lamda1 coincides with (n+1)th dark ring due to lamda2\n", + "#from eq(1) and eq(2)-4nRlamda1=4(n+1)Rlamda2\n", + "# we get,\n", + "n=lamda2/(lamda1-lamda2)\n", + "Dn=math.sqrt(4*n*R*lamda1)\n", + "print \"the diameter of nth dark ring for lamda1 is Dn=\",round(Dn,3),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.30:pg-81" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the difference of square of diameters is D1(n+p)**2-D1n**2=(lamda1*D)/lamda= 0.0937 cm**2\n", + "the difference of square of diameters is D1(n+p)**2-D1n**2=(mu*D)/mu1= 0.094 cm**2\n", + "the difference of square of diameters is D1(n+p)**2-D1n**2=(R1*D)/R= 0.25 cm**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate the difference of square of diameters for nth and (n+p)th ring when light of wavelength lamda is changed to lamda'\n", + "lamda=6*10**-5 #wavelength in cm\n", + "lamda1=4.5*10**-5 #wavelength in cm\n", + "#Let D=(D**2-Dn**2)=0.125 cm**2 \n", + "D=0.125\n", + "#formula is D'(n+p)**2-D'n**2=lamda'*(D(n+p)**2-Dn**2)/lamda\n", + "print \"the difference of square of diameters is D1(n+p)**2-D1n**2=(lamda1*D)/lamda=\",round((lamda1*D)/lamda,4),\"cm**2\"\n", + "#to calculate difference of square of diamaters when liqquid of refractive index mu' is introduced\n", + "mu=1 #refractive index (unitless)\n", + "mu1=1.33 # mu'=1.33\n", + "#formula is D'(n+p)**2-D'n**2=(mu/mu')*(D(n+p)**2-Dn**2)\n", + "print \"the difference of square of diameters is D1(n+p)**2-D1n**2=(mu*D)/mu1=\",round((mu*D)/mu1,3),\"cm**2\"\n", + "#to calculate difference of square of diameters when radius of curvature of convex surface of the plano convex lens is doubled\n", + "R1=2 #radius of curvature is R'=2R\n", + "R=1\n", + "#formula is D'(n+p)**2-D'n**2=(R'/R)*(D(n+p)**2-Dn**2)\n", + "print \"the difference of square of diameters is D1(n+p)**2-D1n**2=(R1*D)/R=\",(R1*D)/R,\"cm**2\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter3-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter3-checkpoint.ipynb new file mode 100755 index 00000000..49add97c --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter3-checkpoint.ipynb @@ -0,0 +1,1337 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter3:DIFFRACTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.1:pg-97" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sintheta= 6.0e-03 m\n", + "total angular width of central maximum is theta1= 1.2e-02 radians \n", + "linear width of central maximum on the screen is Y1= 1.2 cm\n", + "values of m =1,2,3,............ gives the directions of first, second .............minima\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angular width and linear width \n", + "lamda=6*10**-5\n", + "e=0.01 #width of slit in cm\n", + "#position of minima is given by\n", + "sintheta=lamda/e #sintheta=m*lamda/e ,where m=1,2,3,......\n", + "print \"sintheta=\",\"{:.1e}\".format(sintheta),\" m\"\n", + "#since theta is very small,so sintheta is approximately equal to theta\n", + "theta=sintheta\n", + "theta1=2*theta\n", + "print \"total angular width of central maximum is theta1=\",\"{:.1e}\".format(theta1),\" radians \"\n", + "d=100 #distance in cm\n", + "Y=theta*d\n", + "Y1=2*Y\n", + "print \"linear width of central maximum on the screen is Y1=\",Y1,\"cm\"\n", + "print \"values of m =1,2,3,............ gives the directions of first, second .............minima\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.2:pg-97" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of light is lamda= 5600.0 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of light\n", + "#in a diffraction pattern due to single slit, minima is given by e*sintheta=m*lamda\n", + "#since theta is very small, sintheta is approximately equal to theta\n", + "#theta=Y/d\n", + "e=0.014 #width of slit in cm\n", + "d=200 #distance in cm\n", + "m=2.0 \n", + "Y=1.6 #in cm\n", + "lamda=Y*e/(d*m)\n", + "print \"wavelength of light is lamda=\",lamda*1e8,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.3:pg-98" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "width of slit is e= 1.0e-04 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate width of slit\n", + "#direction of minima in fraunhofer diffraction due to single slit is given by math.pi/lamda*e*siuntheta=+m*math.pi,where m=1,2,3\n", + "#angular spread of the central maximum on either side of the incident light is sintheta=lamda/e,where m=1,position of first minima\n", + "lamda=5000*10**-8\n", + "e=lamda/math.sin(math.pi/6)\n", + "print \"width of slit is e=\",\"{:.1e}\".format(e),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.4:pg-98" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of incident light is lamda= 5000.0 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of incident light\n", + "#direction of minima is given by e*sintheta=+m*lamda\n", + "#for first minima m=1,i.e. e*sintheta=lamda,sintheta is approximately equal to theta,then we can write it as e*theta=lamda ...........eq(1)\n", + "#theta=Y/d........................eq(2) \n", + "e=0.02 #in cm\n", + "Y=0.5 #position of first minima from the central maxima in cm\n", + "d=200 #distance of screen from the slit in cm\n", + "#from eq(1) and eq(2),we get\n", + "lamda=e*Y/d\n", + "print \"wavelength of incident light is lamda=\",lamda*1e8,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.6:pg-99" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "lamda1= 6250.0 angstrom\n", + "lamda2= 5000.0 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate values of lamda1 and lamda2\n", + "#in fraunhofer diffraction pattern ,the direction of minima is given by e*sintheta=+m*lamda,where m=1,2,.......\n", + "#direction of fourth minima (m=4) for wavelength lamda1 is given by e*sintheta1=4*lamda1..........eq(1)\n", + "#similarly, e*sintheta2=5*lamda2..........eq(2)\n", + "#from eq(1) and eq(2),we get e*sintheta=4*lamda1=5*lamda2....eq(3)\n", + "y=0.5 #in cm\n", + "f=100 #in cm\n", + "theta=y/f #in radian\n", + "sintheta=theta #theta is very small\n", + "e=0.05 #width of slit in cm\n", + "lamda1=e*sintheta/4\n", + "print \"lamda1=\",lamda1*1e8,\"angstrom\"\n", + "#from eq(3) we get,\n", + "lamda2=4*lamda1/5\n", + "print \"lamda2=\",lamda2*1e8,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.7:pg-100" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "half angular width of central bright maxima is theta= 0.5 radian\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate half angular width \n", + "e=1.2*10**-4 #width of slit in cm\n", + "y=6*10**-5 #wavelength of monochromatic light in cm\n", + "theta=y/e\n", + "print \"half angular width of central bright maxima is theta=\",theta,\"radian\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.8:pg-100" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "angle at which the first dark band are formed in the fraunhofer diffraction pattern is theta= 0.1146 degree\n", + "angle at which the next bright band are formed in the fraunhofer diffraction pattern is theta1= 0.1719 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle\n", + "lamda=6000.0*10**-8 #wavelength of light in cm\n", + "e=0.03 #width of slit in cm\n", + "#e*sintheta=m*lamda,where m=1\n", + "theta=math.degrees(math.asin(lamda/e)) \n", + "print \"angle at which the first dark band are formed in the fraunhofer diffraction pattern is theta=\",round(theta,3),\"degree\"\n", + "theta1=math.degrees(math.sin(3*lamda/(2*e)))\n", + "print \"angle at which the next bright band are formed in the fraunhofer diffraction pattern is theta1=\",round(theta1,3),\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.9:pg-101" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "linear distance of first minimum from the central maximum is y= 0.0982 cm\n", + "linear distance of first secondary maxima is y1= 0.1473 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distances of first dark band and of next bright band on either side of the central maximum\n", + "#formula is e*sintheta=m*lamda,where m=1\n", + "lamda=5890.0*10**-8 #wavelength of light in cm\n", + "e=0.03 #width of slit in cm\n", + "sintheta=lamda/e \n", + "theta=sintheta #becoz theta is very small,so sintheta is approximately equal to theta\n", + "f=50.0\n", + "y=f*theta\n", + "print \"linear distance of first minimum from the central maximum is y=\",round(y,4),\"cm\"\n", + "sintheta1=3*lamda/(2*e)\n", + "theta1=sintheta1\n", + "y1=f*theta1\n", + "print \"linear distance of first secondary maxima is y1=\",round(y1,4),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.10:pg-105" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of light is lamda= 5.882e-05 cm\n", + "missing order is n= 6.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of light and missing orders\n", + "omega=0.25 #fringe width in cm\n", + "D=170 #distance in cm\n", + "twod=0.04 # distance in cm\n", + "lamda=omega*twod/D\n", + "print \"wavelength of light is lamda=\",\"{:.3e}\".format(lamda),\"cm\"\n", + "e=0.08 #width of slit in mm\n", + "d=0.4 #in mm\n", + "m=1\n", + "n=m*(e+d)/e \n", + "print \"missing order is n=\",n,\"unitless\"\n", + "#we can also find order for m=2,3,....\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.11:pg-112" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of the spectral line is lamda= 5e-05 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "n=2.0 #order of spectrum\n", + "theta=math.pi/6 #in radians\n", + "E=1.0/5000 #let (e+d)=E\n", + "lamda=E*math.sin(math.pi/6)/n\n", + "print \"the wavelength of the spectral line is lamda=\",lamda,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.12:pg-112" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "difference in deviations in first and third order spectra is difference = 46.7 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate difference in deviations \n", + "lamda=5*10**-5 #wavelength of light in cm\n", + "eplusd=1/6000.0 #where eplusd=e+d\n", + "theta1=math.degrees(math.asin(lamda/eplusd)) #for first order spectrum\n", + "theta3=math.degrees(math.asin(3*lamda/eplusd)) #for second order spectrum\n", + "difference=theta3-theta1\n", + "print \"difference in deviations in first and third order spectra is difference =\",round(difference,1),\"degree\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.13:pg-112" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the orders will be visible is n= 19.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate orders\n", + "#let E=(e+d) \n", + "#formula is (e+d)*sin thita=n*lamda\n", + "#for maximum order to be possible thita=90 degree\n", + "#sin theta=1\n", + "E=2.54/2620 #in cm\n", + "lamda=5*10**-5 #wavelength of the incident light in cm\n", + "n=E/lamda\n", + "print \"the orders will be visible is n=\",round(n),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.14:pg-113" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of lines is number= 2778.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of lines in the grating\n", + "#theta1=theta2=30 degree\n", + "#sin theta1=sin theta2=1/2\n", + "lamda1=6*10**-5 \n", + " #wavelength in cm\n", + "lamda2=4.5*10**-5\n", + "#let (e+d)=E \n", + "#formula is (e+d)*sin theta1=n*lamda1----------eq(1)\n", + "#(e+d)*sin theta2=(n+1)*lamda2----------eq(2)\n", + "#we get,\n", + "n=lamda2/(lamda1-lamda2) #order of spectrum\n", + "E=n*lamda1/math.sin(math.pi/6)\n", + "number=1/E\n", + "print \"number of lines is number=\",round(number),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.15:pg-113" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "order when wavelength of 4000 angstrom is n1= 6.25 unitless\n", + "order when wavelength of 7500 angstrom is n2= 3.33 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate order when visible light of wavelength in the range 4000 to 7500 angstrom\n", + "#let E=(e+d)\n", + "E=1.0/4000 #in cm\n", + "lamda1=4*10**-5 \n", + " #wavelength in cm\n", + "lamda2=7.5*10**-5\n", + "n1=E*math.sin(math.pi/2)/lamda1\n", + "n2=E*math.sin(math.pi/2)/lamda2\n", + "print \"order when wavelength of 4000 angstrom is n1=\",n1,\"unitless\"\n", + "print \"order when wavelength of 7500 angstrom is n2=\",round(n2,2),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.17:pg-114" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "angle of diffraction for maximum intensity in the first order is theta= 14 degree 29.0 minutes\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of diffraction \n", + "n=1 #order\n", + "lamda=5000*10**-8 #wavelength of light in cm\n", + "eplusd=1/5000.0 # in cm\n", + "theta=math.degrees(math.asin(n*lamda/(eplusd)))\n", + "minu=(theta-int(theta))*60 # minute\n", + "print \"angle of diffraction for maximum intensity in the first order is theta=\",int(theta),\"degree\",round(minu),\"minutes\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.18:pg-115" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of lines is number= 5000.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of lines in one centimeter of the grating\n", + "#let E=(e+d)\n", + "#formula for grating equation for principal maxima is (e+d)*sin theta=n*lamda\n", + "n=2 #order of spectrum\n", + "lamda=5*10**-5 #wavelength in cm\n", + "E=n*lamda/math.sin(math.pi/6)\n", + "number=1/E\n", + "print \"number of lines is number=\",number,\"unitless\"\n", + "#answer is given wrong in the book ,number of lines=1000\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.19:pg-115" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of 5th order spectrum is lamda1= 4.712e-05 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate which spectral line in 5th order will overlap with 4th order line of 5890 angstrom\n", + "#the grating equation for principal maxima is (e+d)*sin theta =n*lamda\n", + "n1=5 \n", + " #order of spectrum \n", + "n2=4\n", + "lamda2=5890*10**-8 #wavelength of 4th order spectrum in cm\n", + "#(e+d)*sin theta=5*lamda-------------eq(1)\n", + "#(e+d)*sin theta=4*5890*10**-8-----------------eq(2)\n", + "#from eq(1) and eq(2) ,we get\n", + "lamda1=n2*lamda2/n1\n", + "print \"wavelength of 5th order spectrum is lamda1=\",lamda1,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.20:pg-115" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "grating element is eplusd= 3.2e-04 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate grating element\n", + "#grating equation for principal maxima is given by (e+d)*sintheta=n*lamda\n", + "#let nth order spectrum for yellow line (lamda=6000 angstrom) coincide with (n+1)th order spectrum for blue line (lamda=4800 angstrom) \n", + "#(e+d)*sintheta=n*6000*10**-8..eq(1)\n", + "#(e+d)*sintheta=(n+1)*4800*10**-8.....eq(2)\n", + "#from eq(1) and eq(2),we get n=4\n", + "n=4\n", + "lamda=6000*10**-8 #wavelength in cm\n", + "sintheta=3.0/4 \n", + "eplusd=n*lamda/sintheta\n", + "print \"grating element is eplusd=\",\"{:.1e}\".format(eplusd),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.21:pg-116" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "angle of refraction is theta= 2 degree 4.0 minutes\n", + "order of absent spectrum is n= 2.0 unitless\n", + "here,m=1 is considered because the higher values of m result the order of absent spectrum more than the given order 3\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of diffraction for third order spectrum and absent spectra if any\n", + "n=3\n", + "lamda=6000*10**-8\n", + "eplusd=1/200.0\n", + "theta=math.degrees(math.asin(n*lamda/eplusd))\n", + "minu=(theta-int(theta))*60 # minute\n", + "print \"angle of refraction is theta=\",int(theta),\"degree\",round(minu),\"minutes\"\n", + "d=0.0025\n", + "e=eplusd-d #width of wire in cm\n", + "m=1\n", + "n=eplusd*m/e\n", + "print \"order of absent spectrum is n=\",n,\"unitless\"\n", + "print \"here,m=1 is considered because the higher values of m result the order of absent spectrum more than the given order 3\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.22:pg-116" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "difference in two wavelengths is dlamda= 86.6 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate difference in the two wavelengths\n", + "#grating equation for principal maxima is (e+d)*sintheta=n*lamda...............eq(1)\n", + "#differentiate both sides ,we get dtheta=n*dlamda/((e+d)*costheta)...........eq(2)\n", + "lamda=5000 #mean value of wavelengths in angstrom\n", + "cottheta=1.732 #cot30degree=1.732\n", + "dtheta=0.01 #in radian\n", + "#put the value of n from eq(2),we can write eq(2) \n", + "dlamda=lamda*dtheta*cottheta\n", + "print \"difference in two wavelengths is dlamda=\",dlamda,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.23:pg-117" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "dispersive power of grating in the second order spectrum is dtheta= 8728 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate dispersive power \n", + "#differentiate grating equation ,we get dtheta/dlamda=n/((e+d)*costheta)\n", + "n=2 #order \n", + "eplusd=1/4000.0\n", + "lamda=5000.0*10**-8 #wavelength in cm\n", + "sintheta=n*lamda/(eplusd)\n", + "costheta=math.sqrt(1-(sintheta)**2)\n", + "dtheta=n/((eplusd)*costheta) #where dispersive power dtheta/dlamda=dtheta\n", + "print \"dispersive power of grating in the second order spectrum is dtheta=\",int(dtheta),\"unitless\"\n", + "\n", + "# answer is slightly different due to approximation\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.24:pg-117" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "orders will be observed by a grating ,if it is illuminated by light of wavelength of 5000 angstrom is nmax1= 5.0 unitless \n", + "orders will be observed ,if it is illuminated by light of wavelength of 7500 angstrom is nmax2= 3.3 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate orders\n", + "eplusd=1/4000.0\n", + "lamda1=5*10.0**-5 #wavelengh in cm\n", + "lamda2=7.5*10**-5\n", + "nmax1=eplusd/lamda1\n", + "nmax2=eplusd/lamda2\n", + "print \"orders will be observed by a grating ,if it is illuminated by light of wavelength of 5000 angstrom is nmax1=\",nmax1,\"unitless \"\n", + "print \"orders will be observed ,if it is illuminated by light of wavelength of 7500 angstrom is nmax2=\",round(nmax2,1),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.25:pg-118" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the difference in wavelengths of two lines is dlamda= 5.87e-08 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate difference in wavelengths of two lines\n", + "#let E=(e+d)=1/5000\n", + "#we get\n", + "E=2*10**-4 #in cm\n", + "n=2 #order of spectrum\n", + "lamda=5893*10**-8 #wavelength in cm\n", + "#dtheta=2.5'=(2.5/60)*(3.14/180),we get\n", + "dtheta=7.27*10**-4 #in radian\n", + "dlamda=math.sqrt(((E/n)**2)-lamda**2)*dtheta\n", + "print \"the difference in wavelengths of two lines is dlamda=\",\"{:.2e}\".format(dlamda),\"cm\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.26:pg-123" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the aperture of the objective of a telescope is a= 15.0 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate aperture of the objective of a telescope\n", + "lamda=6*10**-5 #wavelength of light in cm\n", + "dtheta=4.88*10**-6 # in radians\n", + "a=1.22*lamda/dtheta\n", + "print \"the aperture of the objective of a telescope is a=\",a,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.27:pg-123" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the separation of two points on the moon is X= 50.996 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate separation of two points on the moon\n", + "lamda=5.5*10**-5 #wavelength of light in cm\n", + "a=500 #diameter in cm\n", + "dtheta=1.22*lamda/a #limit of resolution of telescope in radians\n", + "R=3.8*10**8 #distance between earth and moon in m\n", + "X=R*dtheta\n", + "print \"the separation of two points on the moon is X=\",X,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.28:pg-124" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the numerical aperture of the objective is NA= 0.6 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate numerical aperture of the objective\n", + "lamda=5.461*10**-5 #wavelength in cm\n", + "S=5.55*10**-5 #distance in cm\n", + "NA=1.22*lamda/(2*S)\n", + "print \"the numerical aperture of the objective is NA=\",round(NA,1),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.29:pg-124" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the resolving power of microscope is RP= 4000.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate resolving power of microscope\n", + "NA=0.12 #numerical aperture\n", + "lamda=6*10**-5 #wavelength of light in cm\n", + "RP=2*NA/lamda #RP=resolving power\n", + "print \"the resolving power of microscope is RP=\",RP,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.30:pg-124" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the maximum resolving power is RP= 80000 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate maximum resolving power\n", + "lamda=5*10**-5 #wavelength of light in cm\n", + "N=40000 #total number of lines on grating\n", + "#(e+d)=12.5*10**-5 cm\n", + "#formula is nmax=(e+d)/lamda\n", + "#we get\n", + "nmax=2 #order of spectrum\n", + "RP=nmax*N #RP=resolving power\n", + "print \"the maximum resolving power is RP=\",RP,\"unitless\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.31:pg-124" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum number of lines in a grating is N= 491 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate minimum number of lines in a grating\n", + "lamda1=5890 \n", + " #wavelengh in angstrom\n", + "lamda2=5896\n", + "dlamda=6 #smallest wavelength difference in angstrom\n", + "n=2 #order of spectrum \n", + "lamda=(lamda1+lamda2)/2 #average wavelength in angstrom\n", + "RP=lamda/dlamda #RP=resolving power\n", + "N=RP/n\n", + "print \"minimum number of lines in a grating is N=\",N,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.32:pg-125" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 2.237e-05 radian\n", + "alpha= 2.5e-05 radian\n", + "if alpha>theta then telescope will be able to observe the wire-mesh\n" + ] + } + ], + "source": [ + "import math\n", + "#will the telescope be able to observe the wiremesh\n", + "a=3 #aperture in cm\n", + "lamda=5.5*10**-5 #wavelength of light in cm\n", + "#limit of resolution of telescope is given by\n", + "theta=1.22*lamda/a\n", + "#alpha=spacing of wire-mesh/distance of objective from wire-mesh\n", + "alpha=0.2/(80*10**2)\n", + "print \"theta=\",\"{:.3e}\".format(theta),\"radian\"\n", + "print \"alpha=\",alpha,\"radian\"\n", + "print \"if alpha>theta then telescope will be able to observe the wire-mesh\"\n", + "#value of alpha is given wrong in the book 2.25*10**-5 radian\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.33:pg-125" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance between the centres of images of two stars is X= 2.68e-02 cm \n" + ] + } + ], + "source": [ + "import math\n", + "#distance between the centres of images of two stars\n", + "lamda=5500*10**-8 #wavelength of light in cm\n", + "f=4*10**2 #focal length of telescope objective in cm\n", + "a=0.01*10**2 #diameter in cm\n", + "X=1.22*lamda*f/a\n", + "print \"distance between the centres of images of two stars is X=\",\"{:.2e}\".format(X),\"cm \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.34:pg-126" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the diameter of a telescope is a= 3.5 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate diameter of a telescope \n", + "lamda=5.0*10**-5 #wavelength in cm\n", + "theta=(math.pi/180)*(1.0/1000) #in radians\n", + "a=1.22*lamda/theta\n", + "print \"the diameter of a telescope is a=\",round(a,1),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.35:pg-126" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " the smallest angle between two stars is theta= 2.40e-07 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate smallest angle between two stars\n", + "lamda=5*10**-5 #wavelength in cm\n", + "a=100*2.54 #diameter in cm\n", + "theta=1.22*lamda/a\n", + "print \"the smallest angle between two stars is theta=\",\"{:.2e}\".format(theta),\"radians\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.36:pg-126" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the limit of resolution of the telescope is theta= 7.186e-05 radians \n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate limit of resolution of the telescope\n", + "lamda=5890*10**-8 #wavelength in cm\n", + "a=1 #diameter in cm\n", + "theta=1.22*lamda/a\n", + "print \"the limit of resolution of the telescope is theta=\",\"{:.3e}\".format(theta),\"radians \"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.37:pg-126" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "resolving limit of microscope is s= 6.71e-05 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate resolving limit of microscope\n", + "lamda=5.5*10**-5 #wavelengh in cm\n", + "theta=math.pi/6 #in radians\n", + "s=1.22*lamda/(2*math.sin(math.pi/6))\n", + "print \"resolving limit of microscope is s=\",s,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.38:pg-127" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "resolving power is RP = 30000 unitless\n", + "smallest wavelength difference dlamda= 2e-09 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate resolving power of grating \n", + "N=15000 #total number of lines on grating\n", + "lamda=6*10**-5 #wavelength in cm\n", + "n=2 #order of spectrum\n", + "RP=n*N\n", + "print \"resolving power is RP =\",RP,\"unitless\"\n", + "#to calculate smallest wavelength difference that can be resolved with a light of wavelength 6000angstrom in the second order\n", + "dlamda=lamda/(n*N)\n", + "print \"smallest wavelength difference dlamda=\",dlamda,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.39:pg-127" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the resolving power is RP= 1.2e+05 unitless\n", + "smallest wavelength that can be resolved in the third order in 6000angstrom wavelength region is dlamda= 3.33e-10 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate resolving power in the second order\n", + "N=6*10**4 #N=total number of lines on grating\n", + "n=2 #order of spectrum\n", + "RP=n*N #RP=resoling power\n", + "print \"the resolving power is RP=\",\"{:.1e}\".format(RP),\"unitless\"\n", + "#to calculate smallest wavelength\n", + "lamda=6000*10**-8 #wavelength in cm\n", + "n=3 #order of spectrum\n", + "dlamda=lamda/(n*N)\n", + "print \"smallest wavelength that can be resolved in the third order in 6000angstrom wavelength region is dlamda=\",\"{:.2e}\".format(dlamda),\"cm\" \n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter4-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter4-checkpoint.ipynb new file mode 100755 index 00000000..3993d089 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter4-checkpoint.ipynb @@ -0,0 +1,540 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter4:POLARISATION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.1:pg-147" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the intensities of ordinary and extraordinary rays is I= 3.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "# compare the intensities of ordinary and extraordinary rays\n", + "#intensity of ordinary rays is given by Io=a**2 *(sin theta)**2\n", + "#where theta=30 degree\n", + "#we get Io=a**2/4\n", + "Io=1.0/4\n", + "#intensity of extraordinary ray is given by IE=(a*cos theta)**2\n", + "#we get IE=3*a**2/4\n", + "IE=3.0/4\n", + "I=IE/Io\n", + "print \"the intensities of ordinary and extraordinary rays is I=\",I,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.2:pg-147" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "angle of refraction of ray is r= 30.0 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of refraction\n", + "#according to brewster's law mu=tan ip\n", + "mu=1.732 #refractive index\n", + "ip=math.degrees(math.atan(mu)) #polarising angle in degree\n", + "r=90-ip\n", + "print \"angle of refraction of ray is r=\",round(r),\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.3:pg-147" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "polarising angle is ip= 53 degree 22.0 min\n", + "angle of refraction is r= 36 degree 38.0 min\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate polarising angle and angle of refraction\n", + "mu=1.345 #refractive index, mu=1/sinc=1/sin48degree=1/0.7431 \n", + "ip=math.degrees(math.atan(mu))\n", + "r=90-ip\n", + "mn1=ip-int(ip)\n", + "mn2=60-mn1*60\n", + "print \"polarising angle is ip=\",int(ip),\"degree \",round(mn1*60.0),\"min\"\n", + "print \"angle of refraction is r=\",int(r),\"degree\",round(mn2),\"min\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.4:pg-147" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thickness of a half wave plate of quartz is t= 2.78e-03 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of a half wave plate of quartz\n", + "lamda=5*10**-5 #wavelength in cm\n", + "mue=1.553 \n", + " #refractive index (unitless)\n", + "muo=1.544\n", + "#for a half plate of positive crystal\n", + "t=lamda/(2*(mue-muo))\n", + "print \"thickness of a half wave plate of quartz is t=\",\"{:.2e}\".format(t),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.5:pg-148" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thickness of quarter wave plate is t= 1.636e-03 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of quarter wave plate\n", + "lamda=5.890*10**-5 #wavelength of light in cm\n", + "mue=1.553\n", + " #refractive index\n", + "muo=1.544\n", + "t=lamda/(4*(mue-muo)) \n", + "print \"thickness of quarter wave plate is t=\",\"{:.3e}\".format(t),\"cm\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.6:pg-148" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thickness of a plate is t= 1.47e-03 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of a doubly refracting plate\n", + "lamda=5.890*10**-5 #wavelength in cm\n", + "muo=1.53 \n", + " #refractive index\n", + "mue=1.54\n", + "t=lamda/(4*(mue-muo))\n", + "print \"thickness of a plate is t=\",\"{:.2e}\".format(t),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.7:pg-152" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the angle of rotation of the plane of polarisation is theta= 19.8 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of rotation\n", + "alpha=66.0 #specific rotation of cane sugar in degree\n", + "c=15.0/100 #concentration of the solution in gm/cc\n", + "l=20 #length of tube in cm\n", + "theta=alpha*l*c/10\n", + "print \"the angle of rotation of the plane of polarisation is theta=\",theta,\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.8:pg-153" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the specific rotation is alpha= 66.0 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate specific rotation \n", + "theta=26.4 #in degree\n", + "l=20 #length in cm\n", + "c=0.2 #gm/cm**3\n", + "alpha=10*theta/(l*c)\n", + "print \"the specific rotation is alpha=\",alpha,\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.9:pg-153" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "strength of solution is c= 0.0833 gm/cm**3\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate strength of solution\n", + "theta=11 #degree\n", + "l=20.0 #length in cm\n", + "alpha=66 #specific rotation of sugar in degree\n", + "c=10*theta/(l*alpha)\n", + "print \"strength of solution is c=\",round(c,4),\"gm/cm**3\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.10:pg-153" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "difference in refractive indices is mu= 8.4e-05 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate difference in the refractive indices\n", + "#specific rotation is theta/d=29.73 degree/mm\n", + "theta=29.73 #where theta=theta/d\n", + "lamda=5.086*10**-4 #wavelength in mm\n", + "#optical rotation is given by theta=math.pi*d*(mul-mur)/lamda\n", + "#where mul and mur are refractive indices for anti-clockwise and clockwise polarised lights\n", + "mu=theta*lamda/180 #where mu=mul-mur\n", + "print \"difference in refractive indices is mu=\",\"{:.1e}\".format(mu),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.11:pg-153" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "optical rotation is theta1= 6.5 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate optical rotation\n", + "#let theta' be the optical rotation by a solution of strength c' in a tube of length l' then\n", + "#we get 10*theta'/l'*c'=10*theta/l*c\n", + "c=1.0/3 #it is given that solution is 1/3 of its previous concentration i.e. c'/c=1/3,where c=c'/c\n", + "l1=30 #where l1=l'\n", + " #length in cm \n", + "l=20.0\n", + "theta=13 #degree\n", + "#formula is theta'=l'*c'*theta/(l*c)\n", + "theta1=l1*c*theta/l\n", + "print \"optical rotation is theta1=\",theta1,\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.12:pg-154" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the specific rotation is alpha= 66.0 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate specific rotation\n", + "theta=52.8 #optical rotation in degree\n", + "l=20.0 #length of the solution in cm\n", + "c=20/50.0 #concentration of the solution in gm/cc\n", + "alpha=10*theta/(l*c)\n", + "print \"the specific rotation is alpha=\",alpha,\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.13:pg-154" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "length is l1= 35.0 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate length \n", + "l=40 #length in cm\n", + "c=5.0/100 #concentration in percentage\n", + "theta1=35 #optical rotation in degree ,where theta1=theta'\n", + "c1=10.0/100 #concentration in % ,where c1=c'\n", + "theta=20\n", + "#formula of specific rotation is alpha=10*theta/l*c\n", + "l1=l*c*theta1/(c1*theta)\n", + "print \"length is l1=\",l1,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.14:pg-155" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rotation of plane of polarisation of light is thetaR= 3 degree 19.0 min\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate rotation of plane of polarisation of light\n", + "mur=1.53914\n", + " #refractive index\n", + "mul=1.53920\n", + "lamda=6.5*10**-5 #wavelength in cm\n", + "d=0.02 #distance in cm\n", + "thetaR=180*(mul-mur)*d/lamda\n", + "mn1=thetaR-int(thetaR)\n", + "print \"rotation of plane of polarisation of light is thetaR=\",int(thetaR),\"degree\",round(mn1*60),\"min\"\n", + "\n", + "# the answer is slightly different due to approximation\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.15:pg-155" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "percentage of the sugar sample is per= 93.75 %\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate % purity of the sugar sample\n", + "theta=9.9 #optiacal rotation in degree\n", + "alpha=66 #specific roation of pure sugar solution in dm**-1(gm/cc)**-1\n", + "l=20 #length of tube in cm\n", + "c=10*theta/(l*alpha) #concentration of solution in gm/c.c\n", + "#it is given that 80 gm of impure sugar is dissolved in a litre of water\n", + "per=(c*100*10**3)/80 #here c is in gm/litre\n", + "print \"percentage of the sugar sample is per=\",per,\"%\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter5-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter5-checkpoint.ipynb new file mode 100755 index 00000000..6977a7ec --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter5-checkpoint.ipynb @@ -0,0 +1,174 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter5:LASERS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.1:pg-164" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the areal spread is A= 1.44e+04 m**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate area of the spot on the moon\n", + "lamda=6*10**-7 #wavelength in m\n", + "d=2 #diameter in m\n", + "dtheta=lamda/d #angular spread in radian\n", + "D=4*10**8 #distance of the moon\n", + "A=(D*dtheta)**2\n", + "print \"the areal spread is A=\",\"{:.2e}\".format(A),\"m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.2:pg-164" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the angular spread of the beam is dtheta= 1.6e-04 radian\n", + "the areal spread is A= 4.096e+09 m**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angular spread of the beam\n", + "lamda=8*10**-7 #wavelength in m\n", + "d=5*10**-3 #aperture in m\n", + "dtheta=lamda/d \n", + "print \"the angular spread of the beam is dtheta=\",\"{:.1e}\".format(dtheta),\"radian\"\n", + "#to calculate the areal spread when it reaches the moon\n", + "D=4*10**8 #distance of the moon in m\n", + "A=(D*dtheta)**2\n", + "print \"the areal spread is A=\",\"{:.3e}\".format(A),\"m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.3:pg-165" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the number of oscillations is n= 5.0e+04 unitless\n", + "the coherence Time= 9.82e-11 s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of oscillations corresponding to the coherence length\n", + "L=2.945*10**-2 #coherence length in m\n", + "lamda=5890*10**-10 #wavelength of sodium light in m\n", + "n=L/lamda\n", + "print \"the number of oscillations is n=\",\"{:.1e}\".format(n),\"unitless\"\n", + "#to calculate coherence time\n", + "c=3*10**8 #light speed in m\n", + "Time=L/c #coherence time\n", + "print \"the coherence Time=\",\"{:.2e}\".format(Time),\"s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.4:pg-165" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "areal spread = 2.074e-10 m**2\n", + "intensity of the image is I= 2.411e+08 watts/m**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate area and intensity of the image\n", + "lamda=7200*10**-10 #wavelength in m\n", + "d=5*10**-3 #aperture in m\n", + "dtheta=lamda/d #angular spread in radian \n", + "f=0.1 #focal length in m\n", + "arealspread=(dtheta*f)**2\n", + "print \"areal spread =\",\"{:.3e}\".format(arealspread),\"m**2\"\n", + "power=50*10**-3\n", + "I=power/arealspread\n", + "print \"intensity of the image is I=\",\"{:.3e}\".format(I),\"watts/m**2\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter6-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter6-checkpoint.ipynb new file mode 100755 index 00000000..be13b8e7 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter6-checkpoint.ipynb @@ -0,0 +1,234 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter6:FIBER OPTICS AND HOLOGRAPHY" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.1:pg-189" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "critical angle for core-cladding interface is theta1= 15.0 degree\n", + "acceptance angle thetaa= 23.0 degree\n", + "numerical aperture of fibre is NA= 0.3841 unitless\n", + "light collected is per= 14.75 %\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate critical angle for core-cladding interface\n", + "n1=1.5\n", + "n2=1.45\n", + "thetac=math.degrees(math.asin(n2/n1))\n", + "theta1=90-thetac\n", + "\n", + "print \"critical angle for core-cladding interface is theta1=\",round(theta1),\"degree\"\n", + "#to calculate acceptance angle in air for fibre and corresponding angle of obliquences\n", + "na=1\n", + "thetaa=math.degrees(math.asin(n1*0.26/na))\n", + "\n", + "print \"acceptance angle thetaa=\",round(thetaa),\"degree\"\n", + "#to calculate numerical aperture\n", + "NA=((n1+n2)*(n1-n2))**(1/2.0)\n", + "print \"numerical aperture of fibre is NA=\",round(NA,4),\"unitless\"\n", + "#to calculate % of light\n", + "per=(NA)**2*100\n", + "print \"light collected is per=\",round(per,3),\"%\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.2:pg-190" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "numerical aperture is NA= 0.29 unitless\n", + "thetac= 78 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate numerical aperture\n", + "Del=0.02 #relative refractive index difference between the core and the cladding of the fibre i.e. del=(n1-n2)/n1\n", + "n1=1.46 #refractive index of core of W-step index fibre \n", + "n2=n1-Del*n1\n", + "NA=((n1+n2)*(n1-n2))**(1/2.0)\n", + "print \"numerical aperture is NA=\",round(NA,2),\"unitless\"\n", + "#to calculate critical angle at the core cladding interface within the fibre\n", + "thetac=math.degrees(math.asin(n2/n1))\n", + "print \"thetac=\",int(thetac),\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.3:pg-190" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "refractive index is n2= 1.438 unitless\n", + "normalised frequency V number of the fibre is V= 65.3 unitless\n", + "total number of guided modes in the fibre is M= 2132 modes\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index of the cladding\n", + "a=35.0*10**-6 #core diameter in micrometre\n", + "#formula is del=(n1-n2)/n1\n", + "#we get\n", + "Del=1.5/100 \n", + "n1=1.46 #refractive index of the fibre \n", + "lamda=0.85*10**-6 #wavelength in micrometer\n", + "n2=n1-Del*n1\n", + "print \"refractive index is n2=\",round(n2,3),\"unitless\"\n", + "#to calculate normalised frequency V number of the fibre\n", + "V=round((2*math.pi*a*n1*0.173)/lamda,1)\n", + "print \"normalised frequency V number of the fibre is V=\",V,\"unitless\"\n", + "#to calculate total number of guided modes in the fibre\n", + "M=(V**2)/2.0\n", + "print \"total number of guided modes in the fibre is M=\",int(M),\"modes\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.4:pg-191" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "cut-off wavelength is LAMBDAc= 1.354 micrometre\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate cut-off wavelength of the fibre\n", + "#(2*del)**(1/2)=(2*(n1-n2)/n1)**(1/2)=(0.005)**(1/2)=0.071\n", + "a=5*10**-6 #radius in micrometre\n", + "n1=1.46 #core refractive index in micrometre\n", + "Vc=2.405 #cut-off value of V parametre for single mode operation\n", + "#formula is LAMBDAc=(2*math.pi*a*n1*(2*del)**(1/2))/Vc \n", + "lamdac=(2*math.pi*a*n1*0.071)/Vc\n", + "print \"cut-off wavelength is LAMBDAc=\",round(lamdac/1e-6,3),\"micrometre\"\n", + "\n", + "# answer is slightly different due to approximation in book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.5:pg-191" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "maximum value of phase constant is maximum= 12.566 radian/micrometre\n", + "minimum value of phase constant is minimum= 11.31 radian/micrometre\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate maximum and minimum value of phase constant\n", + "lamda=0.8*10**-6 #wavelength in micrometre\n", + "n1=1.6*10**-6 \n", + " #refractive indices in micrometre\n", + "n2=1.44*10**-6\n", + "maximum=(2*math.pi*n1)/lamda\n", + "minimum=(2*math.pi*n2)/lamda\n", + "print \"maximum value of phase constant is maximum=\",round(maximum,3),\"radian/micrometre\"\n", + "print \"minimum value of phase constant is minimum=\",round(minimum,3),\"radian/micrometre\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter7-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter7-checkpoint.ipynb new file mode 100755 index 00000000..a40aa43f --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter7-checkpoint.ipynb @@ -0,0 +1,902 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Chapter7:WAVE MECHANICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.1:pg-200" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the de Broglie wavelength is lamda= 2.635e-14 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate de Broglie wavelength \n", + "v=1.5*10**7 #velocity of proton =(1/20)*velocity of light i.e.3*10**8 in m/s\n", + "m=1.67*10**-27 #mass of the proton in kg\n", + "h=6.6*10**-34 #plank's constant \n", + "lamda=h/(m*v)\n", + "print \"the de Broglie wavelength is lamda=\",\"{:.3e}\".format(lamda),\"m\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.2:pg-200" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the de Broglie wavelength is lamda= 8e-05 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate de Broglie wavelength\n", + "#mo*c**2=1.507*10**-10/1.6*10**-19=941.87 Mev\n", + "#since 12.8 Mev is very small compared to rest mass energy hence relavistic consideration may be ignored\n", + "m=1.67*10**-27 #mass in kg\n", + "h=6.62*10**-34 #plank's constant\n", + "E=12.8*10**6 #energy in Mev\n", + "lamda=h/math.sqrt(2*m*E*1.6*10**-19)/(1e-10)\n", + "print \"the de Broglie wavelength is lamda=\",round(lamda,5),\"angstrom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.4:pg-201" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength is lamda= 3.46e-11 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "h=6.6*10**-34 #plank's constant\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "E=1.25*10**3 #pottential difference keV\n", + "lamda=h/math.sqrt(2*m*E*1.6*10**-19)\n", + "print \"the wavelength is lamda=\",\"{:.2e}\".format(lamda),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.5:pg-201" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy of an electron is K= 4.34e-06 eV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate kinetic energy of an electron \n", + "h=6.63*10**-34 #plank's constant\n", + "mo=9.1*10**-31 #rest mass of an electron in kg\n", + "lamda=5896*10**-10 #wavelength in angstrom\n", + "K=(h**2)/(2*mo*(lamda**2)*1.6*10**-19) \n", + "print \"kinetic energy of an electron is K=\",\"{:.2e}\".format(K),\"eV\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.6:pg-202" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of an electron of kinetic energy is lamda= 8.733e-13 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate the wavelength of an electron of kinetic energy\n", + "mo=9.1*10**-31 #mass of an electron in kg\n", + "c=3*10**8 #speed of light in m/s \n", + "K=1*10**6#kinetic energy in eV\n", + "h=6.62*10**-34 #planck's constant in J-s\n", + "#E=moc**2=81.9*10**-15/1.6*10**-19 eV=0.51MeV\n", + "E=0.51*10**6\n", + "lamda=(h*c)/(math.sqrt(K*(K+2*E))*1.6*10**-19)\n", + "print \"wavelength of an electron of kinetic energy is lamda=\",round(lamda,16),\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.7:pg-203" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "de Broglie wavelength of any electron is lamda= 1.225 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate de Broglie wavelength\n", + "V=100 #potential difference in volts\n", + "lamda=12.25/math.sqrt(V)\n", + "print \"de Broglie wavelength of any electron is lamda=\",lamda,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.9:pg-203" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of the neutron is E= 8.132e-02 eV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate energy of the neutron\n", + "h=6.60*10**-34 #plank's constant in J/s\n", + "m=1.674*10**-27 #mass of the neutron in kg\n", + "lamda=10**-10 #de Broglie wavelength in m\n", + "E=(h**2)/(2*m*(lamda**2)*1.6*10**-19)\n", + "print \"energy of the neutron is E=\",\"{:.3e}\".format(E),\"eV\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.10:pg-204" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of quantum of radiant energy is lamda= 0.0242 angstrom\n", + "number of photons emitted per sec is number= 2.727e+19 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "h=6.6*10**-34 #plank's constant in J/sec\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "c=3*10**8 #light speed in m/s\n", + "# part a\n", + "lamda=h/(m*c)/(1e-10) # in angstrom\n", + "print \"wavelength of quantum of radiant energy is lamda=\",round(lamda,4),\"angstrom\"\n", + "#to calculate number of photons \n", + "# part b\n", + "power=12 #power emitted by the lamp =150*(8/100) in watts\n", + "E=12.0 #energy emitted per second\n", + "lamda=4500*10.0**-10\n", + "energy=(h*c)/lamda #energy contained in one photon in J\n", + "number=E/energy\n", + "print \"number of photons emitted per sec is number=\",\"{:.3e}\".format(number),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.11:pg-209" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "smallest possible uncertainity in the position of an electron is delxmin= 0.039 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in position\n", + "#actual formula is (delx)min*(delp)max=h/2*math.pi-------------eq(1)\n", + "#(delp)max=p(momentum of the electron)\n", + "#mv=mov/math.sqrt(1-(v/c)**2)---------------------eq(2)\n", + "mo=9*10**-31 #mass of an electron in m/s\n", + "c=3*10**8 #light speed in m/s\n", + "v=3*10**7 #velocity in m/s \n", + "h=6.6*10**-34 #plank's constant in J/s\n", + "#from eq(1) and eq(2),we get\n", + "delxmin=(h*math.sqrt(1-(v/c)**2))/(2*math.pi*mo*v)\n", + "print \"smallest possible uncertainity in the position of an electron is delxmin=\",round(delxmin/1e-10,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.12:pg-209" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in the velocity is delvmin= 1.17e+04 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate minimum uncertainity in the velocity\n", + "delxmax=10**-8 #maximum uncertainity in position in m\n", + "h=6.626*10**-34 #planck's constant\n", + "delpmin=h/(2*math.pi*delxmax) #minimum uncertainity in momentum in kg-m/s**2 \n", + "m=9*10**-31 #mass of an electron in kg\n", + "delvmin=delpmin/m\n", + "print \"minimum uncertainity in the velocity is delvmin=\",\"{:.2e}\".format(delvmin),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.13:pg-209" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "uncertainity in the momentum of the parcticle is delp= 1.05e-30 kg-m/s**2\n", + "uncertainity in the velocity of an electron is delv= 2.343e+05 m/s\n", + "uncertainity in the velocity of an electron is delv= 31.574 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in the momentum of the parcticle \n", + "h=6.626*10**-34 #planck's constant J-s\n", + "delx=0.01*10**-2 #uncertainity in position in m\n", + "delp=h/(2*math.pi*delx)\n", + "print \"uncertainity in the momentum of the parcticle is delp=\",\"{:.2e}\".format(delp),\"kg-m/s**2\"\n", + "#to calculate uncertainity in the velocity of an electron\n", + "m=9*10**-31 #mass of an electron in kg\n", + "delx=5*10**-10 \n", + "delv=h/(2*math.pi*m*delx)\n", + "print \"uncertainity in the velocity of an electron is delv=\",\"{:.3e}\".format(delv),\"m/s\"\n", + "#to calculate uncertainity in the velocity of alpha particle \n", + "m=4*1.67*10**-27 #mass of alpha particle in kg\n", + "delx=5*10**-10\n", + "delv=h/(2*math.pi*m*delx)\n", + "print \"uncertainity in the velocity of an electron is delv=\",round(delv,3),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.14:pg-210" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "uncertainity in the position of the electron is delx= 2.883e-06 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in position\n", + "m=9.11*10**-31 #mass of electron in kg\n", + "delv=40 #uncertainity in velocity in m/s\n", + "h=6.6*10**-34 #plank's constant \n", + "delx=h/(2*math.pi*m*delv)\n", + "print \"uncertainity in the position of the electron is delx=\",\"{:.3e}\".format(delx),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.15:pg-210" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in the frequency of the photon is delv= 1.592e+07 sec**-1\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in frequency\n", + "#delE*delt=h/2*math.pi----eq(1)\n", + "#delE=h*delv-----------eq(2)\n", + "delt=10**-8 #uncertainity in time in s\n", + "#from eq(1) and eq(2),we get\n", + "delnu=1/(2*math.pi*delt)\n", + "print \"minimum uncertainity in the frequency of the photon is delv=\",\"{:.3e}\".format(delnu),\"sec**-1\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.16:pg-211" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum error with which the energy of the state can be measured is delE= 0.026 ev\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in the energy\n", + "h=6.63*10**-34 #plank's constant in J-s\n", + "delt=2.5*10**-14 #uncertainity in time in s\n", + "delE=h/(2*math.pi*delt*1.6*10**-19)\n", + "print \"minimum error with which the energy of the state can be measured is delE=\",round(delE,3),\"ev\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.17:pg-211" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time required for the atomic system to retain rotational energy is delt= 1.910e-08 s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate time required for the atomic system \n", + "#delE=h*c*dellamda/lamda**2 -----eq(1)\n", + "#delE*delt=h/2*math.pi----------eq(2)\n", + "dellamda=10**-14\n", + "c=3*10**8\n", + "lamda=6*10**-7\n", + "#from eq(1)and eq(2),we get\n", + "delt=(lamda**2)/(2*math.pi*c*dellamda)\n", + "print \"time required for the atomic system to retain rotational energy is delt=\",\"{:.3e}\".format(delt),\"s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.18:pg-211" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in the momentum of the nucleon is delpmin= 2.109e-21 kg m/s\n", + "minimum kinetic energy of the nucleon is Emin= 8299.24 eV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate minimum uncertainity in the momentum \n", + "delxmax=5*10**-14 #uncertainity in position in m\n", + "h=6.626*10**-34 #plank's constant in Js\n", + "delpmin=h/(2*math.pi*delxmax)\n", + "print \"minimum uncertainity in the momentum of the nucleon is delpmin=\",\"{:.3e}\".format(delpmin),\"kg m/s\"\n", + "m=1.675*10**-27 #mass in kg\n", + "Emin=(delpmin**2)/(2*m*1.6*10**-19)\n", + "print \"minimum kinetic energy of the nucleon is Emin=\",round(Emin,3),\"eV\"\n", + "#the answer is given wrong in the book Emin=0.039 eV\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.19:pg-212" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in velocity is delv= 1.054e+04 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in velocity\n", + "delx=1.1*10**-8 #uncertainity in velocity in m\n", + "h=6.626*10**-34 #plank's constant\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "delv=h/(2*math.pi*m*delx)\n", + "print \"minimum uncertainity in velocity is delv=\",\"{:.3e}\".format(delv),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.20:pg-212" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in the frequency of a photon is delnu= 1.592e+07 sec**-1\n", + "energy of an electron is E= 3.164e-12 J\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#part a\n", + "#to calculate uncertainity in frequency\n", + "delt=10**-8 #uncertainity in time\n", + "delnu=1/(2*math.pi*delt) \n", + "print \"minimum uncertainity in the frequency of a photon is delnu=\",\"{:.3e}\".format(delnu),\"sec**-1\"\n", + "#to use the uncertainity principle to place a lower limit on the energy an electron must have if it is to be part of a nucleus\n", + "\n", + "# part b\n", + "delx=5*10**-15 #uncertainity in position\n", + "delp=h/(2*2*math.pi*delx) #uncertainbity in momentum\n", + "c=3*10**8 #/speed of light in m/s\n", + "E=delp*c\n", + "print \"energy of an electron is E=\",\"{:.3e}\".format(E),\"J\"\n", + "\n", + "# the answer is slightlty different due to approximation in textboook\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.22:pg-223" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability of finding the particle is P= 0.4 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate probability of finding the particle\n", + "a=25*10**-10#width in angstrom \n", + "#wave function of the particle is chi(x)=math.sqrt(2/a)*math.sin(n*math.pi*x/a),for the particle in the least energy state n=1\n", + "chix=math.sqrt(2/a)*math.sin(math.pi*(a/2)/a)\n", + "delx=5*10**-10 #interval in angstrom\n", + "P=delx*chix**2\n", + "print \"probability of finding the particle is P=\",P,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.24:pg-224" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of an electron moving in one dimension in an infinitely high potential box is E= 37.649 eV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate energy of an electron\n", + "n=1 #least energy of the particle \n", + "h=6.63*10**-34 #planck's constant in Js\n", + "m=9.11*10**-31 #mass of electron in kg\n", + "a=10**-10 #width in angstrom\n", + "E=(n**2)*(h**2)/(8*m*(1.602*10**-19)*a**2)\n", + "print \"energy of an electron moving in one dimension in an infinitely high potential box is E=\",round(E,3),\"eV\"\n", + "#the answer is given wrong in the book E=5.68 eV\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.26:pg-225" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P1= 0.198 unitless\n", + "probability for the ground states is probability1 = 19.836 %\n", + "P2= 0.0065 unitless\n", + "probability for first excited states is probability2= 0.645 %\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate probability\n", + "x1=0.45 #x1=0.45*L\n", + "x2=0.55 #x2=0.55*L\n", + "n=1 #for ground state \n", + "#formula is P=integrate('(2/L)*math.sin(n*math.pi*x)**2),'x',x1,x2)\n", + "from scipy.integrate import quad\n", + "def integrand(x):\n", + " return 2*(math.sin(n*math.pi*x)**2)\n", + "P1 ,er=quad(integrand,x1,x2)\n", + "\n", + "print \"P1=\",round(P1,3),\"unitless\"\n", + "probability1=P1*100\n", + "print \"probability for the ground states is probability1 =\",round(probability1,3),\"%\"\n", + "n=2 #for first excited state\n", + "P2, er=quad(integrand,x1,x2)\n", + "print \"P2=\",round(P2,4),\"unitless\"\n", + "probability2=P2*100 \n", + "print \"probability for first excited states is probability2=\",round(probability2,3),\"%\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.28:pg-226" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "lowest energy of a neutron is E= 6.431 MeV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate energy of a neutron\n", + "#consider nucleus as a cubical box of size 10**-14m\n", + "#x=y=z=a=10**-14=l\n", + "#for neutron to be in the lowest energy state nx=ny=nz=1\n", + "#formula is E=(math.pi**2*h**2/8*math.pi**2*m)*((nx/lx)**2+(ny/ly)**2+(nz/lz)**2)\n", + "h=6.626*10**-34 #planck's constant in Js\n", + "m=1.6*10**-27 #mass in kg\n", + "l=10**-14 #in m\n", + "E=(math.pi**2)*(h**2)*3/(4*(math.pi**2)*2*m*(1.6*10**-19)*l**2)\n", + "print \"lowest energy of a neutron is E=\",round(E/(1e6),3),\"MeV\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.29:pg-226" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "zeropointenergy= 1.657e-32 J\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate zero point energy of a linear harmonic oscillator\n", + "h=6.63*10**-34 #planck's constant in Js\n", + "nu=50 #frequency in Hz\n", + "zeropointenergy=(h*nu)/2\n", + "print \"zeropointenergy=\",\"{:.3e}\".format(zeropointenergy),\"J\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.30:pg-226" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "zeropointenergy= 3.315e-34 J\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate zero point energy\n", + "nu=1 #frequency in Hz\n", + "h=6.63*10**-34 #planck's constant in Js\n", + "zeropointenergy=(h*nu)/2\n", + "print \"zeropointenergy=\",zeropointenergy,\"J\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.31:pg-226" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the frequency of vibration is nu= 6.895e+12 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate frequency of vibration\n", + "En=0.1*1.6*10**-19 #energy of a linear harmonic oscillator in eV\n", + "n=3.0 #third excited state\n", + "h=6.63*10**-34 #planck's constant\n", + "nu=En/((n+(1/2.0))*h)\n", + "print \"the frequency of vibration is nu=\",round(nu,-9),\"Hz\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter8-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter8-checkpoint.ipynb new file mode 100755 index 00000000..9a8917f6 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter8-checkpoint.ipynb @@ -0,0 +1,613 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter8:X-RAY" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.1:pg-240" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of plancks constant is h= 6.587e-34 J-s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate value of planck's constant\n", + "e=1.6*10**-19 #in C\n", + "V=100*10**3 #voltage in KV\n", + "c=3*10**8 #light speed in m/s\n", + "lamdamin=12.35*10**-12 #wavelength in m\n", + "h=e*V*lamdamin/c\n", + "print \"the value of plancks constant is h=\",\"{:.3e}\".format(h),\"J-s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.2:pg-240" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "maximum frequency present in the radiation from an X-ray tube is numax= 7.576e+37 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate maximum frequency\n", + "h=6.6*10**-34 #planck's constant in J-s\n", + "c=3.0*10**8 #light speed in m/s\n", + "Ve=50000 #accelerating potential in V\n", + "lamdamin=h*c/Ve #wavelength in m\n", + "numax=c/lamdamin\n", + "print \"maximum frequency present in the radiation from an X-ray tube is numax=\",\"{:.3e}\".format(numax),\"Hz\"\n", + "#answer is given in thec book is incorrect =1.2*10**19 Hz\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.3:pg-240" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of electrons striking the target per second is n= 1.250e+16 unitless\n", + "the speed with which electrons strike the target is v= 6.603e+07 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of electrons \n", + "I=2*10**-3 #current in mA\n", + "e=1.6*10**-19 \n", + "n=I/e\n", + "print \"number of electrons striking the target per second is n=\",\"{:.3e}\".format(n),\"unitless\"\n", + "#to calculate speed\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "V=12.4*10**3 #potential difference in V\n", + "v=math.sqrt(2*V*e/m)\n", + "print \"the speed with which electrons strike the target is v=\",\"{:.3e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.4:pg-240" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the longest wavelength that can be analysed by a rock salt crystal is lamdamax= 2.820e-10 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "n=2 #second order for longest wavelength\n", + "d=2.82*10**-10 # spacing in angstrom\n", + "sintheta=1 \n", + "lamdamax=2*d*sintheta/n\n", + "print \"the longest wavelength that can be analysed by a rock salt crystal is lamdamax=\",\"{:.3e}\".format(lamdamax),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.5:pg-241" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the spacing of the crystal is d= 0.661 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate spacing of the crystal\n", + "h=6.62*10**-34 #planck's constant in J-s\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "V=344 #voltage in V\n", + "e=1.6*10**-19\n", + "lamda=h/math.sqrt(2*m*e*V) #wavelength in m\n", + "#according to Bragg's law\n", + "n=1\n", + "#formula is 2*d*sintheta=n*lamda\n", + "d=n*lamda/(2*math.sin(math.pi/6))\n", + "print \"the spacing of the crystal is d=\",round(d/1e-10,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.6:pg-241" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of Kalpha line for an atom is alphaa= 1.464e-09 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of Kalpha line for an atom\n", + "R=1.1*10**5\n", + "z=92\n", + "#Ka line is emitted when electron jumps from l shell(n2=2) to k shell(n1=1)\n", + "#formula is 1/alphaa=R*(z-b)*((1/n1**2)-(1/n2)**2)\n", + "alphaa=4/(3*R*(z-1)**2)\n", + "print \"wavelength of Kalpha line for an atom is alphaa=\",\"{:.3e}\".format(alphaa),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.7:pg-241" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thickness is x= 1.849 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness\n", + "#mass absorption coefficient mum of an absorber is related with linear absorption coefficient mu and density of the material rho is given by\n", + "#mu=rho*mum=2.7*0.6=1.62 cm**-1\n", + "mu=1.62\n", + "#if initial intensity Io of the X-ray beam is reduced to I in traversing a distance x in absorber I=Io*e**-mu*x\n", + "#where I/Io=20\n", + "#put above values in the below equation , we get\n", + "x=(2.3026*(math.log(20)/math.log(10)))/1.62\n", + "print \"thickness is x=\",round(x,3),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.8:pg-242" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "atomic number is z= 31 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate atomic number of the element\n", + "#equation for balmer series in hydrogen spectrum is 1/lamda=R*((1/2**2)-(1/n**2))\n", + "#for series limit n=infinity ,R=4/lamdainfinity i.e. R=4/364.6nm\n", + "#X-ray wavelength of K series is 1/lamda=R*(z-1)**2*((1/1**2)-(1/n**2))\n", + "lamda=0.1*10**-9\n", + "R=4/(364.6*10**-9)\n", + "#for n=infinity ,minimum wavelength of k series is given by\n", + "z=math.sqrt(1/(lamda*R))+1\n", + "print \"atomic number is z=\",int(z),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.9:pg-242" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of X-rays is lamda= 0.935 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "d=1.87*10**-10 #spacing in angstrom\n", + "n=2 \n", + "#formula is lamda=2*d*sintheta/n\n", + "lamda=2*d*math.sin(math.pi/6)/n\n", + "print \"the wavelength of X-rays is lamda=\",round(lamda/1e-10,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.10:pg-242" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of X-ray is lamda1= 1.68 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of second X-ray beam\n", + "#from bragg's law\n", + "#lamda=(d*math.sin(math.pi/3))/n eq(1)\n", + "#it is given that,theta=60,n=3,lamda=1.97 angstrom\n", + "#from eq(1) we get,2*d*sin60degree=3*0.97 eq(2)\n", + "#let lamda' be the second X-ray beam \n", + "#we get 2*d'*sin theta'=n'*lamda' eq(3)\n", + "#from eq(2) and eq(3),we get\n", + "lamda1=math.sin(math.pi/6)*3*0.97/math.sin(math.pi/3) #where lamda1=lamda'\n", + "print \"wavelength of X-ray is lamda1=\",round(lamda1,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.11:pg-243" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of X-ray is lamda= 0.979 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "d=2.82*10**-10 #spacing in m\n", + "n=1 \n", + "lamda=2*d*math.sin(10*math.pi/180)/n\n", + "print \"wavelength of X-ray is lamda=\",round(lamda/1e-10,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.12:pg-243" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "d1= 4e-10 m\n", + "d2= 2e-10 m\n", + "d3= 0.0 m\n", + "d4= 1e-10 m\n" + ] + } + ], + "source": [ + "import math\n", + "#deduce possible spacing of the set of planes\n", + "#for first order , 2*d*sintheta1=1*lamda...eq(1)\n", + "#for second order ,2*d*sintheta2=2*lamda..eq(2)\n", + "#for third order, 2*d*sintheta3=3*lamda......eq(3)\n", + "#for fourth order, 2*d*sintheta4=4*lamda..............eq(4)\n", + "#divide eq(2) by eq(1),we get sintheta2=2*sintheta1\n", + "#similarly,sintheta3=3*sintheta1,sintheta4=4*sintheta1\n", + "lamda=1.32*10**-10\n", + "sintheta1=0.1650\n", + "d1=lamda/(2*sintheta1)#for first order n=1,d1=d/n\n", + "d2=lamda/(2*2*sintheta1) #for second order n=2,d2=d/n\n", + "d3=lamda/(2*3*sintheta1) #for third order n=3,d3=d/n\n", + "d4=lamda/(2*4*sintheta1) #for fourth order n=4,d4=d/n\n", + "print \"d1=\",d1,\"m\"\n", + "print \"d2=\",d2,\"m\"\n", + "print \"d3=\",round(d3,2),\"m\"\n", + "print \"d4=\",d4,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.13:pg-248" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "compton shift is dellamda= 0.0071 angstrom\n", + "wavelength of the scattered X-rays is lamda= 2.0071 angstrom\n", + "energylost = 0.00354 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate compton shift and wavelength\n", + "h=6.63*10**-34 #planck's constant in J-s\n", + "m0=9.11*10**-31 #mass of electron\n", + "c=3*10**8 #light speed in m/s\n", + "dellamda=h*(1-(1/math.sqrt(2)))/(m0*c)\n", + "lamda0=2*10**-10\n", + "lamda=dellamda+lamda0\n", + "print \"compton shift is dellamda=\",round(dellamda/1e-10,4),\"angstrom\"\n", + "print \"wavelength of the scattered X-rays is lamda=\",round(lamda/1e-10,4),\"angstrom\"\n", + "#to calculate fraction of energy lost by the photon in the collision\n", + "#energy lost =E0-E/E0=(hc/lamda0)-(hc/lamda)/(ha/lamda0)\n", + "#we get,\n", + "energylost=dellamda/lamda\n", + "print \"energylost =\",round(energylost,5),\"unitless\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.14:pg-249" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength is lamda= 0.0245 angstrom\n", + "energy of the incident photon is E= 8.100e-14 J\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength and energy\n", + "#formula is lamda'-lamda=h*(1-cos phi)/(m0*c),where phi=90 degree, lamda'=2lamda ---------------eq(1)\n", + "#dellamda=2lamda-lamda=lamda ----------------------------eq(2)\n", + "h=6.62*10**-34 #planck's constant\n", + "c=3*10**8 #light speed in m.s\n", + "m0=9*10**-31 #mass of electron in kg\n", + "#from eq(1) and eq(2) ,we get\n", + "lamda=h/(m0*c)\n", + "print \"wavelength is lamda=\",round(lamda/1e-10,4),\"angstrom\"\n", + "E=h*c/lamda\n", + "print \"energy of the incident photon is E=\",\"{:.3e}\".format(E),\"J\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.15:pg-249" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of radiation is lamda1= 4.844e-12 m\n", + "direction of emission of electron is theta= 26.607 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of radiation and direction of emission\n", + "h=6.6*10**-34 #planck's constant in J-s\n", + "c=3*10**8 #speed of light in m/s\n", + "energy=510*10**3 #energy of photon in eV\n", + "lamda=h*c/(energy*1.6*10**-19)\n", + "mo=9.1*10**-31 #mass of electron in Kg\n", + "lamda1=lamda+h*(1-math.cos(math.pi/2))/(mo*c)\n", + "print \"wavelength of radiation is lamda1=\",\"{:.3e}\".format(lamda1),\"m\"\n", + "theta=math.degrees(math.atan(lamda*math.sin(math.pi/2)/(lamda1-lamda*math.cos(math.pi/2))))\n", + "print\"direction of emission of electron is theta=\",round(theta,3),\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.16:pg-249" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of two X-rays is lamda1= 10.708 picometer\n", + "maximum wavelength present in the scattered X-rays is lamda2= 14.835 picometer\n", + "maximum kinetic energy of the recoil electrons is Kmax= 40.333 KeV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of two X-rays\n", + "h=6.6*10**-34 #planck's constant in J-s\n", + "c=3.0*10.0**8 #light speed in m/s\n", + "mo=9.1*10**-31 #mass of electron in kg\n", + "lamda=10.0*10**-12 #wavelength in pm\n", + "lamda1=lamda+((h/(mo*c))*(1-(1/math.sqrt(2))))\n", + "print \"wavelength of two X-rays is lamda1=\",round(lamda1*(1e12),3),\"picometer\"\n", + "#to calculate maximum wavelength\n", + "lamda2=lamda+((2*h)/(mo*c))\n", + "print \"maximum wavelength present in the scattered X-rays is lamda2=\",round(lamda2*(1e12),3),\"picometer\"\n", + "#to calculate maximum kinetic energy \n", + "Kmax=(h*c)*((1/lamda)-(1/lamda2))/(1.6*10**-19)\n", + "print \"maximum kinetic energy of the recoil electrons is Kmax=\",round(Kmax/1000.0,3),\"KeV\"\n", + "\n", + "# the answer is slightly different due to approximation\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter9-checkpoint.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter9-checkpoint.ipynb new file mode 100755 index 00000000..cb4c87db --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/.ipynb_checkpoints/chapter9-checkpoint.ipynb @@ -0,0 +1,136 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter9:DIELECTRIC PROPERTIESOF MATERIALS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.1:pg-269" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the dielectric constant of the liquid is epsilon0= 2 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate dielectric constant of the liquid\n", + "#capacitance of the air filled dielectric Cair=Q/Vo-----------eq(1)\n", + "#when dielectric is filled between the plates ,Cliquid=Q/V\n", + "#then Cliquid=epsilonr*Q/Vo------eq(2)\n", + "Vo=60\n", + " #voltage in volts\n", + "V=30\n", + "#from eq(1) and eq(2),we get\n", + "epsilon0=Vo/V\n", + "print \"the dielectric constant of the liquid is epsilon0=\",epsilon0,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.2:pg-269" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the charge on the capacitance is Q= 1.417e-09 Coulomb\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate charge on the capacitance\n", + "epsilon0=8.854*10**-12 #permittivity\n", + "epsilonr=6 #relative permittivity\n", + "V=100 #voltage in volts\n", + "d=1.5*10**-3 #distance in m\n", + "A=4*10**-4#area in m**2\n", + "Q=epsilon0*epsilonr*A*V/d\n", + "print \"the charge on the capacitance is Q=\",\"{:.3e}\".format(Q),\"Coulomb\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.3:pg-269" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the resultant voltage across the capacitor is V= 39.716 volt\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate voltage\n", + "A=6.50*10**-4 #area in m**2\n", + "Q=2*10**-10 #charge in C\n", + "d=4*10**-3 #plate separation in m\n", + "epsilon0=8.854*10**-12\n", + "epsilonr=3.5 #dielectric constant\n", + "V=Q*d/(epsilon0*epsilonr*A)\n", + "print \"the resultant voltage across the capacitor is V=\",round(V,3),\"volt\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter1.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter1.ipynb new file mode 100755 index 00000000..f5b74a8b --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter1.ipynb @@ -0,0 +1,841 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter1:RELATIVISTIC MECHANICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.1:pg-12" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " the length of bar in is 0.66 m\n" + ] + } + ], + "source": [ + "# example 1\n", + "import math\n", + "#to calculate length of the bar measured by the ststionary observer\n", + "lo =1 #length in metre\n", + "v=0.75*3*10**8 #speed (m/s)\n", + "c=3*10**8 #light speed(m/s)\n", + "l=lo*math.sqrt(1-(v**2/c**2))\n", + "print \"\\n the length of bar in is\",round(l,2),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.2:pg-12" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " velocity of rocket is v= 4.23e+07 m/s\n" + ] + } + ], + "source": [ + "# example 2\n", + "import math\n", + "#to calculate velocity of rocket \n", + "#lo be the length at rest \n", + "l=99.0/100 #length is 99 per cent of its length at rest is l=(99/100)lo\n", + "c=3*10**8 #light speed(m/s)\n", + "v=c*math.sqrt(1-l**2) #formula is v=c math.sqrt(1-(l/lo)**2)\n", + "print\"\\n velocity of rocket is v=\",\"{:.2e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.4:pg-13" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "percentage contraction of a rod is 8.35 %\n" + ] + } + ], + "source": [ + "import math\n", + "#to percentage contraction of a rod\n", + "c=3*10**8 #light speed(m/s)\n", + "v=0.8*c #velocity(m/s)\n", + "#let lo be the length of the rod in the frame in which it is at rest\n", + "#s' is the frame which is moving with a speed 0.8c in a direction making an angle 60 with x-axis\n", + "#components of lo along perpendicular to the direction of motion are lo cos60 and lo sin60 respectively\n", + "l1=math.cos(math.pi/3)*math.sqrt(1-(v/c)**2) #length of the rod alond the direction of motion =lo math.cos(pi/3)math.sqrt(1-(v/c)**2)\n", + "l2=math.sin(math.pi/3) #length of the rod perpendicular to the direction of motion =lo sin60\n", + "l=math.sqrt(l1**2+l2**2) # length of the moving rod\n", + "per=(1-l)*100/1\n", + "print \"percentage contraction of a rod is\",round(per,2),\"%\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.7:pg-14" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of the circular lamina relative to frame s is v= 2.598e+08 m/s\n" + ] + } + ], + "source": [ + "# example 7\n", + "import math\n", + "#to calculate velocity of the circular lamina \n", + "c=3*10**8 #light speed (m/s)\n", + "#R'=R/2 (radius)\n", + "#R'=R math.sqrt(1-(v/c)**2)\n", + "v=(math.sqrt(3)/2)*c \n", + "print \"velocity of the circular lamina relative to frame s is v=\",\"{:.3e}\".format(v),\"m/s\"\n", + "#answer is given in terms of c in the textbook\n", + "\n", + "\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.8:pg-17" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "speed of the clock is = 5.45e+07 m/s\n" + ] + } + ], + "source": [ + "# example 8\n", + "import math\n", + "#to calculate speed of the clock\n", + "#clock should record l=59 minutes for each hour recorded by clocks stationary with respect to the observer\n", + "l=59.0 \n", + "lo=60\n", + "c=3*10**8 #light speed (m/s)\n", + "v=math.sqrt(c**2*(1-l**2/lo**2))\n", + "print \"speed of the clock is =\",\"{:.2e}\".format(v),\"m/s\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.9:pg-17" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance travelled by the beam is d= 20.0 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distance travelled by the beam \n", + "deltat0=2.5*10**-8 #proper half life of pi mesons in (s)\n", + "c=3*10**8 #light speed (m/s)\n", + "v=0.8*c #mesons velocity (m/s)\n", + "deltat=deltat0/math.sqrt(1-(v/c)**2) #half life (s)\n", + "#No=initial flux ,N=flux after time t\n", + "#N=N0 e**(-t/T)\n", + "#N=N0/e**2 (given)=No e(-t/T)\n", + "#t=2 deltat\n", + "d=2*deltat*v #d=vt\n", + "print \"distance travelled by the beam is d=\",d,\"m\" \n", + "#answer is given in the textbook=19.96 m\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.10:pg-17" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance travelled by the particle in this time is d= 20.57 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distance travelled by the particle \n", + "deltat0=2*10**-8 #proper half life to of the particle in (s) \n", + "c=3*10**8 #light speed (m/s)\n", + "v=0.96*c #speed of the particle (m/s)\n", + "deltat=(deltat0)/(math.sqrt(1-(v/c)**2)) #half life in the laboratory frame t in (s) \n", + "#t=deltat (flux of the beam falls to (1/2) times initial flux)\n", + "d=v*deltat #d=vt\n", + "print \"distance travelled by the particle in this time is d=\",round(d,2),\"m\"\n", + "#answer is given wrong in the textbook =20.45 m\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.11:pg-18" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " moving clock appears to lose 4min in 24 hours from the stationary observer is v= 3.0e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate speed\n", + "deltat0=1440 #proper time interval measured by an observer moving with the clock (min)\n", + "deltat=1444 #time interval measured by a stationary observer (min)\n", + "c=3*10**8 #light speed (m/s)\n", + "v=c*math.sqrt(1-(deltat0/deltat)**2)\n", + "print \" moving clock appears to lose 4min in 24 hours from the stationary observer is v=\",\"{:.1e}\".format(v),\"m/s\"\n", + "#answer is given wrong in the book =2.32*10**7 m/s\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.12:pg-18" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " velocity of the beta particle as observed by the experimenter is u= 2.82e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity of beta particle\n", + "c=3*10**8 #light velocity(m/s)\n", + "u1=0.9*c #velocity of the beta particle relative to the atom in the direction of motion\n", + "v=0.25*c #velocity of the radioactive atom relative to an experimenter\n", + "u=(u1+v)/(1+u1*v/c**2) \n", + "print \" velocity of the beta particle as observed by the experimenter is u=\",\"{:.2e}\".format(u),\"m/s\"\n", + "#answer is given in terms of c in the book =0.94c\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.13:pg-18" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " the velocity of B with respect to A (m/s) is -2.93e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity\n", + "c=3*10**8 # light velocity\n", + "v=0.75*c #speed of A\n", + "ux=-0.85*c #speed of B\n", + "ux1=(ux-v)/(1-ux*v/c**2)\n", + "print\"\\n the velocity of B with respect to A (m/s) is\",\"{:.2e}\".format(ux1),\"m/s\"\n", + "#answer is given in terms of c in the book=-0.9771c\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.14:pg-19" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "u=ux i+uy j+uz k\n", + "where\n", + "ux= 2.4e+08 m/s\n", + "uy= 2.4 m/s\n", + "uz= 7.2 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity in the laboratory frame\n", + "c=3*10**8 #light speed (m/s)\n", + "v=0.8*c #velocity relative to laboratory along positive direction of x-axis\n", + "#given that u'=3 i+4 j+12 k (m/s)\n", + "ux1=3 #in (m/s)\n", + "uy1=4 #in (m/s)\n", + "uz1=12 #in (m/s)\n", + "ux=(ux1+v)/(1+v*ux1/c**2)\n", + "uy=(uy1*math.sqrt(1-(v/c)**2))/(1+v*ux1/c**2)\n", + "uz=(uz1*math.sqrt(1-(v/c)**2))/(1+v*ux1/c**2)\n", + "print \"u=ux i+uy j+uz k\"\n", + "print \"where\"\n", + "print \"ux=\",\"{:.1e}\".format(ux),\"m/s\"\n", + "print \"uy=\",round(uy,1),\"m/s\"\n", + "print \"uz=\",round(uz,1),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.17:pg-21" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "resultant velocity as observed by a person in frame s1 is u1=ux1 i+uy1 j\n", + "where\n", + "ux1= 0.0 m/s\n", + "uy1= 0.756 c m/s\n" + ] + } + ], + "source": [ + "import math\n", + "# to calculate velocity of the particle\n", + "c=3*10**8 #light speed (m/s)\n", + "v=0.4*c #velocity of frame s' relative to s along axis x\n", + "ux=0.8*c*(1/2.0) #component of velocity u(=0.8 c) of the particle along x axis ux=0.8 c cos60\n", + "uy=0.8*c*sin (math.pi/3) #component of the velocity u of the particle along y axis \n", + "ux1=(ux-v)/(1-ux*v/c**2)\n", + "uy1=uy*math.sqrt(1-(v/c)**2)/(1-(ux*v/c**2))\n", + "print \"resultant velocity as observed by a person in frame s1 is u1=ux1 i+uy1 j\"\n", + "print \"where\"\n", + "print \"ux1=\",ux1/c,\"m/s\"\n", + "print \"uy1=\",round(uy1/c,3),\"c m/s\"\n", + "#answer is given in terms of c in the book i.e. uy1=0.756c m/s\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.18:pg-25" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass m= 1.41 mo\n", + "momentum p= 3.0e+08 mo\n", + "energy E= 1.27e+17 mo\n", + "kinetic energy K= 3.73e+16 mo\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate mass, momentum,total energy,kinetic energy\n", + "c=3*10**8 #light speed (m/s)\n", + "v=c/sqrt (2) #velocity (m/s)\n", + "#let mo be the rest mass of the particle \n", + "#relativistic mass m of the particle is m=mo/math.sqrt(1-(v/c)**2)\n", + "m=1/sqrt (1-v**2/c**2) #in kg\n", + "print \"mass m=\",round(m,2),\" mo\"\n", + "#momentum p of the particle is p=mv\n", + "p=m*v #in kg-m/s\n", + "print \"momentum p=\",\"{:.1e}\".format(p),\" mo\"\n", + "#total energy E of the particle\n", + "E=m*c**2 #in J\n", + "print \"energy E=\",\"{:.2e}\".format(E),\" mo\"\n", + "#kinetic energy K=E-mo c**2\n", + "K=E-c**2 #in J\n", + "print \"kinetic energy K=\",\"{:.2e}\".format(K),\" mo\"\n", + "#answer is given in terms of m0 and c in the book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.19:pg-26" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of the particle is v= 2.828e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity of the parcticle \n", + "c=3*10**8 #light speed(m/s)\n", + "# we know that E(energy)=mc**2\n", + "# mo=rest mass\n", + "#E=3 moc**2=mc**2 or m=3 mo (given that total energy of the particle is thrice its rest energy) \n", + "m=3.0 # relativistic mass \n", + "#formula is v=c math.sqrt(1-(mo/m)**2)\n", + "v=math.sqrt(c**2*(1-(1/m)**2))\n", + "print \"velocity of the particle is v=\",\"{:.3e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.20:pg-26" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "mass is m= 3.58e-30 kg \n", + "speed of an electron is v= 2.9e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate mass(m),speed(v) of an electron\n", + "K=1.5*10**6*1.6*10**-19 #kinetic energy(J)\n", + "m0=9.11*10**-31 #rest mass of an electron(kg)\n", + "c=3*10**8 # velocity of light in vacuum(m/s)\n", + "m=(K/c**2)+m0 #relativistic kinetic energy(k=(m-mo)c**2)\n", + "print \"mass is m=\",\"{:.2e}\".format(m),\"kg \"\n", + "v=c*math.sqrt(1-m0**2/m**2)\n", + "print \"speed of an electron is v=\",\"{:.1e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.21:pg-27" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "amount of work to be done is w= 3.33e-14 J\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate work to be done \n", + "E=0.5*10**6 #rest energy of electron (MeV) E=m0*c**2\n", + "v1=0.6*3*10**8 #speed of electron in (m/s)\n", + "v2=0.8*3*10**8\n", + "c=3*10**8 #speed of light in (m/s)\n", + "K1=E*((1/math.sqrt(1-v1**2/c**2))-1) #kinetic energy in (eV)\n", + "K2=E*((1/math.sqrt(1-v2**2/c**2))-1)\n", + "w=(K2-K1)*1.6*10**-19\n", + "print \"amount of work to be done is w=\",\"{:.2e}\".format(w),\"J\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.22:pg-27" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " speed is v= 2.69e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate speed\n", + "c=3*10**8 #light speed (m/s)\n", + "m=2.25 #mass m of a body be 2.25 times its rest mass mo i.e. m=2.25m0\n", + "#formula is v=c math.sqrt(1-(m0/m)**2)\n", + "v=c*math.sqrt(1-(1/m)**2)\n", + "print \" speed is v=\",\"{:.2e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.23:pg-27" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "speed of the rocket is v= 4.21e+07 m/s\n", + "speed of an electron is v= 3.00e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate speed of the rocket\n", + "m0=50 #weight of man on the earth(kg)\n", + "m=50.5 #weight of man in rocket ship (kg)\n", + "c=3*10**8 #speed of light(m/s)\n", + "v=c*math.sqrt(1-m0**2/m**2)\n", + "print \"speed of the rocket is v=\",\"{:.2e}\".format(v),\"m/s\" \n", + "#to calculate speed of electron\n", + "m0=9.11*10**-31 #mass of electron =rest mass of proton\n", + "m=1.67*10**-27\n", + "v=c*math.sqrt(1-m0**2/m**2)\n", + "print \"speed of an electron is v=\",\"{:.2e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.24:pg-28" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "velocity of a body is v= 2.828e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate velocity\n", + "c=3*10**8 #light speed (m/s)\n", + "#K(kinetic energy)=(m-mo(rest mass))c**2\n", + "#it can also be written as mc**2=K+m0c**2\n", + "#given that K=2m0c**2(rest mass energy)\n", + "#m=3m0\n", + "m=3.0 #relativistic mass\n", + "#formula is v=c math.sqrt(1-(m0/m)**2)\n", + "v=c*math.sqrt(1-(1/m)**2)\n", + "print \"velocity of a body is v=\",\"{:.3e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.25:pg-28" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy is K= 5.12e+06 eV\n", + "momentum is p= 2.99e-21 kg m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate kinetic energy ,momentum of electron\n", + "m0=9.11*10**-31 #its rest mass (kg)\n", + "c=3*10**8 #light velocity in (m/s)\n", + "m=11*m0 #mass of moving electron is 11 times its rest mass\n", + "K=(m-m0)*c**2/(1.6*10**-19) # kinetic energy\n", + "print \"kinetic energy is K=\",\"{:.2e}\".format(K),\"eV\" \n", + "v=c*math.sqrt(1-(m0/m)**2) #velocity(m/s)\n", + "p=m*v #momentum\n", + "print \"momentum is p=\",\"{:.2e}\".format(p),\"kg m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.26:pg-29 " + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "proton gain in mass is delm= 8.89e-28 kg\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate proton gain in mass\n", + "c=3*10**8 #light speed(m/s)\n", + "K=500*10**6*1.6*10**-19 #kinetic energy (J)\n", + "deltam=K/c**2\n", + "print \"proton gain in mass is delm=\",\"{:.2e}\".format(deltam),\"kg\"\n", + "#answer is given wrong in the book=8.89*10**28 kg\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex1.27:pg-29" + ] + }, + { + "cell_type": "code", + "execution_count": 32, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "speed of electron is v= 1.643e+08 m/s\n", + "mass is m= 3.56e-30 kg\n", + "speed is v= 2.90e+08 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate speed of 0.1MeV electron\n", + "E=0.512*10**6 #rest mass energy E=m0*c**2\n", + "c=3*10**8 #velocity of light (m/s)\n", + "K=0.1*10**6 #kinetic energy (MeV)\n", + "v=c*math.sqrt(1-(E/(K+E))**2) \n", + "print \"speed of electron is v=\",\"{:.3e}\".format(v),\"m/s\" \n", + "#to calculate mass and speed of 2MeV electron\n", + "E=2*10**6*1.6*10**-19 #in (J)\n", + "m=E/c**2 \n", + "print \"mass is m=\",\"{:.2e}\".format(m),\"kg\"\n", + "m0=9.11*10**-31 #electron mass (kg)\n", + "v=c*math.sqrt(1-m0**2/m**2)\n", + "print \"speed is v=\",\"{:.2e}\".format(v),\"m/s\"\n", + "\n", + "\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter10.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter10.ipynb new file mode 100755 index 00000000..7e489d37 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter10.ipynb @@ -0,0 +1,295 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter10:MAGNETIC PROPERTIES OF MATERIALS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.1:pg-288" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "permeability is mu= 1.000e-03 N/A**2\n", + "susceptibility is chim= 794.775 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate permeability and susceptibility of the bar\n", + "phi=2.4*10**-5 #magnetic flux in weber\n", + "A=0.2*10**-4 #cross sectional area in m**2\n", + "B=phi/A #magnetic induction in N/Am\n", + "H=1200 #magnetising field in A/m\n", + "mu=B/H\n", + "print \"permeability is mu=\",\"{:.3e}\".format(mu),\"N/A**2\"\n", + "muo=4*math.pi*10**-7 \n", + "chim=(mu/muo)-1\n", + "print \"susceptibility is chim=\",round(chim,3),\"unitless\"\n", + "#the answer is given wrong in the book (round off error) chim=737\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.2:pg-289" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "current is i= 10.0 A\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate current should be sent through the solenoid\n", + "l=.10 #length in m\n", + "N=50 #number of turns\n", + "H=5*10**3 #magnetising field in A/m\n", + "i=H*l/N \n", + "print \"current is i=\",i,\"A\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.3:pg-289" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the magnetic moment of the rod is M= 300.0 A-m**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate magnetic moment of the rod\n", + "#formula is B=muo*(H+I)\n", + "#where H=ni\n", + "n=500.0 #number of turns in turns/m\n", + "i=0.5 #current passed through the solenoid in A\n", + "mur=1200.0 #relative permeability\n", + "I=(mur-1)*n*i #intensity of magnetisation in A/m\n", + "V=10**-3 #volume in m**3\n", + "M=I*V\n", + "print \"the magnetic moment of the rod is M=\",round(M),\"A-m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.4:pg-290" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "flux density is B= 2.000e-02 weber/m**2\n", + "magnetic intensity is H= 300.0 A-turn/m\n", + "permeability is mu= 6.667e-05 weber/A-m\n", + "relative permeability is mur= 53.052 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate flux density,magnetic intensity,permeability of iron\n", + "phi=2.0*10**-6 #flux in the ring in weber\n", + "A=10**-4 #cross-sectional area in m**2\n", + "B=phi/A \n", + "print \"flux density is B=\",\"{:.3e}\".format(B),\"weber/m**2\"\n", + "N=200.0 #number of turns\n", + "i=0.30 #current flows in the windings in A\n", + "l=0.2 #length in m\n", + "H=N*i/l\n", + "print \"magnetic intensity is H=\",H,\"A-turn/m\"\n", + "mu=B/H\n", + "print \"permeability is mu=\",round(mu,8),\"weber/A-m\"\n", + "muo=4*math.pi*10**-7 \n", + "mur=mu/muo\n", + "print \"relative permeability is mur=\",round(mur,3),\"unitless\"\n", + "\n", + "#the answer for H in the book is wrong\n", + "#the answer for mu in book is wrong due to wrong H\n", + "#the answer in book for mur is wrong \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.5:pg-294" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the number of ampere turns is mmf= 153.846 ampere-turns\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of ampere turns\n", + "l=0.5 #length in m\n", + "mu=6.5*10**-3 #permeability of iron in henry/m\n", + "A=2*10**-4 #area of cross-section in m**-4\n", + "R=l/(mu*A) #reluctance in A-turns/weber\n", + "flux=4*10**-4 #in weber\n", + "mmf=flux*R\n", + "print \"the number of ampere turns is mmf=\",round(mmf,3),\"ampere-turns\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.6:pg-294" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "relative permeability of the medium is mur= 375.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate relative permeability of the medium\n", + "phi=1.5*10**-3 #magnetic flux in weber\n", + "l=math.pi*50*10**-2 #length in m\n", + "A=10*10**-4 #area of cross-section\n", + "N=1000 #number of turns\n", + "i=5 #current in A\n", + "muo=4*math.pi*10**-7\n", + "#phi(magnetic flux)=m.m.f/reluctance\n", + "#phi=N*i*muo*mur*A/l\n", + "#we get,\n", + "mur=phi*l/(N*i*A*muo)\n", + "print \"relative permeability of the medium is mur=\",mur,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex10.7:pg-295" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "magnetising current is i= 0.274 A\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate magnetising current\n", + "#formula is phi(magnetic flux)=m.m.f/reluctance\n", + "#phi=N*i*mu*A/l--------eq(1)\n", + "#phi=BA------------eq(2)\n", + "B=0.20 #magnetic flux density in weber/m**2\n", + "l=1 #average length of the circuit in m \n", + "N=100 #number of turns\n", + "mu=7.3*10**-3 #in h.m\n", + "#from eq(1)and eq(2),we get\n", + "i=B*l/(N*mu)\n", + "print \"magnetising current is i=\",round(i,3),\"A\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter11.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter11.ipynb new file mode 100755 index 00000000..5a37e945 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter11.ipynb @@ -0,0 +1,68 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter11:ULTRASONICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex11.1:pg-303" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the fundamental frequency is nu= 2729987.214 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate fundemental frequency\n", + "Y=7.9*10**10 #Young modulus for quartz in Nm**-2\n", + "rho=2.65*10**3 #density of quartz in kg/m**3\n", + "#the velocity of longitudinal wave is given by\n", + "v=math.sqrt(Y/rho) #in m/s\n", + "#for fundamental mode of vibration ,thickness is given by lamda/2\n", + "lamda=2*0.001 #wavelength in m\n", + "nu=v/lamda\n", + "print \"the fundamental frequency is nu=\",round(nu,3),\"Hz\"\n", + "#answer is given wrong in the book ,nu=2730 Hz\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter12.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter12.ipynb new file mode 100755 index 00000000..00c109e4 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter12.ipynb @@ -0,0 +1,557 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:aa2f56a05fd1194f94e3d31e0ec0aca9d2eea46b2e1eabfcedb3c3f6d47fe9fb"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter12:ELECTROMAGNETICS"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.1:pg-322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# part a\n",
+ "#to calculate electric flux\n",
+ "#electric flux through a surface is phi=vector(E)*vector(s)\n",
+ "#where vector E=2i+4j+7k,vector s=10j\n",
+ "E=4 #E=4j\n",
+ "s=10 #s=10j\n",
+ "phi=E*s\n",
+ "print \"electric flux is phi=\",phi,\"units\"\n",
+ "# part b\n",
+ "#to calculate flux coming out of any face of the cube\n",
+ "q=1 #charge in coulomb\n",
+ "epsilon0=8.85*10**-12 #permittivity in free space in coul**2/N-m**2\n",
+ "phi1=q/(6*epsilon0)\n",
+ "print \"flux coming out of any face of the cube is phi1=\",\"{:.3e}\".format(phi1),\"N-m**2/coul**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "electric flux is phi= 40 units\n",
+ "flux coming out of any face of the cube is phi1= 1.883e+10 N-m**2/coul**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.2:pg-322"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "# part a\n",
+ "#to calculate electric field at a point from centre of the shell\n",
+ "q=0.2*10**-6 #charge\n",
+ "r=3 #radius\n",
+ "epsilon0=8.85*10**-12\n",
+ "E=q/(4*math.pi*epsilon0*r**2)\n",
+ "print \"electric field at a point from centre of the shell is E=\",round(E),\"N/coulomb\"\n",
+ "# part b\n",
+ "#to calculate electric field at a point just outside the shell\n",
+ "R=0.25 #radius\n",
+ "E=q/(4*math.pi*epsilon0*R**2)\n",
+ "print \"electric field at a point just outside the shell is E=\",\"{:.3e}\".format(E),\"N/coulomb\"\n",
+ "#to calculate the electric field at a point inside the shell\n",
+ "#when the point is situated inside the spherical shell,the electric field is zero\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "electric field at a point from centre of the shell is E= 200.0 N/coulomb\n",
+ "electric field at a point just outside the shell is E= 2.877e+04 N/coulomb\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.3:pg-323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate electric field at a point on earth vertically below the wire\n",
+ "lamda=10**-4 #wavelength in coulomb/m\n",
+ "r=4 #radius in m\n",
+ "epsilon0=8.854*10**-12\n",
+ "E=2*lamda/(4*math.pi*epsilon0*r)\n",
+ "print \"electric field at a point on earth vertically below the wire is E=\",\"{:.3e}\".format(E),\"N/coulomb\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "electric field at a point on earth vertically below the wire is E= 4.494e+05 N/coulomb\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.4:pg-323"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate separation between those equipotential surfaces \n",
+ "V=5 #potential difference\n",
+ "epsilon0=8.85*10**-12 #permittivity of free space\n",
+ "sigma=1*10**-7 #in c/m**2\n",
+ "#electric field due to an infinite sheet of surface charge density is given by E=sigma/(2*epsilon0) eq(1)\n",
+ "#E=V/d eq(2)\n",
+ "#from eq(1) and eq(2),we get \n",
+ "d=(2*epsilon0*V)/sigma\n",
+ "print \"separation between those equipotential surfaces is d=\",\"{:.3e}\".format(d),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "separation between those equipotential surfaces is d= 8.850e-04 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.5:pg-324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate force per unit area\n",
+ "#force of attraction per unit area is given by F=(epsilon0*E**2)/2 eq(1)\n",
+ "#E=V/d eq(2)\n",
+ "epsilon0=8.85*10**-12 #permittivity of free space\n",
+ "d=1*10**-3 #distance\n",
+ "V=100 #potential difference in volts\n",
+ "#from eq(1) and eq(2),we get\n",
+ "F=(epsilon0*V**2)/(2*d**2)\n",
+ "print \"force per unit area is F=\",\"{:.3e}\".format(F),\"N/m**2\"\n",
+ "#answer is given incorrect in the book ,F=4.425*10**-12\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "force per unit area is F= 4.425e-02 N/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.6:pg-324"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate charge\n",
+ "#let charge be q coulomb ,then the surface density of charge i.e. sigma=q/(4*math.pi*r**2)..............eq(1)\n",
+ "#outward pull per unit area =sigma**2/(2*epsilon0)............eq(2)\n",
+ "#put eq(1) in eq(2),we get q**2/(4*math.pi*r**2)**2*(2*epsilon0)..............eq(3)\n",
+ "#pressure due to surface tension =4*T/r............eq(4)\n",
+ "T=27\n",
+ "r=1.5*10**-2\n",
+ "epsilon0=8.85*10**-12\n",
+ "#equate eq(3) and eq(4),we get\n",
+ "q=math.sqrt(4*T*((4*math.pi*r**2)**2)*2*epsilon0/r)\n",
+ "print \"charge is q=\",\"{:.3e}\".format(q),\"coulomb\"\n",
+ "#answer is given wrong in the book,square of 4*math.pi*r**2 is not taken in the solution.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "charge is q= 1.009e-06 coulomb\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.7:pg-325"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate increase in radius \n",
+ "q=4.8*10**-8 #charge in coulomb\n",
+ "r=10*10**-2 #radius in m\n",
+ "epsilon0=8.85*10**-12 #C**2/N-m**2\n",
+ "P=10**5 #N/m**2\n",
+ "dr=(q**2)/(96*((math.pi)**2)*(r**3)*epsilon0*P)\n",
+ "print \"increase in radius is dr=\",\"{:.3e}\".format(dr),\"m\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "increase in radius is dr= 2.748e-09 m\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.8:pg-340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "#in page no.340,numbering is done wrongly,it should be like ex-8,ex-9,ex-10,ex-11,ex-12,ex-13,ex-14\n",
+ "import math\n",
+ "#to calculate average values of intensities of electric and magnetic fields of radiation\n",
+ "#energy of lamp=1000 J/s\n",
+ "#area illuminated =4*math.pi*r**2=16*math.pi m**2\n",
+ "#energy radiated per unit area per second =1000/16*math.pi\n",
+ "#from poynting theorem |s|=|E*H|=E*H eq(1)\n",
+ "s=1000/(16*math.pi)\n",
+ "muo=4*math.pi*10**-7 #permeability of free space\n",
+ "epsilon0=8.85*10**-12 #permittivity in free space\n",
+ "#E/H=math.sqrt(muo/epsilon0) eq(2)\n",
+ "#from eq(1) and eq(2),we get\n",
+ "E=math.sqrt(s*math.sqrt(muo/epsilon0))\n",
+ "H=s/E\n",
+ "print \"average value of intensity of electric fields of radiation is E=\",round(E,3),\"V/m\"\n",
+ "print \"average value of intensity of magnetic fields of radiation is H=\",round(H,3),\"ampere-turn/m\"\n",
+ "#answer is given wrong in the book E=48.87 V/m,solution of magnetic fields is not given in the book .\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "average value of intensity of electric fields of radiation is E= 86.583 V/m\n",
+ "average value of intensity of magnetic fields of radiation is H= 0.23 ampere-turn/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.9:pg-340"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate amplitudes of electric and magnetic fields of radiation\n",
+ "#energy received by an electromagnetic wave per sec per unit area is given by poynting vector |s|=|E*H|=E*H*sin 90 (becoz E is perpendicular to H)\n",
+ "#it is given that energy received by earth's surface is\n",
+ "s=1400.0 #|s|=2 cal min**-1 cm**-2\n",
+ "muo=4.0*math.pi*10**-7 #permittivity of free space\n",
+ "epsilon0=8.85*10**-12 #permeability of free space\n",
+ "#E*H=1400 eq(1)\n",
+ "#E/H=math.sqrt(muo/epsilon0) eq(2)\n",
+ "#from eq(1) and eq(2) ,we get\n",
+ "E=math.sqrt(s*math.sqrt(muo/epsilon0))\n",
+ "#from eq(1) ,we get\n",
+ "H=1400.0/E\n",
+ "Eo=E*math.sqrt(2) # at distance 2 m\n",
+ "Ho=H*math.sqrt(2) # at distance 2 m\n",
+ "print \"amplitude of electric field is Eo=\",round(Eo,3),\"V/m\"\n",
+ "print \"amplitude of magnetic field is Ho=\",round(Ho,3),\"amp-turn/m\"\n",
+ "\n",
+ "# The answers in the textbook are slightly different due to approximation\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "amplitude of electric field is Eo= 1027.178 V/m\n",
+ "amplitude of magnetic field is Ho= 2.726 amp-turn/m\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.10:pg-341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# no value to be found out , only equation to be written hence skipped following the TBC guidelines"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.11:pg-341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate skin depth \n",
+ "f=10**8 #frequency\n",
+ "sigma=3*10.0**7 #conductivity of the medium\n",
+ "muo=4*math.pi*10**-7 #permeability of free space\n",
+ "Del=math.sqrt(2/(2*math.pi*f*sigma*muo))\n",
+ "print \"skin depth is Del=\",\"{:.3e}\".format(Del),\"cm\"\n",
+ "\n",
+ "# answer in book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "skin depth is Del= 9.189e-06 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.12:pg-341"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# part a\n",
+ "#to calculate frequency \n",
+ "muo=4*math.pi*10**-7 #permeability of free space\n",
+ "sigma=4.3 # in mhos/m\n",
+ "Del=0.1 #skin depth in m\n",
+ "f=2/(2*math.pi*muo*Del**2)\n",
+ "print \"frequency is f=\",\"{:.3e}\".format(f),\"Hz\"\n",
+ "#value of frequency is given incorrect in the book \n",
+ "# part b\n",
+ "#show that for frequencies less than 10**8 ,it can be considered as good conductor\n",
+ "epsilon=80*8.854*10**-12\n",
+ "f=10**8 #frequency in Hz\n",
+ "sigma=4.3\n",
+ "#formula is sigma/(omega*epsilon)>4.3/(2*math.pi*10**8*80*epsilon)\n",
+ "sigma1=sigma/(2*math.pi*f*epsilon) #where sigma1=sigma/(omega*epsilon)\n",
+ "print \"sigma1=\",round(sigma1,3),\"unitless\"\n",
+ "#the ocean water to be good conductor ,the value of sigma/(omega*epsilon) should be greater than 1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "frequency is f= 2.533e+07 Hz\n",
+ "sigma1= 9.662 unitless\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.13:pg-342"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to show that for frequency <10**9 Hz ,a sample of silicon will act like a good conductor\n",
+ "sigma=200 #in mhos/m\n",
+ "omega=2*math.pi*10**9 \n",
+ "epsilon0=8.85*10**-12 #permittivity in free space\n",
+ "epsilon=12*epsilon0 \n",
+ "sigma1=sigma/(omega*epsilon) #sigma1=sigma/(omega*epsilon)\n",
+ "print \"sigma1=\",round(sigma1),\"unitless\"\n",
+ "#if sigma/(omega*epsilon) is greater than 1 , silicon is a good conductor at frequency <10**9 Hz\n",
+ "#to calculate penetration depth\n",
+ "f=10**6 #frequency in Hz\n",
+ "muo=4*math.pi*10**-7 #permeability of free space\n",
+ "sigma=200\n",
+ "Del=math.sqrt(2/(2*math.pi*f*muo*sigma))\n",
+ "print \"penetration depth is del=\",round(Del*100,1),\"cm\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "sigma1= 300.0 unitless\n",
+ "penetration depth is del= 3.6 cm\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Ex12.14:pg-343"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "#to calculate conduction current and displacement current densities \n",
+ "sigma=10**-3 #conductivity in mhos/m\n",
+ "E=4*10**-6 #where E=4*10**-6*math.sin(9*10**9t) v/m\n",
+ "J=sigma*E\n",
+ "print \"conduction current density is J=\",\"{:.3e}\".format(J),\"math.sin(9*10**9t) A/m\"\n",
+ "epsilon0=8.85*10**-12 #permittivity in free space\n",
+ "epsilonr=2.45 #relative permittivity\n",
+ "#formula is epsilon0*epsilonr*(delE/delt)\n",
+ "#delE/delt=4*10**-6*9*10**9*math.cos(9*10**9*t)\n",
+ "Jd=epsilon0*epsilonr*4*10**-6*9*10**9\n",
+ "print \"displacement current density is Jd=\",round(Jd,10),\"math.cos(9*10**9*t) A/m**2\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "conduction current density is J= 4.000e-09 math.sin(9*10**9t) A/m\n",
+ "displacement current density is Jd= 7.806e-07 math.cos(9*10**9*t) A/m**2\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter13.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter13.ipynb new file mode 100755 index 00000000..b7bad40b --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter13.ipynb @@ -0,0 +1,107 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter13:SUPERCONDUCTIVITY" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex13.1:pg-357" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " the value of temperature is 5.039 K\n" + ] + } + ], + "source": [ + "#example 1\n", + "#to calculate value of Temperature\n", + "import math\n", + "Bc=105.0*10**3 #magnetic field in amp/m\n", + "Bo=150.0*10**3 #critical field of the metal in amp/m \n", + "Tc=9.2 #critical temperature of the metal in K\n", + "T=Tc*math.sqrt(1-(Bc/Bo))#temperature\n", + "print\"\\n the value of temperature is\",round(T,3),\"K\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex13.2:pg-357" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + " the temperature is 3.983 K\n", + "\n", + " the critical current density at that temperature is 9.000e+06 A/m^2\n" + ] + } + ], + "source": [ + "#example 2\n", + "#to calculate temperature\n", + "import math\n", + "Tc=7.18 #critical temperature in K\n", + "Bc=4.5*10**3 #critical field in A/m\n", + "Bo=6.5*10**3 #critical magnetic field in A/m\n", + "T=Tc*math.sqrt(1-(Bc/Bo))# temperature\n", + "print\"\\n the temperature is\",round(T,3),\"K\"\n", + "#to calculate critical current density at that temperature\n", + "r=1*10**-3 #diameter of the wire in mm\n", + "TJc=(Bc*2*math.pi*r)/(math.pi*r**2)# critical current density\n", + "print\"\\n the critical current density at that temperature is\",\"{:.3e}\".format(TJc),\"A/m^2\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter2.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter2.ipynb new file mode 100755 index 00000000..5d84b658 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter2.ipynb @@ -0,0 +1,1094 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter2:INTERFERENCE" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.2:pg-41" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ratio of intensity at the maxima and minima in the interference pattern is Imax/Imin=((a1+a2)**2)/((a1-a2)**2)= 2 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate ratio of intensity\n", + "#I1/I2=1/25\n", + "#formula is a1/a2=math.sqrt(I1/I2)=1/5\n", + "a2=5 #a2=5*a1\n", + "a1=1\n", + "I=((1+5)**2)/((1-5)**2)\n", + "print \"ratio of intensity at the maxima and minima in the interference pattern is Imax/Imin=((a1+a2)**2)/((a1-a2)**2)=\",((a1+a2)**2)/((a1-a2)**2),\"unitless\"\n", + "#answer is given in terms of ratio\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.3:pg-42" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " ratio of intensity = 0.8535 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate ratio of intensity at this point to that at the centre of a bright fringe\n", + "#the intensity at any pont is I=a1**2+a2**2+2*a1*a2*cos del\n", + "#let a1=a2=a\n", + "#phase difference del is 0\n", + "#then I0=a**2+a**2+2*a*a*cos 0\n", + "#we get I0=4a**2\n", + "I0=4 #intensity\n", + "#path difference is lemda/8\n", + "#phase difference =2*math.pi/lemda*path difference=math.pi/4\n", + "#I1=a**2+a**2+2a*a*cos math.pi/4\n", + "#I1=3.414a**2\n", + "I1=3.414\n", + "intensity=I1/I0\n", + "print \" ratio of intensity =\",intensity,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.4:pg-42" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the ratio of maximum intensity to minmum intensity in the interference pattern Imax/Imin=((a1+a2)**2)/((a1-a2)**2)= 1 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate ratio of maximum intensity to minimum intensity\n", + "#formula is I1/I2=a1**2/a2**2=100/1\n", + "#a1/a2=10/1\n", + "a1=10 #a1=10*a2\n", + "a2=1\n", + "print \"the ratio of maximum intensity to minmum intensity in the interference pattern Imax/Imin=((a1+a2)**2)/((a1-a2)**2)=\",((a1+a2)**2)/((a1-a2)**2),\"unitless\" \n", + "#answer is given in terms of ratio in the book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.5:pg-43" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the ratio of the intensities of interfering sources is I1/I2=a1**2/a2**2= 1600 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate relative intensities\n", + "#Imax/Imin=(a1+a2)**2/(a1-a2)**2+105/95\n", + "#(a1+a2)/(a1-a2)=1.051\n", + "#we get a1/a2=40 \n", + "a1=40 #a1=40*a2\n", + "a2=1\n", + "print \"the ratio of the intensities of interfering sources is I1/I2=a1**2/a2**2=\",a1**2/a2**2,\"unitless\"\n", + "#answer is given in terms of ratio in the book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.7:pg-52" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the distance between two coherent sources is twod= 0.0005 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distance between the two coherent sources\n", + "lamda=5890*10**-10 #wavelength in m\n", + "omega=9.424*10**-4 #width of the fringes in m\n", + "D=.80 #distance in m\n", + "twod=D*lamda/omega\n", + "print \"the distance between two coherent sources is twod=\",twod,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.8:pg-53" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the fringe width is omega= 0.0001977 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate fringe width \n", + "mu=1.5 #refractive index (unitless)\n", + "alpha=math.pi/180 #refracting angle in radian\n", + "Y1=20*10**-2 #distance between the source and the biprism in m\n", + "Y2=80*10**-2 #distance in m\n", + "D=Y1+Y2 # distance in m\n", + "lamda=6900*10**-10 #wavelength in m\n", + "twod=2*(mu-1)*alpha*Y1 \n", + "omega=D*lamda/twod\n", + "print \"the fringe width is omega=\",round(omega,7),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.9:pg-53" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of light is lamda= 5.9e-07 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of light\n", + "omega=1.888*10**-2/20 #in (m)\n", + "D=1.20 #distance of eye piece from the source in m\n", + "twod=0.00075 #distance between two virtual sources in m\n", + "lamda=omega*twod/D\n", + "print \"the wavelength of light is lamda=\",lamda,\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.10:pg-54" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the thickness of glass plate is t= 3.27e-06 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of glass plate\n", + "n=3\n", + "mu=1.5 #refractive index (unitless)\n", + "lamda=5450*10**-10 #wavelength in m\n", + "t=n*lamda/(mu-1)\n", + "print \"the thickness of glass plate is t=\",t,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.11:pg-54" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the refractive index of the sheet is mu= 1.52 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index of the sheet\n", + "t=6.3*10**-6 #thickness of thin sheet of transparent material in m\n", + "lamda=5460*10**-10 #wavelength in m\n", + "n=6\n", + "mu=(n*lamda/t)+1\n", + "print \"the refractive index of the sheet is mu=\",mu,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.12:pg-54" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the refractive index of mica is mu= 51.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index of mica\n", + "t=1.2*10**-8 #thickness of thin sheet of mica in m\n", + "n=1 \n", + "lamda=6*10**-7 #wavelength in m\n", + "mu=(n*lamda/t)+1\n", + "print \"the refractive index of mica is mu=\",mu,\"unitless\"\n", + "#answer is given wrong in the book=1.50\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.13:pg-54" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the intensity at the centre of the screen is I= 0 unitless\n", + "the lateral shift of the central maximum is x0= 0.0015 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate intensity\n", + "mu=1.5 #refractive index(unitless)\n", + "t=1.5*10**-6 #thickness of thin glass plate in m\n", + "pathdifference=(mu-1)*t # in m\n", + "lamda=5*10**-7 #wavelength in m\n", + "#del=2*math.pi*pathdifference/lamda\n", + "#del=3*math.pi\n", + "a1=1\n", + " #where a1=a2=a\n", + "a2=1\n", + "#formula is I=a1**2+a2**2+2*a1*a2*cos del\n", + "# where cos 3math.pi=-1\n", + "I=a1**2+a2**2+2*a1*a2*(-1) \n", + "print \"the intensity at the centre of the screen is I=\",I,\"unitless\" \n", + "#to calculate lateral shift\n", + "D=1 #distance in m\n", + "twod=5*10**-4 #distance between two slits in m\n", + "mu=1.5 #refractive index (unitless)\n", + "t=1.5*10**-6 #thickness of thin glass plate in m\n", + "x0=D*(mu-1)*t/twod\n", + "print \"the lateral shift of the central maximum is x0=\",x0,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.14:pg-55" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the spacing between the slits is twod= 3.44e-02 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate spacing between the slits\n", + "lamda=6*10**-5 #wavelength in cm\n", + "omegatheta=0.1*math.pi/180 #angular width of a fringe in radians\n", + "twod=lamda/omegatheta\n", + "print \"the spacing between the slits is twod=\",\"{:.2e}\".format(twod),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.15:pg-55" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the distance of the third bright fringe from the central maximum is X3= 0.117 cm\n", + "n= 4.0 unitless\n", + "the distance from the central maximum when the bright fringes due to both wavelengths coincide is Xn= 0.156 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distance of the third bright fringe on the screen from the central maximum \n", + "lamda=6.5*10**-5 #wavelength in cm\n", + "twod=0.2 #distance between the slits in cm\n", + "D=120 #distance between the plane of the slits and the screen in cm\n", + "n=3 \n", + "X3=D*n*lamda/twod\n", + "print \"the distance of the third bright fringe from the central maximum is X3=\",X3,\"cm\"\n", + "#to calculate the least distance from the central maximum \n", + "lamda1=6.5*10**-5 #wavelength in cm\n", + "lamda2=5.2*10**-5 #wavelength in cm\n", + "#Xn=Dnlamda1/2d=D(n+1)lamda2/2d\n", + "#we get,\n", + "n=lamda2/(lamda1-lamda2)\n", + "print \"n=\",n,\"unitless\"\n", + "Xn=D*n*lamda1/twod\n", + "print \"the distance from the central maximum when the bright fringes due to both wavelengths coincide is Xn=\",Xn,\"cm\"\n", + " \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.16:pg-56" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the refractive index of the transparent plate is mu= 1.2 unitless\n", + "the order will be visible is n1= 14.0 unitless\n", + "the distance between the coherent sources is twod= 0.12 cm\n", + "the wavelength of light is lamda= 5e-05 cm\n", + "the wavelength of light is lamda= 5.89e-05 cm\n", + "the changed fringe width is omega1= 0.199 mm\n", + "the thickness of mica sheet is t= 0.0002945 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index \n", + "D=10 #distance in cm\n", + "twod=0.2 #distance detween the slits in cm\n", + "t=0.05 #thickness of transparent plate in cm\n", + "deltaX=0.5 #in cm\n", + "mu=(deltaX*twod/(D*t))+1\n", + "print \"the refractive index of the transparent plate is mu=\",mu,\"unitless\"\n", + "#to calculate order\n", + "n=10 \n", + "lamda=7000*10**-8 #wavelength in cm\n", + "#path difference =n*lamda\n", + "n1=n*lamda/(5000*10**-8) \n", + "print \"the order will be visible is n1=\",n1,\"unitless\"\n", + "#to calculate distance between the two coherent sources\n", + "D=100 #distance in m \n", + "lamda=6000*10**-8 #wavelength in cm\n", + "omega=0.05 #distance between two consecutive bright fringes on the screen in cm\n", + "twod=D*lamda/omega\n", + "print \"the distance between the coherent sources is twod=\",twod,\"cm\"\n", + "#to calculate wavelength\n", + "Xn=1 #distance of fourth bright fringe from the central fringe in cm\n", + "twod=0.02 #distance between the two coherent sources in cm\n", + "n=4 \n", + "D=100 #distance in cm \n", + "lamda=Xn*twod/(n*D)\n", + "print \"the wavelength of light is lamda=\",lamda,\"cm\"\n", + "#to calculate wavelength\n", + "#position of nth bright fringe from the centre of the central fringe is Xn=D*n*lamda/2d----eq(1)\n", + "#fringe width umega=D*lamda/2d---------------------eq(2)\n", + "#from eq(1) and eq(2) we get, Xn=n*omega\n", + "#for 11th bright fringe X11=11*omega\n", + "#position for nth dark fringe Xn'=(2n+1)D*lamda/4d\n", + "#X4'=(7/2)*omega\n", + "#distance between 11th and 4th dark fringe =0.8835 cm\n", + "#we get \n", + "omega=0.1178 #in cm\n", + "twod=0.05 #distance between slis in cm\n", + "D=100 # distance in cm\n", + "lamda=omega*twod/D \n", + "print \"the wavelength of light is lamda=\",lamda,\"cm\"\n", + "#to calculate changed fringe width\n", + "#X10-X0=10*omega\n", + "#given that X10-X0=14.73-12.34=2.39mm \n", + "omega=0.239 #in mm\n", + "lamda=6000 #wavelength in angstrom\n", + "lamda1=5000 #lamda'=5000 angstrom\n", + "omega1=omega*lamda1/lamda\n", + "print \"the changed fringe width is omega1=\",round(omega1,3),\"mm\"\n", + "#to calculate thickness of mica sheet\n", + "n=3\n", + "mu=1.6 #refractive index(unitless)\n", + "lamda=5.89*10**-5 #wavelength in cm\n", + "t=n*lamda/(mu-1)\n", + "print \"the thickness of mica sheet is t=\",t,\"cm\"\n", + "#answer of thickness is given wrong in the book =0.002945 cm\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.17:pg-75" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the smallest thickness of the plate which will appear dark by reflection is t= 3.927e-07 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate the smallest thickness of the plate\n", + "mu=1.5 #refractive index(unitless)\n", + "r=60*math.pi/180 #angle of refraction in radians\n", + "lamda=5890*10**-10 #wavelength in m\n", + "n=1\n", + "#formula is t=n*lamda/(2*mu*cosr) where cosr=0.5\n", + "t=n*lamda/(2*mu*0.5)\n", + "print \"the smallest thickness of the plate which will appear dark by reflection is t=\",\"{:.3e}\".format(t),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.18:pg-75" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the least thickness of the film that will appear black is t= 2.075e-07 m\n", + "the least thickness of the film that will appear bright is t= 1.0375e-07 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate least thickness of the film\n", + "lamda=5893*10**-10#wavelength in m\n", + "r=0 #in degree\n", + "mu=1.42 #refractive index\n", + "n=1\n", + "#the formula is t=n*lamda/(2*mu*cosr), where cos0=1\n", + "t=n*lamda/(2*mu*1)\n", + "print \"the least thickness of the film that will appear black is t=\",t,\"m\"\n", + "t=(2*n-1)*lamda/(2*mu*1*2)\n", + "print \"the least thickness of the film that will appear bright is t=\",t,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.19:pg-76" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the thickness of the film is t= 1.72e-05 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of the film\n", + "lamda1=6.1*10**-7 #wavelength in m\n", + "lamda2=6*10**-7 # wavelength in m\n", + "#the two dark consecutive fringes are overlapping for the wavelength lamda1 and lamda2 respectively\n", + "#then, n*lamda1=(n+1)*lamda2\n", + "#we get,\n", + "n=lamda2/(lamda1-lamda2)\n", + "sini=4.0/5\n", + "mu=4.0/3\n", + "#formula is mu=sini/sinr\n", + "sinr=0.6\n", + "cosr=math.sqrt(1-(sinr)**2)\n", + "t=n*lamda1/(2*mu*cosr)\n", + "print \"the thickness of the film is t=\",\"{:.2e}\".format(t),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.20:pg-77" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the thickness of the film is t= 2.614e-07 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of the film\n", + "mu=1.33 #refractive index of soap film (unitless)\n", + "i=45*math.pi/180\n", + "#the formula is mu=sini/sinr \n", + "sinr=0.5317 \n", + "cosr=math.sqrt(1-(sinr)**2)\n", + "#for destructive interference\n", + "lamda=5890*10**-10 #wavelength in m\n", + "n=1\n", + "t=n*lamda/(2*mu*cosr)\n", + "print \"the thickness of the film is t=\",\"{:.3e}\".format(t),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.21:pg-77" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the angle of the wedge is theta = 1.07e-04 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of the wedge\n", + "lamda=6000*10**-10 #wavelength in m\n", + "mu=1.4 #refractive index in unitless\n", + "omega=2*10.0**-3 #distance in m\n", + "theta=lamda/(2*mu*omega)\n", + "print \"the angle of the wedge is theta =\",\"{:.2e}\".format(theta),\"radians\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.22:pg-77" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of light is lamda= 6790.0 Angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of light \n", + "theta=10*22.0/(7*60*60*180.0) #angle of wedge in radians\n", + "omega=5*10.0**-2 #distance between the successive fringes in m\n", + "mu=1.4 #refractive index\n", + "lamda=2.0*mu*theta*omega/(10e-10)\n", + "print \"the wavelength of light is lamda=\",round(lamda),\"Angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.23:pg-78" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of the monochromatic light is lamda= 5880 Angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of the light\n", + "D15=0.590*10**-2 #diamater of 15th ring in m\n", + "D5=0.336*10**-2 #diameter of 5th ring in m\n", + "p=1 # in m\n", + "R=1 #radius of plano convex lens in m\n", + "#formula is lamda=Dn+p**2-Dn**2/4pR\n", + "lamda=((D15**2)-(D5**2))/(4*p*R)/(10e-10)\n", + "print \"the wavelength of the monochromatic light is lamda=\",int(lamda),\"Angstrom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.24:pg-78" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the refractive index of the liquid is mu= 1.374 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index of the liquid\n", + "n=6\n", + "lamda=6000*10**-10 #wavelength in m\n", + "R=1 #radius of curvature of the curved surface in m\n", + "Dn=3.1*10**-3 #diameter of 6th bright ring in m\n", + "mu=2*(2*n-1)*lamda*R/Dn**2\n", + "print \"the refractive index of the liquid is mu=\",round(mu,3),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.25:pg-78" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the radius of curvature of the lens is R= 1.059 m\n", + "the thickness of the air film is t= 2.95e-06 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate radius of curvature\n", + "lamda=5900*10**-10 #wavelength in m\n", + "n=10\n", + "Dn=5*10**-3 # diameter of 10th dark ring in m\n", + "R=Dn**2/(4*n*lamda)\n", + "print \"the radius of curvature of the lens is R=\",round(R,3),\"m\"\n", + "#to calculate thichness\n", + "t=n*lamda/2\n", + "print \"the thickness of the air film is t=\",t,\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.26:pg-79" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the distance from the apex of the wedge is X= 5.53 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate the distance from the apex of the wedge at which the maximum due to the two wavelengths first coincide\n", + "#condition for maxima for normal incidence air film is 2t=(2n+1)lamda/2\n", + "#let nth order maximum due to lamda1 coincides with (n+1)th order maximum due to lamda2 \n", + "#we get , n=(3lamda2-lamda1)/2(lamda1-lamda2)\n", + "# we also get, 2t=lamda1*lamda2/(lamda1-lamda2)\n", + "#t=X*theta\n", + "lamda1=5896*10**-8 #wavelength in cm\n", + "lamda2=5890*10**-8 #wavelength in cm\n", + "theta=0.3*math.pi/180 #angle of wedge\n", + "X=lamda1*lamda2/(2*(lamda1-lamda2)*theta)\n", + "print \"the distance from the apex of the wedge is X=\",round(X,2),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.27:pg-80" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the radius of curvature of the lens is R= 104.167 cm\n", + "the thickness of the film is t= 3.0e-04 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate radius of curvature \n", + "n=10.0\n", + "Dn=0.50 #diameter of 10th ring in cm\n", + "lamda=6000*10**-8 #wavelength in cm\n", + "R=Dn**2/(4*n*lamda)\n", + "print \"the radius of curvature of the lens is R=\",round(R,3),\"cm\"\n", + "#answer is given wrong in the book =106 cm\n", + "#to calculate thickness of the film\n", + "t=Dn**2/(8*R)\n", + "print \"the thickness of the film is t=\",\"{:.1e}\".format(t),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.28:pg-80" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the diameter of 20th dark ring is D20= 0.9 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate diameter\n", + "#the difference of (n+p)th and nth dark ring is Dn+p**2-Dn**2=4nRlamda\n", + "N=12 #where N=n+p\n", + "n=4\n", + "D12=0.7 #diameter of 12th dark ring in cm\n", + "D4=0.4 #diameter of 4th dark ring in cm\n", + "#D12**2-D4**2=4pRlamda where p=8 ----eq(1)\n", + "#D20**2-D4**2=4pRlamda where p=16 -----eq(2)\n", + "#divide eq(2) by eq(1) ,we get\n", + "D20=math.sqrt((2*D12**2)-D4**2)\n", + "print \"the diameter of 20th dark ring is D20=\",round(D20,1),\"cm\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.29:pg-80" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the diameter of nth dark ring for lamda1 is Dn= 0.255 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate diameter \n", + "lamda1=6*10**-5 #wavelength in cm\n", + "lamda2=4.5*10**-5 #wavelength in cm\n", + "R=90 #radius of curvature of the curved surface in cm\n", + "#Dn**2=4nRlamda1 -------eq(1)\n", + "#Dn+1**2=4(n+1)Rlamda2-------eq(2)\n", + "#the nth dark ring due to lamda1 coincides with (n+1)th dark ring due to lamda2\n", + "#from eq(1) and eq(2)-4nRlamda1=4(n+1)Rlamda2\n", + "# we get,\n", + "n=lamda2/(lamda1-lamda2)\n", + "Dn=math.sqrt(4*n*R*lamda1)\n", + "print \"the diameter of nth dark ring for lamda1 is Dn=\",round(Dn,3),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex2.30:pg-81" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the difference of square of diameters is D1(n+p)**2-D1n**2=(lamda1*D)/lamda= 0.0937 cm**2\n", + "the difference of square of diameters is D1(n+p)**2-D1n**2=(mu*D)/mu1= 0.094 cm**2\n", + "the difference of square of diameters is D1(n+p)**2-D1n**2=(R1*D)/R= 0.25 cm**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate the difference of square of diameters for nth and (n+p)th ring when light of wavelength lamda is changed to lamda'\n", + "lamda=6*10**-5 #wavelength in cm\n", + "lamda1=4.5*10**-5 #wavelength in cm\n", + "#Let D=(D**2-Dn**2)=0.125 cm**2 \n", + "D=0.125\n", + "#formula is D'(n+p)**2-D'n**2=lamda'*(D(n+p)**2-Dn**2)/lamda\n", + "print \"the difference of square of diameters is D1(n+p)**2-D1n**2=(lamda1*D)/lamda=\",round((lamda1*D)/lamda,4),\"cm**2\"\n", + "#to calculate difference of square of diamaters when liqquid of refractive index mu' is introduced\n", + "mu=1 #refractive index (unitless)\n", + "mu1=1.33 # mu'=1.33\n", + "#formula is D'(n+p)**2-D'n**2=(mu/mu')*(D(n+p)**2-Dn**2)\n", + "print \"the difference of square of diameters is D1(n+p)**2-D1n**2=(mu*D)/mu1=\",round((mu*D)/mu1,3),\"cm**2\"\n", + "#to calculate difference of square of diameters when radius of curvature of convex surface of the plano convex lens is doubled\n", + "R1=2 #radius of curvature is R'=2R\n", + "R=1\n", + "#formula is D'(n+p)**2-D'n**2=(R'/R)*(D(n+p)**2-Dn**2)\n", + "print \"the difference of square of diameters is D1(n+p)**2-D1n**2=(R1*D)/R=\",(R1*D)/R,\"cm**2\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter3.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter3.ipynb new file mode 100755 index 00000000..49add97c --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter3.ipynb @@ -0,0 +1,1337 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter3:DIFFRACTION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.1:pg-97" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "sintheta= 6.0e-03 m\n", + "total angular width of central maximum is theta1= 1.2e-02 radians \n", + "linear width of central maximum on the screen is Y1= 1.2 cm\n", + "values of m =1,2,3,............ gives the directions of first, second .............minima\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angular width and linear width \n", + "lamda=6*10**-5\n", + "e=0.01 #width of slit in cm\n", + "#position of minima is given by\n", + "sintheta=lamda/e #sintheta=m*lamda/e ,where m=1,2,3,......\n", + "print \"sintheta=\",\"{:.1e}\".format(sintheta),\" m\"\n", + "#since theta is very small,so sintheta is approximately equal to theta\n", + "theta=sintheta\n", + "theta1=2*theta\n", + "print \"total angular width of central maximum is theta1=\",\"{:.1e}\".format(theta1),\" radians \"\n", + "d=100 #distance in cm\n", + "Y=theta*d\n", + "Y1=2*Y\n", + "print \"linear width of central maximum on the screen is Y1=\",Y1,\"cm\"\n", + "print \"values of m =1,2,3,............ gives the directions of first, second .............minima\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.2:pg-97" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of light is lamda= 5600.0 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of light\n", + "#in a diffraction pattern due to single slit, minima is given by e*sintheta=m*lamda\n", + "#since theta is very small, sintheta is approximately equal to theta\n", + "#theta=Y/d\n", + "e=0.014 #width of slit in cm\n", + "d=200 #distance in cm\n", + "m=2.0 \n", + "Y=1.6 #in cm\n", + "lamda=Y*e/(d*m)\n", + "print \"wavelength of light is lamda=\",lamda*1e8,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.3:pg-98" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "width of slit is e= 1.0e-04 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate width of slit\n", + "#direction of minima in fraunhofer diffraction due to single slit is given by math.pi/lamda*e*siuntheta=+m*math.pi,where m=1,2,3\n", + "#angular spread of the central maximum on either side of the incident light is sintheta=lamda/e,where m=1,position of first minima\n", + "lamda=5000*10**-8\n", + "e=lamda/math.sin(math.pi/6)\n", + "print \"width of slit is e=\",\"{:.1e}\".format(e),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.4:pg-98" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of incident light is lamda= 5000.0 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of incident light\n", + "#direction of minima is given by e*sintheta=+m*lamda\n", + "#for first minima m=1,i.e. e*sintheta=lamda,sintheta is approximately equal to theta,then we can write it as e*theta=lamda ...........eq(1)\n", + "#theta=Y/d........................eq(2) \n", + "e=0.02 #in cm\n", + "Y=0.5 #position of first minima from the central maxima in cm\n", + "d=200 #distance of screen from the slit in cm\n", + "#from eq(1) and eq(2),we get\n", + "lamda=e*Y/d\n", + "print \"wavelength of incident light is lamda=\",lamda*1e8,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.6:pg-99" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "lamda1= 6250.0 angstrom\n", + "lamda2= 5000.0 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate values of lamda1 and lamda2\n", + "#in fraunhofer diffraction pattern ,the direction of minima is given by e*sintheta=+m*lamda,where m=1,2,.......\n", + "#direction of fourth minima (m=4) for wavelength lamda1 is given by e*sintheta1=4*lamda1..........eq(1)\n", + "#similarly, e*sintheta2=5*lamda2..........eq(2)\n", + "#from eq(1) and eq(2),we get e*sintheta=4*lamda1=5*lamda2....eq(3)\n", + "y=0.5 #in cm\n", + "f=100 #in cm\n", + "theta=y/f #in radian\n", + "sintheta=theta #theta is very small\n", + "e=0.05 #width of slit in cm\n", + "lamda1=e*sintheta/4\n", + "print \"lamda1=\",lamda1*1e8,\"angstrom\"\n", + "#from eq(3) we get,\n", + "lamda2=4*lamda1/5\n", + "print \"lamda2=\",lamda2*1e8,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.7:pg-100" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "half angular width of central bright maxima is theta= 0.5 radian\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate half angular width \n", + "e=1.2*10**-4 #width of slit in cm\n", + "y=6*10**-5 #wavelength of monochromatic light in cm\n", + "theta=y/e\n", + "print \"half angular width of central bright maxima is theta=\",theta,\"radian\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.8:pg-100" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "angle at which the first dark band are formed in the fraunhofer diffraction pattern is theta= 0.1146 degree\n", + "angle at which the next bright band are formed in the fraunhofer diffraction pattern is theta1= 0.1719 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle\n", + "lamda=6000.0*10**-8 #wavelength of light in cm\n", + "e=0.03 #width of slit in cm\n", + "#e*sintheta=m*lamda,where m=1\n", + "theta=math.degrees(math.asin(lamda/e)) \n", + "print \"angle at which the first dark band are formed in the fraunhofer diffraction pattern is theta=\",round(theta,3),\"degree\"\n", + "theta1=math.degrees(math.sin(3*lamda/(2*e)))\n", + "print \"angle at which the next bright band are formed in the fraunhofer diffraction pattern is theta1=\",round(theta1,3),\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.9:pg-101" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "linear distance of first minimum from the central maximum is y= 0.0982 cm\n", + "linear distance of first secondary maxima is y1= 0.1473 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate distances of first dark band and of next bright band on either side of the central maximum\n", + "#formula is e*sintheta=m*lamda,where m=1\n", + "lamda=5890.0*10**-8 #wavelength of light in cm\n", + "e=0.03 #width of slit in cm\n", + "sintheta=lamda/e \n", + "theta=sintheta #becoz theta is very small,so sintheta is approximately equal to theta\n", + "f=50.0\n", + "y=f*theta\n", + "print \"linear distance of first minimum from the central maximum is y=\",round(y,4),\"cm\"\n", + "sintheta1=3*lamda/(2*e)\n", + "theta1=sintheta1\n", + "y1=f*theta1\n", + "print \"linear distance of first secondary maxima is y1=\",round(y1,4),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.10:pg-105" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of light is lamda= 5.882e-05 cm\n", + "missing order is n= 6.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of light and missing orders\n", + "omega=0.25 #fringe width in cm\n", + "D=170 #distance in cm\n", + "twod=0.04 # distance in cm\n", + "lamda=omega*twod/D\n", + "print \"wavelength of light is lamda=\",\"{:.3e}\".format(lamda),\"cm\"\n", + "e=0.08 #width of slit in mm\n", + "d=0.4 #in mm\n", + "m=1\n", + "n=m*(e+d)/e \n", + "print \"missing order is n=\",n,\"unitless\"\n", + "#we can also find order for m=2,3,....\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.11:pg-112" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of the spectral line is lamda= 5e-05 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "n=2.0 #order of spectrum\n", + "theta=math.pi/6 #in radians\n", + "E=1.0/5000 #let (e+d)=E\n", + "lamda=E*math.sin(math.pi/6)/n\n", + "print \"the wavelength of the spectral line is lamda=\",lamda,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.12:pg-112" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "difference in deviations in first and third order spectra is difference = 46.7 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate difference in deviations \n", + "lamda=5*10**-5 #wavelength of light in cm\n", + "eplusd=1/6000.0 #where eplusd=e+d\n", + "theta1=math.degrees(math.asin(lamda/eplusd)) #for first order spectrum\n", + "theta3=math.degrees(math.asin(3*lamda/eplusd)) #for second order spectrum\n", + "difference=theta3-theta1\n", + "print \"difference in deviations in first and third order spectra is difference =\",round(difference,1),\"degree\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.13:pg-112" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the orders will be visible is n= 19.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate orders\n", + "#let E=(e+d) \n", + "#formula is (e+d)*sin thita=n*lamda\n", + "#for maximum order to be possible thita=90 degree\n", + "#sin theta=1\n", + "E=2.54/2620 #in cm\n", + "lamda=5*10**-5 #wavelength of the incident light in cm\n", + "n=E/lamda\n", + "print \"the orders will be visible is n=\",round(n),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.14:pg-113" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of lines is number= 2778.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of lines in the grating\n", + "#theta1=theta2=30 degree\n", + "#sin theta1=sin theta2=1/2\n", + "lamda1=6*10**-5 \n", + " #wavelength in cm\n", + "lamda2=4.5*10**-5\n", + "#let (e+d)=E \n", + "#formula is (e+d)*sin theta1=n*lamda1----------eq(1)\n", + "#(e+d)*sin theta2=(n+1)*lamda2----------eq(2)\n", + "#we get,\n", + "n=lamda2/(lamda1-lamda2) #order of spectrum\n", + "E=n*lamda1/math.sin(math.pi/6)\n", + "number=1/E\n", + "print \"number of lines is number=\",round(number),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.15:pg-113" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "order when wavelength of 4000 angstrom is n1= 6.25 unitless\n", + "order when wavelength of 7500 angstrom is n2= 3.33 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate order when visible light of wavelength in the range 4000 to 7500 angstrom\n", + "#let E=(e+d)\n", + "E=1.0/4000 #in cm\n", + "lamda1=4*10**-5 \n", + " #wavelength in cm\n", + "lamda2=7.5*10**-5\n", + "n1=E*math.sin(math.pi/2)/lamda1\n", + "n2=E*math.sin(math.pi/2)/lamda2\n", + "print \"order when wavelength of 4000 angstrom is n1=\",n1,\"unitless\"\n", + "print \"order when wavelength of 7500 angstrom is n2=\",round(n2,2),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.17:pg-114" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "angle of diffraction for maximum intensity in the first order is theta= 14 degree 29.0 minutes\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of diffraction \n", + "n=1 #order\n", + "lamda=5000*10**-8 #wavelength of light in cm\n", + "eplusd=1/5000.0 # in cm\n", + "theta=math.degrees(math.asin(n*lamda/(eplusd)))\n", + "minu=(theta-int(theta))*60 # minute\n", + "print \"angle of diffraction for maximum intensity in the first order is theta=\",int(theta),\"degree\",round(minu),\"minutes\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.18:pg-115" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of lines is number= 5000.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of lines in one centimeter of the grating\n", + "#let E=(e+d)\n", + "#formula for grating equation for principal maxima is (e+d)*sin theta=n*lamda\n", + "n=2 #order of spectrum\n", + "lamda=5*10**-5 #wavelength in cm\n", + "E=n*lamda/math.sin(math.pi/6)\n", + "number=1/E\n", + "print \"number of lines is number=\",number,\"unitless\"\n", + "#answer is given wrong in the book ,number of lines=1000\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.19:pg-115" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of 5th order spectrum is lamda1= 4.712e-05 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate which spectral line in 5th order will overlap with 4th order line of 5890 angstrom\n", + "#the grating equation for principal maxima is (e+d)*sin theta =n*lamda\n", + "n1=5 \n", + " #order of spectrum \n", + "n2=4\n", + "lamda2=5890*10**-8 #wavelength of 4th order spectrum in cm\n", + "#(e+d)*sin theta=5*lamda-------------eq(1)\n", + "#(e+d)*sin theta=4*5890*10**-8-----------------eq(2)\n", + "#from eq(1) and eq(2) ,we get\n", + "lamda1=n2*lamda2/n1\n", + "print \"wavelength of 5th order spectrum is lamda1=\",lamda1,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.20:pg-115" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "grating element is eplusd= 3.2e-04 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate grating element\n", + "#grating equation for principal maxima is given by (e+d)*sintheta=n*lamda\n", + "#let nth order spectrum for yellow line (lamda=6000 angstrom) coincide with (n+1)th order spectrum for blue line (lamda=4800 angstrom) \n", + "#(e+d)*sintheta=n*6000*10**-8..eq(1)\n", + "#(e+d)*sintheta=(n+1)*4800*10**-8.....eq(2)\n", + "#from eq(1) and eq(2),we get n=4\n", + "n=4\n", + "lamda=6000*10**-8 #wavelength in cm\n", + "sintheta=3.0/4 \n", + "eplusd=n*lamda/sintheta\n", + "print \"grating element is eplusd=\",\"{:.1e}\".format(eplusd),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.21:pg-116" + ] + }, + { + "cell_type": "code", + "execution_count": 24, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "angle of refraction is theta= 2 degree 4.0 minutes\n", + "order of absent spectrum is n= 2.0 unitless\n", + "here,m=1 is considered because the higher values of m result the order of absent spectrum more than the given order 3\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of diffraction for third order spectrum and absent spectra if any\n", + "n=3\n", + "lamda=6000*10**-8\n", + "eplusd=1/200.0\n", + "theta=math.degrees(math.asin(n*lamda/eplusd))\n", + "minu=(theta-int(theta))*60 # minute\n", + "print \"angle of refraction is theta=\",int(theta),\"degree\",round(minu),\"minutes\"\n", + "d=0.0025\n", + "e=eplusd-d #width of wire in cm\n", + "m=1\n", + "n=eplusd*m/e\n", + "print \"order of absent spectrum is n=\",n,\"unitless\"\n", + "print \"here,m=1 is considered because the higher values of m result the order of absent spectrum more than the given order 3\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.22:pg-116" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "difference in two wavelengths is dlamda= 86.6 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate difference in the two wavelengths\n", + "#grating equation for principal maxima is (e+d)*sintheta=n*lamda...............eq(1)\n", + "#differentiate both sides ,we get dtheta=n*dlamda/((e+d)*costheta)...........eq(2)\n", + "lamda=5000 #mean value of wavelengths in angstrom\n", + "cottheta=1.732 #cot30degree=1.732\n", + "dtheta=0.01 #in radian\n", + "#put the value of n from eq(2),we can write eq(2) \n", + "dlamda=lamda*dtheta*cottheta\n", + "print \"difference in two wavelengths is dlamda=\",dlamda,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.23:pg-117" + ] + }, + { + "cell_type": "code", + "execution_count": 27, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "dispersive power of grating in the second order spectrum is dtheta= 8728 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate dispersive power \n", + "#differentiate grating equation ,we get dtheta/dlamda=n/((e+d)*costheta)\n", + "n=2 #order \n", + "eplusd=1/4000.0\n", + "lamda=5000.0*10**-8 #wavelength in cm\n", + "sintheta=n*lamda/(eplusd)\n", + "costheta=math.sqrt(1-(sintheta)**2)\n", + "dtheta=n/((eplusd)*costheta) #where dispersive power dtheta/dlamda=dtheta\n", + "print \"dispersive power of grating in the second order spectrum is dtheta=\",int(dtheta),\"unitless\"\n", + "\n", + "# answer is slightly different due to approximation\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.24:pg-117" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "orders will be observed by a grating ,if it is illuminated by light of wavelength of 5000 angstrom is nmax1= 5.0 unitless \n", + "orders will be observed ,if it is illuminated by light of wavelength of 7500 angstrom is nmax2= 3.3 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate orders\n", + "eplusd=1/4000.0\n", + "lamda1=5*10.0**-5 #wavelengh in cm\n", + "lamda2=7.5*10**-5\n", + "nmax1=eplusd/lamda1\n", + "nmax2=eplusd/lamda2\n", + "print \"orders will be observed by a grating ,if it is illuminated by light of wavelength of 5000 angstrom is nmax1=\",nmax1,\"unitless \"\n", + "print \"orders will be observed ,if it is illuminated by light of wavelength of 7500 angstrom is nmax2=\",round(nmax2,1),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.25:pg-118" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the difference in wavelengths of two lines is dlamda= 5.87e-08 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate difference in wavelengths of two lines\n", + "#let E=(e+d)=1/5000\n", + "#we get\n", + "E=2*10**-4 #in cm\n", + "n=2 #order of spectrum\n", + "lamda=5893*10**-8 #wavelength in cm\n", + "#dtheta=2.5'=(2.5/60)*(3.14/180),we get\n", + "dtheta=7.27*10**-4 #in radian\n", + "dlamda=math.sqrt(((E/n)**2)-lamda**2)*dtheta\n", + "print \"the difference in wavelengths of two lines is dlamda=\",\"{:.2e}\".format(dlamda),\"cm\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.26:pg-123" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the aperture of the objective of a telescope is a= 15.0 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate aperture of the objective of a telescope\n", + "lamda=6*10**-5 #wavelength of light in cm\n", + "dtheta=4.88*10**-6 # in radians\n", + "a=1.22*lamda/dtheta\n", + "print \"the aperture of the objective of a telescope is a=\",a,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.27:pg-123" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the separation of two points on the moon is X= 50.996 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate separation of two points on the moon\n", + "lamda=5.5*10**-5 #wavelength of light in cm\n", + "a=500 #diameter in cm\n", + "dtheta=1.22*lamda/a #limit of resolution of telescope in radians\n", + "R=3.8*10**8 #distance between earth and moon in m\n", + "X=R*dtheta\n", + "print \"the separation of two points on the moon is X=\",X,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.28:pg-124" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the numerical aperture of the objective is NA= 0.6 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate numerical aperture of the objective\n", + "lamda=5.461*10**-5 #wavelength in cm\n", + "S=5.55*10**-5 #distance in cm\n", + "NA=1.22*lamda/(2*S)\n", + "print \"the numerical aperture of the objective is NA=\",round(NA,1),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.29:pg-124" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the resolving power of microscope is RP= 4000.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate resolving power of microscope\n", + "NA=0.12 #numerical aperture\n", + "lamda=6*10**-5 #wavelength of light in cm\n", + "RP=2*NA/lamda #RP=resolving power\n", + "print \"the resolving power of microscope is RP=\",RP,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.30:pg-124" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the maximum resolving power is RP= 80000 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate maximum resolving power\n", + "lamda=5*10**-5 #wavelength of light in cm\n", + "N=40000 #total number of lines on grating\n", + "#(e+d)=12.5*10**-5 cm\n", + "#formula is nmax=(e+d)/lamda\n", + "#we get\n", + "nmax=2 #order of spectrum\n", + "RP=nmax*N #RP=resolving power\n", + "print \"the maximum resolving power is RP=\",RP,\"unitless\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.31:pg-124" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum number of lines in a grating is N= 491 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate minimum number of lines in a grating\n", + "lamda1=5890 \n", + " #wavelengh in angstrom\n", + "lamda2=5896\n", + "dlamda=6 #smallest wavelength difference in angstrom\n", + "n=2 #order of spectrum \n", + "lamda=(lamda1+lamda2)/2 #average wavelength in angstrom\n", + "RP=lamda/dlamda #RP=resolving power\n", + "N=RP/n\n", + "print \"minimum number of lines in a grating is N=\",N,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.32:pg-125" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "theta= 2.237e-05 radian\n", + "alpha= 2.5e-05 radian\n", + "if alpha>theta then telescope will be able to observe the wire-mesh\n" + ] + } + ], + "source": [ + "import math\n", + "#will the telescope be able to observe the wiremesh\n", + "a=3 #aperture in cm\n", + "lamda=5.5*10**-5 #wavelength of light in cm\n", + "#limit of resolution of telescope is given by\n", + "theta=1.22*lamda/a\n", + "#alpha=spacing of wire-mesh/distance of objective from wire-mesh\n", + "alpha=0.2/(80*10**2)\n", + "print \"theta=\",\"{:.3e}\".format(theta),\"radian\"\n", + "print \"alpha=\",alpha,\"radian\"\n", + "print \"if alpha>theta then telescope will be able to observe the wire-mesh\"\n", + "#value of alpha is given wrong in the book 2.25*10**-5 radian\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.33:pg-125" + ] + }, + { + "cell_type": "code", + "execution_count": 22, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "distance between the centres of images of two stars is X= 2.68e-02 cm \n" + ] + } + ], + "source": [ + "import math\n", + "#distance between the centres of images of two stars\n", + "lamda=5500*10**-8 #wavelength of light in cm\n", + "f=4*10**2 #focal length of telescope objective in cm\n", + "a=0.01*10**2 #diameter in cm\n", + "X=1.22*lamda*f/a\n", + "print \"distance between the centres of images of two stars is X=\",\"{:.2e}\".format(X),\"cm \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.34:pg-126" + ] + }, + { + "cell_type": "code", + "execution_count": 23, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the diameter of a telescope is a= 3.5 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate diameter of a telescope \n", + "lamda=5.0*10**-5 #wavelength in cm\n", + "theta=(math.pi/180)*(1.0/1000) #in radians\n", + "a=1.22*lamda/theta\n", + "print \"the diameter of a telescope is a=\",round(a,1),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.35:pg-126" + ] + }, + { + "cell_type": "code", + "execution_count": 25, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + " the smallest angle between two stars is theta= 2.40e-07 radians\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate smallest angle between two stars\n", + "lamda=5*10**-5 #wavelength in cm\n", + "a=100*2.54 #diameter in cm\n", + "theta=1.22*lamda/a\n", + "print \"the smallest angle between two stars is theta=\",\"{:.2e}\".format(theta),\"radians\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.36:pg-126" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the limit of resolution of the telescope is theta= 7.186e-05 radians \n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate limit of resolution of the telescope\n", + "lamda=5890*10**-8 #wavelength in cm\n", + "a=1 #diameter in cm\n", + "theta=1.22*lamda/a\n", + "print \"the limit of resolution of the telescope is theta=\",\"{:.3e}\".format(theta),\"radians \"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.37:pg-126" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "resolving limit of microscope is s= 6.71e-05 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate resolving limit of microscope\n", + "lamda=5.5*10**-5 #wavelengh in cm\n", + "theta=math.pi/6 #in radians\n", + "s=1.22*lamda/(2*math.sin(math.pi/6))\n", + "print \"resolving limit of microscope is s=\",s,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.38:pg-127" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "resolving power is RP = 30000 unitless\n", + "smallest wavelength difference dlamda= 2e-09 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate resolving power of grating \n", + "N=15000 #total number of lines on grating\n", + "lamda=6*10**-5 #wavelength in cm\n", + "n=2 #order of spectrum\n", + "RP=n*N\n", + "print \"resolving power is RP =\",RP,\"unitless\"\n", + "#to calculate smallest wavelength difference that can be resolved with a light of wavelength 6000angstrom in the second order\n", + "dlamda=lamda/(n*N)\n", + "print \"smallest wavelength difference dlamda=\",dlamda,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex3.39:pg-127" + ] + }, + { + "cell_type": "code", + "execution_count": 28, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the resolving power is RP= 1.2e+05 unitless\n", + "smallest wavelength that can be resolved in the third order in 6000angstrom wavelength region is dlamda= 3.33e-10 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate resolving power in the second order\n", + "N=6*10**4 #N=total number of lines on grating\n", + "n=2 #order of spectrum\n", + "RP=n*N #RP=resoling power\n", + "print \"the resolving power is RP=\",\"{:.1e}\".format(RP),\"unitless\"\n", + "#to calculate smallest wavelength\n", + "lamda=6000*10**-8 #wavelength in cm\n", + "n=3 #order of spectrum\n", + "dlamda=lamda/(n*N)\n", + "print \"smallest wavelength that can be resolved in the third order in 6000angstrom wavelength region is dlamda=\",\"{:.2e}\".format(dlamda),\"cm\" \n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter4.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter4.ipynb new file mode 100755 index 00000000..3993d089 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter4.ipynb @@ -0,0 +1,540 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter4:POLARISATION" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.1:pg-147" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the intensities of ordinary and extraordinary rays is I= 3.0 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "# compare the intensities of ordinary and extraordinary rays\n", + "#intensity of ordinary rays is given by Io=a**2 *(sin theta)**2\n", + "#where theta=30 degree\n", + "#we get Io=a**2/4\n", + "Io=1.0/4\n", + "#intensity of extraordinary ray is given by IE=(a*cos theta)**2\n", + "#we get IE=3*a**2/4\n", + "IE=3.0/4\n", + "I=IE/Io\n", + "print \"the intensities of ordinary and extraordinary rays is I=\",I,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.2:pg-147" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "angle of refraction of ray is r= 30.0 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of refraction\n", + "#according to brewster's law mu=tan ip\n", + "mu=1.732 #refractive index\n", + "ip=math.degrees(math.atan(mu)) #polarising angle in degree\n", + "r=90-ip\n", + "print \"angle of refraction of ray is r=\",round(r),\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.3:pg-147" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "polarising angle is ip= 53 degree 22.0 min\n", + "angle of refraction is r= 36 degree 38.0 min\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate polarising angle and angle of refraction\n", + "mu=1.345 #refractive index, mu=1/sinc=1/sin48degree=1/0.7431 \n", + "ip=math.degrees(math.atan(mu))\n", + "r=90-ip\n", + "mn1=ip-int(ip)\n", + "mn2=60-mn1*60\n", + "print \"polarising angle is ip=\",int(ip),\"degree \",round(mn1*60.0),\"min\"\n", + "print \"angle of refraction is r=\",int(r),\"degree\",round(mn2),\"min\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.4:pg-147" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thickness of a half wave plate of quartz is t= 2.78e-03 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of a half wave plate of quartz\n", + "lamda=5*10**-5 #wavelength in cm\n", + "mue=1.553 \n", + " #refractive index (unitless)\n", + "muo=1.544\n", + "#for a half plate of positive crystal\n", + "t=lamda/(2*(mue-muo))\n", + "print \"thickness of a half wave plate of quartz is t=\",\"{:.2e}\".format(t),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.5:pg-148" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thickness of quarter wave plate is t= 1.636e-03 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of quarter wave plate\n", + "lamda=5.890*10**-5 #wavelength of light in cm\n", + "mue=1.553\n", + " #refractive index\n", + "muo=1.544\n", + "t=lamda/(4*(mue-muo)) \n", + "print \"thickness of quarter wave plate is t=\",\"{:.3e}\".format(t),\"cm\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.6:pg-148" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thickness of a plate is t= 1.47e-03 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness of a doubly refracting plate\n", + "lamda=5.890*10**-5 #wavelength in cm\n", + "muo=1.53 \n", + " #refractive index\n", + "mue=1.54\n", + "t=lamda/(4*(mue-muo))\n", + "print \"thickness of a plate is t=\",\"{:.2e}\".format(t),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.7:pg-152" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the angle of rotation of the plane of polarisation is theta= 19.8 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angle of rotation\n", + "alpha=66.0 #specific rotation of cane sugar in degree\n", + "c=15.0/100 #concentration of the solution in gm/cc\n", + "l=20 #length of tube in cm\n", + "theta=alpha*l*c/10\n", + "print \"the angle of rotation of the plane of polarisation is theta=\",theta,\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.8:pg-153" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the specific rotation is alpha= 66.0 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate specific rotation \n", + "theta=26.4 #in degree\n", + "l=20 #length in cm\n", + "c=0.2 #gm/cm**3\n", + "alpha=10*theta/(l*c)\n", + "print \"the specific rotation is alpha=\",alpha,\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.9:pg-153" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "strength of solution is c= 0.0833 gm/cm**3\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate strength of solution\n", + "theta=11 #degree\n", + "l=20.0 #length in cm\n", + "alpha=66 #specific rotation of sugar in degree\n", + "c=10*theta/(l*alpha)\n", + "print \"strength of solution is c=\",round(c,4),\"gm/cm**3\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.10:pg-153" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "difference in refractive indices is mu= 8.4e-05 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate difference in the refractive indices\n", + "#specific rotation is theta/d=29.73 degree/mm\n", + "theta=29.73 #where theta=theta/d\n", + "lamda=5.086*10**-4 #wavelength in mm\n", + "#optical rotation is given by theta=math.pi*d*(mul-mur)/lamda\n", + "#where mul and mur are refractive indices for anti-clockwise and clockwise polarised lights\n", + "mu=theta*lamda/180 #where mu=mul-mur\n", + "print \"difference in refractive indices is mu=\",\"{:.1e}\".format(mu),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.11:pg-153" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "optical rotation is theta1= 6.5 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate optical rotation\n", + "#let theta' be the optical rotation by a solution of strength c' in a tube of length l' then\n", + "#we get 10*theta'/l'*c'=10*theta/l*c\n", + "c=1.0/3 #it is given that solution is 1/3 of its previous concentration i.e. c'/c=1/3,where c=c'/c\n", + "l1=30 #where l1=l'\n", + " #length in cm \n", + "l=20.0\n", + "theta=13 #degree\n", + "#formula is theta'=l'*c'*theta/(l*c)\n", + "theta1=l1*c*theta/l\n", + "print \"optical rotation is theta1=\",theta1,\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.12:pg-154" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the specific rotation is alpha= 66.0 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate specific rotation\n", + "theta=52.8 #optical rotation in degree\n", + "l=20.0 #length of the solution in cm\n", + "c=20/50.0 #concentration of the solution in gm/cc\n", + "alpha=10*theta/(l*c)\n", + "print \"the specific rotation is alpha=\",alpha,\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.13:pg-154" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "length is l1= 35.0 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate length \n", + "l=40 #length in cm\n", + "c=5.0/100 #concentration in percentage\n", + "theta1=35 #optical rotation in degree ,where theta1=theta'\n", + "c1=10.0/100 #concentration in % ,where c1=c'\n", + "theta=20\n", + "#formula of specific rotation is alpha=10*theta/l*c\n", + "l1=l*c*theta1/(c1*theta)\n", + "print \"length is l1=\",l1,\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.14:pg-155" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "rotation of plane of polarisation of light is thetaR= 3 degree 19.0 min\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate rotation of plane of polarisation of light\n", + "mur=1.53914\n", + " #refractive index\n", + "mul=1.53920\n", + "lamda=6.5*10**-5 #wavelength in cm\n", + "d=0.02 #distance in cm\n", + "thetaR=180*(mul-mur)*d/lamda\n", + "mn1=thetaR-int(thetaR)\n", + "print \"rotation of plane of polarisation of light is thetaR=\",int(thetaR),\"degree\",round(mn1*60),\"min\"\n", + "\n", + "# the answer is slightly different due to approximation\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex4.15:pg-155" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "percentage of the sugar sample is per= 93.75 %\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate % purity of the sugar sample\n", + "theta=9.9 #optiacal rotation in degree\n", + "alpha=66 #specific roation of pure sugar solution in dm**-1(gm/cc)**-1\n", + "l=20 #length of tube in cm\n", + "c=10*theta/(l*alpha) #concentration of solution in gm/c.c\n", + "#it is given that 80 gm of impure sugar is dissolved in a litre of water\n", + "per=(c*100*10**3)/80 #here c is in gm/litre\n", + "print \"percentage of the sugar sample is per=\",per,\"%\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter5.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter5.ipynb new file mode 100755 index 00000000..6977a7ec --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter5.ipynb @@ -0,0 +1,174 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter5:LASERS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.1:pg-164" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the areal spread is A= 1.44e+04 m**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate area of the spot on the moon\n", + "lamda=6*10**-7 #wavelength in m\n", + "d=2 #diameter in m\n", + "dtheta=lamda/d #angular spread in radian\n", + "D=4*10**8 #distance of the moon\n", + "A=(D*dtheta)**2\n", + "print \"the areal spread is A=\",\"{:.2e}\".format(A),\"m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.2:pg-164" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the angular spread of the beam is dtheta= 1.6e-04 radian\n", + "the areal spread is A= 4.096e+09 m**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate angular spread of the beam\n", + "lamda=8*10**-7 #wavelength in m\n", + "d=5*10**-3 #aperture in m\n", + "dtheta=lamda/d \n", + "print \"the angular spread of the beam is dtheta=\",\"{:.1e}\".format(dtheta),\"radian\"\n", + "#to calculate the areal spread when it reaches the moon\n", + "D=4*10**8 #distance of the moon in m\n", + "A=(D*dtheta)**2\n", + "print \"the areal spread is A=\",\"{:.3e}\".format(A),\"m**2\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.3:pg-165" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the number of oscillations is n= 5.0e+04 unitless\n", + "the coherence Time= 9.82e-11 s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of oscillations corresponding to the coherence length\n", + "L=2.945*10**-2 #coherence length in m\n", + "lamda=5890*10**-10 #wavelength of sodium light in m\n", + "n=L/lamda\n", + "print \"the number of oscillations is n=\",\"{:.1e}\".format(n),\"unitless\"\n", + "#to calculate coherence time\n", + "c=3*10**8 #light speed in m\n", + "Time=L/c #coherence time\n", + "print \"the coherence Time=\",\"{:.2e}\".format(Time),\"s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex5.4:pg-165" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "areal spread = 2.074e-10 m**2\n", + "intensity of the image is I= 2.411e+08 watts/m**2\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate area and intensity of the image\n", + "lamda=7200*10**-10 #wavelength in m\n", + "d=5*10**-3 #aperture in m\n", + "dtheta=lamda/d #angular spread in radian \n", + "f=0.1 #focal length in m\n", + "arealspread=(dtheta*f)**2\n", + "print \"areal spread =\",\"{:.3e}\".format(arealspread),\"m**2\"\n", + "power=50*10**-3\n", + "I=power/arealspread\n", + "print \"intensity of the image is I=\",\"{:.3e}\".format(I),\"watts/m**2\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter6.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter6.ipynb new file mode 100755 index 00000000..be13b8e7 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter6.ipynb @@ -0,0 +1,234 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter6:FIBER OPTICS AND HOLOGRAPHY" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.1:pg-189" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "critical angle for core-cladding interface is theta1= 15.0 degree\n", + "acceptance angle thetaa= 23.0 degree\n", + "numerical aperture of fibre is NA= 0.3841 unitless\n", + "light collected is per= 14.75 %\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate critical angle for core-cladding interface\n", + "n1=1.5\n", + "n2=1.45\n", + "thetac=math.degrees(math.asin(n2/n1))\n", + "theta1=90-thetac\n", + "\n", + "print \"critical angle for core-cladding interface is theta1=\",round(theta1),\"degree\"\n", + "#to calculate acceptance angle in air for fibre and corresponding angle of obliquences\n", + "na=1\n", + "thetaa=math.degrees(math.asin(n1*0.26/na))\n", + "\n", + "print \"acceptance angle thetaa=\",round(thetaa),\"degree\"\n", + "#to calculate numerical aperture\n", + "NA=((n1+n2)*(n1-n2))**(1/2.0)\n", + "print \"numerical aperture of fibre is NA=\",round(NA,4),\"unitless\"\n", + "#to calculate % of light\n", + "per=(NA)**2*100\n", + "print \"light collected is per=\",round(per,3),\"%\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.2:pg-190" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "numerical aperture is NA= 0.29 unitless\n", + "thetac= 78 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate numerical aperture\n", + "Del=0.02 #relative refractive index difference between the core and the cladding of the fibre i.e. del=(n1-n2)/n1\n", + "n1=1.46 #refractive index of core of W-step index fibre \n", + "n2=n1-Del*n1\n", + "NA=((n1+n2)*(n1-n2))**(1/2.0)\n", + "print \"numerical aperture is NA=\",round(NA,2),\"unitless\"\n", + "#to calculate critical angle at the core cladding interface within the fibre\n", + "thetac=math.degrees(math.asin(n2/n1))\n", + "print \"thetac=\",int(thetac),\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.3:pg-190" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "refractive index is n2= 1.438 unitless\n", + "normalised frequency V number of the fibre is V= 65.3 unitless\n", + "total number of guided modes in the fibre is M= 2132 modes\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate refractive index of the cladding\n", + "a=35.0*10**-6 #core diameter in micrometre\n", + "#formula is del=(n1-n2)/n1\n", + "#we get\n", + "Del=1.5/100 \n", + "n1=1.46 #refractive index of the fibre \n", + "lamda=0.85*10**-6 #wavelength in micrometer\n", + "n2=n1-Del*n1\n", + "print \"refractive index is n2=\",round(n2,3),\"unitless\"\n", + "#to calculate normalised frequency V number of the fibre\n", + "V=round((2*math.pi*a*n1*0.173)/lamda,1)\n", + "print \"normalised frequency V number of the fibre is V=\",V,\"unitless\"\n", + "#to calculate total number of guided modes in the fibre\n", + "M=(V**2)/2.0\n", + "print \"total number of guided modes in the fibre is M=\",int(M),\"modes\"\n", + "\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.4:pg-191" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "cut-off wavelength is LAMBDAc= 1.354 micrometre\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate cut-off wavelength of the fibre\n", + "#(2*del)**(1/2)=(2*(n1-n2)/n1)**(1/2)=(0.005)**(1/2)=0.071\n", + "a=5*10**-6 #radius in micrometre\n", + "n1=1.46 #core refractive index in micrometre\n", + "Vc=2.405 #cut-off value of V parametre for single mode operation\n", + "#formula is LAMBDAc=(2*math.pi*a*n1*(2*del)**(1/2))/Vc \n", + "lamdac=(2*math.pi*a*n1*0.071)/Vc\n", + "print \"cut-off wavelength is LAMBDAc=\",round(lamdac/1e-6,3),\"micrometre\"\n", + "\n", + "# answer is slightly different due to approximation in book\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex6.5:pg-191" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "maximum value of phase constant is maximum= 12.566 radian/micrometre\n", + "minimum value of phase constant is minimum= 11.31 radian/micrometre\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate maximum and minimum value of phase constant\n", + "lamda=0.8*10**-6 #wavelength in micrometre\n", + "n1=1.6*10**-6 \n", + " #refractive indices in micrometre\n", + "n2=1.44*10**-6\n", + "maximum=(2*math.pi*n1)/lamda\n", + "minimum=(2*math.pi*n2)/lamda\n", + "print \"maximum value of phase constant is maximum=\",round(maximum,3),\"radian/micrometre\"\n", + "print \"minimum value of phase constant is minimum=\",round(minimum,3),\"radian/micrometre\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter7.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter7.ipynb new file mode 100755 index 00000000..a40aa43f --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter7.ipynb @@ -0,0 +1,902 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Chapter7:WAVE MECHANICS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.1:pg-200" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the de Broglie wavelength is lamda= 2.635e-14 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate de Broglie wavelength \n", + "v=1.5*10**7 #velocity of proton =(1/20)*velocity of light i.e.3*10**8 in m/s\n", + "m=1.67*10**-27 #mass of the proton in kg\n", + "h=6.6*10**-34 #plank's constant \n", + "lamda=h/(m*v)\n", + "print \"the de Broglie wavelength is lamda=\",\"{:.3e}\".format(lamda),\"m\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.2:pg-200" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the de Broglie wavelength is lamda= 8e-05 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate de Broglie wavelength\n", + "#mo*c**2=1.507*10**-10/1.6*10**-19=941.87 Mev\n", + "#since 12.8 Mev is very small compared to rest mass energy hence relavistic consideration may be ignored\n", + "m=1.67*10**-27 #mass in kg\n", + "h=6.62*10**-34 #plank's constant\n", + "E=12.8*10**6 #energy in Mev\n", + "lamda=h/math.sqrt(2*m*E*1.6*10**-19)/(1e-10)\n", + "print \"the de Broglie wavelength is lamda=\",round(lamda,5),\"angstrom\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.4:pg-201" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength is lamda= 3.46e-11 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "h=6.6*10**-34 #plank's constant\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "E=1.25*10**3 #pottential difference keV\n", + "lamda=h/math.sqrt(2*m*E*1.6*10**-19)\n", + "print \"the wavelength is lamda=\",\"{:.2e}\".format(lamda),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.5:pg-201" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "kinetic energy of an electron is K= 4.34e-06 eV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate kinetic energy of an electron \n", + "h=6.63*10**-34 #plank's constant\n", + "mo=9.1*10**-31 #rest mass of an electron in kg\n", + "lamda=5896*10**-10 #wavelength in angstrom\n", + "K=(h**2)/(2*mo*(lamda**2)*1.6*10**-19) \n", + "print \"kinetic energy of an electron is K=\",\"{:.2e}\".format(K),\"eV\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.6:pg-202" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of an electron of kinetic energy is lamda= 8.733e-13 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate the wavelength of an electron of kinetic energy\n", + "mo=9.1*10**-31 #mass of an electron in kg\n", + "c=3*10**8 #speed of light in m/s \n", + "K=1*10**6#kinetic energy in eV\n", + "h=6.62*10**-34 #planck's constant in J-s\n", + "#E=moc**2=81.9*10**-15/1.6*10**-19 eV=0.51MeV\n", + "E=0.51*10**6\n", + "lamda=(h*c)/(math.sqrt(K*(K+2*E))*1.6*10**-19)\n", + "print \"wavelength of an electron of kinetic energy is lamda=\",round(lamda,16),\"m\"\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.7:pg-203" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "de Broglie wavelength of any electron is lamda= 1.225 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate de Broglie wavelength\n", + "V=100 #potential difference in volts\n", + "lamda=12.25/math.sqrt(V)\n", + "print \"de Broglie wavelength of any electron is lamda=\",lamda,\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.9:pg-203" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of the neutron is E= 8.132e-02 eV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate energy of the neutron\n", + "h=6.60*10**-34 #plank's constant in J/s\n", + "m=1.674*10**-27 #mass of the neutron in kg\n", + "lamda=10**-10 #de Broglie wavelength in m\n", + "E=(h**2)/(2*m*(lamda**2)*1.6*10**-19)\n", + "print \"energy of the neutron is E=\",\"{:.3e}\".format(E),\"eV\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.10:pg-204" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of quantum of radiant energy is lamda= 0.0242 angstrom\n", + "number of photons emitted per sec is number= 2.727e+19 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "h=6.6*10**-34 #plank's constant in J/sec\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "c=3*10**8 #light speed in m/s\n", + "# part a\n", + "lamda=h/(m*c)/(1e-10) # in angstrom\n", + "print \"wavelength of quantum of radiant energy is lamda=\",round(lamda,4),\"angstrom\"\n", + "#to calculate number of photons \n", + "# part b\n", + "power=12 #power emitted by the lamp =150*(8/100) in watts\n", + "E=12.0 #energy emitted per second\n", + "lamda=4500*10.0**-10\n", + "energy=(h*c)/lamda #energy contained in one photon in J\n", + "number=E/energy\n", + "print \"number of photons emitted per sec is number=\",\"{:.3e}\".format(number),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.11:pg-209" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "smallest possible uncertainity in the position of an electron is delxmin= 0.039 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in position\n", + "#actual formula is (delx)min*(delp)max=h/2*math.pi-------------eq(1)\n", + "#(delp)max=p(momentum of the electron)\n", + "#mv=mov/math.sqrt(1-(v/c)**2)---------------------eq(2)\n", + "mo=9*10**-31 #mass of an electron in m/s\n", + "c=3*10**8 #light speed in m/s\n", + "v=3*10**7 #velocity in m/s \n", + "h=6.6*10**-34 #plank's constant in J/s\n", + "#from eq(1) and eq(2),we get\n", + "delxmin=(h*math.sqrt(1-(v/c)**2))/(2*math.pi*mo*v)\n", + "print \"smallest possible uncertainity in the position of an electron is delxmin=\",round(delxmin/1e-10,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.12:pg-209" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in the velocity is delvmin= 1.17e+04 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate minimum uncertainity in the velocity\n", + "delxmax=10**-8 #maximum uncertainity in position in m\n", + "h=6.626*10**-34 #planck's constant\n", + "delpmin=h/(2*math.pi*delxmax) #minimum uncertainity in momentum in kg-m/s**2 \n", + "m=9*10**-31 #mass of an electron in kg\n", + "delvmin=delpmin/m\n", + "print \"minimum uncertainity in the velocity is delvmin=\",\"{:.2e}\".format(delvmin),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.13:pg-209" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "uncertainity in the momentum of the parcticle is delp= 1.05e-30 kg-m/s**2\n", + "uncertainity in the velocity of an electron is delv= 2.343e+05 m/s\n", + "uncertainity in the velocity of an electron is delv= 31.574 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in the momentum of the parcticle \n", + "h=6.626*10**-34 #planck's constant J-s\n", + "delx=0.01*10**-2 #uncertainity in position in m\n", + "delp=h/(2*math.pi*delx)\n", + "print \"uncertainity in the momentum of the parcticle is delp=\",\"{:.2e}\".format(delp),\"kg-m/s**2\"\n", + "#to calculate uncertainity in the velocity of an electron\n", + "m=9*10**-31 #mass of an electron in kg\n", + "delx=5*10**-10 \n", + "delv=h/(2*math.pi*m*delx)\n", + "print \"uncertainity in the velocity of an electron is delv=\",\"{:.3e}\".format(delv),\"m/s\"\n", + "#to calculate uncertainity in the velocity of alpha particle \n", + "m=4*1.67*10**-27 #mass of alpha particle in kg\n", + "delx=5*10**-10\n", + "delv=h/(2*math.pi*m*delx)\n", + "print \"uncertainity in the velocity of an electron is delv=\",round(delv,3),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.14:pg-210" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "uncertainity in the position of the electron is delx= 2.883e-06 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in position\n", + "m=9.11*10**-31 #mass of electron in kg\n", + "delv=40 #uncertainity in velocity in m/s\n", + "h=6.6*10**-34 #plank's constant \n", + "delx=h/(2*math.pi*m*delv)\n", + "print \"uncertainity in the position of the electron is delx=\",\"{:.3e}\".format(delx),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.15:pg-210" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in the frequency of the photon is delv= 1.592e+07 sec**-1\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in frequency\n", + "#delE*delt=h/2*math.pi----eq(1)\n", + "#delE=h*delv-----------eq(2)\n", + "delt=10**-8 #uncertainity in time in s\n", + "#from eq(1) and eq(2),we get\n", + "delnu=1/(2*math.pi*delt)\n", + "print \"minimum uncertainity in the frequency of the photon is delv=\",\"{:.3e}\".format(delnu),\"sec**-1\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.16:pg-211" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum error with which the energy of the state can be measured is delE= 0.026 ev\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in the energy\n", + "h=6.63*10**-34 #plank's constant in J-s\n", + "delt=2.5*10**-14 #uncertainity in time in s\n", + "delE=h/(2*math.pi*delt*1.6*10**-19)\n", + "print \"minimum error with which the energy of the state can be measured is delE=\",round(delE,3),\"ev\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.17:pg-211" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "time required for the atomic system to retain rotational energy is delt= 1.910e-08 s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate time required for the atomic system \n", + "#delE=h*c*dellamda/lamda**2 -----eq(1)\n", + "#delE*delt=h/2*math.pi----------eq(2)\n", + "dellamda=10**-14\n", + "c=3*10**8\n", + "lamda=6*10**-7\n", + "#from eq(1)and eq(2),we get\n", + "delt=(lamda**2)/(2*math.pi*c*dellamda)\n", + "print \"time required for the atomic system to retain rotational energy is delt=\",\"{:.3e}\".format(delt),\"s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.18:pg-211" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in the momentum of the nucleon is delpmin= 2.109e-21 kg m/s\n", + "minimum kinetic energy of the nucleon is Emin= 8299.24 eV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate minimum uncertainity in the momentum \n", + "delxmax=5*10**-14 #uncertainity in position in m\n", + "h=6.626*10**-34 #plank's constant in Js\n", + "delpmin=h/(2*math.pi*delxmax)\n", + "print \"minimum uncertainity in the momentum of the nucleon is delpmin=\",\"{:.3e}\".format(delpmin),\"kg m/s\"\n", + "m=1.675*10**-27 #mass in kg\n", + "Emin=(delpmin**2)/(2*m*1.6*10**-19)\n", + "print \"minimum kinetic energy of the nucleon is Emin=\",round(Emin,3),\"eV\"\n", + "#the answer is given wrong in the book Emin=0.039 eV\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.19:pg-212" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in velocity is delv= 1.054e+04 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate uncertainity in velocity\n", + "delx=1.1*10**-8 #uncertainity in velocity in m\n", + "h=6.626*10**-34 #plank's constant\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "delv=h/(2*math.pi*m*delx)\n", + "print \"minimum uncertainity in velocity is delv=\",\"{:.3e}\".format(delv),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.20:pg-212" + ] + }, + { + "cell_type": "code", + "execution_count": 17, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "minimum uncertainity in the frequency of a photon is delnu= 1.592e+07 sec**-1\n", + "energy of an electron is E= 3.164e-12 J\n" + ] + } + ], + "source": [ + "import math\n", + "\n", + "#part a\n", + "#to calculate uncertainity in frequency\n", + "delt=10**-8 #uncertainity in time\n", + "delnu=1/(2*math.pi*delt) \n", + "print \"minimum uncertainity in the frequency of a photon is delnu=\",\"{:.3e}\".format(delnu),\"sec**-1\"\n", + "#to use the uncertainity principle to place a lower limit on the energy an electron must have if it is to be part of a nucleus\n", + "\n", + "# part b\n", + "delx=5*10**-15 #uncertainity in position\n", + "delp=h/(2*2*math.pi*delx) #uncertainbity in momentum\n", + "c=3*10**8 #/speed of light in m/s\n", + "E=delp*c\n", + "print \"energy of an electron is E=\",\"{:.3e}\".format(E),\"J\"\n", + "\n", + "# the answer is slightlty different due to approximation in textboook\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.22:pg-223" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "probability of finding the particle is P= 0.4 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate probability of finding the particle\n", + "a=25*10**-10#width in angstrom \n", + "#wave function of the particle is chi(x)=math.sqrt(2/a)*math.sin(n*math.pi*x/a),for the particle in the least energy state n=1\n", + "chix=math.sqrt(2/a)*math.sin(math.pi*(a/2)/a)\n", + "delx=5*10**-10 #interval in angstrom\n", + "P=delx*chix**2\n", + "print \"probability of finding the particle is P=\",P,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.24:pg-224" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "energy of an electron moving in one dimension in an infinitely high potential box is E= 37.649 eV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate energy of an electron\n", + "n=1 #least energy of the particle \n", + "h=6.63*10**-34 #planck's constant in Js\n", + "m=9.11*10**-31 #mass of electron in kg\n", + "a=10**-10 #width in angstrom\n", + "E=(n**2)*(h**2)/(8*m*(1.602*10**-19)*a**2)\n", + "print \"energy of an electron moving in one dimension in an infinitely high potential box is E=\",round(E,3),\"eV\"\n", + "#the answer is given wrong in the book E=5.68 eV\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.26:pg-225" + ] + }, + { + "cell_type": "code", + "execution_count": 19, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "P1= 0.198 unitless\n", + "probability for the ground states is probability1 = 19.836 %\n", + "P2= 0.0065 unitless\n", + "probability for first excited states is probability2= 0.645 %\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate probability\n", + "x1=0.45 #x1=0.45*L\n", + "x2=0.55 #x2=0.55*L\n", + "n=1 #for ground state \n", + "#formula is P=integrate('(2/L)*math.sin(n*math.pi*x)**2),'x',x1,x2)\n", + "from scipy.integrate import quad\n", + "def integrand(x):\n", + " return 2*(math.sin(n*math.pi*x)**2)\n", + "P1 ,er=quad(integrand,x1,x2)\n", + "\n", + "print \"P1=\",round(P1,3),\"unitless\"\n", + "probability1=P1*100\n", + "print \"probability for the ground states is probability1 =\",round(probability1,3),\"%\"\n", + "n=2 #for first excited state\n", + "P2, er=quad(integrand,x1,x2)\n", + "print \"P2=\",round(P2,4),\"unitless\"\n", + "probability2=P2*100 \n", + "print \"probability for first excited states is probability2=\",round(probability2,3),\"%\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.28:pg-226" + ] + }, + { + "cell_type": "code", + "execution_count": 20, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "lowest energy of a neutron is E= 6.431 MeV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate energy of a neutron\n", + "#consider nucleus as a cubical box of size 10**-14m\n", + "#x=y=z=a=10**-14=l\n", + "#for neutron to be in the lowest energy state nx=ny=nz=1\n", + "#formula is E=(math.pi**2*h**2/8*math.pi**2*m)*((nx/lx)**2+(ny/ly)**2+(nz/lz)**2)\n", + "h=6.626*10**-34 #planck's constant in Js\n", + "m=1.6*10**-27 #mass in kg\n", + "l=10**-14 #in m\n", + "E=(math.pi**2)*(h**2)*3/(4*(math.pi**2)*2*m*(1.6*10**-19)*l**2)\n", + "print \"lowest energy of a neutron is E=\",round(E/(1e6),3),\"MeV\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.29:pg-226" + ] + }, + { + "cell_type": "code", + "execution_count": 21, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "zeropointenergy= 1.657e-32 J\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate zero point energy of a linear harmonic oscillator\n", + "h=6.63*10**-34 #planck's constant in Js\n", + "nu=50 #frequency in Hz\n", + "zeropointenergy=(h*nu)/2\n", + "print \"zeropointenergy=\",\"{:.3e}\".format(zeropointenergy),\"J\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.30:pg-226" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "zeropointenergy= 3.315e-34 J\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate zero point energy\n", + "nu=1 #frequency in Hz\n", + "h=6.63*10**-34 #planck's constant in Js\n", + "zeropointenergy=(h*nu)/2\n", + "print \"zeropointenergy=\",zeropointenergy,\"J\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex7.31:pg-226" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the frequency of vibration is nu= 6.895e+12 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate frequency of vibration\n", + "En=0.1*1.6*10**-19 #energy of a linear harmonic oscillator in eV\n", + "n=3.0 #third excited state\n", + "h=6.63*10**-34 #planck's constant\n", + "nu=En/((n+(1/2.0))*h)\n", + "print \"the frequency of vibration is nu=\",round(nu,-9),\"Hz\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter8.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter8.ipynb new file mode 100755 index 00000000..9a8917f6 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter8.ipynb @@ -0,0 +1,613 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter8:X-RAY" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.1:pg-240" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the value of plancks constant is h= 6.587e-34 J-s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate value of planck's constant\n", + "e=1.6*10**-19 #in C\n", + "V=100*10**3 #voltage in KV\n", + "c=3*10**8 #light speed in m/s\n", + "lamdamin=12.35*10**-12 #wavelength in m\n", + "h=e*V*lamdamin/c\n", + "print \"the value of plancks constant is h=\",\"{:.3e}\".format(h),\"J-s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.2:pg-240" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "maximum frequency present in the radiation from an X-ray tube is numax= 7.576e+37 Hz\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate maximum frequency\n", + "h=6.6*10**-34 #planck's constant in J-s\n", + "c=3.0*10**8 #light speed in m/s\n", + "Ve=50000 #accelerating potential in V\n", + "lamdamin=h*c/Ve #wavelength in m\n", + "numax=c/lamdamin\n", + "print \"maximum frequency present in the radiation from an X-ray tube is numax=\",\"{:.3e}\".format(numax),\"Hz\"\n", + "#answer is given in thec book is incorrect =1.2*10**19 Hz\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.3:pg-240" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of electrons striking the target per second is n= 1.250e+16 unitless\n", + "the speed with which electrons strike the target is v= 6.603e+07 m/s\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate number of electrons \n", + "I=2*10**-3 #current in mA\n", + "e=1.6*10**-19 \n", + "n=I/e\n", + "print \"number of electrons striking the target per second is n=\",\"{:.3e}\".format(n),\"unitless\"\n", + "#to calculate speed\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "V=12.4*10**3 #potential difference in V\n", + "v=math.sqrt(2*V*e/m)\n", + "print \"the speed with which electrons strike the target is v=\",\"{:.3e}\".format(v),\"m/s\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.4:pg-240" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the longest wavelength that can be analysed by a rock salt crystal is lamdamax= 2.820e-10 m\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "n=2 #second order for longest wavelength\n", + "d=2.82*10**-10 # spacing in angstrom\n", + "sintheta=1 \n", + "lamdamax=2*d*sintheta/n\n", + "print \"the longest wavelength that can be analysed by a rock salt crystal is lamdamax=\",\"{:.3e}\".format(lamdamax),\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.5:pg-241" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the spacing of the crystal is d= 0.661 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate spacing of the crystal\n", + "h=6.62*10**-34 #planck's constant in J-s\n", + "m=9.1*10**-31 #mass of electron in kg\n", + "V=344 #voltage in V\n", + "e=1.6*10**-19\n", + "lamda=h/math.sqrt(2*m*e*V) #wavelength in m\n", + "#according to Bragg's law\n", + "n=1\n", + "#formula is 2*d*sintheta=n*lamda\n", + "d=n*lamda/(2*math.sin(math.pi/6))\n", + "print \"the spacing of the crystal is d=\",round(d/1e-10,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.6:pg-241" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of Kalpha line for an atom is alphaa= 1.464e-09 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of Kalpha line for an atom\n", + "R=1.1*10**5\n", + "z=92\n", + "#Ka line is emitted when electron jumps from l shell(n2=2) to k shell(n1=1)\n", + "#formula is 1/alphaa=R*(z-b)*((1/n1**2)-(1/n2)**2)\n", + "alphaa=4/(3*R*(z-1)**2)\n", + "print \"wavelength of Kalpha line for an atom is alphaa=\",\"{:.3e}\".format(alphaa),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.7:pg-241" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "thickness is x= 1.849 cm\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate thickness\n", + "#mass absorption coefficient mum of an absorber is related with linear absorption coefficient mu and density of the material rho is given by\n", + "#mu=rho*mum=2.7*0.6=1.62 cm**-1\n", + "mu=1.62\n", + "#if initial intensity Io of the X-ray beam is reduced to I in traversing a distance x in absorber I=Io*e**-mu*x\n", + "#where I/Io=20\n", + "#put above values in the below equation , we get\n", + "x=(2.3026*(math.log(20)/math.log(10)))/1.62\n", + "print \"thickness is x=\",round(x,3),\"cm\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.8:pg-242" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "atomic number is z= 31 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate atomic number of the element\n", + "#equation for balmer series in hydrogen spectrum is 1/lamda=R*((1/2**2)-(1/n**2))\n", + "#for series limit n=infinity ,R=4/lamdainfinity i.e. R=4/364.6nm\n", + "#X-ray wavelength of K series is 1/lamda=R*(z-1)**2*((1/1**2)-(1/n**2))\n", + "lamda=0.1*10**-9\n", + "R=4/(364.6*10**-9)\n", + "#for n=infinity ,minimum wavelength of k series is given by\n", + "z=math.sqrt(1/(lamda*R))+1\n", + "print \"atomic number is z=\",int(z),\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.9:pg-242" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the wavelength of X-rays is lamda= 0.935 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "d=1.87*10**-10 #spacing in angstrom\n", + "n=2 \n", + "#formula is lamda=2*d*sintheta/n\n", + "lamda=2*d*math.sin(math.pi/6)/n\n", + "print \"the wavelength of X-rays is lamda=\",round(lamda/1e-10,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.10:pg-242" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of X-ray is lamda1= 1.68 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of second X-ray beam\n", + "#from bragg's law\n", + "#lamda=(d*math.sin(math.pi/3))/n eq(1)\n", + "#it is given that,theta=60,n=3,lamda=1.97 angstrom\n", + "#from eq(1) we get,2*d*sin60degree=3*0.97 eq(2)\n", + "#let lamda' be the second X-ray beam \n", + "#we get 2*d'*sin theta'=n'*lamda' eq(3)\n", + "#from eq(2) and eq(3),we get\n", + "lamda1=math.sin(math.pi/6)*3*0.97/math.sin(math.pi/3) #where lamda1=lamda'\n", + "print \"wavelength of X-ray is lamda1=\",round(lamda1,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.11:pg-243" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of X-ray is lamda= 0.979 angstrom\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength\n", + "d=2.82*10**-10 #spacing in m\n", + "n=1 \n", + "lamda=2*d*math.sin(10*math.pi/180)/n\n", + "print \"wavelength of X-ray is lamda=\",round(lamda/1e-10,3),\"angstrom\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.12:pg-243" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "d1= 4e-10 m\n", + "d2= 2e-10 m\n", + "d3= 0.0 m\n", + "d4= 1e-10 m\n" + ] + } + ], + "source": [ + "import math\n", + "#deduce possible spacing of the set of planes\n", + "#for first order , 2*d*sintheta1=1*lamda...eq(1)\n", + "#for second order ,2*d*sintheta2=2*lamda..eq(2)\n", + "#for third order, 2*d*sintheta3=3*lamda......eq(3)\n", + "#for fourth order, 2*d*sintheta4=4*lamda..............eq(4)\n", + "#divide eq(2) by eq(1),we get sintheta2=2*sintheta1\n", + "#similarly,sintheta3=3*sintheta1,sintheta4=4*sintheta1\n", + "lamda=1.32*10**-10\n", + "sintheta1=0.1650\n", + "d1=lamda/(2*sintheta1)#for first order n=1,d1=d/n\n", + "d2=lamda/(2*2*sintheta1) #for second order n=2,d2=d/n\n", + "d3=lamda/(2*3*sintheta1) #for third order n=3,d3=d/n\n", + "d4=lamda/(2*4*sintheta1) #for fourth order n=4,d4=d/n\n", + "print \"d1=\",d1,\"m\"\n", + "print \"d2=\",d2,\"m\"\n", + "print \"d3=\",round(d3,2),\"m\"\n", + "print \"d4=\",d4,\"m\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.13:pg-248" + ] + }, + { + "cell_type": "code", + "execution_count": 18, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "compton shift is dellamda= 0.0071 angstrom\n", + "wavelength of the scattered X-rays is lamda= 2.0071 angstrom\n", + "energylost = 0.00354 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate compton shift and wavelength\n", + "h=6.63*10**-34 #planck's constant in J-s\n", + "m0=9.11*10**-31 #mass of electron\n", + "c=3*10**8 #light speed in m/s\n", + "dellamda=h*(1-(1/math.sqrt(2)))/(m0*c)\n", + "lamda0=2*10**-10\n", + "lamda=dellamda+lamda0\n", + "print \"compton shift is dellamda=\",round(dellamda/1e-10,4),\"angstrom\"\n", + "print \"wavelength of the scattered X-rays is lamda=\",round(lamda/1e-10,4),\"angstrom\"\n", + "#to calculate fraction of energy lost by the photon in the collision\n", + "#energy lost =E0-E/E0=(hc/lamda0)-(hc/lamda)/(ha/lamda0)\n", + "#we get,\n", + "energylost=dellamda/lamda\n", + "print \"energylost =\",round(energylost,5),\"unitless\" \n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.14:pg-249" + ] + }, + { + "cell_type": "code", + "execution_count": 9, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength is lamda= 0.0245 angstrom\n", + "energy of the incident photon is E= 8.100e-14 J\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength and energy\n", + "#formula is lamda'-lamda=h*(1-cos phi)/(m0*c),where phi=90 degree, lamda'=2lamda ---------------eq(1)\n", + "#dellamda=2lamda-lamda=lamda ----------------------------eq(2)\n", + "h=6.62*10**-34 #planck's constant\n", + "c=3*10**8 #light speed in m.s\n", + "m0=9*10**-31 #mass of electron in kg\n", + "#from eq(1) and eq(2) ,we get\n", + "lamda=h/(m0*c)\n", + "print \"wavelength is lamda=\",round(lamda/1e-10,4),\"angstrom\"\n", + "E=h*c/lamda\n", + "print \"energy of the incident photon is E=\",\"{:.3e}\".format(E),\"J\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.15:pg-249" + ] + }, + { + "cell_type": "code", + "execution_count": 10, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of radiation is lamda1= 4.844e-12 m\n", + "direction of emission of electron is theta= 26.607 degree\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of radiation and direction of emission\n", + "h=6.6*10**-34 #planck's constant in J-s\n", + "c=3*10**8 #speed of light in m/s\n", + "energy=510*10**3 #energy of photon in eV\n", + "lamda=h*c/(energy*1.6*10**-19)\n", + "mo=9.1*10**-31 #mass of electron in Kg\n", + "lamda1=lamda+h*(1-math.cos(math.pi/2))/(mo*c)\n", + "print \"wavelength of radiation is lamda1=\",\"{:.3e}\".format(lamda1),\"m\"\n", + "theta=math.degrees(math.atan(lamda*math.sin(math.pi/2)/(lamda1-lamda*math.cos(math.pi/2))))\n", + "print\"direction of emission of electron is theta=\",round(theta,3),\"degree\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex8.16:pg-249" + ] + }, + { + "cell_type": "code", + "execution_count": 11, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of two X-rays is lamda1= 10.708 picometer\n", + "maximum wavelength present in the scattered X-rays is lamda2= 14.835 picometer\n", + "maximum kinetic energy of the recoil electrons is Kmax= 40.333 KeV\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate wavelength of two X-rays\n", + "h=6.6*10**-34 #planck's constant in J-s\n", + "c=3.0*10.0**8 #light speed in m/s\n", + "mo=9.1*10**-31 #mass of electron in kg\n", + "lamda=10.0*10**-12 #wavelength in pm\n", + "lamda1=lamda+((h/(mo*c))*(1-(1/math.sqrt(2))))\n", + "print \"wavelength of two X-rays is lamda1=\",round(lamda1*(1e12),3),\"picometer\"\n", + "#to calculate maximum wavelength\n", + "lamda2=lamda+((2*h)/(mo*c))\n", + "print \"maximum wavelength present in the scattered X-rays is lamda2=\",round(lamda2*(1e12),3),\"picometer\"\n", + "#to calculate maximum kinetic energy \n", + "Kmax=(h*c)*((1/lamda)-(1/lamda2))/(1.6*10**-19)\n", + "print \"maximum kinetic energy of the recoil electrons is Kmax=\",round(Kmax/1000.0,3),\"KeV\"\n", + "\n", + "# the answer is slightly different due to approximation\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter9.ipynb b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter9.ipynb new file mode 100755 index 00000000..cb4c87db --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/chapter9.ipynb @@ -0,0 +1,136 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter9:DIELECTRIC PROPERTIESOF MATERIALS" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.1:pg-269" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the dielectric constant of the liquid is epsilon0= 2 unitless\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate dielectric constant of the liquid\n", + "#capacitance of the air filled dielectric Cair=Q/Vo-----------eq(1)\n", + "#when dielectric is filled between the plates ,Cliquid=Q/V\n", + "#then Cliquid=epsilonr*Q/Vo------eq(2)\n", + "Vo=60\n", + " #voltage in volts\n", + "V=30\n", + "#from eq(1) and eq(2),we get\n", + "epsilon0=Vo/V\n", + "print \"the dielectric constant of the liquid is epsilon0=\",epsilon0,\"unitless\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.2:pg-269" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the charge on the capacitance is Q= 1.417e-09 Coulomb\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate charge on the capacitance\n", + "epsilon0=8.854*10**-12 #permittivity\n", + "epsilonr=6 #relative permittivity\n", + "V=100 #voltage in volts\n", + "d=1.5*10**-3 #distance in m\n", + "A=4*10**-4#area in m**2\n", + "Q=epsilon0*epsilonr*A*V/d\n", + "print \"the charge on the capacitance is Q=\",\"{:.3e}\".format(Q),\"Coulomb\"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Ex9.3:pg-269" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the resultant voltage across the capacitor is V= 39.716 volt\n" + ] + } + ], + "source": [ + "import math\n", + "#to calculate voltage\n", + "A=6.50*10**-4 #area in m**2\n", + "Q=2*10**-10 #charge in C\n", + "d=4*10**-3 #plate separation in m\n", + "epsilon0=8.854*10**-12\n", + "epsilonr=3.5 #dielectric constant\n", + "V=Q*d/(epsilon0*epsilonr*A)\n", + "print \"the resultant voltage across the capacitor is V=\",round(V,3),\"volt\"\n" + ] + } + ], + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/screenshots/1.png b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/screenshots/1.png Binary files differnew file mode 100755 index 00000000..6a183718 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/screenshots/1.png diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/screenshots/2.png b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/screenshots/2.png Binary files differnew file mode 100755 index 00000000..3e3a2856 --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/screenshots/2.png diff --git a/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/screenshots/3.png b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/screenshots/3.png Binary files differnew file mode 100755 index 00000000..395774be --- /dev/null +++ b/Engineering_Physics_by_S_K_Srivastava_and_R_A_Yadav/screenshots/3.png diff --git a/Fundamental_of_Electronics_Devices/Ch3.ipynb b/Fundamental_of_Electronics_Devices/Ch3.ipynb index d78715cf..19b5eab1 100755 --- a/Fundamental_of_Electronics_Devices/Ch3.ipynb +++ b/Fundamental_of_Electronics_Devices/Ch3.ipynb @@ -1,298 +1,341 @@ -{
- "metadata": {
- "name": ""
- },
- "nbformat": 3,
- "nbformat_minor": 0,
- "worksheets": [
- {
- "cells": [
- {
- "cell_type": "heading",
- "level": 1,
- "metadata": {},
- "source": [
- "Chapter3 : Excess Carriers in Semiconductor"
- ]
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.2 Page No 111"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "l=6000 #in Angstrum\n",
- "h=6.6*10**(-34) #Planks constant\n",
- "c=3*10**8 #speed of light in m/s\n",
- "e=1.602*10**(-19) #Constant\n",
- "\n",
- "phi=c*h/(e*l*10**(-10))\n",
- "\n",
- "print\"Minimum required energy is\",round(phi,2),\"eV \"\n"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Minimum required energy is 2.06 eV \n"
- ]
- }
- ],
- "prompt_number": 3
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.3 Page No 112"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "Emax=2.5 #maximum energy of emitted electrons in eV \n",
- "l=2537.0 #in Angstrum\n",
- "\n",
- "EeV=12400.0/l #in eV\n",
- "phi=EeV-Emax #in eV\n",
- "\n",
- "print \"Work function of the cathode material is \",round(phi,2),\"eV\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Work function of the cathode material is 2.39 eV\n"
- ]
- }
- ],
- "prompt_number": 6
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.4 Page No 115"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "t=0.46*10**-4 #in centi meters\n",
- "hf1=2 #in ev\n",
- "hf2=1.43\n",
- "Pin=10 #in mW\n",
- "alpha=50000 # in per cm\n",
- "e=1.6*10**-19 #constant\n",
- "Io=0.01 #in mW\n",
- "\n",
- "import math\n",
- "\n",
- "It=Io*math.exp(-alpha*t) #in mW\n",
- "Iabs=Io-It\n",
- "f=(hf1-hf2)/hf1\n",
- "E=f*Iabs\n",
- "N=Iabs/(e*hf1)\n",
- "\n",
- "print\"(i)Thus power absorbed is \",round(Iabs,3),\"J/s\"\n",
- "print\"(ii)Energy converted into heat is\",round(E,4),\"J/s\"\n",
- "print\"(iii)Number of photons per second given off from recombination events \",round(N,-14)\n",
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "(i)Thus power absorbed is 0.009 J/s\n",
- "(ii)Energy converted into heat is 0.0026 J/s\n",
- "(iii)Number of photons per second given off from recombination events 2.81e+16\n"
- ]
- }
- ],
- "prompt_number": 1
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.5 Page No 123"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "L=100 #in uM\n",
- "A=10&-7 #in cm**2\n",
- "th=10**-6 #in sec\n",
- "V=12 #in Volts\n",
- "ue=0.13 #in m**2/V-s\n",
- "uh=0.05 #in m**2/V-s\n",
- "\n",
- "E=V/(L*10**-6) #in V/m\n",
- "tn=(L*10**-6)/(ue*E)\n",
- "Gain=(1+uh/ue)*(th/tn)\n",
- "\n",
- "print\"Electron transit time in sec is \",round(tn,10),\"s\"\n",
- "print\"Photoconductor gain is \",Gain"
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Electron transit time in sec is 6.4e-09 s\n",
- "Photoconductor gain is 216.0\n"
- ]
- }
- ],
- "prompt_number": 29
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.6 Page No128"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "import math\n",
- "Io=0.15 #in uA\n",
- "V=0.12 #in mVolt\n",
- "Vt=26 #in mVolt\n",
- "\n",
- "I=Io*10**-6*(math.exp(V/(Vt*10**-3))-1) #in A\n",
- "\n",
- "print\"Current flowing through diode is \",round(I*10**6,2),\"micra A\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Current flowing through diode is 15.0 micra A\n"
- ]
- }
- ],
- "prompt_number": 30
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.7 Page No 128"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "import math\n",
- "Io=2.5 #in uA\n",
- "I=10 #in mA\n",
- "Vt=26 #in mVolt\n",
- "n=2 #for silicon\n",
- "\n",
- "V=n*Vt*10**-3*math.log((I*10**-3)/(Io*10**-6))\n",
- "\n",
- "print \"Forward voltage is \",round(V,2),\"V\""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Forward voltage is 0.43 V\n"
- ]
- }
- ],
- "prompt_number": 31
- },
- {
- "cell_type": "heading",
- "level": 3,
- "metadata": {},
- "source": [
- "Example 3.8 Page No 128"
- ]
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [
- "\n",
- "ND=10**21 #in m**-3\n",
- "NA=10**22 #in m**-3\n",
- "De=3.4*10**-3 #in m**2-s**-1\n",
- "Dh=1.2*10**-3 #in m**2-s**-1\n",
- "Le=7.1*10**-4 #in meters\n",
- "Lh=3.5*10**-4 #in meters\n",
- "ni=1.6*10**16 #in m**-3\n",
- "e=1.602*10**-19 #constant\n",
- "\n",
- "IoA=e*ni**2*(Dh/(Lh*ND)+De/(Le*NA))\n",
- "\n",
- "print\"Reverse saturation current density is \",round(IoA*10**6,2),\"uA \""
- ],
- "language": "python",
- "metadata": {},
- "outputs": [
- {
- "output_type": "stream",
- "stream": "stdout",
- "text": [
- "Reverse saturation current density is 0.16 uA \n"
- ]
- }
- ],
- "prompt_number": 33
- },
- {
- "cell_type": "code",
- "collapsed": false,
- "input": [],
- "language": "python",
- "metadata": {},
- "outputs": []
- }
- ],
- "metadata": {}
- }
- ]
-}
\ No newline at end of file +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# Chapter3 : Excess Carriers in Semiconductor" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example 3.2 Page No 111" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Minimum required energy is 2.06 eV \n" + ] + } + ], + "source": [ + "#Example 3.2\n", + "#What is Minimum required energy \n", + "\n", + "#given data\n", + "l=6000 #in Angstrum\n", + "h=6.6*10**(-34) #Planks constant\n", + "c=3*10**8 #speed of light in m/s\n", + "e=1.602*10**(-19) #Constant\n", + "\n", + "#calculation\n", + "phi=c*h/(e*l*10**(-10))\n", + "\n", + "#result\n", + "print\"Minimum required energy is\",round(phi,2),\"eV \"\n" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example 3.3 Page No 112" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Work function of the cathode material is 2.39 eV\n" + ] + } + ], + "source": [ + "#Exa 3.3\n", + "#calculate Work function of the cathode material\n", + "\n", + "#given data\n", + "Emax=2.5 #maximum energy of emitted electrons in eV \n", + "l=2537.0 #in Angstrum\n", + "\n", + "#Calculation\n", + "EeV=12400.0/l #in eV\n", + "phi=EeV-Emax #in eV\n", + "\n", + "#result\n", + "print \"Work function of the cathode material is \",round(phi,2),\"eV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example 3.4 Page No 115" + ] + }, + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "(i)Thus power absorbed is 0.009 J/s\n", + "(ii)Energy converted into heat is 0.0026 J/s\n", + "(iii)Number of photons per second given off from recombination events 2.81e+16\n" + ] + } + ], + "source": [ + "#Example 3.4\n", + "#Find (i)The fraction of each photon energy unit which is converted into heat\",f\n", + "#(ii)Energy converted into heat in ,((2-1.43)/2)*0.009,\"J/s\"\n", + "#(iii)Number of photons per second given off from recombination events \",0.009/(e*2)\n", + "\n", + "#given data\n", + "t=0.46*10**-4 #in centi meters\n", + "hf1=2 #in ev\n", + "hf2=1.43\n", + "Pin=10 #in mW\n", + "alpha=50000 # in per cm\n", + "e=1.6*10**-19 #constant\n", + "Io=0.01 #in mW\n", + "\n", + "import math\n", + "\n", + "#Calculation\n", + "It=Io*math.exp(-alpha*t) #in mW\n", + "Iabs=Io-It\n", + "f=(hf1-hf2)/hf1\n", + "E=f*Iabs\n", + "N=Iabs/(e*hf1)\n", + "\n", + "#result\n", + "print\"(i)Thus power absorbed is \",round(Iabs,3),\"J/s\"\n", + "print\"(ii)Energy converted into heat is\",round(E,4),\"J/s\"\n", + "print\"(iii)Number of photons per second given off from recombination events \",round(N,-14)\n", + "#In book there is calculation mistake in Number of photons." + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example 3.5 Page No 123" + ] + }, + { + "cell_type": "code", + "execution_count": 29, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Electron transit time in sec is 6.4e-09 s\n", + "Photoconductor gain is 216.0\n" + ] + } + ], + "source": [ + "#Example 3.5\n", + "#What is Photoconductor gain \n", + "#Electron transit time.\n", + "\n", + "#given data\n", + "L=100 #in uM\n", + "A=10&-7 #in cm**2\n", + "th=10**-6 #in sec\n", + "V=12 #in Volts\n", + "ue=0.13 #in m**2/V-s\n", + "uh=0.05 #in m**2/V-s\n", + "\n", + "#Calculation\n", + "E=V/(L*10**-6) #in V/m\n", + "tn=(L*10**-6)/(ue*E)\n", + "Gain=(1+uh/ue)*(th/tn)\n", + "\n", + "#result\n", + "print\"Electron transit time in sec is \",round(tn,10),\"s\"\n", + "print\"Photoconductor gain is \",Gain" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example 3.6 Page No128" + ] + }, + { + "cell_type": "code", + "execution_count": 30, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Current flowing through diode is 15.0 micra A\n" + ] + } + ], + "source": [ + "#Example3.6\n", + "#Calculate Current flowing through diode .\n", + "\n", + "#given datex\n", + "import math\n", + "Io=0.15 #in uA\n", + "V=0.12 #in mVolt\n", + "Vt=26 #in mVolt\n", + "\n", + "#calculation\n", + "I=Io*10**-6*(math.exp(V/(Vt*10**-3))-1) #in A\n", + "\n", + "#result\n", + "print\"Current flowing through diode is \",round(I*10**6,2),\"micra A\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example 3.7 Page No 128" + ] + }, + { + "cell_type": "code", + "execution_count": 31, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Forward voltage is 0.43 V\n" + ] + } + ], + "source": [ + "#Exa 3.7\n", + "#Determine the Forward voltage \n", + "\n", + "#given data\n", + "import math\n", + "Io=2.5 #in uA\n", + "I=10 #in mA\n", + "Vt=26 #in mVolt\n", + "n=2 #for silicon\n", + "\n", + "#Calculation\n", + "V=n*Vt*10**-3*math.log((I*10**-3)/(Io*10**-6))\n", + "\n", + "#Result\n", + "print \"Forward voltage is \",round(V,2),\"V\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "### Example 3.8 Page No 128" + ] + }, + { + "cell_type": "code", + "execution_count": 33, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Reverse saturation current density is 0.16 uA \n" + ] + } + ], + "source": [ + "#Example 3.8\n", + "#What is Reverse saturation current density \n", + "\n", + "#given data\n", + "ND=10**21 #in m**-3\n", + "NA=10**22 #in m**-3\n", + "De=3.4*10**-3 #in m**2-s**-1\n", + "Dh=1.2*10**-3 #in m**2-s**-1\n", + "Le=7.1*10**-4 #in meters\n", + "Lh=3.5*10**-4 #in meters\n", + "ni=1.6*10**16 #in m**-3\n", + "e=1.602*10**-19 #constant\n", + "\n", + "#calculation\n", + "IoA=e*ni**2*(Dh/(Lh*ND)+De/(Le*NA))\n", + "\n", + "#Result\n", + "print\"Reverse saturation current density is \",round(IoA*10**6,2),\"uA \"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": false + }, + "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.3" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_11_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_11_1.ipynb new file mode 100755 index 00000000..c0c024dd --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_11_1.ipynb @@ -0,0 +1,165 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 11: Fracture Mechanics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 11.1, Fracture Toughness, Page No. 354"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Since Fracture Toughness of the material is = 172.852 MPa\n",
+ " and the applied stress is 172 MPa thus the flaw will propagate as a brittle fracture\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import sqrt\n",
+ "from math import pi\n",
+ "from math import cos\n",
+ "\n",
+ "#variable declaration\n",
+ "a=5;\n",
+ "a=a*10**-3; #conversion to m\n",
+ "t=1.27; #in cm\n",
+ "t=t*10**-2; #conversion to m\n",
+ "def sec(x):\n",
+ " return 1/cos(x);\n",
+ "\n",
+ "#calculation\n",
+ "K_Ic=24;\n",
+ "sigma=K_Ic/(sqrt(pi*a)*sqrt(sec(pi*a/(2*t))));\n",
+ "\n",
+ "#result\n",
+ "print('Since Fracture Toughness of the material is = %g MPa\\n and the applied stress is 172 MPa thus the flaw will propagate as a brittle fracture')%(sigma);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 11.2, Fracture Toughness, Page No. 354"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Critical Crack depth = 15.4981 mm\n",
+ "which is greater than the thickness of the vessel wall, 12mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import pi\n",
+ "\n",
+ "#variable declaration\n",
+ "K_Ic=57;\n",
+ "sigma0=900;\n",
+ "sigma=360;\n",
+ "Q=2.35;\n",
+ "\n",
+ "#calculation\n",
+ "a_c=K_Ic**2*Q/(1.21*pi*sigma**2);\n",
+ "a_c=a_c*1000; #conversion to mm\n",
+ "\n",
+ "#result\n",
+ "print('\\nCritical Crack depth = %g mm\\nwhich is greater than the thickness of the vessel wall, 12mm')%(a_c);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 11.3, Plasticity, Page No. 361"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Plastic zone size = 0.113177 mm\n",
+ "Stress Intensity Factor = 42.8659 MPa m^(1/2)\n",
+ "\n",
+ "\n",
+ "Note: Calculation Errors in book\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import sqrt\n",
+ "from math import pi\n",
+ "\n",
+ "#variable declaration\n",
+ "a=10;\n",
+ "a=a*10**-3; #conversion to m\n",
+ "sigma=400;\n",
+ "sigma0=1500;\n",
+ "\n",
+ "#calculation\n",
+ "rp=sigma**2*a/(2*pi*sigma0**2);\n",
+ "rp=rp*1000; #conversion to mm\n",
+ "K=sigma*sqrt(pi*a);\n",
+ "K_eff=sigma*sqrt(pi*a)*sqrt(a+pi*rp);\n",
+ "\n",
+ "#result\n",
+ "print('\\nPlastic zone size = %g mm\\nStress Intensity Factor = %g MPa m^(1/2)\\n\\n\\nNote: Calculation Errors in book')%(rp,K_eff);"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_12_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_12_1.ipynb new file mode 100755 index 00000000..02a53d79 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_12_1.ipynb @@ -0,0 +1,337 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 12: Fatigue of Metals"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "### Example 12.1, Mean Stress, Page No. 387"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Bar Diameter = 1.45673 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import pi\n",
+ "from math import sqrt\n",
+ "\n",
+ "#variable declaration\n",
+ "sigma_u=158; # in ksi\n",
+ "sigma0=147; # in ksi\n",
+ "sigma_e=75; # in ksi\n",
+ "l_max=75; # in ksi\n",
+ "l_min=-25; # in ksi\n",
+ "sf=2.5;\n",
+ "\n",
+ "#calculation\n",
+ "sigma_m=(l_max+l_min)/2;\n",
+ "sigma_a=(l_max-l_min)/2;\n",
+ "sigma_e=sigma_e/sf;\n",
+ "A=sigma_a/sigma_e+sigma_m/sigma_u;\n",
+ "D=sqrt(4*A/pi);\n",
+ "\n",
+ "#result\n",
+ "print('\\nBar Diameter = %g in')%(D);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 12.2, Low Cycle Fatigue, Page No. 391"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "d_e_e = 0.000681818\n",
+ "d_e_p = 0.000608182\n",
+ "Number of Cycles = 48884 cycles\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "sigma_b=75.0;\n",
+ "e_b=0.000645;\n",
+ "e_f=0.3;\n",
+ "E=22*10**4;\n",
+ "c=-0.6;\n",
+ "\n",
+ "#calculation\n",
+ "d_e_e=float(2*sigma_b/E);\n",
+ "d_e_p=2*e_b-d_e_e;\n",
+ "N=((d_e_p/(2*e_f))**(1/c))/2;\n",
+ "\n",
+ "#result\n",
+ "print('\\nd_e_e = %g\\nd_e_p = %g\\nNumber of Cycles = %g cycles')%(d_e_e,d_e_p,N);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 12.3, Fatigue Crack Proportion, Page No. 401"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Fatigue Cycles = 261417 cycles\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import pi\n",
+ "\n",
+ "#variable declaration\n",
+ "ai=0.5;\n",
+ "ai=ai*10**-3; #conversion to m\n",
+ "sigma_max=180.0;\n",
+ "Kc=100.0;\n",
+ "alpha=1.12;\n",
+ "p=3.0;\n",
+ "A=6.9*10**-12;\n",
+ "\n",
+ "#calculation\n",
+ "af=(Kc/(sigma_max*alpha))**2/pi;\n",
+ "Nf=float(af**(1-(p/2))-ai**(1-(p/2)))/float((1-p/2)*A*(sigma_max**3)*(pi**(p/2))*(alpha**p));\n",
+ "\n",
+ "#result\n",
+ "print('Fatigue Cycles = %g cycles')%(Nf);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 12.4, Stress Concentration of Fatigue, Page No. 404"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Mean Stress = 25464.8 psi\n",
+ "Fluctuating Bending Stress = 33658.4 psi\n",
+ "Effective Maximum Stress = 59123.2 psi\n",
+ "Effective Minimum Stress = 8193.63 psi\n",
+ "sigma_a = 39834.1 psi\n",
+ "\n",
+ "\n",
+ "Note: Calculation Errors in the book\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "from math import sqrt\n",
+ "from math import pi\n",
+ "\n",
+ "#variable declaration\n",
+ "rho=0.0004;\n",
+ "S_u=190000;\n",
+ "M=200;\n",
+ "Pm=5000;\n",
+ "D=0.5;\n",
+ "dh=0.05;\n",
+ "r=dh/2;\n",
+ "Kt=2.2;\n",
+ "\n",
+ "#calculation\n",
+ "Kf=1+(Kt-1)/(1+sqrt(rho/r));\n",
+ "q=(Kf-1)/(Kt-1);\n",
+ "A=pi/4*D**2;\n",
+ "sigma_m=Pm/A;\n",
+ "I=pi/64*D**4;\n",
+ "sigma_a=Kf*((M*D)/(2*I));\n",
+ "sigma_max=sigma_a+sigma_m;\n",
+ "sigma_min=sigma_a-sigma_m;\n",
+ "sigma_e=S_u/2;\n",
+ "sigma_a1=sigma_e/Kf*(1-sigma_m/S_u);\n",
+ "\n",
+ "#result\n",
+ "print('\\nMean Stress = %g psi\\nFluctuating Bending Stress = %g psi\\nEffective Maximum Stress = %g psi\\nEffective Minimum Stress = %g psi\\nsigma_a = %g psi\\n\\n\\nNote: Calculation Errors in the book')%(sigma_m,sigma_a,sigma_max,sigma_min,sigma_a1);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 12.5, Infinite Life Design, Page No. 422"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Fatigue Limit = 14245.3 psi\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "#variable declaration\n",
+ "Kt=1.68;\n",
+ "q=0.9;\n",
+ "sigma_ed=42000;\n",
+ "Cs=0.9;\n",
+ "Cf=0.75;\n",
+ "Cz=0.81;\n",
+ "\n",
+ "#calculation\n",
+ "Kf=q*(Kt-1)+1;\n",
+ "sigma_e=sigma_ed*Cs*Cf*Cz;\n",
+ "sigma_en=sigma_e/Kf;\n",
+ "\n",
+ "#result\n",
+ "print('\\nFatigue Limit = %g psi')%(sigma_en);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 12.6, Local Strain method, Page No. 424"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false,
+ "scrolled": true
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Number of cycles = 14785.5 cycles\n",
+ "Fatigue damage per cycle = 6.7634e-05\n",
+ "Number of cycles with correction of mean stress= 129289 cycles\n",
+ "Fatigue damage per cycle with correction of mean stress= 7.7346e-06 damage per year\n",
+ "Shaft will fail in 2.2446 days\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from scipy.optimize import fsolve\n",
+ "\n",
+ "#variable declaration\n",
+ "K=189;\n",
+ "n=0.12;\n",
+ "ef=1.06;\n",
+ "sigma_f=190;\n",
+ "b=-0.08;\n",
+ "c=-0.66;\n",
+ "E=30000000.0;\n",
+ "E=E/1000; #conversion to ksi\n",
+ "s=200.0;\n",
+ "sigma_m=167.0;\n",
+ "sigma_a=17.0;\n",
+ "se=s**2/E;\n",
+ "\n",
+ "#calculation\n",
+ "def f(ds):\n",
+ " return (ds**2)/(2*E)+(ds**((1+n)/n))/((2*K)**(1/n))-se/2;\n",
+ "ds=fsolve(f,1)\n",
+ "de=se/ds;\n",
+ "def f1(N2):\n",
+ " return (N2**(b))*(sigma_f/E)+ef*(N2**(c))-de/2;\n",
+ "N2=fsolve(f1,1);\n",
+ "N_1=N2/2;\n",
+ "de_e2=sigma_a/E;\n",
+ "def f2(N2):\n",
+ " return (N2**b)*((sigma_f-sigma_m)/E)+ef*(N2**c)-de_e2;\n",
+ "N2=fsolve(f2,1);\n",
+ "N_2=N2/2;\n",
+ "C_pd=2*60*60*8;\n",
+ "f=N_2/C_pd;\n",
+ "\n",
+ "#result\n",
+ "print('\\nNumber of cycles = %g cycles\\nFatigue damage per cycle = %g\\nNumber of cycles with correction of mean stress= %g cycles\\nFatigue damage per cycle with correction of mean stress= %g damage per year\\nShaft will fail in %g days')%(N_1,1/N_1,N_2,1/N_2,f);\n"
+ ]
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_13_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_13_1.ipynb new file mode 100755 index 00000000..2afb13d5 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_13_1.ipynb @@ -0,0 +1,181 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 13: Creep and Stress Rupture"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "### Example 13.1, Engineering Creep, Page No. 461"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "-----------------------------------------------------------\n",
+ "\n",
+ "Temperature\tCreep Strength, psi\tWorking Stress, psi\n",
+ "\n",
+ "------------------------------------------------------------\n",
+ "\n",
+ "1100 F\t\t\t30000\t\t\t10000\n",
+ "\n",
+ "\n",
+ "1500 F\t\t\t4000\t\t\t1333\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "#variable declaration\n",
+ "sf=3;\n",
+ "per=1/1000;\n",
+ "T=[1100, 1500];\n",
+ "C=[30000, 4000]; \n",
+ "W=[0, 0];\n",
+ "#calculation\n",
+ "W[0]=C[0]/sf;\n",
+ "W[1]=C[1]/sf;\n",
+ "\n",
+ "#result\n",
+ "print('\\n-----------------------------------------------------------\\n');\n",
+ "print('Temperature\\tCreep Strength, psi\\tWorking Stress, psi\\n');\n",
+ "print('------------------------------------------------------------');\n",
+ "print('\\n1100 F\\t\\t\\t%i\\t\\t\\t%i\\n')%(C[0],W[0]);\n",
+ "print('\\n1500 F\\t\\t\\t%i\\t\\t\\t%i\\n')%(C[1],W[1]);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 13.2, Engineering Creep, Page No. 461"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Activation Energy = 157867 cal/mol\n",
+ "\n",
+ "\n",
+ "\n",
+ "Note: Calculation Errors in book\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "from math import log\n",
+ "\n",
+ "#variable declaration\n",
+ "def C(f):\n",
+ " return (f-32)*5/9;\n",
+ "R=1.987;\n",
+ "T2=1300;\n",
+ "T1=1500;\n",
+ "\n",
+ "#calculation\n",
+ "T2=C(T2)+273.15;\n",
+ "T1=C(T1)+273.15;\n",
+ "e2=0.0001;\n",
+ "e1=0.4;\n",
+ "Q=R*log(e1/e2)/(1/T2-1/T1);\n",
+ "\n",
+ "#result\n",
+ "print('\\nActivation Energy = %g cal/mol')%(Q)\n",
+ "print('\\n\\n\\nNote: Calculation Errors in book');"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 13.3, Prediction of long time properties, Page No. 464"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "At T = 1200 F, P = 41500\n",
+ "At T = 1600 F, P = 51500\n",
+ "And from the master ploy of Astroploy, corresponding stress required are sigma = 78000 psi and sigma = 11000 psi\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import log10\n",
+ "\n",
+ "#variable declaration\n",
+ "t=10**5;\n",
+ "C1=20;\n",
+ "T1=1200;\n",
+ "T2=1600;\n",
+ "\n",
+ "#calculation\n",
+ "P_1200=(T1+460)*(log10(t)+C1);\n",
+ "P_1600=(T2+460)*(log10(t)+C1);\n",
+ "\n",
+ "#result\n",
+ "print('\\nAt T = 1200 F, P = %g\\nAt T = 1600 F, P = %g\\nAnd from the master ploy of Astroploy, corresponding stress required are sigma = 78000 psi and sigma = 11000 psi')%(P_1200,P_1600);"
+ ]
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_14_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_14_1.ipynb new file mode 100755 index 00000000..bd230ae6 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_14_1.ipynb @@ -0,0 +1,90 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 14: Brittle Fracture and Impact Testing"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 14.1, Stress Corrosion Cracking, Page No. 494"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Estimated Life = 11.5741 days\n",
+ "\n",
+ "\n",
+ "\n",
+ "---------------------------------\n",
+ "Stress, MPa\tCrack Length, mm\n",
+ "---------------------------------\n",
+ "\n",
+ "\t500\t\t0.105226\n",
+ "\n",
+ "\t300\t\t0.292296\n",
+ "\n",
+ "\t100\t\t2.63066\n",
+ "\n",
+ "---------------------------------\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import pi\n",
+ "\n",
+ "#variable declaration\n",
+ "cg=0.01;\n",
+ "gr=10**-8;\n",
+ "\n",
+ "#calculation\n",
+ "l=cg/(gr*3600*24);\n",
+ "K_l_SCC=10;\n",
+ "a_sigma2=K_l_SCC**2/(1.21*pi);\n",
+ "s=[500,300,100];\n",
+ "\n",
+ "#result\n",
+ "print('\\nEstimated Life = %g days')%(l);\n",
+ "print('\\n\\n\\n---------------------------------\\nStress, MPa\\tCrack Length, mm\\n---------------------------------\\n');\n",
+ "for i in range (0,3):\n",
+ " print('\\t%g\\t\\t%g\\n')%(s[i],a_sigma2*1000/s[i]**2);\n",
+ "print('---------------------------------');"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_15_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_15_1.ipynb new file mode 100755 index 00000000..4b4e7632 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_15_1.ipynb @@ -0,0 +1,294 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 15: Fundamentals of Metalworking"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 15.1, Mechanics of Metal Working, Page No. 506"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Enginering Strain = 1\n",
+ "True Strain = 0.693147\n",
+ "Reduction = 1\n",
+ "\n",
+ "\n",
+ "Enginering Strain = -0.5\n",
+ "True Strain = -0.693147\n",
+ "Reduction = -1\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import log\n",
+ "\n",
+ "#For Bar which is double in length\n",
+ "#variable declaration 1\n",
+ "L2=2;\n",
+ "L1=1;\n",
+ "\n",
+ "#calculation 1\n",
+ "e=(L2-L1)/L1;\n",
+ "e1=log(L2/L1);\n",
+ "r=1-L1/L2;\n",
+ "\n",
+ "#result 1\n",
+ "print('\\nEnginering Strain = %g\\nTrue Strain = %g\\nReduction = %g')%(e,e1,r);\n",
+ "\n",
+ "\n",
+ "\n",
+ "#For bar which is halved in length\n",
+ "#variable declaration 2\n",
+ "L1=1;\n",
+ "L2=0.5;\n",
+ "\n",
+ "#calculation 2\n",
+ "e=(L2-L1)/L1;\n",
+ "e1=log(L2/L1);\n",
+ "r=1-L1/L2;\n",
+ "\n",
+ "#result 2\n",
+ "print('\\n\\nEnginering Strain = %g\\nTrue Strain = %g\\nReduction = %g')%(e,e1,r);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "### Example 15.2, Mechanics of Metal Working, Page No. 511"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Plastic work done in 1st step = 39752.1 lb/in^2\n",
+ "Plastic work done in 2nd step = 97934.8 lb/in^2\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from scipy.integrate import quad\n",
+ "from math import log\n",
+ "\n",
+ "#variable declaration\n",
+ "D0=25.0;\n",
+ "D1=20.0;\n",
+ "D2=15.0;\n",
+ "def integrand(e):\n",
+ " return 200000*e**0.5\n",
+ "\n",
+ "#calculation\n",
+ "ep1=log((D0/D1)**2);\n",
+ "U1,U1_err=quad(integrand,0,ep1);\n",
+ "ep2=log((D1/D2)**2);\n",
+ "U2,U2_err=quad(integrand,ep1,ep1+ep2);\n",
+ "\n",
+ "#result\n",
+ "print('\\nPlastic work done in 1st step = %g lb/in^2\\nPlastic work done in 2nd step = %g lb/in^2\\n')%(U1,U2);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 15.3, Hodography, Page No. 517"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Pressure = 2.88675\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import sin\n",
+ "from math import radians\n",
+ "\n",
+ "#variable declaration\n",
+ "alpha=60;\n",
+ "\n",
+ "#calculation\n",
+ "r=radians(alpha);\n",
+ "mu=1/sin(r);\n",
+ "p_2k=mu*5/2;\n",
+ "\n",
+ "#result\n",
+ "print('Pressure = %g')%(p_2k);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 15.4, Temperature in Metalworking, Page No. 526"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Temperature Rise for aluminium = 78.4808 C\n",
+ "Temperature Rise for titanium = 162.686 C\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "Al_s=200;\n",
+ "Al_e=1;\n",
+ "Al_p=2.69;\n",
+ "Al_c=0.215;\n",
+ "Ti_s=400;\n",
+ "Ti_e=1;\n",
+ "Ti_p=4.5;\n",
+ "Ti_c=0.124;\n",
+ "J=4.186;\n",
+ "b=0.95;\n",
+ "\n",
+ "#calculation\n",
+ "Al_Td=Al_s*Al_e*b/(Al_p*Al_c*J);\n",
+ "Ti_Td=Ti_s*Ti_e*b/(Ti_p*Ti_c*J);\n",
+ "\n",
+ "#result\n",
+ "print('\\nTemperature Rise for aluminium = %g C\\nTemperature Rise for titanium = %g C\\n')%(Al_Td,Ti_Td);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 15.5, Friction and Lubrication, Page No. 546"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "For OD after deformation being 70 mm, Di = 22.3607 mm\n",
+ "Precent change in inside diameter = 25.4644 percent\n",
+ "Peak pressure = 1.93531\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "For OD after deformation being 81.4 mm, Di = 35.0137 mm\n",
+ "Precent change in inside diameter = -16.7124 percent\n",
+ "Peak pressure = 1.17321\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#variable declaration\n",
+ "Do=60;\n",
+ "Di=30;\n",
+ "def1=70;\n",
+ "def2=81.4;\n",
+ "h=10;\n",
+ "a=30;\n",
+ "\n",
+ "#calculation1\n",
+ "di=sqrt((Do**2-Di**2)*2-def1**2);\n",
+ "pr=(Di-di)/Di*100;\n",
+ "m=0.27;\n",
+ "p_s=1+2*m*a/(sqrt(3)*h);\n",
+ "\n",
+ "#result 1\n",
+ "print('\\nFor OD after deformation being 70 mm, Di = %g mm\\nPrecent change in inside diameter = %g percent\\nPeak pressure = %g')%(di,pr,p_s);\n",
+ "\n",
+ "#calculation 2\n",
+ "di=sqrt(def2**2-(Do**2-Di**2)*2);\n",
+ "pr=(Di-di)/Di*100;\n",
+ "m=0.05;\n",
+ "p_s=1+2*m*a/(sqrt(3)*h);\n",
+ "\n",
+ "#result 2\n",
+ "print('\\n\\n\\n\\nFor OD after deformation being 81.4 mm, Di = %g mm\\nPrecent change in inside diameter = %g percent\\nPeak pressure = %g')%(di,pr,p_s);\n"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_16_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_16_1.ipynb new file mode 100755 index 00000000..df731606 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_16_1.ipynb @@ -0,0 +1,131 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 16: Forging"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 16.1, Forging in Plain Strain, Page No. 574"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "At the centerline of the slab = 63044.5 psi\n",
+ "\n",
+ "\n",
+ "Pressure Distributon from the centerline:\n",
+ "\n",
+ "---------------------------------\n",
+ "\n",
+ "x\tp (ksi)\t\tt_i (ksi)\n",
+ "\n",
+ "---------------------------------\n",
+ "\n",
+ "0\t63.0445\t\t15.7611\n",
+ "\n",
+ "0.25\t38.2384\t\t9.55961\n",
+ "\n",
+ "0.5\t23.1928\t\t5.7982\n",
+ "\n",
+ "0.75\t14.0671\t\t3.51678\n",
+ "\n",
+ "1\t8.53215\t\t2.13304\n",
+ "\n",
+ "1.25\t5.17501\t\t1.29375\n",
+ "\n",
+ "1.5\t3.1388\t\t0.7847\n",
+ "\n",
+ "1.75\t1.90378\t\t0.475945\n",
+ "\n",
+ "2\t1.1547\t\t0.288675\n",
+ "\n",
+ "---------------------------------\n",
+ "\n",
+ "\n",
+ "For sticking friction:\n",
+ "p_max = 10.3923 ksi\n",
+ "\n",
+ "\n",
+ "The Forging load = 62.7695 tons\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import sqrt\n",
+ "from math import exp\n",
+ "from math import log\n",
+ "\n",
+ "#variable declaration\n",
+ "sigma=1000;\n",
+ "mu=0.25;\n",
+ "a=2;\n",
+ "b=6;\n",
+ "h=0.25;\n",
+ "x=0;\n",
+ "mu=0.25;\n",
+ "\n",
+ "#calculation\n",
+ "p_max=2*sigma*exp(2*mu*(a-x)/h)/sqrt(3);\n",
+ "print('\\nAt the centerline of the slab = %g psi\\n')%(p_max);\n",
+ "print('\\nPressure Distributon from the centerline:');\n",
+ "print('\\n---------------------------------\\n');\n",
+ "print('x\\tp (ksi)\\t\\tt_i (ksi)\\n');\n",
+ "print('---------------------------------\\n');\n",
+ "while x<=2:\n",
+ " p=2*sigma*exp(2*mu*(a-x)/h)/(1000*sqrt(3)); #in ksi\n",
+ " t_i=mu*p;\n",
+ " print('%g\\t%g\\t\\t%g\\n')%(x,p,t_i);\n",
+ " x+=0.25;\n",
+ "print('---------------------------------\\n');\n",
+ "k=sigma/sqrt(3);\n",
+ "x=0;\n",
+ "p_max1=2*sigma*((a-x)/h+1)/sqrt(3);\n",
+ "x1=a-h/(2*mu)*log(1/(2*mu));\n",
+ "p=2*sigma*(a/(2*h)+1)/sqrt(3);\n",
+ "P=2*p*a*b;\n",
+ "P=P*0.000453; #conversion to metric tons\n",
+ "\n",
+ "#result\n",
+ "print('\\nFor sticking friction:\\np_max = %g ksi')%(p_max1/1000);\n",
+ "print('\\n\\nThe Forging load = %g tons')%(P);"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_17_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_17_1.ipynb new file mode 100755 index 00000000..b223cd0f --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_17_1.ipynb @@ -0,0 +1,239 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 17: Rolling of Metals"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "### Example 17.1, Forces in rolling, Page No. 596"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Maximum possible reduction when mu is 0.08 = 0.0768 in\n",
+ "\n",
+ "Maximum possible reduction when mu is 0.5 = 3 in\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import atan\n",
+ "\n",
+ "#variable declaration\n",
+ "mu1=0.08;\n",
+ "mu2=0.5;\n",
+ "R=12;\n",
+ "\n",
+ "#calculation\n",
+ "alpha=atan(mu1);\n",
+ "dh1=mu1**2*R;\n",
+ "dh2=mu2**2*R;\n",
+ "\n",
+ "#result\n",
+ "print('\\nMaximum possible reduction when mu is 0.08 = %g in\\n')%(dh1);\n",
+ "print('Maximum possible reduction when mu is 0.5 = %g in')%(dh2);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 17.2, Rolling Load, Page No. 598"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Rolling Load = 3039.51 kips\n",
+ "\n",
+ "Rolling Load if sticking friction occurs = 5509.54 kips\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import sqrt\n",
+ "from math import exp\n",
+ "\n",
+ "#variable declaration\n",
+ "h0=1.5;\n",
+ "mu=0.3;\n",
+ "D=36;\n",
+ "s_en=20;\n",
+ "s_ex=30;\n",
+ "\n",
+ "#calculation\n",
+ "h1=h0-0.3*h0;\n",
+ "dh=h0-h1;\n",
+ "h_=(h1+h0)/2;\n",
+ "Lp=sqrt(D/2*dh);\n",
+ "Q=mu*Lp/h_;\n",
+ "sigma0=(s_en+s_ex)/2;\n",
+ "P=sigma0*(exp(Q)-1)*s_ex*Lp/Q;\n",
+ "Ps=sigma0*(Lp/(4*dh)+1)*s_ex*Lp;\n",
+ "\n",
+ "#result\n",
+ "print('\\nRolling Load = %g kips')%(P);\n",
+ "print('\\nRolling Load if sticking friction occurs = %g kips')%(Ps);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 17.3, Rolling Load, Page No. 599"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "P2 = 1410.35\n",
+ "R2 = 18.6281\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "from math import sqrt\n",
+ "from math import exp\n",
+ "\n",
+ "#variable declaration\n",
+ "h0=1.5;\n",
+ "mu=0.3;\n",
+ "D=36;\n",
+ "s_en=20;\n",
+ "s_ex=30;\n",
+ "C=3.34*10**-4;\n",
+ "P_=1357;\n",
+ "\n",
+ "#calculation\n",
+ "h1=h0-0.3*h0;\n",
+ "dh=h0-h1;\n",
+ "h_=(h1+h0)/2;\n",
+ "R=D/2;\n",
+ "R1=R*(1+C*P_/(s_ex*(dh)));\n",
+ "Lp=sqrt(R1*dh);\n",
+ "Q=mu*Lp/h_;\n",
+ "sigma0=(s_en+s_ex)/2;\n",
+ "P2=sigma0*(exp(Q)-1)*s_ex*Lp/Q;\n",
+ "P2=P2*0.45359 #conversion to tons\n",
+ "R2=R*(1+C*P2/(s_ex*(dh)));\n",
+ "\n",
+ "#result\n",
+ "print('\\nP2 = %g\\nR2 = %g')%(P2,R2);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 17.4, Torque and Horsepower, Page No. 614"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Rolling Load = 540.012\n",
+ "Horsepower = 1713.63\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import sqrt\n",
+ "from math import pi\n",
+ "from math import log\n",
+ "\n",
+ "#variable declaration\n",
+ "w=12;\n",
+ "hi=0.8;\n",
+ "hf=0.6;\n",
+ "D=40;\n",
+ "N=100;\n",
+ "\n",
+ "#calculation\n",
+ "R=D/2;\n",
+ "dh=abs(hf-hi);\n",
+ "e1=log(hi/hf);\n",
+ "r=(hi-hf)/hi;\n",
+ "sigma=20*e1**0.2/1.2;\n",
+ "Qp=1.5;\n",
+ "P=2*sigma*w*sqrt(R*(hi-hf))*Qp/sqrt(3);\n",
+ "a=0.5*sqrt(R*dh);\n",
+ "a=a/12; #conversion to ft\n",
+ "hp=4*pi*a*P*N*1000/33000;\n",
+ "\n",
+ "#result\n",
+ "print('\\nRolling Load = %g\\nHorsepower = %g')%(P,hp);\n"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_18_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_18_1.ipynb new file mode 100755 index 00000000..8fcdfd7b --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_18_1.ipynb @@ -0,0 +1,94 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 18: Extrusion"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 18.1, Extrusion Process, Page No. 629"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Force required for the Operation = 3827.95 metric tons\n",
+ "\n",
+ "\n",
+ "Note: Slight calculation errors in book\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import log\n",
+ "from math import radians\n",
+ "from math import tan\n",
+ "from math import sqrt\n",
+ "from math import pi\n",
+ "\n",
+ "#variable declaration\n",
+ "def cot(x):\n",
+ " return 1/tan(x);\n",
+ "Db=6;\n",
+ "Df=2;\n",
+ "L=15;\n",
+ "v=2;\n",
+ "alpha=60;\n",
+ "mu=0.1;\n",
+ "\n",
+ "#calculations\n",
+ "R=Db**2/Df**2;\n",
+ "e=6*v*log(R)/Db\n",
+ "sigma=200*e**0.15;\n",
+ "alpha=radians(alpha);\n",
+ "B=mu*cot(alpha);\n",
+ "p_d=sigma*((1+B)/B)*(1-R**B);\n",
+ "p_d=abs(p_d);\n",
+ "t_i=sigma/sqrt(3);\n",
+ "p_e=p_d+4*t_i*L/Db;\n",
+ "p_e=p_e*145.0377; #conversion to psi\n",
+ "A=pi*Db**2/4;\n",
+ "P=p_e*A;\n",
+ "P=P*0.000453; #conversion to metric tons\n",
+ "\n",
+ "#result\n",
+ "print('\\nForce required for the Operation = %g metric tons\\n\\n\\nNote: Slight calculation errors in book')%(P);"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_19_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_19_1.ipynb new file mode 100755 index 00000000..33c96b04 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_19_1.ipynb @@ -0,0 +1,145 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 19: Drawing of Rods, Wires and Tubes"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 19.1, Analysis of Wiredrawing, Page No. 640"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Drawing Stress = 240.422 MPa\n",
+ "Drawing Force = 12.0849 kN\n",
+ "Power = 36.2548 kW\n",
+ "Horsepower = 48.599 hp\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import pi\n",
+ "from math import radians\n",
+ "from math import tan\n",
+ "from math import log\n",
+ "\n",
+ "#variable declaration\n",
+ "def cot(x):\n",
+ " return 1/tan(x);\n",
+ "Ab=10;\n",
+ "r=0.2;\n",
+ "alpha=12;\n",
+ "mu=0.09;\n",
+ "n=0.3;\n",
+ "K=1300;\n",
+ "v=3;\n",
+ "\n",
+ "#calculation\n",
+ "alpha=radians(alpha);\n",
+ "B=mu*cot(alpha/2);\n",
+ "e1=log(1/(1-r));\n",
+ "sigma=K*e1**0.3/(n+1);\n",
+ "Aa=Ab*(1-r);\n",
+ "sigma_xa=sigma*((1+B)/B)*(1-(Aa/Ab)**B);\n",
+ "Aa=pi*Aa**2/4;\n",
+ "Pd=sigma_xa*Aa;\n",
+ "Pd=Pd/1000; #conversion to kilo units\n",
+ "P=Pd*v;\n",
+ "H=P/0.746;\n",
+ "\n",
+ "#result\n",
+ "print('\\nDrawing Stress = %g MPa\\nDrawing Force = %g kN\\nPower = %g kW\\nHorsepower = %g hp')%(sigma_xa,Pd,P,H);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 19.2, Analysis of Wiredrawing, Page No. 645"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "By First Approximation, r = 0.514412\n",
+ "By Second Approximation, r = 0.830601\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import radians\n",
+ "from math import tan\n",
+ "from math import log\n",
+ "\n",
+ "#variable declaration\n",
+ "def cot(x):\n",
+ " return 1/tan(x);\n",
+ "alpha=12;\n",
+ "r=0.2;\n",
+ "mu=0.09;\n",
+ "n=0.3;\n",
+ "K=1300;\n",
+ "v=3;\n",
+ "\n",
+ "#calculation\n",
+ "alpha=radians(alpha);\n",
+ "B=mu*cot(alpha/2);\n",
+ "e1=log(1/(1-r));\n",
+ "sigma_xa=K*e1**0.3/(n+1);\n",
+ "r1=1-((1-(B/(B+1)))**(1/B));\n",
+ "e=log(1/(1-r1));\n",
+ "sigma0=1300*e**0.3;\n",
+ "r2=1-(1-((sigma0/sigma_xa)*(B/(B+1)))**(1/B));\n",
+ "\n",
+ "#result\n",
+ "print('\\nBy First Approximation, r = %g\\nBy Second Approximation, r = %g')%(r1,r2);"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_1_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_1_1.ipynb new file mode 100755 index 00000000..8cfa5e5c --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_1_1.ipynb @@ -0,0 +1,73 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 1: Introduction"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 1.1, Shear Stress, Page No. 16"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Shear Stress Required to nucleate a grain boundary crack in high temperature deformation = 158.887 MPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "from math import pi\n",
+ "from math import sqrt\n",
+ "y_b=2;\n",
+ "G=75;\n",
+ "G=G*10**9; #conversion to Pa\n",
+ "L=0.01;\n",
+ "L=L*10**-3; #conversion to m\n",
+ "nu=0.3;\n",
+ "\n",
+ "#calculation\n",
+ "T=sqrt((3*pi*y_b*G)/(8*(1-nu)*L));\n",
+ "T=T/10**6;\n",
+ "\n",
+ "#result\n",
+ "print ('Shear Stress Required to nucleate a grain boundary crack in high temperature deformation = %g MPa') %(T)"
+ ]
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_20_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_20_1.ipynb new file mode 100755 index 00000000..90519f65 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_20_1.ipynb @@ -0,0 +1,109 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 20: Sheet-Metal Forming"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 20.1, Deep Drawing, Page No. 672"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Limiting ratio = 1.98104\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import log\n",
+ "\n",
+ "#variable declaration\n",
+ "le=0.3;\n",
+ "wd=-0.16;\n",
+ "\n",
+ "#calcualtion\n",
+ "l_l0=1+le;\n",
+ "w_w0=1+wd;\n",
+ "R=log(1/w_w0)/log((w_w0)*l_l0);\n",
+ "\n",
+ "#result\n",
+ "print('\\nLimiting ratio = %g')%(R);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 20.2, Forming Limit Criteria, Page No. 675"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Major Strain = 80 percent \n",
+ "Minor Strain = -20 percent\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "d=0.1;\n",
+ "mj_d=0.18;\n",
+ "mn_d=0.08;\n",
+ "\n",
+ "#calculation\n",
+ "e1=(mj_d-d)/d;\n",
+ "e2=(mn_d-d)/d;\n",
+ "\n",
+ "#result\n",
+ "print('\\nMajor Strain = %g percent \\nMinor Strain = %g percent')%(e1*100,e2*100);"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_21_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_21_1.ipynb new file mode 100755 index 00000000..94f15509 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_21_1.ipynb @@ -0,0 +1,243 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 21: Machining of Metals"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "### Example 21.1, Mechanics of Machining, Page No. 685"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 12,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Shear Plane Angle for 1040 steel= 22.2946 deg\n",
+ "\n",
+ "Shear Plane Angle for Copper = 10.6433 deg\n"
+ ]
+ }
+ ],
+ "source": [
+ "from scipy.optimize import fsolve\n",
+ "from math import radians, degrees, pi, cos, sin\n",
+ "\n",
+ "#variable declaration\n",
+ "a=6;\n",
+ "sigma_s=60000.0;\n",
+ "su_s=91000.0;\n",
+ "sigma_c=10000.0;\n",
+ "su_c=30000;\n",
+ "a=radians(a);\n",
+ "\n",
+ "\n",
+ "#calculation\n",
+ "def s(fi):\n",
+ " return cos(fi-a)*sin(fi)-sigma_s/su_s*(cos(pi/4-a/2)*sin(pi/4+a/2))\n",
+ "def c(fi):\n",
+ " return cos(fi-a)*sin(fi)-sigma_c/su_c*(cos(pi/4-a/2)*sin(pi/4+a/2))\n",
+ "fi1=fsolve(s,0);\n",
+ "fi2=fsolve(c,0);\n",
+ "fi1=degrees(fi1);\n",
+ "fi2=degrees(fi2);\n",
+ "\n",
+ "#result\n",
+ "print('\\nShear Plane Angle for 1040 steel= %g deg')%(fi1);\n",
+ "print('\\nShear Plane Angle for Copper = %g deg')%(fi2);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 21.2, Mechanics of Machining, Page No. 687"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Slip plane angle = 33.1927 deg\n",
+ "Percentage of total energy that goes into friction = 30.918 percent\n",
+ "Percentage of total energy that goes into shear = 69.082 percent\n",
+ "Total energy per unit volume = 0.197285 hp min/in^3\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "from math import sin\n",
+ "from math import cos\n",
+ "from math import tan\n",
+ "from math import atan\n",
+ "from math import radians\n",
+ "from math import sqrt\n",
+ "from math import degrees\n",
+ "\n",
+ "#variable declaration\n",
+ "v=500;\n",
+ "alpha=6;\n",
+ "b=0.4;\n",
+ "t=0.008;\n",
+ "Fv=100;\n",
+ "Fh=250;\n",
+ "L=20;\n",
+ "rho=0.283;\n",
+ "m=13.36;\n",
+ "m=m/454; #conversion to lb\n",
+ "\n",
+ "#calculation\n",
+ "tc=m/(rho*b*L);\n",
+ "r=t/tc;\n",
+ "alpha=radians(alpha);\n",
+ "fi=atan(r*cos(alpha)/(1-r*sin(alpha)));\n",
+ "#fi=degrees(fi);\n",
+ "mu=(Fv+Fh*tan(alpha))/(Fh-Fv*tan(alpha));\n",
+ "be=atan(mu);\n",
+ "Pr=sqrt(Fv**2+Fh**2);\n",
+ "Ft=Pr*sin(be);\n",
+ "p_fe=Ft*r/Fh;\n",
+ "Fs=Fh*cos(fi)-Fv*sin(fi);\n",
+ "vs=v*cos(alpha)/cos(fi-alpha);\n",
+ "p_se=Fs*vs/(Fh*v);\n",
+ "U=Fh*v/(b*t*v);\n",
+ "U=U/33000; #conversion to hp\n",
+ "U=U/12; #conversion of ft units to in units\n",
+ "fi=degrees(fi);\n",
+ "\n",
+ "#result\n",
+ "print('\\nSlip plane angle = %g deg\\nPercentage of total energy that goes into friction = %g percent\\nPercentage of total energy that goes into shear = %g percent\\nTotal energy per unit volume = %g hp min/in^3')%(fi,p_fe*100,p_se*100,U);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 21.3, Tool Materials and Tool Life, Page No. 698"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "For High Speed steel tool, increase in tool life is given by: t2 = 322.54 t1\n",
+ "\n",
+ "For Cemented carbide tool, increase in tool life is given by: t2 = 10.0794 t1\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "d=0.5;\n",
+ "\n",
+ "#calculation\n",
+ "t1=(1/d)**(1/0.12);\n",
+ "t2=(1/d)**(1/0.3);\n",
+ "\n",
+ "#result\n",
+ "print('\\nFor High Speed steel tool, increase in tool life is given by: t2 = %g t1')%(t1);\n",
+ "print('\\nFor Cemented carbide tool, increase in tool life is given by: t2 = %g t1')%(t2);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 21.4, Grinding Processes, Page No. 703"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Tangential force = 24 N\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "U=40;\n",
+ "uw=0.3;\n",
+ "b=1.2;\n",
+ "v=30;\n",
+ "d=0.05;\n",
+ "\n",
+ "#calculation\n",
+ "b=b*10**-3; #conversion to m\n",
+ "d=d*10**-3; #conversion to m\n",
+ "U=U*10**9; #conversion to Pa\n",
+ "M=uw*b*d;\n",
+ "P=U*M;\n",
+ "F=P/v;\n",
+ "\n",
+ "#result\n",
+ "print('Tangential force = %g N')%(F);\n"
+ ]
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_2_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_2_1.ipynb new file mode 100755 index 00000000..535881a6 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_2_1.ipynb @@ -0,0 +1,251 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 2: Stress and Strain Relationships for Elastic Behavior"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "### Example 2.1, State of Stress in two dimensions, Page No. 25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "sigma_x= -12.5 MPa\n",
+ "sigma_y= -2.5 MPa\n",
+ "T_xy= 57.5 MPa\n",
+ "sigma_y`= -65 MPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import sin\n",
+ "from math import cos\n",
+ "from math import radians\n",
+ "from numpy.linalg import inv\n",
+ "import numpy as np\n",
+ "\n",
+ "#variable declaration\n",
+ "sigma_x=25;\n",
+ "sigma_y=5;\n",
+ "theta=45;\n",
+ "sigma_x_=50;\n",
+ "T_x_y_=5;\n",
+ "\n",
+ "#calculation\n",
+ "theta=radians(theta);\n",
+ "A=[[(sigma_x+sigma_y)/2+(sigma_x-sigma_y)/2*cos(2*theta),sin(2*theta)],[(sigma_y-sigma_x)/2*sin(2*theta),cos(2*theta)]];\n",
+ "B=[[sigma_x_],[T_x_y_]];\n",
+ "X=np.dot(inv(A),B);\n",
+ "p=X[0];\n",
+ "T_xy=X[1];\n",
+ "sigma_x1=sigma_x*p;\n",
+ "sigma_y1=sigma_y*p;\n",
+ "sigma_y_=sigma_x1+sigma_y1-sigma_x_;\n",
+ "\n",
+ "#result\n",
+ "print ('\\nsigma_x= %g MPa\\nsigma_y= %g MPa\\nT_xy= %g MPa\\nsigma_y`= %g MPa') %(sigma_x1,sigma_y1,T_xy,sigma_y_);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.2, State of Stress in three dimensions, Page No. 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "sigma0 = 360 MPa\n",
+ "\n",
+ "sigma1 = -280 MPa\n",
+ "\n",
+ "sigma2 = -160 MPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "import numpy as np\n",
+ "\n",
+ "#variable declaration\n",
+ "A=[[0,-240,0],[-240,200,0],[0,0,-280]];\n",
+ "\n",
+ "#calcualtion\n",
+ "p=[1, -(A[0][0]+A[1][1]+A[2][2]), (A[0][0]*A[1][1]+A[1][1]*A[2][2]+A[0][0]*A[2][2]-A[1][0]**2-A[2][1]**2-A[2][0]**2), -(A[0][0]*A[1][1]*A[2][2]+2*A[1][0]*A[2][1]*A[2][0]-A[0][0]*A[2][1]**2-A[1][1]*A[2][0]**2-A[2][2]*A[1][0]**2)];\n",
+ "X=np.roots(p);\n",
+ "\n",
+ "#result\n",
+ "for i in range (0,3):\n",
+ " print('\\nsigma%i = %g MPa')%(i,X[i]);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.3, Calculation of Stresses from elastic strains, Page No. 52"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "sigma1 = 971.833 MPa\n",
+ "sigma2 = 520.705 MPa\n",
+ "\n",
+ "\n",
+ "Note: Slight calculation errors in Book\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "E=200;\n",
+ "nu=0.33;\n",
+ "e1=0.004;\n",
+ "e2=0.001;\n",
+ "\n",
+ "#calculation\n",
+ "sigma1=E*(e1+nu*e2)/(1-nu**2);\n",
+ "sigma2=E*(e2+nu*e1)/(1-nu**2);\n",
+ "sigma1=sigma1*1000; #conversion to MPa\n",
+ "sigma2=sigma2*1000; #conversion to MPa\n",
+ "\n",
+ "#result\n",
+ "print('\\nsigma1 = %g MPa\\nsigma2 = %g MPa\\n')%(sigma1,sigma2);\n",
+ "print('\\nNote: Slight calculation errors in Book')"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 2.4, Elastic Anisotropy, Page No. 60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "For Iron:\n",
+ "\n",
+ "\n",
+ "E_111 = 2.72727 x 10^11 Pa\n",
+ "E_100 = 1.25 x 10^11 Pa\n",
+ "\n",
+ "\n",
+ "\n",
+ "\n",
+ "For Tungten:\n",
+ "\n",
+ "\n",
+ "E_111 = 3.84615 x 10^11 Pa\n",
+ "E_100 = 3.84615 x 10^11 Pa\n",
+ "\n",
+ "Therefore tungsten is elastically isotropic while iron is elasitcally anisotropic\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "from math import sqrt\n",
+ "S11_Fe=0.8;\n",
+ "S12_Fe=-0.28;\n",
+ "S44_Fe=0.86;\n",
+ "S11_W=0.26;\n",
+ "S12_W=-0.07;\n",
+ "S44_W=0.66;\n",
+ "D_100_l=1;\n",
+ "D_100_m=0;\n",
+ "D_100_n=0;\n",
+ "D_110_l=1/sqrt(2);\n",
+ "D_110_m=1/sqrt(2);\n",
+ "D_110_n=0;\n",
+ "D_111_l=1/sqrt(3);\n",
+ "D_111_m=1/sqrt(3);\n",
+ "D_111_n=1/sqrt(3);\n",
+ "\n",
+ "#calculation\n",
+ "Fe_E_111=1/(S11_Fe-2*((S11_Fe-S12_Fe)-S44_Fe/2)*(D_111_l**2*D_111_m**2+D_111_n**2*D_111_m**2+D_111_l**2*D_111_n**2));\n",
+ "Fe_E_100=1/(S11_Fe-2*((S11_Fe-S12_Fe)-S44_Fe/2)*(D_100_l**2*D_100_m**2+D_100_n**2*D_100_m**2+D_100_l**2*D_100_n**2));\n",
+ "W_E_111=1/(S11_W-2*((S11_W-S12_W)-S44_W/2)*(D_111_l**2*D_111_m**2+D_111_n**2*D_111_m**2+D_111_l**2*D_111_n**2));\n",
+ "W_E_100=1/(S11_W-2*((S11_W-S12_W)-S44_W/2)*(D_100_l**2*D_100_m**2+D_100_n**2*D_100_m**2+D_100_l**2*D_100_n**2));\n",
+ "\n",
+ "#result\n",
+ "print '\\nFor Iron:\\n\\n'\n",
+ "print 'E_111 = %g x 10^11 Pa\\nE_100 = %g x 10^11 Pa\\n' %(Fe_E_111,Fe_E_100)\n",
+ "print '\\n\\n\\nFor Tungten:\\n\\n'\n",
+ "print 'E_111 = %g x 10^11 Pa\\nE_100 = %g x 10^11 Pa\\n\\nTherefore tungsten is elastically isotropic while iron is elasitcally anisotropic' %(W_E_111,W_E_100)\n"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_3_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_3_1.ipynb new file mode 100755 index 00000000..3168a0f9 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_3_1.ipynb @@ -0,0 +1,212 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 3: Elements of the Theory of Plasticity"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.1, True Stress and True Strain, Page No. 76"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Engineering Stress at maximum load = 99852.1 psi\n",
+ "True Fracture Stress = 112785 psi\n",
+ "True Strain at fracture = 0.344939\n",
+ "Engineering strain at fracture = 0.411903\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import pi\n",
+ "from math import log\n",
+ "from math import exp\n",
+ "\n",
+ "#variable declaration\n",
+ "D_i=0.505;\n",
+ "L=2;\n",
+ "P_max=20000;\n",
+ "P_f=16000;\n",
+ "D_f=0.425;\n",
+ "\n",
+ "#calculation\n",
+ "E_St= P_max*4/(pi*D_i**2);\n",
+ "T_fr_St= P_f*4/(pi*D_f**2);\n",
+ "e_f=log(D_i**2/D_f**2);\n",
+ "e=exp(e_f)-1;\n",
+ "\n",
+ "#result\n",
+ "print('\\nEngineering Stress at maximum load = %g psi\\nTrue Fracture Stress = %g psi\\nTrue Strain at fracture = %g\\nEngineering strain at fracture = %g')%(E_St,T_fr_St,e_f,e);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.2, Yielding Criteria for Ductile Metals, Page No. 78"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Since the calculated value of sigma0 = 224.054 MPa, which is less than the yield strength of the aluminium alloy\n",
+ "Thus safety factor is = 2.23161\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import sqrt\n",
+ "\n",
+ "#variable declaration\n",
+ "sigma00=500;\n",
+ "sigma_z=-50;\n",
+ "sigma_y=100;\n",
+ "sigma_x=200;\n",
+ "T_xy=30;\n",
+ "T_yz=0;\n",
+ "T_xz=0;\n",
+ "\n",
+ "#calculation\n",
+ "sigma0=sqrt((sigma_x-sigma_y)**2+(sigma_y-sigma_z)**2+(sigma_z-sigma_x)**2+6*(T_xy**2+T_yz**2+T_xz**2))/sqrt(2);\n",
+ "s=sigma00/sigma0;\n",
+ "\n",
+ "#result\n",
+ "print('\\nSince the calculated value of sigma0 = %g MPa, which is less than the yield strength of the aluminium alloy\\nThus safety factor is = %g')%(sigma0,s);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 3.3, Tresca Criterion, Page No. 81"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Since the calculated value of sigma0 = 250 MPa, which is less than the yield strength of the aluminium alloy\n",
+ "Thus safety factor is = 2\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "sigma00=500;\n",
+ "sigma_z=-50;\n",
+ "sigma_y=100;\n",
+ "sigma_x=200;\n",
+ "T_xy=30;\n",
+ "T_yz=0;\n",
+ "T_xz=0;\n",
+ "\n",
+ "#calculation\n",
+ "sigma0=sigma_x-sigma_z;\n",
+ "s=sigma00/sigma0;\n",
+ "\n",
+ "#result\n",
+ "print('\\nSince the calculated value of sigma0 = %g MPa, which is less than the yield strength of the aluminium alloy\\nThus safety factor is = %g')%(sigma0,s);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "### Example 3.4, Levy-Mises Equation, Page No. 91"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Plastic Strain = 0.199532\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import sqrt\n",
+ "\n",
+ "#variable declaration\n",
+ "r_t=20;\n",
+ "p=1000;\n",
+ "\n",
+ "#calculation\n",
+ "sigma1=p*r_t;\n",
+ "sigma1=sigma1/1000; #conversion to ksi\n",
+ "sigma=sqrt(3)*sigma1/2;\n",
+ "e=(sigma/25)**(1/0.25);\n",
+ "e1=sqrt(3)*e/2;\n",
+ "\n",
+ "#result\n",
+ "print('\\nPlastic Strain = %g')%(e1);\n"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_4_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_4_1.ipynb new file mode 100755 index 00000000..ff5e6897 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_4_1.ipynb @@ -0,0 +1,73 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 4: Plastic Deformation of Single Crystals"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 4.1, Critical Resolved Shear Stress for Slip, Page No. 125"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Tensile Stress applied = 14.6969 MPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import sqrt\n",
+ "import numpy as np\n",
+ "\n",
+ "#variable declaration\n",
+ "a=[1,-1,0];\n",
+ "n=[1,-1,-1];\n",
+ "s=[0,-1,-1];\n",
+ "Tr=6;\n",
+ "\n",
+ "#calculation\n",
+ "cos_fi=np.dot(a,n)/(sqrt(a[0]**2+a[1]**2+a[2]**2)*sqrt(n[0]**2+n[1]**2+n[2]**2));\n",
+ "cos_lm=np.dot(a,s)/(sqrt(a[0]**2+a[1]**2+a[2]**2)*sqrt(s[0]**2+s[1]**2+s[2]**2));\n",
+ "sigma=Tr/(cos_fi*cos_lm);\n",
+ "\n",
+ "#result\n",
+ "print('Tensile Stress applied = %g MPa')%(sigma);"
+ ]
+ }
+ ],
+ "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.10"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_5_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_5_1.ipynb new file mode 100755 index 00000000..50279cb5 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_5_1.ipynb @@ -0,0 +1,74 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 5: Dislocation theory"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 5.1, Forces Between Dislocations, Page No. 166"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "The Total force on the dislocation is = 1.32629e-07 N\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "from math import pi\n",
+ "G=40;\n",
+ "G=G*10**9; #conversion to N/m^2\n",
+ "b=2.5;\n",
+ "b=b*10**-10; #conversion to m\n",
+ "r=1200;\n",
+ "r=r*10**-10; #conversion to m\n",
+ "l=0.04;\n",
+ "l=l*10**-3; #conversion to m\n",
+ "\n",
+ "#calculation\n",
+ "F=G*b**2/(2*pi*r);\n",
+ "Ft=F*l;\n",
+ "\n",
+ "#result\n",
+ "print('The Total force on the dislocation is = %g N')%(Ft);"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_6_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_6_1.ipynb new file mode 100755 index 00000000..f1ec6bb6 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_6_1.ipynb @@ -0,0 +1,223 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 6: Strengthening Mechanisms"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.1, Grain Size Measurement, Page No. 193"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Yield Stress = 254.464 MPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import sqrt\n",
+ "\n",
+ "#variable declaration\n",
+ "sigma_i=150;\n",
+ "k=0.7;\n",
+ "n=6;\n",
+ "\n",
+ "#calculation\n",
+ "N_x=2**(n-1);\n",
+ "N=N_x/(0.01)**2; #in grains/in^2\n",
+ "N=N*10**6/25.4**2; # in grains/m^2\n",
+ "D=sqrt(1/N);\n",
+ "sigma0=sigma_i+k/sqrt(D);\n",
+ "\n",
+ "#result\n",
+ "print ('\\nYield Stress = %g MPa')%(sigma0);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.2, Strengthing Mechanism, Page No. 219"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Particle Spacing = 2.3e-08 m\n",
+ "Particle Size = 7.35948e-10 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "sigma0=600;\n",
+ "G=27.6;\n",
+ "G=G*10**9 #conversion to Pa\n",
+ "b=2.5*10**-8;\n",
+ "b=b*10**-2; #conversion to m\n",
+ "T0=sigma0/2;\n",
+ "T0=T0*10**6; #conversion to Pa\n",
+ "\n",
+ "#calculation\n",
+ "lambda1=G*b/T0;\n",
+ "Cu_max=54;\n",
+ "Cu_eq=4;\n",
+ "Cu_min=0.5;\n",
+ "rho_al=2.7;\n",
+ "rho_theta=4.43;\n",
+ "wt_a=(Cu_max-Cu_eq)/(Cu_max-Cu_min);\n",
+ "wt_theta=(Cu_eq-Cu_min)/(Cu_max-Cu_min);\n",
+ "V_a=wt_a/rho_al;\n",
+ "V_theta=wt_theta/rho_theta;\n",
+ "f=V_theta/(V_a+V_theta);\n",
+ "r=(3*f*lambda1)/(4*(1-f));\n",
+ "\n",
+ "#result\n",
+ "print('\\nParticle Spacing = %g m\\nParticle Size = %g m')%(lambda1,r);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.3, Fiber Strengthing, Page No. 222"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Ec for 10 vol% = 92 GPa\n",
+ "\n",
+ "\n",
+ "Ec for 60 vol% = 252 GPa\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "Ef=380;\n",
+ "Em=60;\n",
+ "\n",
+ "#calculation\n",
+ "#Case 1\n",
+ "f_f1=0.1;\n",
+ "Ec1=Ef*f_f1+(1-f_f1)*Em;\n",
+ "\n",
+ "#Case 2\n",
+ "f_f2=0.6;\n",
+ "Ec2=Ef*f_f2+(1-f_f2)*Em;\n",
+ "\n",
+ "#result\n",
+ "print('\\nEc for 10 vol%% = %g GPa\\n')%(Ec1);\n",
+ "print('\\nEc for 60 vol%% = %g GPa\\n')%(Ec2);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 6.4, Load Transfer, Page No. 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "sigma_cu = 2.55 GPa for L=100um\n",
+ "\n",
+ "sigma_cu = 0.596875 GPa for L=2mm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#variable declaration\n",
+ "sigma_fu=5;\n",
+ "sigma_fu=sigma_fu*10**9; #Conversion to Pa\n",
+ "sigma_m=100;\n",
+ "sigma_m=sigma_m*10**6; #Conversion to Pa\n",
+ "T0=80;\n",
+ "T0=T0*10**6; #Conversion to Pa\n",
+ "f_f=0.5;\n",
+ "d=100;\n",
+ "d=d*10**-6;\n",
+ "B=0.5;\n",
+ "L1=10;\n",
+ "L1=L1*10**2; #conversion to m\n",
+ "Lc=sigma_fu*d/(2*T0);\n",
+ "sigma_cu1=sigma_fu*f_f*(1-Lc/(2*L1))+sigma_m*(1-f_f);\n",
+ "sigma_cu1=sigma_cu1*10**-9;\n",
+ "print('\\nsigma_cu = %g GPa for L=100um\\n')%(sigma_cu1);\n",
+ "\n",
+ "L2=2;\n",
+ "L2=L2*10**-3; #conversion to m\n",
+ "sigma_cu2=sigma_fu*f_f*(1-Lc/(2*L2))+sigma_m*(1-f_f);\n",
+ "sigma_cu2=sigma_cu2*10**-9;\n",
+ "print('sigma_cu = %g GPa for L=2mm')%(sigma_cu2);"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_7_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_7_1.ipynb new file mode 100755 index 00000000..9111bb76 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_7_1.ipynb @@ -0,0 +1,113 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 7: Fracture"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.1, Cohesive Strength, Page No. 245"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cohesive strength of a silica fiber = 24.367 GPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import sqrt\n",
+ "\n",
+ "#variable declaration\n",
+ "E=95;\n",
+ "E=E*10**9;\n",
+ "Ys=1000;\n",
+ "Ys=Ys*10**-3; #conversion to J/m^2\n",
+ "a0=1.6;\n",
+ "a0=a0*10**-10; #conversion to m\n",
+ "\n",
+ "#calculation\n",
+ "sigma_max=sqrt(E*Ys/a0)\n",
+ "sigma_max=sigma_max*10**-9;\n",
+ "\n",
+ "#result\n",
+ "print('Cohesive strength of a silica fiber = %g GPa')%(sigma_max);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 7.2, Fracture Stress, Page No. 246"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Fracture Stress = 100 MPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "from math import sqrt\n",
+ "\n",
+ "#variable declaration\n",
+ "E=100;\n",
+ "E=E*10**9;\n",
+ "Ys=1;\n",
+ "a0=2.5*10**-10;\n",
+ "c=10**4*a0;\n",
+ "\n",
+ "#calculation\n",
+ "sigma_f=sqrt(E*Ys/(4*c));\n",
+ "sigma_f=sigma_f*10**-6;\n",
+ "\n",
+ "#result\n",
+ "print('Fracture Stress = %g MPa')%(sigma_f);"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_8_1.ipynb b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_8_1.ipynb new file mode 100755 index 00000000..9609602d --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/Chapter_8_1.ipynb @@ -0,0 +1,255 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "# Chapter 8: The Tension Test"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "### Example 8.1, Standard properties of the material, Page No. 281"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "Ultimate Tensile Strength = 92363.2 psi\n",
+ "0.2 percent offset yield strength = 74889.1 psi\n",
+ "Breaking Stress = 80880.2 psi\n",
+ "Elongation = 26.5 percent\n",
+ "Reduction of Area = 61.092 percent\n",
+ "\n",
+ "\n",
+ "Note: Slight Computational Errors in book\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import pi\n",
+ "\n",
+ "#variable declaration\n",
+ "D=0.505;\n",
+ "Lo=2;\n",
+ "Lf=2.53;\n",
+ "Py=15000;\n",
+ "Pmax=18500;\n",
+ "Pf=16200;\n",
+ "D_f=0.315;\n",
+ "\n",
+ "#calculation\n",
+ "A0=pi*D**2/4;\n",
+ "Af=pi*D_f**2/4;\n",
+ "s_u=Pmax/A0;\n",
+ "s0=Py/A0;\n",
+ "s_f=Pf/A0;\n",
+ "e_f=(Lf-Lo)/Lo;\n",
+ "q=(A0-Af)/A0;\n",
+ "\n",
+ "#result\n",
+ "print('\\nUltimate Tensile Strength = %g psi\\n0.2 percent offset yield strength = %g psi\\nBreaking Stress = %g psi\\nElongation = %g percent\\nReduction of Area = %g percent\\n\\n\\nNote: Slight Computational Errors in book')%(s_u,s0,s_f,e_f*100,q*100);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 8.2, True Strain, Page No. 288"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "True Strain to fracture using changes in length = 0.405465\n",
+ "True Strain to fracture using changes in area = 0.405465\n",
+ "\n",
+ "\n",
+ "\n",
+ "For More ductile metals\n",
+ "True Strain to fracture using changes in length = 0.729961\n",
+ "True Strain to fracture using changes in diameter = 0.940007\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "from math import log\n",
+ "\n",
+ "#case 1\n",
+ "#variable declaration\n",
+ "Af=100.0;\n",
+ "Lf1=60.0;\n",
+ "A0=150.0;\n",
+ "L01=40.0;\n",
+ "Lf=83.0;\n",
+ "L0=40.0;\n",
+ "Df=8.0;\n",
+ "D0=12.8;\n",
+ "\n",
+ "#calculation\n",
+ "L1=float (Lf1/L01);\n",
+ "A1=float (A0/Af);\n",
+ "ef11=log(L1);\n",
+ "ef21=log(A1);\n",
+ "L2=(Lf/L0);\n",
+ "D2=D0/Df;5\n",
+ "ef12=log(L2);\n",
+ "ef22=2*log(D2);\n",
+ "\n",
+ "#result\n",
+ "print('\\nTrue Strain to fracture using changes in length = %g\\nTrue Strain to fracture using changes in area = %g')%(ef11,ef21);\n",
+ "print('\\n\\n\\nFor More ductile metals\\nTrue Strain to fracture using changes in length = %g\\nTrue Strain to fracture using changes in diameter = %g')%(ef12,ef22);\n"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 8.3, Ultimate Tensile Strength, Page No. 290"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Ultimate Tensile Strength = 99729.2 psi\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "from math import exp\n",
+ "\n",
+ "#variable declaration\n",
+ "def sigma(e):\n",
+ " return 200000*e**0.33;\n",
+ "E_u=0.33;\n",
+ "\n",
+ "#calculation\n",
+ "sigma_u=sigma(E_u);\n",
+ "s_u=sigma_u/exp(E_u);\n",
+ "\n",
+ "#result\n",
+ "print('Ultimate Tensile Strength = %g psi')%(s_u);"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "### Example 8.4, Effect of Strain Rate, Page No. 298"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "\n",
+ "At 70deg F\n",
+ "\n",
+ "sigma_a = 10.2 ksi\n",
+ "sigma_b = 13.8229 ksi\n",
+ "sigma_b/sigma_a = 1.35519\n",
+ "\n",
+ "\n",
+ "\n",
+ "At 825deg F\n",
+ "\n",
+ "sigma_a = 2.1 ksi\n",
+ "sigma_b = 5.54906 ksi\n",
+ "sigma_b/sigma_a = 2.64241\n",
+ "\n"
+ ]
+ }
+ ],
+ "source": [
+ "\n",
+ "\n",
+ "#variable declaration\n",
+ "C_70=10.2;\n",
+ "C_825=2.1;\n",
+ "m_70=0.066;\n",
+ "m_825=0.211;\n",
+ "e1=1;\n",
+ "e2=100;\n",
+ "\n",
+ "#calculation 1\n",
+ "print('\\nAt 70deg F\\n');\n",
+ "sigma_a=C_70*e1**m_70;\n",
+ "sigma_b=C_70*e2**m_70;\n",
+ "\n",
+ "#result 1\n",
+ "print('sigma_a = %g ksi\\nsigma_b = %g ksi\\nsigma_b/sigma_a = %g\\n')%(sigma_a,sigma_b,sigma_b/sigma_a);\n",
+ "\n",
+ "\n",
+ "#calculation 2\n",
+ "print('\\n\\nAt 825deg F\\n');\n",
+ "sigma_a=C_825*e1**m_825;\n",
+ "sigma_b=C_825*e2**m_825;\n",
+ "\n",
+ "#result 2\n",
+ "print('sigma_a = %g ksi\\nsigma_b = %g ksi\\nsigma_b/sigma_a = %g\\n')%(sigma_a,sigma_b,sigma_b/sigma_a);\n"
+ ]
+ }
+ ],
+ "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.9"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/screenshots/13.PNG b/Mechanical_Metallurgy_by_George_E._Dieter/screenshots/13.PNG Binary files differnew file mode 100755 index 00000000..4b53b239 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/screenshots/13.PNG diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/screenshots/20.PNG b/Mechanical_Metallurgy_by_George_E._Dieter/screenshots/20.PNG Binary files differnew file mode 100755 index 00000000..5aca77b7 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/screenshots/20.PNG diff --git a/Mechanical_Metallurgy_by_George_E._Dieter/screenshots/6.PNG b/Mechanical_Metallurgy_by_George_E._Dieter/screenshots/6.PNG Binary files differnew file mode 100755 index 00000000..b196b824 --- /dev/null +++ b/Mechanical_Metallurgy_by_George_E._Dieter/screenshots/6.PNG diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch10.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch10.ipynb new file mode 100755 index 00000000..b47575f1 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch10.ipynb @@ -0,0 +1,331 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:52a8123efdb6330b1c01d828fbdcc37a6411e5ce1469de2c94b22a16e7b4d8c8" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 10: Antennas, Diversity and Link Analysis" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.1, Page 292" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "D=10000; #in metres\n", + "TxEIRP=30; #Effective Isotropic Radiated Power(EIRP)dBW\n", + "lamda=0.2; #in metres\n", + "Pt=10; #Transmitted power in dBW\n", + "Gt=20; #transmitter gain in dBi\n", + "Gr=3; #receiver gain in dBi\n", + "Lo=6;#total system lossses in dB\n", + "Nf=5; #noise figure in dB\n", + "BW=1.25; #mHz\n", + "k=1.38*10**-23; #Boltzmann constant\n", + "T=290; #temperature in degree kelvin\n", + "\n", + "#Calculations\n", + "Lp=20*math.log10(lamda/(4*math.pi*D)); #free space loss\n", + "Pr=Lp+Pt+Gt+Gr-Lo;# received power in dBW\n", + "No=10*math.log10(k*T); #Noise density in dBW\n", + "NO=No+30; #factor of '30' to convert from dBW to dBm\n", + "Pn=Nf+10*math.log10(BW*10**6)+NO;# noise signal power in dBm\n", + "SNR=(Pr+30)-Pn;\n", + "\n", + "#Results\n", + "print 'The received signal power is %d dBm'%(round(Pr+30)); #factor of '30' to convert from dBW to dBm\n", + "print 'SNR is %d dB'%SNR" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The received signal power is -59 dBm\n", + "SNR is 49 dB\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.2, Page 293" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "#As we have to use data from Eg 10.1, \n", + "D=10000; # in metres\n", + "TxEIRP=30; #Effective Isotropic Radiated Power(EIRP)dBW\n", + "lamda=0.2; #in metres\n", + "Pt=10; #trasmitted power in dBW\n", + "Gt=20; #transmitter gain in dBi\n", + "Gr=3; #receiver gain in dBi\n", + "Lo=6;#total system lossses in dB\n", + "Nf=5; #noise figure in dB\n", + "BW=1.25; #mHz\n", + "k=1.38*10**-23; #Boltzmann constant\n", + "T=290; #temperature in degree kelvin\n", + "#additional data given in this eg\n", + "hr=40.; #height of receiver in metre\n", + "ht=2; #trasmittter antenna height in metres\n", + "\n", + "#Calculations\n", + "Lp=20*math.log10(hr*ht/D**2);\n", + "Pr=Lp+Pt+Gt+Gr-Lo;# received power in dBW\n", + "No=10*math.log10(k*T); #Noise density in dBW\n", + "NO=No+30; #factor of '30' to convert from dBW to dBm\n", + "Pn=Nf+10*math.log10(BW*10**6)+NO;# noise signal power in dBm\n", + "SNR=(Pr+30)-Pn;\n", + "\n", + "#Result\n", + "print 'The received signal power is %d dBm'%(round(Pr+30)); #factor of '30' to convert from dBW to dBm\n", + "print 'SNR is %d dB'%SNR" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The received signal power is -65 dBm\n", + "SNR is 43 dB\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.3, Page 299" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Pin=12.; #Input power in watts\n", + "Ploss=3; #resistive losses in Watts\n", + "D=5; #Directivity\n", + "\n", + "#Calculations\n", + "Eff=(Pin-Ploss)/Pin;\n", + "G=Eff*D;\n", + "\n", + "#Results\n", + "print 'Gain of the antenna is %.2f dB = %.2f'%(10*math.log10(G),G);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Gain of the antenna is 5.74 dB = 3.75\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.4, Page 299" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "G=12.; #Gain of antenna in dBi\n", + "\n", + "#Calculations\n", + "Theta=101.5/10**(G/10);\n", + "\n", + "#Result\n", + "print 'The 3-dB beam width of a linear element antenna is %.1f degrees'%Theta" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The 3-dB beam width of a linear element antenna is 6.4 degrees\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.5, Page 299" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "N=12; #number of turns\n", + "fr=1.8; #frequency in GHz\n", + "\n", + "#Calculations\n", + "lamda=3*10**8/(fr*10**9);\n", + "DH=lamda/math.pi;# diameter of helix in milli-meters\n", + "S=lamda/4;#turn spacing in millimetres\n", + "L=N*S;\n", + "G=15*N*S*(DH*math.pi)**2/lamda**3;\n", + "Theta=52*lamda/(math.pi*DH)*math.sqrt(lamda/(N*S));\n", + "\n", + "#Results\n", + "print 'The optimim diameter is %d mm'%(DH*1000);\n", + "print 'Spacing is %.1f mm'%(S*1000);\n", + "print 'Total Length of antenna is %d mm'%(L*1000);\n", + "print 'The antenna gain is %.1f dBi'%(10*math.log10(G));\n", + "print 'The BeamWidth of antenna is %d degrees'%Theta" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The optimim diameter is 53 mm\n", + "Spacing is 41.7 mm\n", + "Total Length of antenna is 500 mm\n", + "The antenna gain is 16.5 dBi\n", + "The BeamWidth of antenna is 30 degrees\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.6, Page 305" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "E0=1000.; #average SNR\n", + "Eg=10; #threshold value for SNR\n", + "M=3; #3-Branch Combiner\n", + "e=2.71828; #Euler's number\n", + "\n", + "#Calculations&Results\n", + "x=Eg/E0;\n", + "P3=(1-e**(-x))**M; #Considering 3-branch selection combiner\n", + "print 'By considering 3-branch selection combiner technique, probability comes to be %.e'%P3;\n", + "P1=(1-e**(-x));#M=1;\n", + "print ' BY not considering diversity technique, probability comes to be %.e'%P1;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "By considering 3-branch selection combiner technique, probability comes to be 1e-06\n", + " BY not considering diversity technique, probability comes to be 1e-02\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 10.7, Page 312" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "SR=3.84; #spreading rate in Mcps\n", + "\n", + "#Calculations\n", + "ChipDur=1./(SR*10**6);\n", + "Speed=3*10**8;\n", + "Dd=ChipDur*Speed;\n", + "\n", + "#Result\n", + "print 'Minimum delay distance to successfully resolve the multipath components and operate the Rake receiver is %d m'%Dd" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum delay distance to successfully resolve the multipath components and operate the Rake receiver is 78 m\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch11.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch11.ipynb new file mode 100755 index 00000000..9cc0698a --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch11.ipynb @@ -0,0 +1,469 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:a9273e79f8d5c3c028c517c94bebc1e2c1c9a292aef113298724eb86d1685f66" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 11: Spread Spectrum (SS) and CDMA Systems" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.1, Page 322" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "CR1=1.2288; #Mcps(Clock rate 1)\n", + "CR2=5.;#Mcps(Clock rate 2)\n", + "R1=9.6; #Information rate in Kbps for CR1\n", + "PG2=256; #Processing Gain for CR2\n", + "\n", + "#Calculations\n", + "PG1=10*math.log10(CR1*10**3/9.6);#Processing Gain for CR1\n", + "R2=CR2*10**3/PG2;#information rate in Kbps for CR2\n", + "\n", + "#Results\n", + "print 'The processing gain for clock rate 1.2288Mcps is %d dB'%PG1\n", + "print 'Improvemrnt in information rate is %.2f Kbps'%(R2-R1);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The processing gain for clock rate 1.2288Mcps is 21 dB\n", + "Improvemrnt in information rate is 9.93 Kbps\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.2, Page 326" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "#From figure 11.5 we get resultant demodulated signal at a mobile;\n", + "Rx=[[1,1,1,1,-3,1],[1,-3,1,1,1,1],[1,-3,1,1,1,-3],[1,-3,1,1,1,1],[-1,3,3,-1,3,-1]];#Resultant demodulated signal at mobile\n", + "\n", + "#from Figure 11.4 \n", + "c1=[[-1,-1,-1,-1,1,1],[1,-1,1,1,-1,-1],[1,-1,1,-1,-1,-1],[-1,1,1,1,-1,1],[1,-1,-1,1,-1,1]];\n", + "c2=[[1,1,-1,1,1,-1],[-1,1,-1,1,-1,-1],[-1,-1,1,1,1,-1],[1,1,-1,-1,1,-1],[1,-1,-1,-1,-1,-1]];\n", + "c3=[[-1,-1,1,-1,1,-1],[-1,-1,-1,1,1,1],[-1,1,1,-1,-1,1],[-1,1,-1,-1,-1,-1],[1,1,1,-1,1,1]];\n", + "\n", + "#Calculations&Results\n", + "#t={[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]};\n", + "#for Mobile 1\n", + "for i in range(0,5):\n", + " Demod1=c1[i][0]*Rx[i][0]+c1[i][1]*Rx[i][1]+c1[i][2]*Rx[i][2]+c1[i][3]*Rx[i][3]+c1[i][4]*Rx[i][4]-1\n", + " if(Demod1<0):\n", + " B1=1;\n", + " else:\n", + " B1=0;\n", + "\n", + "#for mobile 2\n", + "for i in range(0,5):\n", + " Demod2=c2[i][0]*Rx[i][0]+c2[i][1]*Rx[i][1]+c2[i][2]*Rx[i][2]+c2[i][3]*Rx[i][3]+c2[i][4]*Rx[i][4]+1;\n", + " if(Demod2<0):\n", + " B2=1;\n", + " else:\n", + " B2=0;\n", + "\n", + "#for mobile 3\n", + "for i in range(0,5):\n", + " Demod3=c3[i][0]*Rx[i][0]+c3[i][1]*Rx[i][1]+c3[i][2]*Rx[i][2]+c3[i][3]*Rx[i][3]+c3[i][4]*Rx[i][4]-1;\n", + " if(Demod3<0):\n", + " B3=1;\n", + " else:\n", + " B3=0;\n", + "\n", + "print \"Value of integration at end of bit period for mobile1\",Demod1\n", + "print \"Value of integration at end of bit period for mobile2\",Demod2\n", + "print \"Value of integration at end of bit period for mobile3\",Demod3\n", + "print \"The recovered signal at mobile 1 is \",B1\n", + "print \"The recovered signal at mobile 2 is \",B2\n", + "print \"The recovered signal at mobile 3 is \",B3\n", + "print \"In all cases, Recovered signal is negated value of transmitted signal\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Value of integration at end of bit period for mobile1 -12\n", + "Value of integration at end of bit period for mobile2 -8\n", + "Value of integration at end of bit period for mobile3 8\n", + "The recovered signal at mobile 1 is 1\n", + "The recovered signal at mobile 2 is 1\n", + "The recovered signal at mobile 3 is 0\n", + "In all cases, Recovered signal is negated value of transmitted signal\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.3, Page 332" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "BW=100; #in MHz\n", + "Fspac=10; #frequency spacing in kHz\n", + "\n", + "#Calculations\n", + "FreqTones=BW*10**3/Fspac;\n", + "Chips=math.log(FreqTones,2);\n", + "\n", + "#Result\n", + "print 'Minimum number of chips required are %d chips'%Chips" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum number of chips required are 13 chips\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.4, Page 332" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "R=120; #transmission rate in kbps\n", + "Hop=2000; #per second\n", + "Spectrum=10; #in MHz\n", + "\n", + "#Calculations&Results\n", + "#For 32-FSK\n", + "Bits_sym=math.log(32,2);\n", + "SR=R/Bits_sym;\n", + "print 'Bits per symbol are %d'%Bits_sym\n", + "print 'Hops per second are 2000 and Symbol rate is %d kbps'%SR\n", + "Sym_hop=SR*10**3/Hop;\n", + "Min_BW=Sym_hop*SR;\n", + "Nonoverlap_hop=Spectrum*10**3/Min_BW;\n", + "print 'Symbols transmitted per hop are %d'%Sym_hop;\n", + "print 'Number of non-Overlapping hop frequencies are %d'%(round(Nonoverlap_hop))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Bits per symbol are 5\n", + "Hops per second are 2000 and Symbol rate is 24 kbps\n", + "Symbols transmitted per hop are 12\n", + "Number of non-Overlapping hop frequencies are 35\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.5, Page 332" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "R=200;#input data rate in bps\n", + "Fhop=200;#per second\n", + "k=1;#Multipication_Factor\n", + "\n", + "#Calculations&Results\n", + "# We have 32-FSK modulation scheme\n", + "Bits_sym=math.log(32,2);\n", + "Rs=Fhop/Bits_sym;\n", + "print 'There are 200 hops per second and Symbol rate is %d symbols per sec'%Rs; \n", + "\n", + "SDur=1/Rs;\n", + "L=Fhop/Rs;\n", + "CDur=SDur/L;\n", + "Separation=1/CDur;\n", + "M=2**Bits_sym;\n", + "Hop_BW=k*M*Fhop*L;\n", + "Gp=M*k*L; \n", + "\n", + "\n", + "print ' Minimum separation between frequency tones should be %d Hz'%Separation;\n", + "print ' Number of different frequency tones produced by a frequency synthesizer are %d'%M;\n", + "print ' Processing Gain is %d'%Gp;\n", + "print 'Hopping bandwidth is %d kHz'%(Hop_BW/1000);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "There are 200 hops per second and Symbol rate is 40 symbols per sec\n", + " Minimum separation between frequency tones should be 200 Hz\n", + " Number of different frequency tones produced by a frequency synthesizer are 32\n", + " Processing Gain is 160\n", + "Hopping bandwidth is 32 kHz\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.6, Page 342" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "M1=[1,0,0,1,1];\n", + "\n", + "Rx1=[[1,1,1,1,-3,1],[1,-3,1,1,1,1],[1,-3,1,1,1,-3],[1,-3,1,1,1,1],[-1,3,3,-1,3,-1],[1,-1,-1,0,0,0]];#Resultant demodulated signal at mobile(Z(t)) from path1\n", + "Rx2=[[-1,-1,1,1,1,1],[-3,1,1,-3,1,1],[1,1,1,-3,1,1],[1,-3,1,-3,1,1],[1,1,-1,3,3,-1],[3,1,-1,0,0,0]];#Resultant demodulated signal at mobile(Z(t-2Tc)) from path2\n", + "Rx=Rx1+Rx2; #since,Z(t)=z(t)+Z(t-2Tc)\n", + "\n", + "#from Figure 11.13 (d) & Figure 11.14\n", + "c1=[[-1,-1,-1,-1,1,1],[1,-1,1,1,-1,-1],[1,-1,1,-1,-1,-1],[-1,1,1,1,-1,1],[1,-1,-1,1,-1,1]];\n", + "c2=[[-1,1,-1,-1,-1,-1],[1,1,1,-1,1,1],[-1,-1,1,-1,1,-1],[-1,-1,-1,1,1,1],[-1,1,1,-1,-1,1],[-1,1,0,0,0,0]];\n", + "\n", + "#Calculations&Results\n", + "#case-1:Z(t)*C1(t);\n", + "for i in range(0,5):\n", + " Demod_1=c1[i][0]*Rx[i][0]+c1[i][1]*Rx[i][1]+c1[i][2]*Rx[i][2]+c1[i][3]*Rx[i][3]+c1[i][4]*Rx[i][4]+c1[i][5]*Rx[i][5];\n", + " if(Demod_1<0):\n", + " B1=1;\n", + " else:\n", + " B1=0;\n", + "\n", + "#case-2:Z(t)*C1(t-2Tc);\n", + "for j in range(0,5):\n", + " Demod_2=c2[j][2]*Rx[j][2]+c2[j][3]*Rx[j][3]+c2[j][4]*Rx[j][4]+c2[j][5]*Rx[j][5]+c2[j+1][0]*Rx[j+1][0]+c2[j+1][1]*Rx[j+1][1]-10\n", + " if(Demod_2<0):\n", + " B2=1;\n", + " else:\n", + " B2=0;\n", + "\n", + "print \"case-1:z(t)*c1(t)\";\n", + "print \"Value of integration at end of bit period for mobile(case-1)\",Demod_1\n", + "print \"The recovered signal at mobile(case-1) is \",B1\n", + "print \"Actual bit values are\",M1\n", + "print \"Recovered and actual values are not matching\",\n", + "\n", + "print \"\\n\\ncase-2:z(t)*c1(t-2Tc)\"\n", + "print \"Value of integration at end of bit period for mobile(case-2)\",Demod_2\n", + "print \"The recovered signal at mobile(case-2) is \",B2\n", + "print \"Actual bit values are\",M1\n", + "print \"Recovered and actual values are not matching\",\n", + "\n", + "#case3-Sum of path1 and path2\n", + "print \"\\n\\ncase-3:Sum of path1 & path2 integrator\"\n", + "Demod_3=Demod_1+Demod_2;\n", + "print \"Sum of integrator outputs(rake receiver output)\",Demod_3\n", + "\n", + "for k in range(0,5):\n", + " if(Demod_3<0):\n", + " B3=1;\n", + " else:\n", + " B3=0;\n", + " \n", + "print \"Detected bit value \",B3\n", + "print \"Actual bit values are\",M1\n", + "print \"Recovered and actual values are matching\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "case-1:z(t)*c1(t)\n", + "Value of integration at end of bit period for mobile(case-1) -12\n", + "The recovered signal at mobile(case-1) is 1\n", + "Actual bit values are [1, 0, 0, 1, 1]\n", + "Recovered and actual values are not matching \n", + "\n", + "case-2:z(t)*c1(t-2Tc)\n", + "Value of integration at end of bit period for mobile(case-2) -12\n", + "The recovered signal at mobile(case-2) is 1\n", + "Actual bit values are [1, 0, 0, 1, 1]\n", + "Recovered and actual values are not matching \n", + "\n", + "case-3:Sum of path1 & path2 integrator\n", + "Sum of integrator outputs(rake receiver output) -24\n", + "Detected bit value 1\n", + "Actual bit values are [1, 0, 0, 1, 1]\n", + "Recovered and actual values are matching\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.7, Page 360" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Prm=-97;#the signal strength from the base stations in dBm\n", + "#The constant ( K ) is the part of the broadcast message that is sent to the mobile by the base station on the paging channel.\n", + "K=-73; #dB\n", + "P2=18; #power as directed by BS (dBm)\n", + "\n", + "#Calculations&Results\n", + "Ptm=K-Prm;\n", + "print 'The mobile transmitter power be set as a first approximation of %d dBm'%Ptm\n", + "Pwr_Redu=Ptm-P2;#power reduction\n", + "print 'Power reduction = %d dBm'%Pwr_Redu\n", + "Time=6*1.25;\n", + "print 'Time required by mobile station to make changes as directed by base station is %.1f msec'%Time\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The mobile transmitter power be set as a first approximation of 24 dBm\n", + "Power reduction = 6 dBm\n", + "Time required by mobile station to make changes as directed by base station is 7.5 msec\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 11.8, Page 362" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "P1=-95; #pilot1 in dBm\n", + "P2=-100; #pilot2 in dBm\n", + "P3=-101; #pilot3 in dBm\n", + "P4=-105; #pilot4 in dBm\n", + "P5=-102; #pilot in dBm\n", + "NoiseP=-107; #Receiver sensitivity(dBm)\n", + "Tadd=-13; #dB\n", + "\n", + "#Calculations&Results\n", + "#Pcj = received power of the jth pilot in the candidate set\n", + "# Pai= received power of the ith pilot in the active set \n", + "Pa1=P1-NoiseP;\n", + "Pa2=P2-NoiseP;\n", + "Pa3=P3-NoiseP;\n", + "Pa4=P4-NoiseP;\n", + "Pc5=P5-NoiseP;\n", + "\n", + "X=10*math.log10(10**(0.1*Pa1)+10**(0.1*Pa2)+10**(0.1*Pa3)+10**(0.1*Pa4)+10**(0.1*Pc5)); \n", + "print \"Since P1>P2>P3>P4, we replace P4\"\n", + "T_COMP=(P5-P4)/0.5;\n", + "print 'The value of T-COMP that could trigger the mobile station to generate a PSMM should be <= %d dB (<= %d)'%(T_COMP,round(10**(0.1*T_COMP)));\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Since P1>P2>P3>P4, we replace P4\n", + "The value of T-COMP that could trigger the mobile station to generate a PSMM should be <= 6 dB (<= 4)\n" + ] + } + ], + "prompt_number": 8 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch12.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch12.ipynb new file mode 100755 index 00000000..8234bb5b --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch12.ipynb @@ -0,0 +1,91 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:5a8dcdff9c441023f41d39cb4ab911bae195c143982b35aa0ceb85309af37715" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 12: Mobility Management in Wireless Networks" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 12.1, Page 374" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "P=10000; #Mobile density(mobiles/km**2)\n", + "R=500*10**-3; #km\n", + "V=10; #Average moving velocity of a mobile in Kmph\n", + "Nc=10.; #No of cells per LA\n", + "N_LA=5; #Number of LAs per MSC/VLR \n", + "\n", + "\n", + "#Calculations&Results\n", + "#Number of transactions and duration of each transaction to MSC/VLR per LU for different LU types are given in Table 12.1.(page no.374)\n", + "\n", + "\n", + "# L=length (km) of the cell exposed perimeter in an LA\n", + "L=6*R*(1./3+1./(2*math.sqrt(Nc)-3)); #Km\n", + "# lamdaLU=number of transactions processed by MSC/VLR in an LA perimeter of the jth cell per hour\n", + "LamdaLu=V*P*L/math.pi; #Lus per hour\n", + "\n", + "\n", + "# case(1)\n", + "print \"Case-1\"\n", + "R1_LU=LamdaLu/3600*(1*600./1000); #resource occupancy from Table 12.1\n", + "print 'The resource occupancy in the jth cell due to MS LUs is %.1f Erlangs'%R1_LU;\n", + "\n", + " \n", + "#case(2)\n", + "print \"\\nCase-2\"\n", + "R2_LU=LamdaLu/3600*(0.8*3500/1000+0.2*4000/1000); #from Table 12.1\n", + "print 'The resource occupancy in the jth cell due to MS LUs is %.2f Erlangs'%R2_LU;\n", + "Np=6*math.sqrt(Nc/3)-3;#Number of cells located on perimeter of an LA\n", + "print 'Number of cells where inter-VLR LUs occur will be: %d'%(round(0.5*Np*4));\n", + "print 'Number of cells where intra-VLR LUs occur will be: %d'%(4*Nc-16);\n", + "TNLU=LamdaLu*(2*24+16*(0.8*14+0.2*16)); #from table 12.1\n", + "print 'The MSC/VLR transaction load using the \ufb02uid \ufb02ow model is %.2e transactions at peak hour'%TNLU;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Case-1\n", + "The resource occupancy in the jth cell due to MS LUs is 10.1 Erlangs\n", + "\n", + "Case-2\n", + "The resource occupancy in the jth cell due to MS LUs is 60.55 Erlangs\n", + "Number of cells where inter-VLR LUs occur will be: 16\n", + "Number of cells where intra-VLR LUs occur will be: 24\n", + "The MSC/VLR transaction load using the \ufb02uid \ufb02ow model is 1.69e+07 transactions at peak hour\n" + ] + } + ], + "prompt_number": 1 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch13.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch13.ipynb new file mode 100755 index 00000000..fec26202 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch13.ipynb @@ -0,0 +1,104 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:0963e656a45b56e87c82b1b894058e0c0c5d5a3acfd1e2f8850678ef319681b0" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 13: Security in Wireless Systems" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.1, Page 424" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "#Two prime numbers\n", + "p=5;\n", + "q=7;\n", + "\n", + "#Calculations\n", + "n=p*q;\n", + "z=(p-1)*(q-1);\n", + "e=5\n", + "d=29\n", + "\n", + "#Results\n", + "print 'Public keys is (%d, %d)'%(n,e);\n", + "print 'Private key is (%d, %d)'%(n,d);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Public keys is (35, 5)\n", + "Private key is (35, 29)\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 13.2, Page 425" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "p=23; #prime number that both parties agreed upon\n", + "g=5;# g is primitive mod p\n", + "a=6; #party A choosen number\n", + "b=15; #party B choosen number\n", + "\n", + "#Calculations&Results\n", + "print 'Party A sends to party B as (g**a mod p) = %d'%(g**a%23);\n", + "print 'Party B sends to party A as (g**b mod p) = %d'%(g**b%23);\n", + "print 'Party A computes secret key as ((g**b modp)**a mod p) = %d'%(((g**b%23)**a)%p);\n", + "print 'Party B computes secret key as ((g**a modp)**b mod p) = %d'%(((g**a%23)**b)%p);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Party A sends to party B as (g**a mod p) = 8\n", + "Party B sends to party A as (g**b mod p) = 19\n", + "Party A computes secret key as ((g**b modp)**a mod p) = 2\n", + "Party B computes secret key as ((g**a modp)**b mod p) = 2\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch14.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch14.ipynb new file mode 100755 index 00000000..58285a29 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch14.ipynb @@ -0,0 +1,106 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:3bb6fed41815ab02f5db449f0fb6dc3bca89d7411c6822dfe382fccc1777b7c3" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 14: Mobile Network and Transport Layer" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.1, Page 452" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "O=800*1000; #Object size(Bytes)\n", + "S=536.*8; #max Segment Size(in bits)\n", + "RTT=0.1; #Round trip-time in sec\n", + "R=1.*10**6; #Transmission rate of the link from the server to the client in bps\n", + "\n", + "#Calculations\n", + "Lmin=2*RTT+(O/R); #latency(msec)\n", + "# For minimum latency (S/R) +RTT -(W*S/R) = 0;Therefore\n", + "W=1+(RTT)/(S/R);\n", + "\n", + "#Results\n", + "print 'The minimum possible latency is %d sec'%Lmin;\n", + "print 'The minimum window size is %.1f segments'%W;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The minimum possible latency is 1 sec\n", + "The minimum window size is 24.3 segments\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 14.2, Page 452" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "RTT=0.1; #Round trip-time in sec\n", + "MSS=536.*8; #Maximum segment size in bits\n", + "p=0.01;# packet loss probability for the path\n", + "RTO=5*RTT; #Retransmission time out(from eqn 14.2 on page 450)\n", + "\n", + "#Calculations\n", + "R=0.93*MSS/(RTT*math.sqrt(p));\n", + "RR=MSS/(RTT*math.sqrt(1.33*p)+RTO*p*(1+32*p**2)*min(1,3*math.sqrt(0.75*p)));\n", + "\n", + "#Results\n", + "print 'The upper bound of the throughput is %.4f Mbps'%(R*10**-6);\n", + "print 'The throughput with retransmission due to errors is %.4f Mbps'%(RR*10**-6);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The upper bound of the throughput is 0.3988 Mbps\n", + "The throughput with retransmission due to errors is 0.3341 Mbps\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch17.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch17.ipynb new file mode 100755 index 00000000..708d447e --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch17.ipynb @@ -0,0 +1,769 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:029905df97aa37359789733a28b442f75b82e79e7e96006449e39c092f0d4cca" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 17: Planning and Design of a Wireless Network" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.1, Page 597" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration \n", + "Susage=150.;#subscriber usage per month in mins\n", + "days=24;#days per month\n", + "busyhrs=6;#in a day\n", + "BW=4.8*10**3; #in kHz\n", + "Freqreuse=4./12;#Frequency reuse plan\n", + "chwidth=200; #in kHz\n", + "subscriber=50000;#Present subscriber count\n", + "Sgrowth=0.05;#Growth rate per year\n", + "Area=500; #in km\n", + "BTScapacity=30; #in Erlangs\n", + "N=4; #Initial installation design years\n", + " \n", + "#Calculations&Results\n", + "Erlangspersub=Susage/(days*busyhrs*60);\n", + "print 'Average busy-hour traf\ufb01c per subscriber is %.4f Erlangs'%Erlangspersub;\n", + "RFcarriers=BW/chwidth;\n", + "RFcarrier_percell=RFcarriers/((Freqreuse**-1)*4); #freq reuse factor of 4\n", + "\n", + "#Assuming 2 control channels per cell\n", + "CC=2;#control channels\n", + "TC_percell=2*RFcarriers/3-CC;\n", + "#Referring Erlang-B table in Appendix A\n", + "print \"Referring Erlang-B table in Appendix A,Traf\ufb01c capacity of a GSM cell at 2% GoS for 14 channels = 8.2 Erlangs \"\n", + "Tcapacity=8.2;# in Erlangs\n", + "print \"There are 3 cells per BTS\"\n", + "BTS=3;\n", + "Traffic_perBTS=Tcapacity*BTS;\n", + "print 'Traffic capacity per BTS is %.1f Erlangs'%Traffic_perBTS\n", + "print \"Therefore, Traffic per BTS is less than BTS capacity(30 Erlangs)\"\n", + "maxsubscriber=Traffic_perBTS/Erlangspersub;\n", + "initialsub=subscriber*(1+Sgrowth)**N;\n", + "BTS_perZone=initialsub/maxsubscriber;\n", + "print 'The required number of base stations per zone are %d'%(round(BTS_perZone));\n", + "cellRadius=(Area/(BTS_perZone*2.6))**0.5;\n", + "print 'The hexagonal cell radius is %.1f km'%cellRadius;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Average busy-hour traf\ufb01c per subscriber is 0.0174 Erlangs\n", + "Referring Erlang-B table in Appendix A,Traf\ufb01c capacity of a GSM cell at 2% GoS for 14 channels = 8.2 Erlangs \n", + "There are 3 cells per BTS\n", + "Traffic capacity per BTS is 24.6 Erlangs\n", + "Therefore, Traffic per BTS is less than BTS capacity(30 Erlangs)\n", + "The required number of base stations per zone are 43\n", + "The hexagonal cell radius is 2.1 km\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.2, Page 598" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "usage=150.; #subscriber usage per month in mins\n", + "days=24;#Days in a month\n", + "BHrs=6;#Busy hours per day\n", + "BW=4.8; #in MHz\n", + "RFch=200; #in kHz\n", + "Psubscribers=50000;#present subscriber count\n", + "growth=0.05;#subscriber growth per year\n", + "rollover=4;#network roll over period\n", + "NPCS=5;#Number of packet calls per session \n", + "NPP=25;#Number of packets within a packet call \n", + "Tr=120;#Reading time between packet calls(sec)\n", + "NBP=480*8;#Packet size(in bits)\n", + "Tint=0.01;#Time interval between two packets(sec)\n", + "Ttot=3000;#Total packet service holding time\n", + "BH_PS=0.15;#Busy hour packet sessions per subscriber\n", + "Penetration=0.25;\n", + "datarate=48; #in kbps\n", + "PTT=10;#Packet transmission time(sec)\n", + "BTS=40;#NO of BTS sites\n", + "\n", + "#Calculations&Results\n", + "Bitstx_duringPTT=NPCS*NPP*NBP/1000; \n", + "PST=PTT+Tr*(NPCS-1)+Tint*(NPP-1);\n", + "PT_duringBH=BH_PS*Ttot/PST;\n", + "Bits_persub_persec=Bitstx_duringPTT*PT_duringBH/(60*60);\n", + "VoiceErlangs=usage/(days*BHrs*60);\n", + "Initial_subscribers=round(Psubscribers*(1+growth)**rollover);\n", + "Data_subscribers=Initial_subscribers*Penetration;\n", + "Totalvoice=Initial_subscribers*VoiceErlangs;\n", + "Voicetraffic_perBTS=Totalvoice/BTS;\n", + "print 'Voice Traffic per Cell(sector) is %.2f Erlangs'%(Voicetraffic_perBTS/3);\n", + "Totaldata=Data_subscribers*Bits_persub_persec;\n", + "Datathroughput_perBTS=Totaldata/BTS;\n", + "print 'Data throughput per Cell(sector) is %.2f kbps'%(Datathroughput_perBTS/3)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Voice Traffic per Cell(sector) is 8.79 Erlangs\n", + "Data throughput per Cell(sector) is 15.50 kbps\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.3, Page 600" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Holdtime=120;#Average holding time during Busy Hours(in sec)\n", + "Tx=3;# No of transreceivers\n", + "TSsig=3;#No of TSs per cell for signaling\n", + "RLC=0.80;#Radio link control efficiency\n", + "Radioblocks=9000;#Total numbers of transmitted radio blocks\n", + "TSdata=3;#TSs allocated for data traf\ufb01c per cell\n", + "Datarate=15.5; #From eg 17.2\n", + "Voicetraffic=8.82; #From eg.17.2\n", + "Duration=0.02;#Duration of block in sec\n", + "\n", + "#Calculations&Results\n", + "DataEr=Radioblocks*Duration/Holdtime;\n", + "print 'Data Erlangs = %.1f'%DataEr;\n", + "TSuti=DataEr/TSsig;\n", + "print 'Time Slot(TS) utilization = %.1f'%TSuti;\n", + "Throughput=(Datarate/TSdata)*RLC;\n", + "TScap=Throughput/TSuti;\n", + "print 'TS capacity is %.2f kbps'%TScap;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Data Erlangs = 1.5\n", + "Time Slot(TS) utilization = 0.5\n", + "TS capacity is 8.27 kbps\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.4, Page 602" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Pt=36;#Base station transmitted power in dBm\n", + "Pms=24;#mobile station transmitted power in dBm\n", + "Nms=8;#mobile station noise figure in dB\n", + "Nbs=5;#Base station nise figure in dB\n", + "Ga=18;#Base station transmit and receive antenna gain in dBi\n", + "Gm=0;#Mobile antenna gain in dBi\n", + "SNR=12;# in dB\n", + "Lc_TX=5;#BS transmit antenna cable, connector, and \ufb01lter losses in dB\n", + "Lc_RX=2;#BS receiver antenna cable, connector, and \ufb01lter losses in dB\n", + "Bodyloss=3;# Body losses at mobile\n", + "fading=10.2;# in dB\n", + "ThermalNoise=-174;# in dBm/Hz\n", + "Gdiversity=5;#Antenna diversity gain at BS in dB\n", + "#Assuming standard value of RF channel as \n", + "RFch=200*10**3; #in Hz\n", + "\n", + "#Calculations\n", + "N=ThermalNoise+10*math.log10(RFch)+Nms;\n", + "Smin=N+SNR;\n", + "Smean=Smin+fading+Bodyloss;\n", + "Lp=Pt-Lc_TX+Ga-Smean;\n", + "N1=ThermalNoise+10*math.log10(RFch)+Nbs;\n", + "Smin=N1+SNR-Gdiversity;\n", + "Smean1=Smin+fading+Bodyloss;\n", + "Lp1=Pms-Smean1+Ga-Lc_RX;\n", + "R=10**((Lp1-133.2)/33.8);\n", + "\n", + "#Result\n", + "print 'Cell radius is %.1f km'%R;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cell radius is 1.2 km\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.5, Page 608" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Ri=12.2*10**3;#Information rate in bps\n", + "Rc=3.84*10**6;#Chip rate in cps(chips per second)\n", + "Eb_Nt=4.; #in dB\n", + "Imargin=2.; #Interference margin(3 dB)\n", + "B=0.5;#Interference factor due to other cells\n", + "Vi=0.65;#Channel activity factor\n", + "\n", + "#Calculations&Results\n", + "Eb_Ntreqd=10**(Eb_Nt/10);\n", + "LF_peruser=(1+B)*(1./(1+(Rc/Ri)*(1./Eb_Ntreqd)*(1./Vi))); #M(no of users=1) in Eq 17.13\n", + "print 'Cell load factor per voice user is %.5f'%LF_peruser;\n", + "CellLoading=(Imargin-1)/Imargin;\n", + "VoiceUsers=CellLoading/LF_peruser;\n", + "print 'No of Voice Users are %d per cell'%VoiceUsers;\n", + "#From EQ 17.6 assuming Power control efficiency=1\n", + "Polecap=Rc/(Ri*Vi*(1+B)*Eb_Ntreqd);\n", + "print 'Pole Capacity is %d'%Polecap;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cell load factor per voice user is 0.00774\n", + "No of Voice Users are 64 per cell\n", + "Pole Capacity is 128\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.6, Page 608" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Eb_Nt=1.; #in dB\n", + "cellLoading=0.5;#Required interference margin(3 dB)\n", + "B=0.5;#Interference factor due to other cells\n", + "Vi=1;#Channel activity factor\n", + "\n", + "#Calculations\n", + "Eb_Ntreqd=10**(Eb_Nt/10);\n", + "#Assuming standard value of chip rate as 3.84Mcps\n", + "Rc=3.84*10**6;#in cps(chips per second)\n", + "Throughput=(cellLoading*Rc)/(Eb_Ntreqd*(1+B));\n", + "\n", + "#Result\n", + "print 'Uplink Throughput is %d kbps'%(Throughput/1000);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Uplink Throughput is 1016 kbps\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.7, Page 610" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Ri=12.2*10**3;#Information rate in bps\n", + "Rc=3.84*10**6;# Chip rate in chips per second\n", + "Eb_Nt=4.; # in dB\n", + "Eb_Nt=10**(Eb_Nt/10);\n", + "B=0.5;#Average interference factor due to other cells\n", + "Zeta=0.6; # orthogonality factor\n", + "Imargin=2.;#Interference margin(3 dB)\n", + "Vi=0.65 #assuming Channel activity factor as 0.65\n", + "\n", + "#Calculations&Results\n", + "Loadfactor_peruser=(Zeta+B)*(1./((Rc/Ri)*(1./Eb_Nt)*(1./Vi)))\n", + "print 'Downlink cell load factor is %.4f'%Loadfactor_peruser;\n", + "cellLoading=(Imargin-1)/Imargin;\n", + "Voiceusers=cellLoading/Loadfactor_peruser;\n", + "print 'No of voice users per cell are %d'%Voiceusers;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Downlink cell load factor is 0.0057\n", + "No of voice users per cell are 87\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.8, Page 610" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "N0=-174;#Noise density in dBm/Hz\n", + "Bc=1.25;#Channel bandwidth in mHz\n", + "Rc=1.2288;#Chip rate in Mcps\n", + "Nf=6; #Receiver Noise figure in dB\n", + "Pt=27; #Effective radiated power from mobile in dBm\n", + "Lct=0.5; #Transmitter cable and connector loss in dBm\n", + "Lbody=1.5;#Body loss in dB\n", + "Lcr=2; #Receiver cable and connector loss in dB\n", + "Mint=0; #Interference margin in dB\n", + "Mfading=2;#fast fadinf margin in dB\n", + "Lpent=8;#Penetration loss in dB\n", + "Gm=0;#Transmitter antennna gain in dBi\n", + "Gb=12;#Receiver antenna gain in dBi\n", + "Fm=8;#Fade margin in dB\n", + "Eb_Nt=7;# in dB\n", + "\n", + "#Calculations\n", + "Nth=N0+Nf;\n", + "S_Nt=Eb_Nt+10*math.log10((Rc*10**6)/(Bc*10**6));\n", + "Smin=S_Nt+10*math.log10(Rc*10**6)+Nth;\n", + "Lpmax=(Pt-Smin)+(Gb+Gm)-(Lbody+Lct+Lcr+Fm+Lpent)-Mint-Mfading;\n", + "\n", + "#Results\n", + "print 'Minimum signal power required is %.2f dBm'%Smin;\n", + "print 'Maximum allowable path loss is %.2f dB'%Lpmax;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum signal power required is -100.18 dBm\n", + "Maximum allowable path loss is 117.18 dB\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.9, Page 612" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Rc=3.84;#Chip rate in Mcps\n", + "Ri=16;#Data rate in kbps\n", + "UL=0.5;#UL loading factor\n", + "DL=0.9;#DL loading factor\n", + "Eb_NtU=4;#in dB\n", + "Eb_NtD=6;# in dB\n", + "Gm=0;#Mobile antenna gain in dBi\n", + "Gb=18;#Base station gain in dBi\n", + "\n", + "#Calculations\n", + "R=10**((139.65-138.5)/35.7);\n", + "print 'Cell Radius is %.3f km'%R;\n", + "Area=round(2.6*R**2);\n", + "\n", + "#Results\n", + "print 'Area covered by hexagonal cell is %d km**2'%Area;\n", + "print 'Number of BTSs required to cover an area of 2400 Km**2 are %d'%(2400/Area);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Cell Radius is 1.077 km\n", + "Area covered by hexagonal cell is 3 km**2\n", + "Number of BTSs required to cover an area of 2400 Km**2 are 800\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.10, Page 614" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Rc=3.84;#chip rate in Mcps\n", + "N=3.;#Noise rise in dB\n", + "OF=0.8;#orthogonality factor\n", + "B=0.55;#Interference from other cells \n", + "Eb_N0=4.;#in dB\n", + "Sec_Eff=0.85;#Sector efficiency\n", + "Pwr_Eff=0.80;#Power control efficiency\n", + "Y=1.2; #Retransmit rate\n", + "X=10.; #10MB at 384Kbps\n", + "X1=2.; #2MB at 144Kbps\n", + "X2=1.; #1MB at 64Kbps\n", + "\n", + "#Calculations\n", + "#Assuming Voice activity=Vf=1\n", + "Vf=1;\n", + "AvgDR=Y*X*10**6*(1./3600)+Y*X1*10**6*(1./3600)+Y*X2*10**6*(1./3600);\n", + "CLoad=(N-1)/(N+1);\n", + "DLcap=(Rc*10**6*Pwr_Eff*Sec_Eff)/(((10**(Eb_N0/10))*(B+OF)*Vf));\n", + "Allowcap=CLoad*DLcap;\n", + "users=Allowcap/AvgDR;\n", + "\n", + "#Result\n", + "print 'NO of users that can be supported on the downlink of the WCDMA network are %d'%(round(users));" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "NO of users that can be supported on the downlink of the WCDMA network are 89\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.11, Page 616" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "P1=1./2;#relative frequency of packets for user class1 \n", + "P2=1./3;#relative frequency of packets for user class2\n", + "P3=1./6;#relative frequency of packets for user class3\n", + "R1=16; #data rate in kbps for P1\n", + "R2=64; #data rate in kbps for P2\n", + "R3=1024; #data rate in kbps for P3\n", + "S1=16;#number of slots assigned to the R1 user\n", + "S2=8;#number of slots assigned to the R2 user\n", + "S3=2;#number of slots assigned to the R3 user\n", + "\n", + "#Calculations\n", + "#Using Equation 17.20 from page no 616\n", + "Ravg=(P1*R1*S1+P2*R2*S2+P3*R3*S3)/(P1*S1+P2*S2+P3*S3);\n", + "# For equal latency, using Eq 17.18\n", + "Rav=1./(P1/R1+P2/R2+P3/R3);\n", + "# For Latency ratio=4, using Eq 17.19 from page no 616\n", + "PL=4;\n", + "C=(P1+P2+PL*P3)/(P1/R1+P2/R2+P3/R3);\n", + "\n", + "#Results\n", + "print 'The average throughput for equal access condition is %.1f kbps'%Ravg;\n", + "print 'The average throughput by considering equal latency is %.1f kbps'%Rav;\n", + "print 'The average throughput by considering latency ratio as 4 is %.2f kkbps'%C\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The average throughput for equal access condition is 58.2 kbps\n", + "The average throughput by considering equal latency is 27.3 kbps\n", + "The average throughput by considering latency ratio as 4 is 40.96 kkbps\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.12, Page 620" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Ec_Nt=-23.;#in dB\n", + "DRC=-1.5;#DRC gain with respect to pilot in dB\n", + "Tg=3.75; # Traf\ufb01c channel gain with respect to pilot in dB\n", + "B=0.85;#Interference factor due to other cells \n", + "\n", + "#Calculations\n", + "Mmax=(1./(1+10**(DRC/10)+10**(Tg/10)))*(1./((10**(Ec_Nt/10)*(1+B))));\n", + "#The sector loading can be expressed as a fraction of the pole capacity Mmax. This is typically 70% of the pole capacity. \n", + "M_allow=int(0.7*Mmax);\n", + "#From table 17.2 we get Traffic channel rate as 9.6kbps since we are given traffic channel gain with respect to pilot as 3.75 dB\n", + "Ri=9.6; #in kbps(see table 17.2)\n", + "Tput=Ri*M_allow;\n", + "\n", + "#Result\n", + "print 'Allowable reverse link throughput is %d kbps'%(round(Tput));" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Allowable reverse link throughput is 173 kbps\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.13, Page 623" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Ptmax=5.5;#Maximum transmit power of DSCH in watts\n", + "Pbs=18;# Total base station power in watts\n", + "alpha=0.2;#downlink orthogonality factor \n", + "G=0.363;# geometry factor\n", + "SF=16; #Spreading Factor for DSCH;fixed at value of 16\n", + "\n", + "#Calculations\n", + "# Using equation no 17.27 given on page no 623\n", + "SINR=SF*(Ptmax/(Pbs*(1-alpha+(1/G))));\n", + "# In dB\n", + "SINR_db=10*math.log10(SINR);\n", + "\n", + "#Result\n", + "print 'The average SINR of HSDPA is %.4f dB(%.1fdB)'%(SINR,SINR_db);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The average SINR of HSDPA is 1.3753 dB(1.4dB)\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.14, Page 624" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Users=350;#no of users supported\n", + "ExpectedTraf=1.8; # From section 17.7 (in Kbps)\n", + "BHTraf=1.785;#Busy hour traffic in kbps\n", + "BTS=180;\n", + "\n", + "#Calculations\n", + "IubBW=(ExpectedTraf*Users*BHTraf)/1000; # in Mbps\n", + "TotalBW=BTS*IubBW;\n", + "\n", + "#Result\n", + "print 'Required total bandwidth of Iub Interface is %.2f Mbps'%TotalBW;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Required total bandwidth of Iub Interface is 202.42 Mbps\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 17.15, Page 625" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "BTS=800.;#No of BTS sites\n", + "Sec=3;#No of sectors per BTS\n", + "freq_sec=2;#No of frequencies used per sector\n", + "cellsRNC=1152;#Maximum capacity of cellRNC\n", + "btsRNC=384;#One RNC can support btsRNC(BTSs)\n", + "VE=25;#Voice service(mErl/subscriber)\n", + "BRV=16;# bitrate Voice\n", + "CS1=10;#CS data service 1(mErl/subscriber)\n", + "BRC1=32;#bit rate for CS1 in kbps\n", + "CS2=5;#CS data service 2(mErl/subscriber)\n", + "BRC2=64;##bit rate for CS2 in kbps\n", + "PSdata=0.2;#PS data service(kbps per subscriber)\n", + "PSoverhead=0.15;\n", + "SHO=0.4;#40%\n", + "Totalsub=350000;#Total subsribers\n", + "Maxcap=196;#Maximum Iub capacity of tpRNC (in Mbps)\n", + "FR1=0.9;FR2=0.9;FR3=0.9;#Filler rates\n", + "\n", + "#Calculations&Results\n", + "RNCreqd=(BTS*Sec*freq_sec)/(cellsRNC*FR1);#from eqn 17.28\n", + "print 'using equation 17.28,Number of RNC required are %d'%(round(RNCreqd));\n", + "RNC_reqd=BTS/(btsRNC*FR2);#from eqn 17.29\n", + "print 'using equation 17.29,Number of RNC required are %d'%(round(RNC_reqd));\n", + "RNCrequired=((VE/1000*BRV+CS1/1000*BRC1+CS2/1000*BRC2+(PSdata/(1-PSoverhead)))*(1+SHO)*Totalsub)/(Maxcap*1000*FR3);#from eqn 17.30\n", + "print 'using equation 17.30,Number of RNC required are %d'%(round(RNCrequired));\n", + "print 'We select first value which is %d RNCs'%(round(RNCreqd));" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "using equation 17.28,Number of RNC required are 5\n", + "using equation 17.29,Number of RNC required are 2\n", + "using equation 17.30,Number of RNC required are 1\n", + "We select first value which is 5 RNCs\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch19.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch19.ipynb new file mode 100755 index 00000000..fee9ff09 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch19.ipynb @@ -0,0 +1,106 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:dd18f098648291d58cdb32b1739d692bc9e7a8620a737fa84a463a3efca95463" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 19: Wireless Personal Area Network - Bluetooth" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 19.1, Page 666" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "SS=80.; #Frame length of HV3 voice packet\n", + "R=64*10**3; #Data rate in bps\n", + "TS=240; #No of bits carried in a slot\n", + "\n", + "#Calculations\n", + "#From table 19.3:Bluetooth air interface details, we get Frequency hopping rate as 1600hopes/second\n", + "\n", + "#From table 19.5, we can note that for HV3, No of slots are 1 and carry in all(80(user voice sample)+160(parity bits))=240 bits in one slot packet\n", + "HR=1600; #hopes/second\n", + "Eff=SS/TS;\n", + "x=R/SS; #x is number of times a packet is sent\n", + "\n", + "#Results\n", + "print 'Hopping rate is %d hopes/sec'%HR;\n", + "print 'No of bits transmitted in one slot are %d'%TS;\n", + "print 'Efficiency of packet transmission is %.4f'%Eff;\n", + "print 'Number of times a packet is sent is equal to %d'%x;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Hopping rate is 1600 hopes/sec\n", + "No of bits transmitted in one slot are 240\n", + "Efficiency of packet transmission is 0.3333\n", + "Number of times a packet is sent is equal to 800\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 19.2, Page 666" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "R=136.; # bits per slot\n", + "SR=800; # no of slots per second\n", + "\n", + "#Calculations\n", + "# A symmetric 1-slot DM1 link is setup between a master and a slave\n", + "AR=R*SR; #Data rate in bps\n", + "\n", + "#Result\n", + "print 'Associated data rate is %0.1f kbps'%(AR/1000);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Associated data rate is 108.8 kbps\n" + ] + } + ], + "prompt_number": 2 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch2.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch2.ipynb new file mode 100755 index 00000000..b82f7950 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch2.ipynb @@ -0,0 +1,533 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:dd4432cc2f7e790571ec64d7a8254cb368aab6a22204c8b382ba85e3c1b5a734" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 2: Teletraffic Engineering" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.1, Page 25" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "LC=10.; #Lost calls\n", + "CC=380; #Carried calls\n", + "\n", + "#Calculations\n", + "OC=LC+CC; #Total offered calls\n", + "#Gos=Blocking probability=(number of Lost calls/Total number of offered calls)\n", + "Gos=LC/OC;\n", + "\n", + "#Result\n", + "print 'The Gos during busy hour is %f \\n '%Gos" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Gos during busy hour is 0.025641 \n", + " \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.2, Page 26" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Ht=5; #Average holding time in seconds\n", + "PC=450; # Peg count for one hour period\n", + "OC=0; # Overflow count\n", + "\n", + "#Calculations&Results\n", + "# usage(Erlangs)=(peg count- overflow count)*Average holding time(in hrs)\n", + "U=(PC-OC)*(5./3600); \n", + "print 'Usage = %.3f Erlangs'%U\n", + "\n", + "# IN CCS\n", + "Uccs=U*36; # usage in CCS\n", + "print '%.1f CCS'%Uccs\n", + "\n", + "Ucs=Uccs *100; #usage in call-seconds\n", + "print '%d call-seconds'%Ucs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Usage = 0.625 Erlangs\n", + "22.5 CCS\n", + "2250 call-seconds\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.3, Page 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "B=0.05; #Blocking(5%)\n", + "CL=3000.; #Carried Load in CCS\n", + "\n", + "#Calculations\n", + "#Offered Load=Carried Load/(1-Blocking);\n", + "OL=CL/(1-B); #Offered Load in CCS\n", + "\n", + "#Result\n", + "print 'Offered load is %d CCS'%OL\n", + "print 'Overflow is %d CCS'%((OL-CL))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Offered load is 3157 CCS\n", + "Overflow is 157 CCS\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.4, Page 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Ht=120; #Holding time in seconds\n", + "CR=2.; #call rate per hour\n", + "\n", + "#Calculations\n", + "#Traffic Intensity(Erlangs) = call rate * Holding time(in hrs));\n", + "I=CR*Ht/3600; #Traffic Intensity\n", + "\n", + "#Result\n", + "print 'Traffic Intensity is %.4f Erlangs = %.1f CCS \\n'%(I,I*36);\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Traffic Intensity is 0.0667 Erlangs = 2.4 CCS \n", + "\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.5, Page 27" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "time=90.; #in minutes\n", + "calls=10.; #no of calls in 90mins\n", + "\n", + "#Calculations\n", + "CR=calls/(time/60); #call arrival rate in calls/hour\n", + "tavg=(60.+74+80+90+92+70+96+48+64+126)/10; #average call holding time in sec per call\n", + "I= CR*(tavg/3600); #traffic intensity in Erlangs\n", + "\n", + "#Result\n", + "print 'Traffic Intensity is %.3f Erlangs = %.2f CCS \\n '%(I,I*36)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Traffic Intensity is 0.148 Erlangs = 5.33 CCS \n", + " \n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.6, Page 28" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "time=8.; #in hours\n", + "calls=11.; #no of calls in 90mins period\n", + "\n", + "#Calculations&Results\n", + "CR=calls/time; #call arrival rate in calls/hour\n", + "tavg=(3+10.+7+10+5+5+1+5+15+34+5)/11; #average call holding time in mins per call\n", + "I= CR*(tavg/60); #traffic intensity in Erlangs\n", + "print 'Traffic Intensity during eight hour period is %.3f Erlangs = %.1f CCS \\n'%(I,I*36);\n", + "\n", + "#For Busy Hour i.e between 4:00PM and 5:00PM\n", + "CRB=2; #call arrival rate during busy hour in calls/hour(from table 2.2)\n", + "tavgB=(34+5.)/2; #average holding time during Busy Hour in mins/call (from table 2.2)\n", + "IB=CRB*(tavgB/60); #Traffic Intensity during Busy Hour\n", + "print 'Traffic Intensity during busy hour is %.2f Erlangs = %.1f CCS'%(IB,IB*36);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Traffic Intensity during eight hour period is 0.208 Erlangs = 7.5 CCS \n", + "\n", + "Traffic Intensity during busy hour is 0.65 Erlangs = 23.4 CCS\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.7, Page 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "minutes=500.; #No of minutes used per month per user\n", + "Twork=0.9; #Traffic During Work day\n", + "TBH=0.1; #Traffic during busy hour\n", + "Days=20; #No of workdays in a month\n", + "\n", + "#Calculations\n", + "#Avg BH usage per subscriber (in minutes) = minutes*Twork(TBH/Days);\n", + "Traffic=minutes*Twork*(TBH/Days);\n", + "\n", + "#Result\n", + "print 'Traffic per user per BH is %.4f Erlangs \\n'%(Traffic/60);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Traffic per user per BH is 0.0375 Erlangs \n", + "\n" + ] + } + ], + "prompt_number": 15 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.8, Page 29" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "minutes=500.; #No of minutes used per month per user\n", + "Twork=0.9; #Traffic During Work day\n", + "TBH=0.1; #Traffic during busy hour\n", + "Days=20; #No of workdays in a month\n", + "MeanHT=100; #Mean holding time(in secs)\n", + "\n", + "#Calculations\n", + "#Avg BH usage per subscriber (in minutes) = minutes*Twork(TBH/Days);\n", + "#BHCAs=traf\ufb01c (in Erlangs) *3600/(meanHT)\n", + "\n", + "Traffic=minutes*Twork*(TBH/Days);\n", + "BHCAs=(Traffic/60)*(3600/MeanHT);\n", + "\n", + "#Result\n", + "print 'Average Busy Hour call attempts are %.2f'%BHCAs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Average Busy Hour call attempts are 1.35\n" + ] + } + ], + "prompt_number": 16 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.9, Page 35" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Tpopu=200000;#Total population\n", + "SP=0.25; #subscriber penetration\n", + "HT1=100.; #holding time for Mobile to Land line and vicecersa\n", + "c1=3; #Avg calls/hr for Mobile to Land line and vicecersa\n", + "HT2=80.; #For mobile to mobile\n", + "c2=4; #For mobile to mobile\n", + "TMSC=1800; #traffic one msc can hold\n", + "TrafDist=0.9 #Traffic distribution for Mobile to Land line and vicecersa\n", + "\n", + "#Calculations\n", + "aM_L=c1*HT1/3600; #Traffic Generated by Subscriber (M-L and L-M).\n", + "aM_M=c2*HT2/3600; #Traffic Generated by Subscriber (M-M).\n", + "WlessSub=SP*Tpopu; #total wireless subscribers\n", + "TotalTraffic=WlessSub*TrafDist*aM_L+WlessSub*(1-TrafDist)*aM_M;\n", + "MSCreqd=TotalTraffic/TMSC;\n", + "if(MSCreqd-int(MSCreqd)>0):#for rounding of to next integer ef 2.33 to 3\n", + " MSCreqd=MSCreqd+1;\n", + " \n", + "\n", + "#Result\n", + "print 'Total Traffic is %.1f Erlangs'%TotalTraffic;\n", + "print 'NO of MSCs Required are %d'%(int(MSCreqd))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total Traffic is 4194.4 Erlangs\n", + "NO of MSCs Required are 3\n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.10, Page 37" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Rlines=15000.;#Residential lines\n", + "Blines=80000.;#Business lines\n", + "PWElines=5000;#PBX, WATS, and Foreign Exchange (FX) lines\n", + "CR_R=2.;#Call rates for Rlines\n", + "CR_B=3.;# call rates for Blines\n", + "CR_PWE=10.;#call rates for PWElines\n", + "HT_R=140.;#average holding time for Rlines(sec)\n", + "HT_B=160.;#average holding time for Blines(sec)\n", + "HT_PWE=200.;#average holding time for PWE lines(sec)\n", + "Slines=100000.;# no of lines carried by switch\n", + "HD_ABS=1.5;# HD/ABS for the switch\n", + "\n", + "#Calculations\n", + "percentR_lines=Rlines/Slines;\n", + "percentB_lines=Blines/Slines;\n", + "percentPWE_lines=PWElines/Slines;\n", + "CCSR=CR_R*HT_R/100;\n", + "CCSB=CR_B*HT_B/100;\n", + "CCSPWE=CR_PWE*HT_PWE/100;\n", + "\n", + "CR=CR_R*percentR_lines+CR_B*percentB_lines+CR_PWE*percentPWE_lines;\n", + "print 'The call rate is %.1f calls per line \\n '%CR\n", + "CCS=CCSR*percentR_lines+CCSB*percentB_lines+CCSPWE*percentPWE_lines;\n", + "AvgHTperline=CCS*100/CR;\n", + "ABS_BH_calls=CR*Slines;\n", + "ABS_BH_usage=CCS/36*Slines;\n", + "print 'Design cell capacity based on HD is %d calls \\n'%(HD_ABS*ABS_BH_calls);\n", + "print 'DESIGN Erlangs based on HD is %d \\n'%(round(HD_ABS*ABS_BH_usage)); " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The call rate is 3.2 calls per line \n", + " \n", + "Design cell capacity based on HD is 480000 calls \n", + "\n", + "DESIGN Erlangs based on HD is 21917 \n", + "\n" + ] + } + ], + "prompt_number": 23 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.11, Page 43" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "maxcalls_hour=4000.;#maximum call per hour\n", + "avgHT=160.;#average holding time in sec\n", + "Gos=0.02;\n", + "\n", + "#Calculations&Results\n", + "A=maxcalls_hour*avgHT/3600; #offered load\n", + "print 'Offered load A = %.2f Erlangs \\n'%A\n", + "#Refering Appendix A i.e Erlang B table \n", + "print \"For calculated Offered load and referring Erlang B table we get Service channels as 182 giving 168.3 Erlangs at 2% blocking\"\n", + "#Incorrect answer in textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Offered load A = 177.78 Erlangs \n", + "\n", + "For calculated Offered load and referring Erlang B table we get Service channels as 182 giving 168.3 Erlangs at 2% blocking\n" + ] + } + ], + "prompt_number": 27 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 2.12, Page 43" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "channels=50;\n", + "blocking=0.02;\n", + "HT=120;#average holding time inm sec\n", + "BHcall=1.2;# in calls per hour\n", + "\n", + "#Calculations\n", + "#Refering Erlang B table in appendix A, For 50 channels at 2% blocking, the offered load=40.26 Erlangs.\n", + "A=40.26;\n", + "B=A*(1-0.02); #carried load\n", + "Avgtraffic_user=BHcall*HT/3600;\n", + "No_users=B/Avgtraffic_user;\n", + "\n", + "#Result\n", + "print 'NO of mobile subscribers supported are %d \\n'%(round(No_users))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "NO of mobile subscribers supported are 986 \n", + "\n" + ] + } + ], + "prompt_number": 29 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch21.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch21.ipynb new file mode 100755 index 00000000..8bbb0588 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch21.ipynb @@ -0,0 +1,476 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:0dee4e43707ceeefa5dfd2c385df6788c5d4953bcdfe972a22a90a0c7cd8abc7" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 21: Wireless Local Area Networks" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.1, Page 727" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "import sympy\n", + "from sympy import * \n", + "\n", + "#Variable declaration\n", + "Fl=902; #lower limit frequency MHz\n", + "Fh=928; #higher limit frequency in MHz\n", + "Rt=0.5; #symbol transmission rate in Mega symbols per sec\n", + "S=16; #No of symbols\n", + "BER=10**-5;#Bir error rate\n", + "SG=2.6;#sector gain\n", + "B=0.5; #Interference factor\n", + "a=0.9; #power control efficiency\n", + "\n", + "#Calculations&Results\n", + "BW=Fh-Fl;\n", + "Rb=Rt*math.log(S,2);\n", + "Gp=BW/Rb;\n", + "x = symbols('x')\n", + "y = solve(0.5*(1-erf(sqrt(x)))-10**-5,x)\n", + "M=Gp/y[0] * 1/(1+B) * SG * a;\n", + "print 'Number of users that can be supported by the WLAN are %d'%M\n", + "eff=Rb*int(M)/BW;\n", + "print 'The bandwidth efficiency is %.2f bps/Hz'%eff" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Number of users that can be supported by the WLAN are 2\n", + "The bandwidth efficiency is 0.15 bps/Hz\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.2, Page 733" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Stepsize=200.; #in Hz\n", + "Chipsmin=20.;#length of linear feedback shift register \n", + "Datarate=1.2*10**3; #bps\n", + "\n", + "#Calculations\n", + "No_of_tones=2**Chipsmin;\n", + "Bss=No_of_tones*Stepsize;\n", + "Chiprate=Datarate*Chipsmin;\n", + "Gp=Bss/Datarate;#processing gain\n", + "Symbolrate=Datarate/3; #8-ary FSK is used\n", + "Chips_symbol=Chiprate/Symbolrate;\n", + "\n", + "#Results\n", + "print 'The Hopping Bandwidth is %.3f MHz'%(Bss/10**6);\n", + "print 'The chiprate is %d kchip/sec'%(Chiprate/10**3);\n", + "print 'Chips per symbol are %d'%(Chips_symbol);\n", + "print 'The processing gain is %.1f'%Gp" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Hopping Bandwidth is 209.715 MHz\n", + "The chiprate is 24 kchip/sec\n", + "Chips per symbol are 60\n", + "The processing gain is 174762.7\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.3, Page 734" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "InfoSc=48.;#Information subcarriers\n", + "SyncSc=4.;#synchronization subcarriers\n", + "ReservedSc=12.;#Reserved subcarriers\n", + "Symrate=250.; #ksps(kilosymbols per second)\n", + "BW=20.; #/in MHz\n", + "Grdt=800.; #Guard time in nsec\n", + "\n", + "#Calculations\n", + "TotalSc=InfoSc+SyncSc+ReservedSc;#Total subcarriers\n", + "BW_Sch=BW*10**6/TotalSc;#BW of subchannel\n", + "Mod_eff=Symrate*10**3/(BW_Sch);#Modulation efficiency\n", + "User_txrate=InfoSc*Symrate*10**3;\n", + "User_bitsymbol=4; #16-QPSK is used\n", + "User_DR=36; #Mbps\n", + "Sym_Dur=1./(Symrate*10**3);\n", + "TimeUti=Sym_Dur/(Sym_Dur+(Grdt/10**9));\n", + "\n", + "#Results\n", + "print 'The bandwidth of subchannel is %.1f kHz'%(BW_Sch/10**3);\n", + "print 'Modulation efficiency is %.1f symbols/sec/Hz'%Mod_eff\n", + "print 'User symbol rate is %d Msps'%(User_txrate/10**6);\n", + "print 'Time Utilization efficiency is %.2f'%TimeUti" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The bandwidth of subchannel is 312.5 kHz\n", + "Modulation efficiency is 0.8 symbols/sec/Hz\n", + "User symbol rate is 12 Msps\n", + "Time Utilization efficiency is 0.83\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.4, Page 735" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Eb_No=10; #in dB\n", + "Noise=-120; #in dBm\n", + "Pt=20; #in mwatt\n", + "R=1; #Data rate in Mbps\n", + "CHBW=0.5; #BW in MHz\n", + "A=37.7; #path loss at the \ufb01rst meter in dB\n", + "Y=3.3; #path loss exponent\n", + "Lf=19; #function relating power loss with number of \ufb02oors n (in dB)\n", + "Ls=10; # lognormally distributed random variable representing the shadow effect in dB \n", + "\n", + "#Calculations\n", + "S2Nreqd=Eb_No*R/CHBW;\n", + "Rx_sensi=Noise+S2Nreqd;\n", + "Lp=10*math.log10(20)-Rx_sensi;\n", + "#Lp=A+10Ylod(d)+Lf+Ls;therefore\n", + "d=10**((Lp-A-Lf-Ls)/(10*Y));\n", + "\n", + "#Result\n", + "print 'The coverage of AP is %.1f metres'%d;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The coverage of AP is 25.3 metres\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.5, Page 758" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "R=3./4;#code rate of convolution encoder\n", + "M1=9.; #payload transmission rate in Mbps for mode 1\n", + "M2=36.; #payload transmission rate in Mbps for mode 2\n", + "\n", + "#Calculations&Results\n", + "D1=M1*10**6/48;#user data rate in kbps for mode 1 \n", + "D2=M2*10**6/48;#user data rate in kbps for mode 2 \n", + "#Refering to Table 21.11\n", + "print 'Data transmission rate per carrier with 3/4 convolution encoder are %.1f Kbps and %d Kbps'%(D1/10**3,D2/10**3);\n", + "C1=D1/R;\n", + "C2=D2/R;\n", + "print 'Carrier transmission rate with R=3/4 convolutional encoder are %d Kbps and %d Kbps'%(C1/10**3,C2/10**3);\n", + "print 'Carrier symbol rate with R=3/4 convolutional encoder are %d ksps and %d Ksps'%(C1/10**3,C2/4/10**3); #Mode1 as BPSK and MOde2 as 16-QAM" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Data transmission rate per carrier with 3/4 convolution encoder are 187.5 Kbps and 750 Kbps\n", + "Carrier transmission rate with R=3/4 convolutional encoder are 250 Kbps and 1000 Kbps\n", + "Carrier symbol rate with R=3/4 convolutional encoder are 250 ksps and 250 Ksps\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.6, Page 759" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "R=3./4; #code rate for convolution encoder\n", + "\n", + "#Calculations\n", + "#64-QAM modulation is used\n", + "Sc=250; #Carrier symbol rate(ksps) from Exa 21.5\n", + "Bits_sym=math.log(64,2); #64-QAM is used\n", + "User_R=Bits_sym*Sc*10**3*R*48;\n", + "\n", + "#Result\n", + "print 'The user data rate is %d Mbps'%(User_R/10**6);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The user data rate is 54 Mbps\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.7, Page 762" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "D=1000.*8; #packet size in bits\n", + "R=2.*10**6; #transmission rate in bps\n", + "L=3.; #msec(Dwell time)\n", + "H=0.625; #msec(Duration of BT packet)\n", + "\n", + "#Calculations\n", + "Tw=10**3*D/R; #the packet duration of IEEE 802.11 in msec\n", + "H_L=1.;\n", + "G=(H_L)*L-Tw-H;\n", + "Gm=abs(G);\n", + "PER_FH=1-((1-Gm/L)*(78./79)**(H_L)+Gm/L*(78./79)**((H_L)-G/Gm));\n", + "PER_DS=1-((1-Gm/L)*(57./79)**(H_L)+Gm/L*(57./79)**((H_L)-G/Gm));\n", + "\n", + "#Results\n", + "print 'The PER for FH packet and PER for DS packet are %d percent & %.2f percent respectively'%(round(PER_FH*100),PER_DS*100);\n", + "print \"The collision probability with 802.11 DS is much higher than with 802.11 FH.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The PER for FH packet and PER for DS packet are 2 percent & 38.73 percent respectively\n", + "The collision probability with 802.11 DS is much higher than with 802.11 FH.\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.8, Page 765" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "d=10; # distance between AP and IEEE 802.11 device in metres\n", + "Y=4; #path loss exponent\n", + "PBt=20; #the transmitted power by the BT in dBm\n", + "PAp=40; #the transmitted power by the AP in dBm\n", + "Pe=10**-5;#acceptable error probability\n", + "\n", + "#Calculations\n", + "#Pe=0.5*e**(-0.5*Eb/No)\n", + "SIR=math.log(Pe/0.5)/(-0.5);# signal-to-interference ratio \n", + "rmax=d*(SIR*PBt/PAp)**(1./Y);# range of interference between Bluetooth and 802.11 device \n", + "\n", + "#Results\n", + "print 'Minimum SIR is %.2f dB = %.1f'%(10*math.log10(SIR),SIR);\n", + "print 'Maximum coverage range is %.2f metres'%rmax;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum SIR is 13.35 dB = 21.6\n", + "Maximum coverage range is 18.14 metres\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.9, Page 765" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "SIRmin=21.6; #From eg 21.8 i.e(13.36 dB)\n", + "d=10; #distance between AP and IEEE 802.11 device in m\n", + "PMs=40; # transmitted power of the IEEE 802.11 device in dBm\n", + "PBt=20; #the transmitted power by the BT in dBm\n", + "Y=4 ; #path loss exponent\n", + "\n", + "#Calculations\n", + "rmax=d*(SIRmin*PMs/PBt)**(1./Y);\n", + "\n", + "#Result\n", + "print 'Maximum coverage range is %.1f metres'%rmax" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum coverage range is 25.6 metres\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 21.10, Page 765" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Gp=11;#processing gain(given)\n", + "#Defining variables from Exa 21.8 & 21.9\n", + "PBt=20; # transmitted power by the BT in dBm\n", + "PMs=40; # transmitted power of the IEEE 802.11 device in dBm\n", + "PAp=40; # transmitted power by the AP in dBm\n", + "d=10; # distance between AP and IEEE 802.11 device in m\n", + "Y=4; #path loss exponent\n", + "Pe=10**-5;#Error probability\n", + "\n", + "#Calculations&Results\n", + "#Pe=0.5*e**(-0.5*Eb/No)\n", + "SIR=math.log(Pe/0.5)/(-0.5);\n", + "r1max=d*(SIR*PBt/(PAp*Gp))**(1./Y);# range of interference between Bluetooth and 802.11 device \n", + "print 'Maximum coverage range for IEEE 802.11 DS is %.2f metres'%r1max\n", + "r2max=d*(SIR*PMs/(PBt*Gp))**(1./Y);\n", + "print 'Maximum coverage range for IEEE 802.11 FH is %.2f metres'%r2max;\n", + "print \"Thus, the interference ranges are smaller for the IEEE 802.11 DS device than the IEEE 802.11 FH device.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Maximum coverage range for IEEE 802.11 DS is 9.96 metres\n", + "Maximum coverage range for IEEE 802.11 FH is 14.08 metres\n", + "Thus, the interference ranges are smaller for the IEEE 802.11 DS device than the IEEE 802.11 FH device.\n" + ] + } + ], + "prompt_number": 11 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch3.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch3.ipynb new file mode 100755 index 00000000..40f3b8ea --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch3.ipynb @@ -0,0 +1,543 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f32dec82dcc091d4a1d388fd0afce868d4917308e897fe0d3ace9d832db79571" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3: Radio Propagation and Propagation Path-Loss Models" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1, Page 51" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "hb=100; #in feets(height of BS antenna)\n", + "hm=5; # in feets(height of mobile antenna)\n", + "f=881.52;#in MHz\n", + "lamda=1.116; #in feet\n", + "d=5000; #in feet\n", + "Gb=10**0.8; #8dB(BS antenna gain)\n", + "Gm=10**0; # 0dB (Mobile antenna gain)\n", + "\n", + "#Calculations&Results\n", + "free_atten=(4*math.pi*d/lamda)**2*(Gb*Gm)**-1;\n", + "y=round(10*math.log10(free_atten));\n", + "print 'Free space attenuation is %d dB \\n'%y\n", + "reflect_atten= (d**4/(hb*hm)**2)*(Gb*Gm)**-1;\n", + "x=round(10*math.log10(reflect_atten));\n", + "print 'Reflecting surface attenuation is %d dB \\n '%x" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Free space attenuation is 87 dB \n", + "\n", + "Reflecting surface attenuation is 86 dB \n", + " \n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2, Page 52" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "d=8000; #Distance between base station and mobile station\n", + "f=1.5*10**9;#in Hz \n", + "lamda=0.2; #in metres\n", + "Pt=10; #BS transmitted power in watts\n", + "Lo=8; #Total system losses in dB\n", + "Nf=5; #Mobile receiver noise figure in dB\n", + "T=290; #temperature in degree kelvin\n", + "BW=1.25*10**6; #in Hz\n", + "Gb=8; #in dB\n", + "Gm=0; #in dB\n", + "Hb=30; #in metres\n", + "Hm=3.; #in metres\n", + "B=1.38*10**-23; #Boltzmann's constant\n", + "\n", + "#Calculations&Results\n", + "Free_Lp=20*math.log10(Hm*Hb/d**2);\n", + "Pr=Free_Lp-Lo+Gm+Gb+Pt; #in dBW\n", + "Te=T*(3.162-1);\n", + "Pn=B*(Te+T)*BW;\n", + "print 'Received signal power is %d dBW \\n'%(10*math.log10(Pn))\n", + "SNR=Pr-10*math.log10(Pn);\n", + "print 'SNR ratio is %d dB \\n'%(round(SNR))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Received signal power is -138 dBW \n", + "\n", + "SNR ratio is 31 dB \n", + "\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3, Page 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "d=3*1000;#in metres\n", + "Y=4;# path loss exponent\n", + "Pt=4; #Transmitted power in watts\n", + "f=1800*10**6;#in Hz\n", + "Shadow=10.5; #in dB\n", + "d0=100.;#in metres\n", + "P0=-32; #in dBm\n", + "\n", + "#Calculations&Results\n", + "print \"Using equation 3.11 and including shadow effect we get\"\n", + "Pr=P0+10*Y*math.log10(d0/d)+Shadow;\n", + "print 'Received power is %.1f dBm \\n'%Pr\n", + "path_loss=10*math.log10(Pt*1000)-Pr;\n", + "print 'Allowable path loss is %.1f dB \\n'%path_loss" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Using equation 3.11 and including shadow effect we get\n", + "Received power is -80.6 dBm \n", + "\n", + "Allowable path loss is 116.6 dB \n", + "\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4, Page 58" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "shadow=10.; #in dB\n", + "Lp=150; #in dB\n", + "\n", + "#Calculations&Results\n", + "print \"Using equation given in Problem i.e Lp=133.2+40*math.log(d) we get,\"\n", + "d=10**((Lp-10-133.2)/40);\n", + "print \"Separation between transmitter and receiver as %.2f km\"%d" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Using equation given in Problem i.e Lp=133.2+40*math.log(d) we get,\n", + "Separation between transmitter and receiver as 1.48 km\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.5, Page 61" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "v=60*0.44704; #.. mph to mps\n", + "fc=860*10**6;#in Hz\n", + "td=2*10**-6; #RMS delay spread in sec\n", + "c=3.*10**8;# speed of light in m/sec\n", + "Rs=19200.; #Coded symbol rate in bps\n", + "\n", + "#Calculations&Results\n", + "lamda=c/fc;\n", + "fm=v/lamda; #Maximum doppler shift\n", + "tc=1/(2*math.pi*fm);#Channel coherence time\n", + "print 'Channel coherence time is %.4f sec \\n'%tc\n", + "ts=1/Rs; #symbol interval\n", + "print 'Symbol interval is %d microsec \\n'%(ts*10**6);\n", + "print \"As the symbol interval is much smaller compared to the channel coherence time. So, Symbol distortion is minimal and fading is slow.\";\n", + "print \"\";\n", + "Bc=1/(2*math.pi*td);\n", + "print 'Coherence Bandwidth is %.2f kHz \\n'%(Bc/1000)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Channel coherence time is 0.0021 sec \n", + "\n", + "Symbol interval is 52 microsec \n", + "\n", + "As the symbol interval is much smaller compared to the channel coherence time. So, Symbol distortion is minimal and fading is slow.\n", + "\n", + "Coherence Bandwidth is 79.58 kHz \n", + "\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.6, Page 65" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "p=1;# re\ufb02ection coef\ufb01cient of ground \n", + "c=3.*10**8;# velocity of light in free space(m/sec)\n", + "e=2.71828;#Euler's number\n", + "fm=20; #in Hz\n", + "fc=900*10**6; #carrier frequency in Hz\n", + "\n", + "#Calculations&Results\n", + "Nr=math.sqrt(2*math.pi)*fm*p*e**-(p**2);\n", + "print 'NO of fades per second are %.2f \\n'%Nr\n", + "Afd=e**-(p**2)/(p*fm*math.sqrt(2*math.pi));\n", + "print 'Average fade duration is %.4f sec \\n '%Afd\n", + "v=fm*c/fc;\n", + "print 'Maximum velocity of mobile is %.2f m/sec = %d Km/hour \\n'%(v,v*18/5);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "NO of fades per second are 18.44 \n", + "\n", + "Average fade duration is 0.0073 sec \n", + " \n", + "Maximum velocity of mobile is 6.67 m/sec = 24 Km/hour \n", + "\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.7, Page 70" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "import matplotlib\n", + "import matplotlib.pyplot as plt\n", + "import numpy as np\n", + "%matplotlib inline\n", + "\n", + "#Variable declaration\n", + "d=np.array([1, 2, 3, 4, 5]); #in km\n", + "hb=30; #Height of BS antenna in metres\n", + "hm=2;# height of mobile antenna in matres\n", + "fc=900;#carrier frequency in MHz\n", + "W=15; #street width(m)\n", + "b=30; # distance between building along radio path (m) \n", + "phi=90; # incident angle relative to the street\n", + "hr=30; #in m\n", + "\n", + "#Calculations\n", + "dellhm=hr-hm;\n", + "#L50=Lf+Lrts+Lms\n", + "\n", + "# By COST 231 model\n", + "Lf=32.4+20*np.log10(d)+20*np.log10(fc);\n", + "L0=4-0.114*(phi-55);\n", + "Lrts=-16.9-10*math.log10(W)+10*math.log10(fc)+20*math.log10(dellhm)+L0;\n", + "Lbsh=-18*math.log10(11);\n", + "ka=54-0.8*hb;\n", + "dellhb=hb-hr;\n", + "kd=18-15*dellhb/dellhm;\n", + "kf=4+0.7*(fc/925-1);\n", + "Lms=Lbsh+ka+kd*np.log10(d)+kf*np.log10(fc)-9*np.log10(b);\n", + "L50=np.array([0, 0, 0, 0, 0])\n", + "L50=Lf+Lrts+Lms;\n", + "\n", + "#Okumura/Hata model\n", + "ahm=(1.1*math.log10(fc)-0.7)*hm-(1.56*math.log10(fc)-0.8);\n", + "L_50=69.55+26.16*np.log10(fc)+(44.9-6.55*np.log10(hb))*np.log10(d)-13.82*np.log10(hb)-ahm;\n", + "L_50 = np.array(L_50)\n", + "\n", + "#Results\n", + "fig,ax1 = plt.subplots()\n", + "ax1.plot(d,L_50,'b-')\n", + "ax1.set_xlabel('Distance from transmitter(in km)')\n", + "ax1.set_ylabel('Path loss (in dB)')\n", + "ax2 = ax1.twinx()\n", + "ax2.plot(d,L50,'r')\n", + "ax1.legend(['COST 231 model'],loc=0)\n", + "ax2.legend(['HATA model'],loc=0)\n", + "ax1.grid()\n", + "plt.show()\n", + "print \"L50 values by Cost 231 model\"\n", + "print '%.2f %.2f %.2f %.2f %.2f \\n '%(L50[0],L50[1],L50[2],L50[3],L50[4]);\n", + "print \"L50 values bu Okumura/Hata model\"\n", + "print '%.2f %.2f %.2f %.2f %.2f \\n '%(L_50[0],L_50[1],L_50[2],L_50[3],L_50[4]);\n", + "print \"The results from the plot of two models shows that the calculated path loss with the COST 231 model is higher than the value obtained by the Okumura/Hata model.\"\n", + "\n", + "#Answers vary due to built-in functions of Python used" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "metadata": {}, + "output_type": "display_data", + "png": "iVBORw0KGgoAAAANSUhEUgAAAZYAAAEPCAYAAABhkeIdAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJztnXd4VNXWh1+KNCkJUqRHBMEGiIUugU+6AlIEFDTCBTWK\nCl4LKk1RAQW8oIgiCAQBQZCO9NAE6R1pCtJ7h0DK+f5YZ5LJZGYyCdNOst7nOU9OP7/sTM6avdbe\na4GiKIqiKIqiKIqiKIqiKIqiKIqiKIqiKIqiKIqiKIqiKIrfGQucAnbY7esHHAW2mEsTu2O9gP3A\nX0BD/0hUFEXJlDh7PwN0B/YAO4FBdvuD5v1cB3iE5ML7Aj2dnPsAsBW4AwgDDgBZfaxPURQls+Ls\n/VwPWIy8hwEKmz/T/H725ct7FXDByf4sTva1ACYDscAhRPgTPlOmKIqSuXH2fn4N+AJ5DwOcMX+m\n+f0ciF5Bd2AbMAYIMfcVR1xkNo4CJfysS1EUJTNTHngSWAdEA4+Z+9P8fva3YfkOuAeoApwAhrg5\n1/CLIkVRFAUgOxAKVAfeBaa6Odft+zm7F0V5wmm79R+BOeb6MaCU3bGS5r5kFC9e3Dh+/Ljv1CmK\nomRMDgLlUjnnKDDDXN8AJACF8PD9bI+/eyzF7NafJSlwNBtoD+RAejTlgfWOFx8/fhzDMIJ+6du3\nb8A1qE7VqTpV4+nTBsOHGwD3evB+ngnUN9fvM9/HZz19P9vjyx7LZKAuYvGOICPCwhE3mAH8A7xi\nnrsb6XbtBuKASCzsCjt06FCgJXiE6vQuqtO7WEFnMGqMiYHZsyEqClatgqefdnqa7f18F/J+7oMM\nQR6LfOG/Bbxonpvm97MvDUsHJ/vGujn/c3NRFEVR0kBCAqxeLcZk+nR49FHo1AkmT4a8eeHnn1Nc\n4uz9DNDJxf40vZ/9HWPJFERERARagkeoTu+iOr2LFXQGWuPevWJMJk6EfPnEmGzfDiVLBlSW0zkl\nwYxhGJb1kCmKotw2Z8/ClCliUP79F55/XgxK5cqQxcUbPYscsNr73m8YzggNDTUQn58uuqRpCQ0N\ndfqZSg/Lly/32r18iTOd+j+UMRZXn2fzuN/IEK6wCxcuYGhPRkkHWVx9xctk6P9QxiBYPs/BocJz\nDGcf/ixZsug/hZIu9LMjaDtkDFz9Hf3tCtNEj4qiKIpXUcOiKF4iOjo60BI8wio6FeuihkWxLOPG\njaNOnToenRsREUHv3r19rEhR0k9aPqNhYWEsXbrUx4rSjxoWPzFp0iQee+wx8uXLR/HixWnatClr\n1qxJPL57926aN29OSEgI+fPnp379+qxduzbZPcaMGcP9999P/vz5ufvuu2nWrBlXr16lSZMm5MuX\nj3z58pEjRw5y5syZuB0ZGZlCy7x586hduzahoaEUK1aMrl27cvXq1cTj7733HqVLlyZ//vyULFmS\nnj17EhcXl3i8W7duVKxYkWzZsjF+/HgftJb3yZIli88Dm+Hh4T69v7ewik4bzl6irr5UhIeHU7Bg\nQWJjJfP7q6++mvi/kDNnTnLkyJG43axZMwAMw6Bs2bI8+OCDvv9l3JCWz6g/Ps+3gxoWPzB06FB6\n9OjBxx9/zOnTpzly5Aivv/46s2fPBuDgwYPUqlWLypUrc+jQIU6cOMGzzz5Lw4YNWbduHQArVqzg\no48+YsqUKVy+fJk9e/bQvn17ABYsWMCVK1e4cuUKL7zwAu+//37i9siRI1PouXz5Mn369OHEiRPs\n2bOHY8eO8e677yYe79KlC7t37+by5cusX7+eRYsW8eOPPyYer1KlCiNHjqRq1apB/eF2RIPT1sTT\nl+ihQ4dYv349RYoUYdasWQCMGjUq8X/hww8/pH379onb8+bNA2DlypXcvHmTM2fOsHHjRp/+LqmR\nUT6jalh8zKVLl+jbty8jR46kZcuW5M6dm2zZstGsWTMGDZLKn/369aNWrVp8+umnhISEcOedd9K9\ne3c6derE+++/D8CGDRuoUaMGlStXBiA0NJROnTqRN2/eFM9M7cPZoUMHGjZsSK5cuQgJCaFr167J\nek8VKlRIvK9hGGTNmpVixZLyh0ZGRlK/fn1y5cqV6u8fERFBZGQkTZs2JV++fNSpU4eTJ0/y1ltv\nERoayv3338/WrVsTz9+zZw/h4eGEhoby0EMPMWfOnMRj586do3nz5hQoUIBq1apx8ODBZM/666+/\naNCgAXfddRcVK1Zk2rRpqerzJlaJXVhFpzucGZoJEybw1FNP0alTJ6c9acNMzOjI+PHjad26NS1a\ntEi1Bx4WFsZXX31FpUqVyJcvH126dOHUqVM0adKEAgUK0KBBAy5evJh4/uzZs3nwwQcJDQ2lXr16\n/PXXX4nHtmzZQtWqVcmfPz/t27cnJiYm2bPmzp1LlSpVCA0NpVatWuzY4VhFOHhRw+Jj1q5dS0xM\nDM8++6zLc5YsWULbtm1T7G/bti1r1qzh5s2bVK9enYULF9KvX7/Efd5ixYoVPPTQQ8n2DRw4kHz5\n8lGqVCmefvppWrRoke77T5s2jc8++4yzZ8+SI0cOqlevzuOPP8758+dp06YNPXtKterY2FieeeYZ\nGjduzJkzZxgxYgQvvPAC+/btA+D1118nT548nDx5krFjx/LTTz8lvmCuXbtGgwYN6NixI2fOnGHK\nlClERkayZ8+edOtWggdHg+DMQEyYMIF27drx3HPPsXDhQk6fPp3iHEeuX7/O9OnTE6+bMmVKohvN\nGVmyZGHGjBksXbqUvXv3MnfuXJo0acLAgQM5ffo0CQkJDB8+HIB9+/bx/PPPM3z4cM6ePUvTpk15\n5plniIuL49atW7Rs2ZKXXnqJCxcu0LZtW6ZPn574ed6yZQtdunRh9OjRnD9/nldeeYXmzZu71aak\nH5ezSlMDvLOklYkTJxp3332323OyZ89uLFy4MMX+PXv2GFmyZDGOHz9uGIZhLFiwwHjmmWeMkJAQ\nI2/evEbPnj2N+Pj4ZNdEREQYH3/8scf6Fi1aZISGhhr79+93enzz5s1G6dKljenTp6c4Vrt2bWP8\n+PFu7x8REWF069YtcXvEiBHGAw88kLi9fft2IyQkxDAMw1i5cmWKturQoYPRr18/Iy4uzrjjjjuM\nvXv3Jh778MMPjdq1axuGYRhTpkwx6tSpk+zabt26Gf3790/U4axdPPnsZAZSbYdA/QMZhlGmTBkj\nb968RkhISOKSJ0+eZH/vVatWGbly5TIuX75sGIZhVK5c2Rg2bFiy+/Tt29fo2LFjsn1RUVFGyZIl\nDcMwjLi4OKNQoULGb7/95lJLWFiYMWnSpMTt1q1bG5GRkYnbI0aMMFq2bGkYhmF88sknRrt27RKP\nJSQkGCVKlDCio6ONFStWGMWLF09275o1axq9e/c2DMMwXn311cR1GxUqVDBWrlyZqGPp0qUp9Ll7\nR/rzRZ1peize+s9IK3fddRdnz54lISHB5TmFChXCWQGzEydOkDVrVkJDQwFo3Lgxs2fP5sKFC8ya\nNYtx48Yli32klXXr1vHCCy8wffp0ypVzXgPokUceITIykqioqHQ/p0iRIonruXLlSradO3fuxIED\nx48fp1SpUsmuLVOmDMePH+fs2bPExcUlO166dOnE9cOHD/Pnn38SGhqauEyaNIlTp06lW7diR6D+\ngZBewqxZs7hw4ULiMnLkyGS9lvHjx9OwYUPy5csHSG/fk4El48ePp1WrVgBky5aNli1bpnpd0aJF\nE9dz586dbDtXrlzJPs/2n9EsWbJQqlQpjh07xokTJyhRInl13zJlyiSuHz58mCFDhiT7PB89etTp\neyIYyRApXYKZGjVqkDNnTn777Tdat27t9JynnnqKadOmpciUOnXqVGrWrOk0llG/fn3q16/Prl27\n0qVry5YttGjRgnHjxlGvXj2358bGxnLnnXem6zlpoXjx4hw5cgTDMBJdAocPH6ZixYoULlyY7Nmz\n8++//1KhQgUA/v3338RrS5cuTd26dVm0aJHPdboiOjraEiOurKLTHfZG5caNG0ydOpWEhITEWODN\nmze5ePEi27dvp1KlSkDKuMzRo0dZtmwZGzZsYOpUqcJ7/fp1YmJiOHfuHHfddVeatdhTokSJZHER\nwzA4cuQIJc3Uw8eOJS/CePjw4cQveKVLl+ajjz7iww8/9EhDsJFpeiyBokCBAnzyySe8/vrrzJo1\ni+vXrxMbG8uCBQsSA/N9+/bljz/+4OOPP+bChQtcuXKFESNGEBUVlRjgnz17Nr/88ktiTqf169ez\nYsUKqlevnux5rj7k9uzcuZPGjRvzzTff0LRp0xTXf//991y8eDHxOSNHjkz8VgdiaGJiYkhISODW\nrVvExMS4fK4nemxUq1aNPHnyMHjwYGJjY4mOjmbu3Lm0b9+erFmz0qpVK/r168eNGzfYvXs348eP\nT3xZNGvWjH379jFx4kRiY2OJjY1lw4YNicHStOhQrMXMmTPJnj07e/bsYdu2bWzbto09e/ZQp04d\nJkyYkHie42cgKiqKihUrsm/fvsTr9u3bR8mSJZk8efJt62rbti3z5s1j2bJlxMbGMmTIEHLlykXN\nmjWpXr062bNnZ/jw4cTGxjJjxgw2bNiQeG3Xrl0ZNWoU69evxzAMrl27xrx585JNCwhm1LD4gZ49\nezJ06FAGDBhAkSJFKF26NCNHjkwM6JcrV47Vq1ezbds2wsLCKF68OL/99huLFi2iRo0agIwCGz16\nNPfddx8FChSgU6dOvPfee3TokLxejydDM4cOHcq5c+fo3Llz4pj+hx9+GJB/vpkzZ3LvvfdSoEAB\nunTpwoABA5IZlgYNGpAnTx7WrVtHt27dyJMnD6tWrXL6LEc9zvTZtnPkyMGcOXNYsGABhQsX5o03\n3iAqKor77rsPgG+++YarV69y991307lzZzp37px4j3z58rFo0SKmTJlCiRIlKFasGL169eLWrVse\nt8vtYpVegFV0usP+7zlhwgQ6d+5MyZIlKVKkCEWKFKFo0aK88cYbTJo0KdEN7fgZmDBhApGRkYnX\n2K579dVXkxkkT7Q401WhQgUmTpxI9+7dKVy4MPPmzWPOnDlkz56dHDlyMGPGDMaNG8ddd93F1KlT\nk3k0Hn30UUaPHs0bb7xBwYIFKV++PBMmTLDM8H5rqEzCcPbNUxPoKelFPzuCtkPGQJNQKkoGwyrz\nQ6yiU7EualgURVEUr6KuMCVTo58dQdshY6CuMEVRFCVDooZFUbyEVWIXVtGpWBc1LIqiKBmRK1dg\n1ix47TVnR8cCpwD7zJb9gKPAFnNpbO4PA27Y7U+ZMt2BDDHzPjQ01DLju5XgwpYuxxtYZX6IM536\nP5QxCC1QAAYNgt9/h40boXp1aNTI2ak/ASMA+wk7BjDUXBw5ADziqY4MYVjOnz8faAmKYmms8D90\n6RJMmwZRUbB7Nzz3HHTqBNWqQaa1iefOweLFYkgWLoS8eeHoUfjvfyE8HGypmOzqLZmsQnoijnil\nJdUV5gOs4sNWnd5FdXqX6OhoYmNh7lxo1w7KlIEFC6BHDzh2DL79Vr6QB9Ko+L0t4+Nh7Vro21cs\natmyMGkSPPEErF4N+/fDiBHQrFmSUUkb3YFtwBggxG7/PYgbLBqondpNMkSPRVGUjMXmzfJ+bNcO\nypWDF1+E776DggUDrSwAHD8uvZHff4clS6BkSWjcGL74AmrVgpw5U1wSHR2dHqP3HfCJuf4pMATo\nAhwHSgEXgKrATOBB4IqrG1mtA+l0HouiKNbHMOT9OXAgHDoEL78MHTvCvfcGWpmfuXkT1qwRQ/L7\n7+LaatBAjEnDhuCQbt8TXMxjCQPmAA87ucTdseXAO8BmV8/THouiKAElLg5+/VUMSnw8fPCB9FSy\nZ6a308GDSXGSFSvg/vvFkHz/PTz+uL8aoxhwwlx/lqQRY4WQ3ko8UBYoD/zt7kYaY/EBVvJhWwHV\n6V2CRWdMjLw3K1SQeMlnn8H27fDCC/IeDRad7ki3xmvXYN486N4dypeH2rVhwwZ4/nn4+29Ytw76\n9YMaNXxlVCYDfwAVgCNAZ2AQsB2JsdQFepjnPmnu2wJMA14BLrq7eWb6TqAoShBw6RKMGgVffw2P\nPgrjx8t7NUNjGLBrV5J7688/4bHHpFfy669QqZK/RyF0cLJvrItzZ5iLx2iMRVEUv3DyJPzvf/DD\nD9CkCbz3nrxPMywXLsDSpUnG5I475Bdv3Bjq1QOzjLI/8HeuMO2xKIriU/7+G776CqZMEU/Pxo1w\nzz2BVuUDEhJg06YkQ7J9O9SpI4bkvffE5ZVJJtxojMUHWME3DKrT26jO5GzbJobkiScgNBT++gu+\n+cZzo2KF9vxjxgyYMEECQ0WLQkQEXLwo8ZEzZ2D+fHjzTbjvvkxjVEB7LIqieBHDkHl6AwfCli0y\nmXHUKMifP9DKvERsrExQNHslj+/fLylTGjWSeSWlSwdaYVDgSxM6FmgGnCblWOh3gC+RYWznkTHT\ne4C/zONrgUgn99QYi6IEIQkJMshp4EA4fVo8P506Qa5cgVbmBQ4dSpqguHy5zNhs3FiWatUkdhLk\nZKQYi7MkZyAzOBsAhx32pynJmaIogSc2VmIngwZBjhwyB6V1a8iWLdDKboMbN2Quic2YnDsnPZI2\nbWR8dJEigVYY9PgyxrIKmVTjyFDgPR8+N+BYwTcMqtPbZCad169LvKR8efjpJxg6VOLWzz3nPaPi\nt/Y0DAkAff219EKKFIHPP4dChWDiRBnOFhUlcRQHo2KVv7m/8XeMpQWS73+7k2O2JGeXgI+B1X7U\npSiKB1y4IJMZR4yAmjWlt1K9eqBVpYPLl5OGAi9cKL68xo2hWzf45RcoUCDQCi2NPw1LHuBDxA1m\nw+bz8zjJWUREBGFhYQCEhIRQpUqVxPoStm8Puu3Ztm1fsOix+rZtX7Do8eb28ePQo0c08+dDmzbh\nREfDqVPRxMQA+Ob5tn1euV9CAhvHjKHg+vWU3bcPNm/mfMWKnH/8ccrNnw/330/0ihVyvmlUPL2/\nvVZv/v6+aE9/4etgThhJicweBpYA181jJYFjwBNIgN8eV0nONHivKH5k3z748kuYPh1eegl69oRS\npQKtykPOnEleqyQkJCnoXrcu5MkTaIV+w9/Be3/OY9kBFEVcXvcgLrGqiFEpBNg8sx4lOQtmHL/J\nBCuq07tkJJ2bNkHbtpKVvUQJMTDDhvnXqKS5PePiJCtwnz4yeaZcOZg6VXx269bB3r0y9b9JE68Z\nFav8zf2NL11hk5FEZnchSc76ICPFbNh3PZ5E6gDEAgl4kORMURTvYhgymvaLLySW/c47EpjPmzfQ\nytxw9GjS6K2lS6UaWKNGMHiwGJQcOQKtMFNitamg6gpTFC+TkAAzZ8oclCtX4P33ZcZ8UL6Tb96E\nVauS3FsnTiSvVVKsWKAVBiX+doWpYVGUTMqtWzKadvBgmRnfqxe0aAFZgy3R04EDSfm3Vq6Ehx4S\nQ9KokWQItvSkGf+QkWMsmQar+F1Vp3exis4FC6IZNkwqM/7yi5T8/fNPePbZIDEqt27B3Lkca9lS\nRD75pNQqfvFFmQX/xx8SR6lWLeBGxSp/c3+jucIUJZNw9qzMP/n6a/myP2sWVK0aaFUmhiE5uCZO\nlID7/fcT8+CD8Omn0kPJRAkcMwJW+2upK0xR0si//8rM+AkTJCvJu+/KjPmgYP9++PlnMSjZs0uC\nsRdeAHOumuIdMlKuMEVRAsju3RI/mTMHunSBnTuhePFAq0K6Tr/8Isbk77+hQweZwv/oo9ozySAE\ng0c1w2EVv6vq9C7BonPdOmjZUooUli8vse/Bg5OMSkB0xsTAtGnQvLnML1mzBnr3luHCX38tQXgH\noxIs7ekOK2gMBNpjUZQMgGHAokUyZPiff8TdNWlSgCeXJyTI0OCoKJgxQwI6nTpJTyXDFGhRnGG1\nfqfGWBTFjvh4+PVXMSixsZK2vl27AJcI2bNHjMnPP0syx06dxN1VsmQARWVuNMaiKEqqxMTA+PGS\nx6toURk81bRpAIcLnzwpcZKoKFl//nkJ7lSqFCBBSiDRGIsPsIrfVXV6F3/ovHxZ4iVly8p7e9w4\nCVc8/bTnRsVrOq9dE39bkyZQsaLUIh40SIahffnlbRsVK/zdraAxEKhhURQLcOoUfPihGJRt22QS\n+ty5ULu2n4XEx8OSJZLquGRJ6aF06gTHjkkX6qmnAj5pUfGIscApJDmwjX5IcuAt5tLE7lgvYD9S\nPr5hajfXGIuiBDH//CNf/qdMkTDFO++IcfE727ZJ0H3SJMnH1bEjtG8Pd98dADFKWnESY6kDXEVK\nxz9s7uuL1MAa6nD5A8Ak4HGgBFL+5D4kYbBTNMaiKEHI9u3iVVq4EF55ReLhRYv6WcTRo2JIJk6E\nS5dk4uLixfDAA34WoviAVUi9LEecdTZaINnqY4FDwAGkjtY6VzdXV5gPsIrfVXV6F2/oXLUKmjWT\nHIuVK8PBg/DZZ941Km51XrkigZunnpIYyf79kgfmn3+kDrwfjYoV/u5W0JhGugPbgDFAiLmvOOIi\ns3EU6bm4RHssihJgEhJg/nwZMnzyJLz3nlRszJXLTwLi4mQSzMSJIqRuXekmPfOMH0Uo3iQ6Ojo9\nRu87pC4WwKfAEKCLi3PdxiQ0xqIoASI2VjKbDBokabI++EByefkl9m0YUiYyKkoCOGXLShD+ueeg\nUCE/CFD8iYt5LGEklY53xP7YB+a+gebP35F4zJ+unqc9FkXxM9evw9ix8NVXcM898rNhQz+lyTp0\nKCnpY2ysBOFXrw6irJRKACkGnDDXnyVpxNhsJHg/FHGBlQfWu7uRxlh8gFX8rqrTu6Sm88IFiZeU\nLStVdKdMkVLAjRr52KhcvAijR0tdk8ce49j69WLZ9u+Hfv2C1qhY4e9uBY0umAz8AVRASsd3BgYB\n25EYS12gh3nubmCq+XMBEEkqrjDtsSiKjzl+HIYNk3f5M8/AsmV+iIHfugULFoira/FiKd/7zjvQ\npAn7//iDEjVq+FiAEuR0cLJvrJvzPzcXj9AYi6L4iP37ZQ7Kr79K8cOePaF0aR8+0LFY1gMPSNyk\nTRsIDfXhg5VgR3OFKYrF2bRJAvLLl0NkJOzb5+N4uLNiWRs3arEsJWBojMUHWMXvqjq9h2HAsGHR\nNGwILVpAjRoy9aN/fx8ZlbNn4dtv5UG1a0scZcoUmUn50UdujYoV2hOsodMKGgOB9lgU5TbZvx+6\ndpViiP37ywT1HDl88KCYGMk8GRUFK1bITMrevSV+EtA8+YqSnLT43HIhIwFu+kiLJ2iMRQka4uPh\nf/+TCem9e8Mbb/hgDoqzYlkdO0KrVlosS/GYYIqxZAVaIqMHaprbWYB4YC3wMzCTVIadKUpG5K+/\noHNn6SisWyfVdr2Ks2JZ27drsSzFEriLsUQDjwJfAWWRyTN3m+tfIZkuV/hYnyWxit9VdaaduDip\nh1K7tri8li9PMiq3rfPkSan//uijkqsrNlZcX9u3S61hLxmVYGpPd1hBpxU0BgJ3PZYGOHd73USy\nWq4DcvpClKIEI7t2wcsvQ758sGGDzJq/ba5dg1mzpHeydq1E/gcNgnr1tK6JYlnS4nO7E7gfOAyc\n8Y2cVNEYi+J34uJkPsrQoTBgAHTrdpsz5ePjpasTFQWzZ0P16uLqatEC7rzTa7oVxUYwxViaA8OB\n88DHwLdIxbF7gPeBcb4WpyiBZscO6aUULChTQ8qUuY2bOSuWNWiQFstSMhzuYiwDkBKUrwDTgP8D\nqiPZLv/re2nWxSp+V9XpmthY+PRTqF8fXn1VCm6lZlSc6jx6VIIylSpB8+YS7V+8WKzU228HxKjo\n3917WEFjIHDXY4kH9pnrf5sLwGmkkpiiZEi2bpVeSrFisHkzlCqVxhtcuSIFVSZOlBu0aiXFsurU\ngaw6J1nJ+LjzuW0Hws1zlpvr2G1X8qUwF2iMRfEZt25J9uHvvpNOxksvpSGW4qxYVseOWixLCQqC\nKcaSH9hkrmexW1eUDMemTdJLKVNGeizFi3t4YWyslPIdMEC6OJ06wfDhWixLydS465eHIYH6exzW\nbYviAqv4XVUn3LwpqbWaNpWSwLNne2hU4uLEoFSoIJmEp0wheuBAeP31oDcq+nf3HlbQGAjc9Viq\npnLtZm8KURR/s3699FLuu08GbHkUR4+Pl2SP/fuLBRo3TgpoAehLRlEA9z63aCRdS25kBv52c38l\nYCOQWqWgsUAzJNjvWFP5HeBLoBAynBmgF1LFLB54E1jk5J4aY1Fum5gY6NsXxo+Xie7t2nkQS0lI\nkIB8v36SYsU2ZMwv9YQV5fYIphhLuPlzBtCVpPrHDwH9Pbj3T8AIYILD/lLIrP7DdvseANqZP0sA\nS4D7gAQPnqMoHrN2rfRSKlWSTClFiqRygWHAzJliiXLlgiFD/FBLWFGsjSdjHyuSZFQAdiIz8FNj\nFXDByf6hwHsO+1ogNZhjgUPAAeAJD54RlFjF75qZdF6/LpV5W7WSOPvUqakYFcOAuXMlb9cnn8hw\nsT//hMaNXRqVzNSe/sAKOq2gMRB4Uo9lO/AjMBHpSj0PbEvn81oAR0lyq9kojuQes3EU6bkoym2z\nahV06SI2YseOVGLrhiHDhvv0EWvUvz+0bKnzTxQlDXjSn88NvAbUMbdXAt8BMR5cGwbMQWIseZD5\nLw2Ay8A/wGPAOcRltg5JxQ9iyOYjbjh7NMaieMy1a/DhhzBtGowcKfbBLcuWiUE5d04MSps2alCU\nDEEwxVhs3EDcV0Nv81n3IobG1tspicyNqQYcQ2Iv2B075uwmERERhJllV0NCQqhSpQrh4eFAUrdU\nt3V7xQp4/vloHngAdu4Mp2BBN+dnzw69e3N9/34Ov/QS93/yCWTLFlS/j27r9u1uZyTCSB6fsecf\noKC5/gCwFciBzJE5iHPraliB5cuXB1qCR2REnVeuGMbrrxtGiRKGMWdOKievXWsYDRoYRliYYYwd\naxixsX7TGUhUp/ewgkbDMAz8XJDRl/38ycAfyOiuI8DLDsftf9HdwFTz5wIgEq1MqaSRpUvh4YfF\nBbZjBzyAM/t9AAAgAElEQVT9tIsTN22SevHPPSfurr17ZahYdk868IqSIRiLZKt39sX/HWREru2L\nfxjiudpiLiNTu7nVxkyaxldRkrh8WWbNz5sHP/wATZq4OHHbNhk2vGGDBF/+8x/IqbXqlIyPkxhL\nHeAqMh3Efp5hKWA0UAGZv3ie5LFyj/Ckx1LBfNBiJPi+HFjm6QMUxZcsWiS9lPh42LnThVHZtQva\ntpWhwuHhcOCApF5Ro6JkXtIyHSTNeGJYpiHpWz4G3rVbFBfYgmbBjpV1XrokHY6uXWH0aFkKFHA4\nae9eeP55mSH/xBNiUN5+G3Ln9pvOYER1eg8raEwDrqaDgMS+tyAZWWqndiNPnMqxyPBiRQkK5s+H\nV16RGMqOHZA/v8MJBw/KpMb586FHD/j+eylUryiZhOjo6LQavTzAh8h0EBs219lxxEV2AckhORN4\nELji6maexFj6ITXuZwA37fafd3q2b9EYSybmwgWxEytXwo8/SkckGYcPSw6vmTOhe3fpnaToxihK\n5sPFPJYwkmInDyOptK6bx2xTPp5A8j3asxwJ8LtMROxJjyUCGaHlWI5YU+crfmP2bHjtNUnJsn07\n5M1rd/DoUUm5MnWqnLRvnxSpVxTFU3YARe22/yEpeF8I6a3EA2WB8iRVFHaKJzGWMFLWYlGj4gar\n+F2toPPcOWjQIJqePWHSJKnwm2hUTpyAN9+UjJL580tMZcCAgBkVK7QnqE5vYgWNLkjLdJAnkYnt\nW5CY+yvARXc3d9dj+T9gKdAa53NKHNOtKIpXmTED3ngDataUkcJ33mkeOH0aBg2Cn36CiAjYsweK\nFnV3K0VRktMhleNl7dZnkMb3vbsYS3+gLzAO54bF0cL5A42xZALOnJEQyebNYjtq1TIPnDsHX34p\nQ8Cefx569UpDDWFFybz4O1eYTpBUgopp08S71bGjDOzKnRuJ2g8dKpkk27aVyY2lSwdaqqJYBn8b\nFncxlgjcu8pyEJheS9BjFb9rMOk8fVpsRp8+8Ntv0jHJHXsZPvmE2LAwOH4cNm6EUaOC1qgEU3u6\nQ3V6DytoDATuDEteYAMS5OmJ1GF5ARlmNhn4E0mpryjpxjBg8mSJv5crB1u2QPWHrsIXX8iOAwfY\n/O23MGYM3KNjRhTFCqTWNcoC1EJmWtq+Jh4GViMjCvztl1JXWAbi5EkZHbx/v8RSHn/wuri7vvwS\n6tWTvF73e1KsVFEUdwRbPRYDMSKr/aBFySQYBkycCP/9r6RkmTIuhpzjf4AWA6FGDViyRBKAKYpi\nSbQ8ng+wit81EDqPHYPmzaVTsmDmTQaU+I6cD5UXYzJvHkyfnsKoaHt6F9XpPaygMRCoYVH8gmGI\nu+uRR+DxKrFsjvyRqh0qwJw5MmFl9mw5qCiK5dHhxorPOXIEunWDMyfimNFqIqXHfQL33it15WvW\nDLQ8RcnwBNNwYxtvAwUQUWOQaf2NfClKyRgYhsxlfOyReF7J+zMbrj1A6aU/Sddl8WI1KoqSQfHE\nsHQGLgENkVKVnYCBvhRldazid/WlzsOHoXHDBA4MnMbhkEq0PPYtWUZ9B9HRULdumu6l7eldVKf3\nsILGQOBJdmNb96kZEAXs9J0cxeokJMD3owzWfjCLqDv7UrhEDrIMGAKNGkEWq3leFUVJD578p48D\niiNJySoD2ZB8/I/6TpZLNMYSxPzzt8EPLefz0sE+lCmdQO7Bn0g1LjUoihJQgjFXWFbgEeAgkir5\nLqAEzstX+ho1LEFIQrzBnDcXU+KHPpQpdI2CI/qTrVVLyKqDDhUlGAjG4H0NYC9iVDoBHyMxF8UF\nVvG7ekPnsYnL2VnwSSr/9BbFB/eg8LFtZGvTyqtGJTO1pz9Qnd7DChoDgSf//aOAa4gbrCdwAJjg\nS1FK8BO/YjVHytfn5ktdOf50N0pd3EnxHu20l6Ioikddoy2IK6wvUgP5R6TWcVUf6nKFusICzbp1\nXHunD5c27WdC6d60mf0i5Sp6MgZEUZRAEWy5wgCuAB8CHYE6SPD+Dl+KUoKQTZswevfhytod9Iv9\nmHIDI3jvzRzaQVEUJQWevBbaATeR+SwnkcD9l74UZXWs4nf1SOe2bdCyJbFNm/PV7qa0rbyfN7Z3\nI/Jt/xmVDNWeQYDq9B5W0BgIPHk1nAB+BkKAp4EYNMaS8dm1C9q2xWjcmCVx4ZSNP0C+D15nwbKc\nlC2b+uWKomRePPG5PYf0UFaY208C7wLTfCXKDRpj8TV790pN4MWLOdnxv7SNfp1cd93J6NEQFhZo\ncYqipIdgnMeyHXgKOG1uFwaWApV8JcoNalh8xcGD8OmnMG8e8d3fZkjsm3w5Kh+ffw7/+Y/OcVQU\nKxOM81iyAGfsts9hvazIfsUqftfo6GhJ6tW1K1SrBmFh7PjtAI/P/IhlG/KxaZMcCrRRsVR7WgDV\n6T2soDEQeGJYfgcWAhHAy8B8YIEPNSn+4MwZyg8bBlWrQpEi3Nq5j3704/9aFaB7d1iwAEqXTv02\niqJYkrHAKWCHk2PvAAlI0mEbvYD9wF9IQmK3ePJdNAvQCql7bwCrgN88uM4XqCvMG+zdC02bytKn\nD1uOFiYiAkqVgu+/hxIlAi1QURRv4sQVVge4igzEsi/ZWgoYDVRA8kGeBx4AJgGPI6OClwD3IcbH\nKZ7MYzGA6eaiWJ3Vq6F1a/j8c2527MKAAfDDD/DVV9CxY+DdXoqi+IVVQJiT/UOB94BZdvtaAJOB\nWOAQkn3lCWCdq5u7c4VdRSZHOlsueyg+UxK0ftdffoFnn4UJE9hbuwsVK0azYwds3QqdOgWvUQna\n9nRAdXoXK+i0gsY00AI4SsoEw8XN/TaOIj0Xl7jrseRNlzQl+DAMGDwYvvkGlizheOHKNKoJrVrB\nkCHBa1AURUkf0dHRaTV6eZAMKw3s9rl7M7iNSVjtlaIxlrQSFwfdu8Mff8C8eVzOX5Inn4R27aBX\nr0CLUxTFH7gYbhwGzEFiLA8jsZPr5rGSSG7IasigLUiqHPw7kjvyT1fP82VSDmejDj4FtgFbkbkw\npcz9YcANJOHlFmCkD3VlHq5ehRYtZI7KqlXEFi1JmzZQowZ88EGgxSmKEkTsAIoC95jLUSTR8Clg\nNtAeyGEeKw+sd3czXxqWn4DGDvsGI+n3qwAzEatn4wCSRfkRINKHunxOUPhdT5yQ2vJFi8K8eRj5\n8vOf/0CuXDBihLi/gkKnB6hO76I6vYcVNLpgMvAHMrrrCEm9Ehv2rqHdwFTz5wLk/ezWdeTLfOfO\nRh1csVvPC5z14fMzL7t2QbNmMmX+o48gSxb69JZRxsuWQXbNcq8omZ0OqRx3zAj4ubl4hCcxltaI\nb62o3fkGkN+Da8NI8uHZ+AypRHkdqI5UpgwDdiITcC4hVSpXO7mfxlhSY9kyaN8ehg6V8cPIcOIv\nv5QwS+HCAdanKIrfCcZcYQeRrMZ70nH/MFIaFhsfIJNwXkZ8d3cCFxC/3kzgQZL3cEANi3uiouCd\nd2RYcb16AMydK2lZVq2CcuUCrE9RlIAQjIW+TpI+o5Iak5D0MAC3zAWkOuVBJEC02fGiiIgIwsw0\nuyEhIVSpUoXw8HAgyd8Z6G3bPr89v25dGDCAmG+/ZfugQTxhGpXvvoumVy9YtCiccuVSXv/1118H\nZfsFvD3Tua3t6d1tK7Tn1q1befvtt4NGj7vtYKG1ufwP+AXxydn2tfLwHmEkHxVW3m69OxBlrhdC\nKlOC+PaOIvVfHDGswPLly/33sFu3DOPllw2jalXDOH48cfeBA4ZRrJhhzJ7t+lK/6rwNVKd3UZ3e\nwwoaDcMwSCXY7m3cdY3GkSQmCymFOY4icGQyUBcxGqeQEWBNEfdXPNIreQ1Jx98K+ARJGZAA9AHm\nObmn2UYKAJcvQ5s2kCMHTJkCeWVO65kzULMm/Pe/8MorAdaoKErACcYYS21SBtKd7fMHalhsHD0q\nSSRr1ZLxw+ZQr+vXoX59eOopGDAgwBoVRQkKgrEey3AP9ykm9r5sn7B1q8xy7NgRRo5MNCrx8dCh\nA1SoIDW7Aq7TS6hO76I6vYcVNAYCd8H7GkBNoAjQkyRrl4+keIjibxYuFIPy7bfw3HOJuw1DMrdc\nvw7Tpmn+L0VRAoe7109doB7wCjDKbv8VZAjxfh/qckXmdoX9+KNMeJw+HWrXTnZo4EAJs6xcCfk9\nmWGkKEqmIRhjLGFIDv5gIHMaFsOA3r1h8mSYP198XXZMnAgffywTIIsXD5BGRVGClmCMsVwHvkLm\nnCw3l2W+FGV1vOp3vXlTXF9LlsDatSmMytKlMidy/vy0GxWr+IdVp3dRnd7DChoDgSeG5WekznFZ\noB/Se9noO0lKIhcuQKNGcOOGpGopUiTZ4W3bJFg/bRo88ECANCqKojjgSddoM5JmZTtQydy3EXjM\nV6LckHlcYYcOyXDiRo2kbnC25OMljhyRuSpDhiSL4SuKoqQgGF1htlQrJ5GcYVWBUJ8pUmDjRrEa\nr7wCw4alMCoXL0KTJtCjhxoVRVGCD08MywAkvco7wH+BH4EevhRldW7L7zpnjliNkSPhrbdSHL55\nE1q2hAYNoGfP9D8GrOMfVp3eRXV6DytoDATu5rHkBl4FygElgDFAuB80ZV6+/Vamy8+dC9WqpTic\nkAAREZL6fsgQ/8tTFEXxBHc+t6mIG2wVkuPrEJDyK7R/yZgxloQEeP99mD0bFiyAso41doR334V1\n62DxYqkEqSiK4gnBlDb/fpLqqIwBNvheTibkxg148UU4eVImotx1l9PThg+XjsyaNWpUFEUJbtzF\nWOJcrCup4LHf9exZyRaZLZt0Q1wYlRkzYPBg6cwULBgAnQFGdXoX1ek9rKAxELgzLJWQ9C225WG7\n9cu+l5bBOXBARn7VqQOTJrnshqxZA6++KjF9s76ZoihKUGO1VIUZI8aydi20agX9+rktmPLXXxAe\nDhMmQMOGflOnKEoGI5hiLIovmD5duiDjx8sESBecPCmHBw5Uo6IoirXwZB6Lkkac+l0NQyY7vvWW\npL53Y1SuXIFmzeDll2V4sa+win9YdXoX1ek9rKAxEKhh8Qfx8WJQxoyRkV9Vq7o8NTZWZtM/+qhk\nLFYURfEBY5GS8Tvs9n0KbAO2AkuBUub+MOAGsMVcRqZ2c42x+Jpr1+D556UbMmMGhIS4PNUwoEsX\nOHUKZs1KLAypKIpyWziJsdQBrgITSJpWkg8ZnAXQHagM/AcxLHPszksV7bH4klOnoF49KFAAfv/d\nrVEB6N8fduyAX35Ro6Ioik9ZBVxw2HfFbj0vcDa9N1fD4gOio6NlSFeNGpL3a/x4yJHD7TVjxkBU\nlEyCzJvXjzotgOr0LqrTe1hBYxr5DPgXeAkYaLf/HsQNFg3UTnlZcvR7sQ8osG0btGsnQ7pefjnV\n8+fPl4rDK1dC0aJ+EKgoSoYmOjo6vUbvI3P5ABgGvAwcR+ItF5Ds9jOBB0new0mGxli8zeTJEqif\nNElm1afCxo3SqZk9Wzo4iqIo3sbFPJYwXMdOSiNVgx9ycmw5ku1+s6vnaY/FWxgGDBok6e6XLoWH\nU49z/f03NG8OP/6oRkVRlIBTHthvrrdAXF8AhZDeSjxSSbg88Le7G2mMxRvExcmkxylTYO1aos+d\nS/WSs2elp/LRR9CihR80OsEq/mHV6V1Up/ewgkYXTAb+ACoAR4DOwBfI8OOtSImUd8xzn0SGIW8B\npgGvABfd3Vx7LLfLlStJZRxXrYJ8+WD/freX3LghPZVnn4XXX/eDRkVRlOR0cLJvrItzZ5iLx2iM\n5XY4flymyD/2mLjA7rgj1Uvi46FtW8iTR3KAZdU+o6IoPiYYa94rzti5UwIjbdvCDz94ZFQMA95+\nGy5dgrFj1agoipIx0Vdbeli6FOrXhy++gA8/hCzJvwi48rt+9RWsWCET8FOZ1uIXrOIfVp3eRXV6\nDytoDAQaY0kr48fDe+/BtGlQt67Hl02eDCNGSKqwAgV8qE9RFCXAaIzF8ydLzpXx42VG4/33e3zp\n8uUyX3LZMnjI2ahwRVEUH6L1WIKRW7egWzfYtUuKdN19t8eX7tghRuWXX9SoKIqSOdAYS2pcuiS1\nU86fh+hoj4yKze969KgMGvvf/yQXZbBhFf+w6vQuqtN7WEFjIFDD4o5//4VataBiRfjtN7jzTo8v\ntdmj7t2hg7MR44qiKBkUjbG4YssWeOYZ6NEDevZMMfLLHbduQePG8OCDMHx4mi5VFEXxOv6OsVjt\nlecfw7JgAbz4Inz3HbRpk6ZLExLk0uvXZeBYtmw+0qgoiuIhGWmCZFpKXwL0QhKg/QU09KEu9/zw\ng6S6nzUrzUYFZFrLli3R/Pxz8BsVq/iHVad3UZ3ewwoaA4EvDctPQGOHfYORcpdVkJz+fc39DwDt\nzJ+NkZrK/o3/JCRAr17w5ZeS86tmzTTf4ttvJRTz+eeQO7cPNCqKolgAX3eNwnCd778XUAApKNML\nSAAGmcd+B/oB6xyu8Y0r7OZNiIiAw4elp1K4cJpvMXMmREbCmjVwzz3el6goipJeMsM8ls+ATsAN\n4AlzX3GSG5GjQAm/qDl/XtIMFy4sqVrS0dVYuxa6dpXQjBoVRVEyO4EwLPalL79GSl86w2nXJCIi\ngrCwMABCQkKoUqUK4eHhQJK/09PtdZMmUemDD8jz3HMweDDRK1em6fro6GiOHIF33w1nwgS4ejUa\nm8s1PDw8zXr8vf3111/fVvv5a9u2L1j0aHv6Z9sK7bl161befvvtoNHjbjsjEUby4L09pYGd5voH\n5mLjd6Cak2sMr/Hnn4ZRrJhhjBiR7lucPGkYZcsaxo8/Jt+/fPny29PmJ1Snd1Gd3sUKOq2g0TAM\nAxdf1H2Fv2Ms9qUvuyOusE5I0H6SuV0CWAKUI2VjmG10m8yaBf/5D4wZIxW30sHVqzKbvlkz6Nfv\n9iUpiqL4iowUY5kM1EXqJR9BRoA1RUphxgMHgdfMc3cDU82fcUAkvrKwI0ZIuvv58+Hxx9N1i7g4\nyf9VqRL07Zv6+YqiKJkJXw7p7YAE5XMg81XGAm2Q3ksVoDVw2u78z5FeSkVgodfVJCTIDPqRI2Xo\nVjqNimHI6K+EBBg1yvmsentfdjCjOr2L6vQuVtBpBY2BIHNkN75xAzp2hLNnpSBKaGi6bzVgAGza\nJAW7PCgaqSiKkunI+CldzpyBFi1kHPDYsZAzZ7ofPm4cfPKJ2KY0ZM5XFEUJKBkppUvg2b9fZtDX\nqwdRUbdlVBYuhA8+kLkqalQURVFck3ENy5o1UKeOlBH+7DPImv5fdfNm6NQJpk+HChVSP98qflfV\n6V1Up3exgk4raAwEGdOwTJsGLVuK76pr19u61aFDkj1/1CgpzaIoipIB8GmS4IwVYzEMGDIEvv4a\n5s6FKlVu62Hnz4sxiYyUgl2KoihWxEmMpQ5wFZhA0jzDfMAVc707kjD4PyTNM3ycpHmG9yH5HZ2S\ncUaFxcXBW2/BypWSvKtUqdSvcUNMjMydfPppNSqKomQ4ViET2O25YreeFzhrrrdA5iXGAoeAA8hk\ndsckwYlkDFfYtWuSSHLfPli9+raNSkKCjE4uVQoGDUr9fEes4ndVnd5FdXoXK+i0gsY08hnwLxAB\nfGHuK44kBraRapJg6/dYTp6UIMhDD0mRrtucXGIYMo/y7FkZCXYbMX9FUZSAEB0dnV6jd1tJgm1Y\nO8ayZw80bSoVH3v39kpx+aFDZbrL6tUQEnLbt1MURQk4LuaxhOG6XlZpYD7wEEkJggeaP39HUnT9\n6ep51v0+Hh0N4eHQvz/06eMVo/LLLzBsmMxVUaOiKEomo7zdegtgi7k+G2iPpOe6xzxvvbsbWdOw\n/PwzPPccTJoEL77olVuuWCFB+nnzbjtEYxm/q+r0LqrTu1hBpxU0umAy8AeSFPgI0BmJqexAhhuH\nA++Y59onCV6AB0mCrRdj+ewziaUsWyZxFS+wa5fYqcmTJWOxoihKBqeDk31j3Zz/ubl4hKViLD+A\n0fWRR2SOSvHiXrnn8eNQo4bYq44dvXJLRVGUoCIj1WPxOtdA5qnkzeuV+12+DE2awGuvqVFRFEXx\nFpaKsfQArxmVW7egdWuZWf/++165ZSJW8buqTu+iOr2LFXRaQWMgsJRh8RaGIZWJ8+SRgpJeGFCm\nKIqimFjtleqVmvcffQRLl0r8P08eL6hSFEUJYjTG4mNGjYKpU6VYlxoVRVEU75OpXGFz5kgFyN9/\nh8KFffccq/hdVad3UZ3exQo6raAxEGSaHsuff0LnzjB/Ptx7b6DVKIqiZFwyRYzlwAEpJjl6tKTB\nVxRFyUxozXsvc+aMzFXp31+NiqIoij/I0Ibl2jUxJu3bQ7du/nuuVfyuqtO7qE7vYgWdVtAYCDKs\nYYmLE4NSsaIE7BVFURT/kCFjLIYhaVr+/lvSiuXI4QdliqIoQYrOY/ECX3who8BWrFCjoiiK4m8y\nnCtswgTJqj9vHuTPHxgNVvG7qk7vojq9ixV0WkFjIMhQPZbFi+Hdd2H5cq9l1VcURVHSSIaJsWzd\nCg0bwvTpMmdFURRFEXQeSzr4918ZVvztt2pUFEVRAo3lDcuFCzIB8p13oG3bQKsRrOJ3VZ3eRXV6\nFyvotILGQGBpwxITAy1bQqNG0KNHoNUoiqIoYOEYS0ICdOggc1amTIGsljaRiqIovkPnsXjIu+/C\niROwaJEaFUVRlGDCl6/kscApYIfdvi+BPcA2YAZQwNwfBtwAtpjLSHc3/vprWLAAZs6EXLm8rNoL\nWMXvqjq9i+r0LlbQaQWNLvDZ+xl8a1h+Aho77FsEPAhUBvYBveyOHQAeMZdIVzf99Vf46isxLAUL\nelewt9i6dWugJXiE6vQuqtO7WEGnFTS6wCfvZxu+NCyrgAsO+xYDCeb6n0DJtN40MlLyf5Upc5vq\nfMjFixcDLcEjVKd3UZ3exQo6raDRBT55P9sIZHSiMzDfbvsepJsVDdR2ddHEiVClim+FKYqiZHLS\n9X62Eajg/UfALWCSuX0cKIVY0KrATKRLdsXxwoYN/aTwNjh06FCgJXiE6vQuqtO7WEGnFTSmg3S/\nn/1FGMmDQwARwBrAXdh9OfILOHIAMHTRRRdddEnTcoCUhOHd97PfCCO58MbALqCQw3mFgGzmelng\nKBDia3GKoiiZmDAs+H6ejHShbgFHEJ/dfuAwKYettQZ2mvs2Ac38LVZRFCUToe9nRVEURbkdnE3c\ncWQ4Yl23IeOqA0FqOsOBSyRZ/4/9IysFpRCf6C7kW8ebLs4LdJt6ojOcwLdpLmQo5lZgN/CFi/MC\n3Z6e6Awn8O0J4mbZAsxxcTzQbWnDnc5wgqMtDwHbTQ3rXZwTLO3pV+ogv6yrF3ZTkobBVQPW+UOU\nE1LTGQ7M9psa19wN2AZo5wX2Avc7nBMMbeqJznCCo03zmD+zI23lOPwyGNoTUtcZTnC0Z0/gZ5xr\nCZa2BPc6w13s9zf/AO6mjvulPYMxy5aziTv2NAfGm+t/IkGkor4W5YTUdEJwJPk8iXxrBbiKpGxw\nrK8ZDG3qiU4Ijja9bv7MgXyLPe9wPBjaE1LXCYFvz5LIy+5HF1qCpS1T04mb/f7GnQ6/tGcwGpbU\nKIEEm2wc5TZmiPoQA6iJdDfnAw8EVg4go0AeQT5Q9gRbm4bhXGewtGlWxAieQtx3ux2OB0t7pqYz\nGNpzGPAuSTO+HQmWtkxNZzC0pU3HEmAj0NXJcb+0pxUNC6S0yEZAVLhnMxI3qAyMQCYVBZK8wK/A\nW0iPwJFgaVN3OoOlTRMQt11J4EnEDeJIMLRnajoD3Z5PA6eReIC7b9mBbktPdAa6LW3UQr6UNQFe\nR1z2jvi8Pa1oWI4hf0AbJc19wcYVklwRC4A7cO/79CV3ANOBiTj/wAdLm6amM5jaFCRYOw94zGF/\nsLSnDVc6A92eNRHXzD/I8Nf6wASHc4KhLT3RGei2tHHC/HkG+A14wuF4MLRnwAjDs+B9dQIbzAvD\ntc6iJH0zeAIZrREIsiD/BMPcnBMMbeqJzmBo00IkTQ7LDawE/s/hnGBoT090BkN72qiL89FWwdCW\n9rjSGQxtmQfIZ67ficygd0yC5Zf2DMZCX5ORP14hxBfYF7H+AN8jjdIUSVFwDXg5ABohdZ1tgNeA\nOOSbTPsAaATpGnckaQgiwIdAaXM9WNrUE53B0KbFkOBnVnOJApYCr5jHg6U9PdEZDO1pj80lE2xt\n6YgzncHQlkWRXgrIu/1nJBV+sLenoiiKoiiKoiiKoiiKoiiKoiiKoiiKoiiKoiiKoiiKoiiKkvmI\nR+aP7ETyS/UkacLXo8D/3FxbBujgU3XueRPJgxXl4+e8jUw2DAaeAd4311uSPBP0S8g8lvTwBlKe\nFqA/KSdVuiMCSWeSXpaSNMFPUZQMwBW79cLAYqCfh9eG47qWhj9wlQnZ2xOA/wHucnEskOmRxiFV\n/mwsR74MpIVsyBeJLaS/3V7i9gxLV+QLjaIoGYQrDtv3AGfN9XCSDEddkooZbUKSRq4DLpr73kJ6\nMCvN45uAGnb3iQamIcZgot3zHkdSUGxFshrfibzsvkQKFm0DujnRPQq4iczYfxvJgBAFrEZmHpcB\nlpnXLyEpT9I4pPTqWuCgqW080vP5yclz3rR7zlJz31XgK1NzLaC3qXUHMsvZRjQw0Py99pJUF+VB\nc98WU9+9SJqgv0wNe83foaHZNvvMdoKk3kEN4Bzwt3mf95C/5V9IYsRciJGJRjLe/o7UvrHpGgZs\nQF7otZGMEjbGkWSwDiFfNDaZbVDBSRvZG5ZmwB+IIR6HZ21dFNfFqRRFsSCOhgWk3kxhkhuW2SQZ\nijzIy98xf1JuIKe5Xh55cWHe5yLSu8iCvHhqIvVCDpL0LTuved9uwEfmvpzmfcKc6LQvbtTPPM/2\n/DlAJ3P9ZZJSXowDJpnrzYHLyIs+C/ICrpzKc0CyB7ex2w61W5+AZMUF6UF8aa43QXqDIC/h5831\n7LNdT4kAAAMiSURBVIgRCANiHbSMsdNp0x9B0kv8J6CV3bOXA1XN9TtIesEDtLO733LgG7vrPiB5\nj8H+vv8g2XJBUpeMJiU2w/Is8sWigN19PG3rv5EvFYqFCcZcYUpwswb5lvszMAPJjOqYhjsH8sKq\njMRuytsdWw8cN9e3Ij2jK0hW1k3mflu6/IbAwyS9vPMD5XCf4M9AjN9Nc7s6EoMA6SENtjvPZgx3\nIoXGdpnbu5AX/DY3zwH53abbbddHanbkQQzQTmCueWyG+XMzScbxD8RwljSPHzD3/+OgZYmdTtu1\njjj+DWzbFZCXuO0e2Uhqf4Bf7NZLIz09V9j/Dq2cHM+CtMFjQAOSlz3wtK1PIb3Kv9zoUIIcNSyK\nK8oiL84zDvsHIS/LZoiRaeTk2h6IoeiEvMhi7I7dtFuPRz6D7upBvEHSN3xPue6w7aqGxi3zZ4KD\nrgQ8+9+IIUl7LuBbpNd1DHHJ5bI713Z/2+8M4nZah/Rs5iPJAv9xosVepytdjm1o286CvLxrurju\nmsO2u7oozn4Hx2ceRL4sVCDpiwJ43tZZCM76SkoasGI9FsX3FEZiF84CsfciL6rBiMupAuLasB/N\nkx/5VgrwImJcXGEgsYRiJNULyWdesxCIJOnFcx9Jddw95Q+SMs2+gLho0ssV5Hdzhs2InENceW09\nuF9ZxJCMAGYhvbP0vFQdddlv70X+ntXN7TtwXd3wMEnxl/SQxbxHG8QVmJ4qikWRqoaKhVHDotjI\nTdJw48VIkLe/ecwg6YX3FhKc3oZ8C12ABHPjEdfWW0ig9iVzuwLJXSLOXpyxiO9/hHnNQiRG8iMS\n4N1sPvM7XH9TdrXdHYmtbEMMy1suznN3Dxs/IO2y1Mk5F5G4w07zHMeyys7u/Zx5/hbEXTUB59/Y\nnem0/5tMQVxwmxBjNQ75YrAZ+R9vg/Q0t5rPqoFzVpOyGJgr/c7ax7Z/L9LW00w9rn4Hx+27EcPs\n2ItSFEVRLIptuHGOAD2/G+JGVRRFUTIQkQSu+NNSxI2oKIqiKIqiKIqiKIqiKIqiKIqiKIqiKIqi\nKIqiKIqiKIqiZEz+H0C1ZRMhMDC/AAAAAElFTkSuQmCC\n", + "text": [ + "<matplotlib.figure.Figure at 0xb55925ac>" + ] + }, + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "L50 values by Cost 231 model\n", + "129.03 140.47 147.16 151.91 155.59 \n", + " \n", + "L50 values bu Okumura/Hata model\n", + "125.13 135.73 141.93 146.34 149.75 \n", + " \n", + "The results from the plot of two models shows that the calculated path loss with the COST 231 model is higher than the value obtained by the Okumura/Hata model.\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.8, Page 76" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "SNRmin=12;#in dB\n", + "n=3; #No of floors\n", + "Backgroundnoise=-115; #dBm\n", + "pt=100 #in dBm\n", + "\n", + "#Calculations\n", + "pt_db=10*math.log10(pt);\n", + "Sr=Backgroundnoise+SNRmin; #receiver sensitivity\n", + "Lpmax=pt_db-Sr;\n", + "#Refering table 3.4\n", + "Lp_d0=38; #ref path loss at the first meter(dB)\n", + "Lf=15+4*(n-1); #signal attenuation through n floors\n", + "y=3; #path loss exponent\n", + "X=10; #Shadowing effect(dB)\n", + "d=10**((Lpmax-Lp_d0-Lf-X)/30); #max allowable path loss\n", + "\n", + "#Result\n", + "print 'Coverage radius of an access point = %d m \\n'%(round(d))" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Coverage radius of an access point = 54 m \n", + "\n" + ] + } + ], + "prompt_number": 22 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.9, Page 77" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "SSmean=-100; #signal strength(dBm)\n", + "Sr=-110; #receiver sensitivity(dBm)\n", + "sd=10; #standard deviation(dB)\n", + "\n", + "#Calculations\n", + "P_Smin=(0.5-0.5*math.erf((Sr-SSmean)/(math.sqrt(2)*sd)));\n", + "\n", + "#Result\n", + "print 'probability of exceeding signal beyond the receiver sensitivity is %.2f \\n'%(P_Smin)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "probability of exceeding signal beyond the receiver sensitivity is 0.84 \n", + "\n" + ] + } + ], + "prompt_number": 24 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.10, Page 81" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Lp=140; # path losses in dB \n", + "k=1.38*10**-23; # Boltzmann\u2019s constant (W/Kelvin-Hz)\n", + "k_db=10*math.log10(k);\n", + "f=900;#in MHz\n", + "Gt=8; #transmitting antenna gain(dB)\n", + "Gr=0; #receiver antenna gain(dB)\n", + "Ag=24;#gain of receiver ampli\ufb01er in dB \n", + "Fmargin=8;#Fade margin(dB)\n", + "Nf=6;#Noise figure(dB)\n", + "L0=20; #\u0002 other losses in dB\n", + "Lf=12; # antenna feed line loss in dB \n", + "T=24.6;#Temperature expressed in dB\n", + "R=39.8; #\u0002 data rate in dB \n", + "M=8; #overall link margin(dB)\n", + "Eb_No=10;#dB\n", + "\n", + "#Calculations\n", + "#From equation (3.54)\n", + "pt_db=M-Gt-Gr-Ag+ Nf + T+ k_db+ Lp+ Lf+ L0 + Fmargin+ R+ Eb_No;\n", + "\n", + "Pt=10**(pt_db/10); #dB into normal number\n", + "\n", + "#Result\n", + "print 'Total transmitted power is %d Watts \\n'%Pt" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total transmitted power is 6 Watts \n", + "\n" + ] + } + ], + "prompt_number": 25 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch4.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch4.ipynb new file mode 100755 index 00000000..6a6cd416 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch4.ipynb @@ -0,0 +1,338 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:d1cbcab673c40d252caf601352e39b3f6fb5df10eada02ad15211795afd1b59f" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 4: An Overview of Digital Communication and Transmission" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.1, Page 93" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Fm=20; # in KHz\n", + "\n", + "#Calculations\n", + "print \"An Engineering version of the Nyquist sampling rate : fs>=2.2*fm.\"\n", + "print 'Therefore sampling rate of >= %d ksps should be used '%(2.2*Fm); \n", + "print \"The sampling rate for a compact disc digital audio player = 44.1 ksps and for a studio quality audio player = 48 ksps are used.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "An Engineering version of the Nyquist sampling rate : fs>=2.2*fm.\n", + "Therefore sampling rate of >= 44 ksps should be used \n", + "The sampling rate for a compact disc digital audio player = 44.1 ksps and for a studio quality audio player = 48 ksps are used.\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.2, Page 96" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Rt=1; #Resistance(ohm)\n", + "#L= Number of quantization values\n", + "L1=32;\n", + "L2=64;\n", + "L3=128;\n", + "L4=256;\n", + "\n", + "#Calculations\n", + "# L=2**R i.e R=math.log2(L);\n", + "R1=math.log(L1,2);\n", + "R2=math.log(L2,2);\n", + "R3=math.log(L3,2);\n", + "R4=math.log(L4,2);\n", + "\n", + "#P=A**2/2; #average power of signal\n", + "#sig**2=0.333*A**2*2**(-2*Rt); #Avg quantization noise power\n", + "#SNR=P/sig**2;\n", + "# SNR(dB)=1.8+ 6R;\n", + "\n", + "SNR1=1.8+6*R1;\n", + "SNR2=1.8+6*R2;\n", + "SNR3=1.8+6*R3;\n", + "SNR4=1.8+6*R4;\n", + "\n", + "#Result\n", + "print 'For L=32, SNR is %.1f dB\\n '%SNR1\n", + "print 'For L=64, SNR is %.1f dB\\n '%SNR2\n", + "print 'For L=128, SNR is %.1f dB\\n '%SNR3\n", + "print 'For L=256, SNR is %.1f dB\\n '%SNR4" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For L=32, SNR is 31.8 dB\n", + " \n", + "For L=64, SNR is 37.8 dB\n", + " \n", + "For L=128, SNR is 43.8 dB\n", + " \n", + "For L=256, SNR is 49.8 dB\n", + " \n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.3, Page 99" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Fs=8*10**3; #in Hz\n", + "Fm=3.4*10**3; # in Hz\n", + "VCH=24; #voice channels\n", + "SCH=1; #sunchronization channel\n", + "PDur=1; #extra pulse duration in microsec\n", + "\n", + "#Calculations&Results\n", + "Ts=1/(Fs);\n", + "TimeCH=Ts/(VCH+SCH)*10**6; # in microsec\n", + "print 'Time between the pulses is %d microsec\\n'%(TimeCH-PDur);\n", + "#Now by using the engineering version of Nyquist rate sampling\n", + "NyquistRate=2.2*Fm;\n", + "Ts1_microsec=1/NyquistRate*10**6;\n", + "Tc=round(Ts1_microsec)/(VCH+SCH);\n", + "print \"Time between the pulses by using engineering version of Nyquist rate sampling is %.2f microsec\\n\"%(Tc-PDur);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Time between the pulses is -1 microsec\n", + "\n", + "Time between the pulses by using engineering version of Nyquist rate sampling is 4.36 microsec\n", + "\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.4, Page 101" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Fm=3000; #highest modulating frequency in signal(Hz)\n", + "M=32; # number of pulse levels \n", + "b=5; #bits per symbol \n", + "p=0.01; #Quantization distortion\n", + "\n", + "#Calculations\n", + "#2**R = L >= 1/2P\n", + "# where R is the number of bits required to represent quantization levels L\n", + "R=math.log10(1./(2*p))/math.log10(2);\n", + "Fs=2*Fm; # Nyquist sampling criteria (samples per second)\n", + "fs=round(R)*Fs;\n", + "Rs=fs/b;\n", + "\n", + "#Result\n", + "print 'The minimum number of bits/sample or bits/PCM word that should be used are %d'%(round(R));\n", + "print 'The minimum sampling rate is %d samples per second\\n '%Fs;\n", + "print 'The resulting transmission rate is %d bps\\n '%fs;\n", + "print 'The PCM pulse or symbol transmission rate is %d symbols/sec\\n'%Rs" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The minimum number of bits/sample or bits/PCM word that should be used are 6\n", + "The minimum sampling rate is 6000 samples per second\n", + " \n", + "The resulting transmission rate is 36000 bps\n", + " \n", + "The PCM pulse or symbol transmission rate is 7200 symbols/sec\n", + "\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.5, Page 110" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "S_No=53.; #dB-Hz\n", + "R=9.6*10**3; #bps\n", + "BW=4.8*10**3; #Khz\n", + "Pb=10**-5; #BER<=10**-5;\n", + "\n", + "#Calculations\n", + "print \"Since the required data rate of 9.6 kbps is more than the available bandwidth of 4.8 kHz, the channel is bandwidth-limited.\"\n", + "Eb_No=S_No-10*math.log10(R); #dB\n", + "# Try for 8-PSK modulation scheme\n", + "M=8;\n", + "Ps=math.log(M,2)*Pb; #Max ps\n", + "Es_No=math.log(M,2)*10**(0.1*Eb_No);\n", + "#Ps(8)=2*Q(math.sqrt(2*Es_No)*sin(math.pi/8));\n", + "#2*Q(math.sqrt(2*Eb_No))=erfc(math.sqrt(Eb_No)); #Refer EQn C(7) from appendix C\n", + "\n", + "Ps8=math.erfc(math.sqrt(Es_No)*math.sin(math.pi/8));\n", + "\n", + "#Result\n", + "print 'Symbol error rate is given as %.5f \\n '%Ps\n", + "print 'The ratio of signal energy to noise is %.2f \\n '%Es_No;\n", + "print 'Symbol error rate for 8-PSK is %.5f \\n '%Ps8;\n", + "print \"As symbol error rate for 8-PSK modulation is lower than threshold value. so, We can use 8-PSK modulation.\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Since the required data rate of 9.6 kbps is more than the available bandwidth of 4.8 kHz, the channel is bandwidth-limited.\n", + "Symbol error rate is given as 0.00003 \n", + " \n", + "The ratio of signal energy to noise is 62.35 \n", + " \n", + "Symbol error rate for 8-PSK is 0.00002 \n", + " \n", + "As symbol error rate for 8-PSK modulation is lower than threshold value. so, We can use 8-PSK modulation.\n" + ] + } + ], + "prompt_number": 13 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 4.6, Page 111" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "SNR=48.; #dB-Hz\n", + "BW=45.*10**3; #in Hz\n", + "R=9.6*10**3; #bps\n", + "Pb=10**-5; #Bit error rate\n", + "e=2.71828; #Natural exponent e\n", + "\n", + "#Calculations&Results\n", + "print \"since the available bandwidth of 45 kHz is more than adequate to support the required data rate of 9.6 kbps.\";\n", + "print \"So, the channel is not bandwidth limited \";\n", + "Eb_No=SNR-10*math.log10(R);\n", + "#We try the 16-FSK modulation scheme\n", + "M=16;\n", + "\n", + "Es_No=math.log(M,2)*Eb_No;\n", + "Ps=(M-1)/2*e**(-Es_No/2);\n", + "#For orthogonal signalling\n", + "Ps16=(2**M-1)/(2**(M-1))*Pb;\n", + "print \"\"\n", + "print 'The maximum symbol error probability is %0.5f \\n '%Ps16\n", + "print 'The symbol error probability achieved by 16-PSK is %.9f \\n '%Ps;\n", + "print \"As achieved symbol error probability is far less than maximum tolerable value\";\n", + "print \"So, we can meet the given speci\ufb01cations for this power-limited channel with a 16-FSK modulation scheme without any error-correction coding\"" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "since the available bandwidth of 45 kHz is more than adequate to support the required data rate of 9.6 kbps.\n", + "So, the channel is not bandwidth limited \n", + "\n", + "The maximum symbol error probability is 0.00001 \n", + " \n", + "The symbol error probability achieved by 16-PSK is 0.000000553 \n", + " \n", + "As achieved symbol error probability is far less than maximum tolerable value\n", + "So, we can meet the given speci\ufb01cations for this power-limited channel with a 16-FSK modulation scheme without any error-correction coding\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch5.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch5.ipynb new file mode 100755 index 00000000..153ee7fb --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch5.ipynb @@ -0,0 +1,416 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:98db718d0bf89da2e915ec31624499d68101b659175b122291fbf41d86cde068" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 5: Fundamentals of Cellular Communications" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.1, Page 130" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "ToCH=960.;# Total available channels\n", + "Cellarea=6.; #in km^2\n", + "Covarea=2000.;#in km^2\n", + "N1=4.; # Cluster Size\n", + "N2=7.; #Cluster Size\n", + "\n", + "#Calculations\n", + "Area1=N1*Cellarea;#for N=4\n", + "Area2=N2*Cellarea;#For N=7\n", + "No_of_clusters1=round(Covarea/Area1);\n", + "No_of_clusters2=round(Covarea/Area2);\n", + "No_of_CH1=ToCH/N1; # No of channels with cluster size 4\n", + "No_of_CH2=ToCH/N2; # No of channels with cluster size 7\n", + "SysCap1=No_of_clusters1*ToCH;\n", + "SysCap2=No_of_clusters2*ToCH;\n", + "\n", + "#Results\n", + "print 'System Capacity with cluster size 4 is %d channels'%SysCap1\n", + "print 'Number of clusters for covering total area with N equals 4 are %d'%No_of_clusters1\n", + "print 'System Capacity with cluster size 7 is %d channels'%SysCap2\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "System Capacity with cluster size 4 is 79680 channels\n", + "Number of clusters for covering total area with N equals 4 are 83\n", + "System Capacity with cluster size 7 is 46080 channels\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.2, Page 132" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "S_IAMP=18.;# S/I ratio in dB\n", + "S_IGSM=12.;# S/I ratio in dB\n", + "PPL=4.; # propogation path loss coefficient\n", + "\n", + "#Calculations\n", + "# Using Equation 5.16 on page no 132, we get\n", + "N_AMP=(1./3)*((6*10**(0.1*S_IAMP))**(2/PPL));#reuse factor for AMPS\n", + " \n", + "N_GSM=(1./3)*((6*10**(0.1*S_IGSM))**(2/PPL));#reuse factor for GSM\n", + "\n", + "\n", + "#Result\n", + "print 'Reuse Factor for AMP system is N = %.3f = approx %d \\n'%(N_AMP,N_AMP+1);\n", + "print 'Reuse Factor for GSM system is N = %.3f = approx %d \\n'%(N_GSM,N_GSM+1);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Reuse Factor for AMP system is N = 6.486 = approx 7 \n", + "\n", + "Reuse Factor for GSM system is N = 3.251 = approx 4 \n", + "\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.3, Page 132" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "VCH=395.;#Total voice channels\n", + "CallHT=120.;#average call holding time in sec\n", + "Blocking=0.02;# 2%\n", + "PPL=4.; #propogation path loss coefficient\n", + "N1=4. #reuse factor\n", + "N2=7.; #reuse factor\n", + "N3=12.; #reuse factor\n", + "\n", + "#Calculations&Results\n", + "No_of_VCH1=VCH/N1; #for reuse factor N1\n", + "No_of_VCH2=VCH/N2; #for reuse factor N2\n", + "No_of_VCH3=VCH/N3; #for reuse factor N3\n", + "print 'NO of voice channels for N=4 are %d'%(round(No_of_VCH1));\n", + "print 'NO of voice channels for N=7 are %d'%(round(No_of_VCH2));\n", + "print 'NO of voice channels for N=12 are %d\\n'%(round(No_of_VCH3));\n", + "TrafLoad1=87.004;\n", + "Carryload1=(1-Blocking)*TrafLoad1;\n", + "TrafLoad2=45.877;\n", + "Carryload2=(1-Blocking)*TrafLoad2;\n", + "TrafLoad3=24.629;\n", + "Carryload3=(1-Blocking)*TrafLoad3;\n", + "# To find cell capacity\n", + "Ncall1=Carryload1*3600/CallHT;#Calls per hour per cell \n", + "Ncall2=Carryload2*3600/CallHT;\n", + "Ncall3=Carryload3*3600/CallHT;\n", + "print 'calls per hour per cell for N=4 are %d'%(round(Ncall1));\n", + "print 'calls per hour per cell for N=7 are %d'%(round(Ncall2));\n", + "print 'calls per hour per cell for N=12 are %d \\n'%(Ncall3);\n", + "# To find S BY I\n", + "# N=(1/3)[6*(S/I)]**(2/PPL)\n", + "S_I1=10*(PPL/2)*(math.log10(N1)-math.log10(1./3)-(2./PPL)*math.log10(6));#Mean S/I (dB)\n", + "\n", + "S_I2=10*(PPL/2)*(math.log10(N2)-math.log10(1./3)-(2./PPL)*math.log10(6));\n", + "S_I3=10*(PPL/2)*(math.log10(N3)-math.log10(1./3)-(2./PPL)*math.log10(6));\n", + "\n", + "print 'Mean S/I(dB) for N=4 is %.1f'%S_I1\n", + "print 'Mean S/I(dB) for N=7 is %.1f'%S_I2\n", + "print 'Mean S/I(dB) for N=12 is %.1f'%S_I3" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "NO of voice channels for N=4 are 99\n", + "NO of voice channels for N=7 are 56\n", + "NO of voice channels for N=12 are 33\n", + "\n", + "calls per hour per cell for N=4 are 2558\n", + "calls per hour per cell for N=7 are 1349\n", + "calls per hour per cell for N=12 are 724 \n", + "\n", + "Mean S/I(dB) for N=4 is 13.8\n", + "Mean S/I(dB) for N=7 is 18.7\n", + "Mean S/I(dB) for N=12 is 23.3\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.4, Page 154" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "spectrum=12.5*10**6; #in Hz\n", + "CHBW=200*10**3;#in Hz\n", + "N=4.;#reuse factor\n", + "Blocking=0.02; # 2%\n", + "callHT=120.;#average call holding time in sec\n", + "PPL=4.;#propogation path loss coefficient\n", + "CntrlCH=3.; #No of control channels\n", + "Ts=8.; # No of voice channels per RF channel\n", + "\n", + "#Calculations&Results\n", + "No_ofVCH=((spectrum*Ts)/(CHBW*N))-CntrlCH;\n", + "print 'No of voice channels for N=4 are %d'%(No_ofVCH)\n", + "TrafLoad=110.;\n", + "CarryLoad=(1-Blocking)*TrafLoad;\n", + "Ncall=CarryLoad*3600/callHT;\n", + "print 'Calls per hour per cell for N=4 are %d calls/hour/cell \\n '%(round(Ncall));\n", + "S_I=10*(PPL/2)*(math.log10(N)-math.log10(1./3)-(2./PPL)*math.log10(6));\n", + "print 'Mean S/I(dB) for N=4 is %.1f dB \\n '%(S_I)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "No of voice channels for N=4 are 122\n", + "Calls per hour per cell for N=4 are 3234 calls/hour/cell \n", + " \n", + "Mean S/I(dB) for N=4 is 13.8 dB \n", + " \n" + ] + } + ], + "prompt_number": 18 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 5.5, Page 139" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "VCH=395.;#Total allocated voice channels\n", + "CHBW=30.; # in kHz\n", + "Spectrum=12.5; # in MHz\n", + "CallHT=120.; #Average call holding time in sec\n", + "Blocking=0.02; # 2%\n", + "PL=40.; #slope of path loss in dBperdecade\n", + "\n", + "#Calculations&Results\n", + "print \"We consider only the \ufb01rst tier interferers and neglect the effects of cochannel interference from the second and other higher tiers.\"\n", + "#FOR 120degree sectorization\n", + "#N=4\n", + "VCH11=(VCH/(4*3));\n", + "OffLoad11=24.629; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site11=3*OffLoad11;\n", + "CarLoad11=(1-Blocking)*Load_site11;\n", + "Calls_hr_site11=CarLoad11*3600/CallHT;\n", + "R11=math.sqrt(CarLoad11/0.52);\n", + "Seff11=CarLoad11/(2.6*Spectrum*R11**2);\n", + "S_I11=PL*math.log10(math.sqrt(3*4))-10*math.log10(2);\n", + "#N=7\n", + "VCH12=(VCH/(3*7));\n", + "OffLoad12=12.341; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site12=3*OffLoad12;\n", + "CarLoad12=(1-Blocking)*Load_site12;\n", + "Calls_hr_site12=CarLoad12*3600/CallHT;\n", + "R12=math.sqrt(CarLoad12/0.52);\n", + "Seff12=CarLoad12/(2.6*Spectrum*R12**2);\n", + "S_I12=PL*math.log10(math.sqrt(3*7))-10*math.log10(2);\n", + "#N=12\n", + "VCH13=VCH/(3*12);\n", + "OffLoad13=5.842; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site13=3*OffLoad13;\n", + "CarLoad13=(1-Blocking)*Load_site13;\n", + "Calls_hr_site13=CarLoad13*3600/CallHT;\n", + "R13=math.sqrt(CarLoad13/0.52);\n", + "Seff13=CarLoad13/(2.6*Spectrum*R13**2);\n", + "S_I13=PL*math.log10(math.sqrt(3*12))-10*math.log10(2);\n", + "#For omnidirectional \n", + "#N=4\n", + "VCH21=VCH/(4);\n", + "OffLoad21=87.004; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site21=OffLoad21;\n", + "CarLoad21=(1-Blocking)*Load_site21;\n", + "Calls_hr_site21=CarLoad21*3600/CallHT;\n", + "R21=math.sqrt(CarLoad21/0.52);\n", + "Seff21=CarLoad21/(2.6*Spectrum*R21**2);\n", + "S_I21=PL*math.log10(math.sqrt(3*4))-10*math.log10(6);\n", + "#N=7\n", + "VCH22=VCH/(7);\n", + "OffLoad22=46.817; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site22=OffLoad22;\n", + "CarLoad22=(1-Blocking)*Load_site22;\n", + "Calls_hr_site22=CarLoad22*3600/CallHT;\n", + "R22=math.sqrt(CarLoad22/0.52);\n", + "Seff22=CarLoad22/(2.6*Spectrum*R22**2);\n", + "S_I22=PL*math.log10(math.sqrt(3*7))-10*math.log10(6);\n", + "#N=12\n", + "VCH23=VCH/(12);\n", + "OffLoad23=24.629; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site23=OffLoad23;\n", + "CarLoad23=(1-Blocking)*Load_site23;\n", + "Calls_hr_site23=CarLoad23*3600/CallHT;\n", + "R23=math.sqrt(CarLoad23/0.52);\n", + "Seff23=CarLoad23/(2.6*Spectrum*R23**2);\n", + "S_I23=PL*math.log10(math.sqrt(3*12))-10*math.log10(6);\n", + "# For 60degree Sectorization\n", + "#N=3\n", + "VCH31=VCH/(6*3);\n", + "OffLoad31=14.902; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site31=6*OffLoad31;\n", + "CarLoad31=(1-Blocking)*Load_site31;\n", + "Calls_hr_site31=CarLoad31*3600/CallHT;\n", + "R31=math.sqrt(CarLoad31/0.52);\n", + "Seff31=CarLoad31/(2.6*Spectrum*R31**2);\n", + "S_I31=PL*math.log10(math.sqrt(3*3))-10*math.log10(1);\n", + "#N=4\n", + "VCH32=VCH/(6*4);\n", + "OffLoad32=10.656; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site32=6*OffLoad32;\n", + "CarLoad32=(1-Blocking)*Load_site32;\n", + "Calls_hr_site32=CarLoad32*3600/CallHT;\n", + "R32=math.sqrt(CarLoad32/0.52);\n", + "Seff32=CarLoad32/(2.6*Spectrum*R32**2);\n", + "S_I32=PL*math.log10(math.sqrt(3*4))-10*math.log10(1);\n", + "#N=7\n", + "VCH33=VCH/(6*7);\n", + "OffLoad33=5.084; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site33=6*OffLoad33;\n", + "CarLoad33=(1-Blocking)*Load_site33;\n", + "Calls_hr_site33=CarLoad33*3600/CallHT;\n", + "R33=math.sqrt(CarLoad33/0.52);\n", + "Seff33=CarLoad33/(2.6*Spectrum*R33**2);\n", + "S_I33=PL*math.log10(math.sqrt(3*7))-10*math.log10(1);\n", + "#N=12\n", + "VCH34=VCH/(6*12);\n", + "OffLoad34=2.227; # Offered traf\ufb01c load per sector from Erlang-B table(Appendix A)\n", + "Load_site34=6*OffLoad34;\n", + "CarLoad34=(1-Blocking)*Load_site34;\n", + "Calls_hr_site34=CarLoad34*3600/CallHT;\n", + "R34=math.sqrt(CarLoad34/0.52);\n", + "Seff34=CarLoad34/(2.6*Spectrum*R34**2);\n", + "S_I34=PL*math.log10(math.sqrt(3.*12))-10*math.log10(1);\n", + "\n", + "print 'For Omnidirectional Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency'\n", + "print 'For N=4 %d %.1f %.3f\\n'%(Calls_hr_site21,S_I21,Seff21);\n", + "print 'For N=7 %d %.1f %.3f\\n'%(Calls_hr_site22,S_I22,Seff22);\n", + "print 'For N=12 %d %.1f %.3f\\n'%(Calls_hr_site23,S_I23,Seff23);\n", + "\n", + "print 'For 120deg sector Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\\n'\n", + "print 'For N=4 %d %.1f %.3f\\n'%(Calls_hr_site11,S_I11,Seff11);\n", + "print 'For N=7 %d %.1f %.3f\\n'%(Calls_hr_site12,S_I12,Seff12);\n", + "print 'For N=12 %d %.1f %.3f\\n'%(Calls_hr_site13,S_I13,Seff13);\n", + "\n", + "print 'For 60 deg Sector Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\\n'\n", + "print 'For N=3 %d %.1f %.3f\\n'%(Calls_hr_site31,S_I31,Seff31);\n", + "print 'For N=4 %d %.1f %.3f\\n'%(Calls_hr_site32,S_I32,Seff32);\n", + "print 'For N=7 %d %.1f %.3f\\n'%(Calls_hr_site33,S_I33,Seff33);\n", + "print 'For N=12 %d %.1f %.3f\\n'%(Calls_hr_site34,S_I34,Seff34);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "We consider only the \ufb01rst tier interferers and neglect the effects of cochannel interference from the second and other higher tiers.\n", + "For Omnidirectional Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\n", + "For N=4 2557 13.8 0.016\n", + "\n", + "For N=7 1376 18.7 0.016\n", + "\n", + "For N=12 724 23.3 0.016\n", + "\n", + "For 120deg sector Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\n", + "\n", + "For N=4 2172 18.6 0.016\n", + "\n", + "For N=7 1088 23.4 0.016\n", + "\n", + "For N=12 515 28.1 0.016\n", + "\n", + "For 60 deg Sector Calls_per_hour_per_cellsite Mean S_I ratio SpecrtalEfficiency\n", + "\n", + "For N=3 2628 19.1 0.016\n", + "\n", + "For N=4 1879 21.6 0.016\n", + "\n", + "For N=7 896 26.4 0.016\n", + "\n", + "For N=12 392 31.1 0.016\n", + "\n" + ] + } + ], + "prompt_number": 22 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch6.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch6.ipynb new file mode 100755 index 00000000..7c64b872 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch6.ipynb @@ -0,0 +1,466 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:0b8e52617510df277ef1e48e119f37ff192613df767b6d3b9de6242855aa9cf9" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 6: Multiple Access Techniques" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.1, Page 158" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Area=8; #in km^2\n", + "Cover=4000.;# in km^2\n", + "CallBH=1.2; #Avg calls during BH\n", + "HT=100; # Avg holding time in sec\n", + "Block=0.02; #Blocking=2%\n", + "N=4.;#Frequency reuse factor\n", + "Spectrum=12.5;# in MHz\n", + "CHBW=200;# in kHz\n", + "User_CH=8;#No of users per RF channel\n", + "\n", + "#Calculations&Results\n", + "RFCH=Spectrum*1000/CHBW;\n", + "TCH=int(RFCH)*User_CH;\n", + "SigCH=3;#No of signalling channels per cell\n", + "TCH_cell=TCH/N-SigCH;\n", + "Cells=Cover/Area;\n", + "OffLoad=108.4; # in Erlangs\n", + "print 'Using Erlang-B Tables, Total traffic offered by %d channels at 0.02 blocking = %.1f Erlangs/cell'%(TCH_cell,OffLoad*(1-Block));\n", + "CarLoad=OffLoad*(1-Block);\n", + "Calls_hr_cell=CarLoad*3600/HT;\n", + "MaxUser_hr_cell=Calls_hr_cell/CallBH;\n", + "Seff=CarLoad*Cells/(Spectrum*Cover);\n", + "print 'Spectral Efficiency is %.2f Erlangs/MHz/km^2'%Seff;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Using Erlang-B Tables, Total traffic offered by 121 channels at 0.02 blocking = 106.2 Erlangs/cell\n", + "Spectral Efficiency is 1.06 Erlangs/MHz/km^2\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.2, Page 159" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "TCH=395; # Traffic Channels\n", + "SysBW=12.5; #in MHz\n", + "CHspace=30.; # in kHz\n", + "\n", + "#Calculations\n", + "Eff=TCH*CHspace/(SysBW*1000);\n", + "\n", + "#Result\n", + "print 'Multiple access spectral efficiency of FDMA System is %.3f'%Eff" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Multiple access spectral efficiency of FDMA System is 0.948\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.3, Page 160" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Tf=40; #Frame duration in msec\n", + "Mt=6; # Frames per slot\n", + "Bu=30; #bandwidth(KHz) of an individual user during his or her time slot\n", + "Nu=395.;# number of users sharing the same time slot in the system, but having access to different frequency sub-bands\n", + "Bw=12.5; # in MHz\n", + "DR=16.2;#Data rate in kbps\n", + "FDur=40.; # Frame duration in msec\n", + "slots=6; #No of slots per time frame\n", + "IndiRate=16.2; #Individual data rate in kbps\n", + "Srate=13.; #Speech rate in kbps\n", + "\n", + "#Calculations\n", + "TimeSlot=(Srate/IndiRate)*(FDur/slots);\n", + "Seff=TimeSlot*slots*Bu*Nu/(FDur*Bw*1000);\n", + "\n", + "#Results\n", + "print 'Multiple access spectral efficiency of TDMA is %.2f'%Seff;\n", + "print 'The overhead portion of the frame is %d percent'%((1-Seff)*100);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Multiple access spectral efficiency of TDMA is 0.76\n", + "The overhead portion of the frame is 23 percent\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.4, Page 161" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "nb=0.9; #BW efficiency factor\n", + "u=2; # Bit Efficiency with QPSK\n", + "Vf=1; # Voice activity factor\n", + "BW=12.5; #in MHz\n", + "IR=16.2; # in kbps\n", + "N=19; #frequency reuse factor\n", + "\n", + "#Calculations\n", + "Nu=nb*u*BW*1000/(Vf*IR*N);# number of channels (mobile users) per cell\n", + "Seff=int(Nu)*IR/(BW*1000);\n", + "\n", + "#Results\n", + "print 'Capacity of system is %d mobile users per cell'%Nu;\n", + "print 'Spectral efficiency of TDMA system is %.3f bit/sec/Hz'%Seff" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacity of system is 73 mobile users per cell\n", + "Spectral efficiency of TDMA system is 0.095 bit/sec/Hz\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.5, Page 163" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Nr=2.;# number of reference bursts per frame\n", + "Nt=24; # number of traf\ufb01c bursts (slots) per frame(120msec)\n", + "FL=120; #Frame length in msec\n", + "Br=148; # number of overhead bits per reference burst\n", + "Bp=34; # number of overhead bits per preamble per slot \n", + "Bg=8.25;#number of equivalent bits in each guard time interval \n", + "Tf=120; # frame duration in msec\n", + "Rrf=270.83333333; # bit rate of the RF channel in kbps\n", + "R=22.8; #bit rate of each channel in kbps\n", + "\n", + "#Calculations\n", + "B0=Nr*(8*Br)+Nt*(8*Bp)+(Nt+Nr)*(8*Bg);#The number of overhead bits per frame\n", + "Bt=FL*10**-3*Rrf*10**3;#The total number of bits per frame \n", + "Eff=(1-B0/Bt)*100;\n", + "CH_Frame=(Eff/100)*Rrf/R;#No of channels/frame\n", + "\n", + "#Results\n", + "print 'The frame efficiency is %.2f percent'%Eff;\n", + "print 'Number of channels/frame are %d'%(CH_Frame)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The frame efficiency is 67.35 percent\n", + "Number of channels/frame are 7\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.6, Page 170" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "nb=0.9;#bandwidth ef\ufb01ciency\n", + "nf=0.45;#frequency reuse ef\ufb01ciency \n", + "Cd=0.8; #capacity degradation factor \n", + "Vf=0.4;#voice activity factor \n", + "Eb_I0=7; # desired energy-to-interference ratio in dB\n", + "L=1;# ef\ufb01ciency of sector-antenna in cell \n", + "BW=12.5;#One way system BW in MHz\n", + "R=16.2;#Information rate in kbps\n", + "\n", + "#Calculations\n", + "Eb_I=10**(Eb_I0*0.1);#To convert from dB to a normal value\n", + "Nu=(nf*nb*Cd*L/Vf)*(BW*1000/(Eb_I*R));#Capacity of system\n", + "Seff=round(Nu)*R/(12.5*10**3);\n", + "\n", + "#Results\n", + "print 'Capacity of system is %d mobile users per cell'%round(Nu);\n", + "print 'Spectral efficiency of TDMA system is %.3f bits/sec/Hz'%Seff;\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Capacity of system is 125 mobile users per cell\n", + "Spectral efficiency of TDMA system is 0.162 bits/sec/Hz\n" + ] + } + ], + "prompt_number": 10 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.7, Page 171" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "#Given Data from Exa 6.4 and Exa 6.6\n", + "Cd=0.8; #capacity degradation factor\n", + "R=16.2;#Data rate in kbps\n", + "Eb_I0=7; #in dB\n", + "Eb_I=10**(Eb_I0*0.1);#To convert from dB to a normal value\n", + "Vf=0.4;#voice activity factor \n", + "u=2; # Bit Efficiency\n", + "IR=16.2; # in kbps\n", + "N=19; #frequency reuse factor\n", + "nf=0.45;#frequency reuse ef\ufb01ciency \n", + "\n", + "#Calculations\n", + "Ncdma_by_Ntdma=Cd*N*nf*IR/(Eb_I*Vf*u*R);\n", + "\n", + "#Result\n", + "print 'The ratio of capacity of DS-CDMA to TDMA is %.3f'%Ncdma_by_Ntdma" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The ratio of capacity of DS-CDMA to TDMA is 1.706\n" + ] + } + ], + "prompt_number": 11 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.8, Page 172" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Bss=600; #Hopping bandwidth in MHz\n", + "stepsize=400; # in Hz\n", + "\n", + "#Calculations\n", + "No_of_Tones=Bss*10**6/stepsize;\n", + "Min_chips_required=math.log(No_of_Tones,2);\n", + "\n", + "#Result\n", + "print 'Minimum number of chips required are %d chips'%Min_chips_required" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Minimum number of chips required are 20 chips\n" + ] + } + ], + "prompt_number": 12 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.9, Page 179" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "e=2.71828; #Euler's number\n", + "Tprop=0.4; #Max propogation delay in sec\n", + "R=10; #data rate in Mbps\n", + "PackLen=400; #packet length in bits\n", + "\n", + "#Calculations\n", + "Tp=PackLen/R; #packet transmission time in microsec\n", + "a=Tprop/Tp;\n", + "G=Tp*10**-6*R*10**6/PackLen;#normalized offered traf\ufb01c load \n", + "#Slotted nonpersistent\n", + "S0=a*G*e**(-a*G)/(1-e**(-a*G)+a);#normalized throughput \n", + "#Unslotted nonpersistent\n", + "S1=G*e**(-a*G)/(1+(2*a)+e**(-a*G));#normalized throughput \n", + "#Slotted 1-persistent\n", + "S2=G*e**(-G*(1+a))*(1+a-e**(-a*G))/((1+a)*(1-e**(-a*G))+a*e**(-G*(1+a)));#normalized throughput \n", + "\n", + "#Results\n", + "print 'The Normalized throughput with an unslotted non persistent,a slotted persistent and a slotted 1-persistent CSMA protocol are \\n %.3f,%.3f and %.3f respectively'%(S0,S1,S2);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The Normalized throughput with an unslotted non persistent,a slotted persistent and a slotted 1-persistent CSMA protocol are \n", + " 0.496,0.493 and 0.531 respectively\n" + ] + } + ], + "prompt_number": 14 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 6.10, Page 188" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Tprop=4; #maximum propogation delay in sec\n", + "R=10; # data rate in Mbps\n", + "PackLen=400.; #data packet length in bits\n", + "ACK=20; #length of ACK packet in bits\n", + "Tproc=1; #processing time(sec)\n", + "p=0.01;#probability that a data packet or its ACK can be corrupted during transmission\n", + "\n", + "#Calculations\n", + "Tp=PackLen/R; #packet transmission time in microsec\n", + "Ta=ACK/R; # transmission time for an ACK in microsec\n", + "T=Tp+2*Tprop+2*Tproc+Ta;# total time for transmission time \n", + "# Stop and wait ARQ\n", + "Eff0=(1-p)*Tp/((1-p)*T+p*Tp);\n", + "#SRP with window size W=8\n", + "W=8;\n", + "Eff1=(2+p*(W-1))/(2+p*(3*W-1));\n", + "#Go-Back-N protocol with window size W=8\n", + "Eff2=1./(1+W*(p/(1-p)));\n", + "\n", + "#Results\n", + "print 'The data link protocol efficiency with Stop and Wait protocol, SRP and GBN are \\n %.3f, %.3f abd %.3f respectively'%(Eff0,Eff1,Eff2);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The data link protocol efficiency with Stop and Wait protocol, SRP and GBN are \n", + " 0.763, 0.928 abd 0.925 respectively\n" + ] + } + ], + "prompt_number": 15 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch8.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch8.ipynb new file mode 100755 index 00000000..ccf24614 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch8.ipynb @@ -0,0 +1,178 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:f50ddd5f96951e3a4bd117adfc40133b15c129b8f04d9b391396a08431c3aae2" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 8: Speech Coding and Channel Coding" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.1, Page 227" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Pdiff=-3.; #in dB\n", + "AMR1=12.2; #in kbps\n", + "AMR2=7.95; #in kbps\n", + "AMR3=4.75; #in kbps\n", + "\n", + "#Calculations\n", + "#CG(dB)=10math.log{(DPDCH(kbps)+DPCCH)/(DPDCH(AMR bit rate (kbps))+ DPCCH)}\n", + "CG1=10*math.log10((AMR1+AMR1*10**(Pdiff/10))/(AMR2+AMR1*10**(Pdiff/10)));\n", + "CG2=10*math.log10((AMR1+AMR1*10**(Pdiff/10))/(AMR3+AMR1*10**(Pdiff/10)));\n", + "\n", + "#Results\n", + "print 'By reducing the AMR bit rate from 12.2 to 7.95 kbps coverage gain becomes %.2f dB'%CG1;\n", + "print 'By reducing the AMR bit rate from 7.95 to 4.75 kbps coverage gain becomes %.2f dB'%CG2;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "By reducing the AMR bit rate from 12.2 to 7.95 kbps coverage gain becomes 1.15 dB\n", + "By reducing the AMR bit rate from 7.95 to 4.75 kbps coverage gain becomes 2.27 dB\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.2, Page 239" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import numpy as np\n", + "import sympy\n", + "from sympy import symbols\n", + "\n", + "#Variable declaration\n", + "K=4; #constraint length\n", + "r=1./2; #code rate(n/k)\n", + "x=symbols('x');#Defining x as a ploynomial variable\n", + "G1=1+x**2+x**3;\n", + "G2=1+x+x**2+x**3;\n", + "ins=np.array([1, 0, 1, 1, 1]);#input(first bit first)\n", + "\n", + "#Calculations&Results\n", + "#with reference to Fig 8.9 on page no 239\n", + "g1=np.array([1, 0, 1, 1]); #converting from G1 polynomial to bit form\n", + "g2=[1, 1, 1, 1];##converting from G2 polynomial to bit form\n", + "x1=np.convolve(g1,ins)\n", + "x2=np.convolve(g2,ins)\n", + "V1=x1%2;\n", + "V2=x2%2;\n", + "print \"Multiplexing the V1 and V2 to get required output sequence as\"\n", + "a=5;\n", + "for i in range(0,6):\n", + " print '%d%d'%(V2[a],V1[a]);\n", + " a=a-1;\n", + " " + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Multiplexing the V1 and V2 to get required output sequence as\n", + "10\n", + "10\n", + "10\n", + "00\n", + "10\n", + "11\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 8.3, Page 246" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import numpy as np\n", + "\n", + "#Variable declaration\n", + "BitStream=np.array([0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1]);#Last bit to first bit\n", + "\n", + "# Interleaver\n", + "Input1=[[1, 0, 0, 0],[1,0,0,0],[1,1,1,0],[0,0,0,0]] #Writing data row wise\n", + "\n", + "#Calculations&Results\n", + "print \"GIven Bit stream is\",BitStream\n", + "print \"Input to interleaver is\",Input1\n", + "\n", + "Output1=np.array([0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 1]); # Reading data column wise\n", + "print \"Output of interleaver is\",Output1\n", + "#De-interleaver\n", + "Input2=[[1, 1, 1, 0],[0,0,1,0],[0,0,1,0],[0,0,0,0]] #Writing o/p data row wise\n", + " # Let From 6th to 9th bits have Burst Error \n", + "print \"Input to de-interleaver is\",Input2\n", + " #Output of deinterleaver\n", + " \n", + "Output2= [0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1]; \n", + "print \"Output of de-interleaver is\",Output2\n", + "print \"Bits with Burst error were from 6th to 9th. But in output of de-interleaver, they relocated to positions 3rd, 6th, 10th and 14th.\";" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "GIven Bit stream is [0 0 0 0 0 1 1 1 0 0 0 1 0 0 0 1]\n", + "Input to interleaver is [[1, 0, 0, 0], [1, 0, 0, 0], [1, 1, 1, 0], [0, 0, 0, 0]]\n", + "Output of interleaver is [0 0 0 0 0 1 0 0 0 1 0 0 0 1 1 1]\n", + "Input to de-interleaver is [[1, 1, 1, 0], [0, 0, 1, 0], [0, 0, 1, 0], [0, 0, 0, 0]]\n", + "Output of de-interleaver is [0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 1]\n", + "Bits with Burst error were from 6th to 9th. But in output of de-interleaver, they relocated to positions 3rd, 6th, 10th and 14th.\n" + ] + } + ], + "prompt_number": 3 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/ch9.ipynb b/Wireless_Communications_and_Networking_by_V._Garg/ch9.ipynb new file mode 100755 index 00000000..7efd7e54 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/ch9.ipynb @@ -0,0 +1,478 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:4f7509b378d9baa23589f40ce770175499b6cadfd03b87969971e1834bcae9ad" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 9: Modulation Schemes" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.1, Page 259" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "import scipy\n", + "from scipy.optimize import fsolve\n", + "\n", + "#Variable declaration\n", + "Pe=10**-6;#Probability of error\n", + "e=2.71828; #Euler's Number\n", + "\n", + "#Calculations\n", + "# For BPSK\n", + "#Pe(=10**-6)=e**(-x)/(2*sqrt(%pi*x)); where x=Eb/No\n", + "def f(x):\n", + " y=2.71828**(-x)/(2*math.sqrt(math.pi*x))-10**-6\n", + " return y\n", + "x = fsolve(f,0.1);\n", + "\n", + "#Results\n", + "print 'Eb/No For BPSK is %.2f dB'%(10*math.log10(x));\n", + "print 'FSK requires 3 dB more in terms of Eb/N0 to give the same Pe as BPSK so it comes out to be %.2f dB'%(10*math.log10(x)+3);" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Eb/No For BPSK is 10.54 dB\n", + "FSK requires 3 dB more in terms of Eb/N0 to give the same Pe as BPSK so it comes out to be 13.54 dB\n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.2, Page 259" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Pe=10.**-6;#Probability of error\n", + "No=10.**-10; # PSD in W/Hz\n", + "R=100*10**3; #data rate in bps\n", + "\n", + "#Calculations\n", + "#From Example 9.1, Eb/N0= 10.54dB (11.32) for Pe=10**-6 \n", + "#Therefore\n", + "Eb_No=11.32; #From Exa. 9.1\n", + "# Eb/No = A**2/(2*No*R);\n", + "A=math.sqrt(2*No*(Eb_No)*R);\n", + "\n", + "#Result\n", + "print 'Amplitude of a carrier signal is %.3f mV'%(A*1000);\n", + "#Incorrect answer in textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Amplitude of a carrier signal is 15.047 mV\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.3, Page 267" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "B=['00','10','01','11','01','00','11','10','10','01','01','00'];#Given Bit stream\n", + "\n", + "#Calculations&Results\n", + "print \"Phase transition table for pi/4-DQPSK Modulation is given as \"\n", + "print \" By Referring Table 9.1 on page No 266 i.e\"\n", + "print \"Symbol Phase transition\"\n", + "print \"00 => 45\u00b0\"\n", + "print \"01 => 135\u00b0\"\n", + "print \"10 => -45\u00b0\"\n", + "print \"11 => -135\u00b0\"\n", + "print \"sym Dell phi(k) Phi(k)\"\n", + "#BitStream='001001110100111010010100';\n", + "\n", + "phase=0; #Taking initial phase as zero\n", + "for i in range(0,12):\n", + " if(B[i]=='00'):\n", + " phase=phase+45; \n", + " print ' %s 45 %d'%(B[i],phase);\n", + " \n", + " if(B[i]=='01'):\n", + " phase=phase+135;\n", + " print ' %s 135 %d'%(B[i],phase);\n", + " \n", + " if(B[i]=='10'):\n", + " phase=phase-45;\n", + " print ' %s -45 %d'%(B[i],phase);\n", + " \n", + " if(B[i]=='11'):\n", + " phase=phase-135;\n", + " print ' %s -135 %d'%(B[i],phase);\n", + " \n", + "\n", + "print 'final phase for the pi/4-DQPSK modulation method for given bitstream is %d degree'%phase" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Phase transition table for pi/4-DQPSK Modulation is given as \n", + " By Referring Table 9.1 on page No 266 i.e\n", + "Symbol Phase transition\n", + "00 => 45\u00b0\n", + "01 => 135\u00b0\n", + "10 => -45\u00b0\n", + "11 => -135\u00b0\n", + "sym Dell phi(k) Phi(k)\n", + " 00 45 45\n", + " 10 -45 0\n", + " 01 135 135\n", + " 11 -135 0\n", + " 01 135 135\n", + " 00 45 180\n", + " 11 -135 45\n", + " 10 -45 0\n", + " 10 -45 -45\n", + " 01 135 90\n", + " 01 135 225\n", + " 00 45 270\n", + "final phase for the pi/4-DQPSK modulation method for given bitstream is 270 degree\n" + ] + } + ], + "prompt_number": 4 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.4, Page 270" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "CHBW=200; #Channel BW in KHz\n", + "R=270.83; #Data rate in kbps\n", + "Fc=900; #carrier frequency in MHz\n", + "\n", + "#Calculations\n", + "FreqShift=0.5*R;\n", + "#Transmitted Frequencies\n", + "Fh=Fc*1000+0.25*R;#Max\n", + "Fl=Fc*1000-0.25*R;#Min\n", + "BWEff=R/CHBW;\n", + "\n", + "#Results\n", + "print 'The frequency shift between binary 1 and binary 0 is %.3f kHz'%FreqShift;\n", + "print 'Maximum and Minimum value of transmitted frequencies are %.4f mHz and %.4f mHz respectively'%(Fh/1000,Fl/1000);\n", + "print 'Bandwidth efficiency is %.2f bps/Hz'%BWEff" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "The frequency shift between binary 1 and binary 0 is 135.415 kHz\n", + "Maximum and Minimum value of transmitted frequencies are 900.0677 mHz and 899.9323 mHz respectively\n", + "Bandwidth efficiency is 1.35 bps/Hz\n" + ] + } + ], + "prompt_number": 5 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.5, Page 271" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "R=270.; #data rate in kbps\n", + "Eb_No=6.; # in dB\n", + "GMSK=0.3; #Gaussian minimum shift keying\n", + "\n", + "#Calculations&Results\n", + "Tb=1./R *10**3; #in microsec\n", + "B=GMSK/Tb;\n", + "print '3-dB BW for a gaussian low pass filter is %.f kHz'%(B*1000);\n", + "PowerBW=1.41*R;\n", + "DegradFac=0.89;\n", + "Pe=math.erfc(math.sqrt(2*DegradFac*10**(0.1*Eb_No)));\n", + "print 'Power bandwidth in the RF channel is %.1f kHz'%PowerBW\n", + "print 'Bit error probability for GMSK is %.1e'%Pe; #Incorrect answer in textbook" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "3-dB BW for a gaussian low pass filter is 81 kHz\n", + "Power bandwidth in the RF channel is 380.7 kHz\n", + "Bit error probability for GMSK is 1.7e-04\n" + ] + } + ], + "prompt_number": 6 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.6, Page 273" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "\n", + "#Variable declaration\n", + "Rs=19200; #symbols per second\n", + "states=64;\n", + "\n", + "#Calculations\n", + "Bits_symbol=math.log(states,2);\n", + "BitRate=Bits_symbol*Rs;\n", + "\n", + "#Result\n", + "print 'Bit Rate of the modulator is %.1f kbps'%(BitRate/1000)" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Bit Rate of the modulator is 115.2 kbps\n" + ] + } + ], + "prompt_number": 7 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.7, Page 274" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "import scipy\n", + "from scipy.optimize import fsolve\n", + "\n", + "#Variable declaration\n", + "Rb=144; #data rate in kbps\n", + "BW=36; #in MHz\n", + "Pb=3*10**-5;#probability of bit error\n", + "\n", + "#Calculations\n", + "Seff=Rb/BW; #spectral efficiency in bps/Hz\n", + "M=2**(Rb/BW); #since the channel is band limited\n", + "\n", + "#since Q[sqrt(2*Eb_No)]=(1/2)*erfc[sqrt(Eb_No)] # refer page no 257 equ 9.35\n", + "def f(x):\n", + " y=(3./8)*math.erfc(math.sqrt((2./5)*x))-Pb #from eqn 9.66 and 9.35\n", + " return y\n", + " \n", + "x = fsolve(f,0.1)\n", + "\n", + "#Result\n", + "print 'For a rectangular constellation (refer Figure 9.12), with a Gaussian channel and matched \ufb01lter reception, the calculated Eb/No value is %.1f dB'%(10*math.log10(x));" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For a rectangular constellation (refer Figure 9.12), with a Gaussian channel and matched \ufb01lter reception, the calculated Eb/No value is 12.9 dB\n" + ] + } + ], + "prompt_number": 8 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.8, Page 274" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "import math\n", + "import scipy\n", + "from scipy.optimize import fsolve\n", + "\n", + "#Variable declaration\n", + "Pb=10**-8;#BER probability\n", + "\n", + "#Calculations&Results\n", + "print \"For 16-PSK:\"\n", + "# Pb=0.5*Q(0.552*sqrt(Eb_No));\n", + "#since Q[sqrt(2*Eb_No)]=(1/2)*erfc[sqrt(Eb_No)] # refer page no 257 equ 9.35\n", + "def f(x):\n", + " y=0.25*math.erfc(math.sqrt(0.5*0.552**2*x))-Pb\n", + " return y\n", + "\n", + "x = fsolve(f,0.1)\n", + "\n", + "print 'Using equation 9.50 we get Eb/No as %d dB (approx)'%round(10*math.log10(x));\n", + "\n", + "print \"For 16-QAM\"\n", + "#Pb=0.75*Q(sqrt(0.8*Eb_No));\n", + "def f(x1):\n", + " y=(3./8)*math.erfc(math.sqrt(0.4*x1))-Pb\n", + " return y\n", + " \n", + "x1 = fsolve(f,0.1)\n", + "\n", + "#since Q[sqrt(2*Eb_No)]=(1/2)*erfc[sqrt(Eb_No)] # refer page no 257 equ 9.35\n", + "print 'Using equation 9.66 we get Eb/No as %d dB (approx)'%round(10*math.log10(x1));\n", + "print 'Thus 16-QAM has an advantage of about %d dB compared to 16-PSK'%(10*math.log10(x)-10*math.log10(x1));" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "For 16-PSK:\n", + "Using equation 9.50 we get Eb/No as 20 dB (approx)\n", + "For 16-QAM\n", + "Using equation 9.66 we get Eb/No as 16 dB (approx)\n", + "Thus 16-QAM has an advantage of about 4 dB compared to 16-PSK\n" + ] + } + ], + "prompt_number": 9 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 9.9, Page 277" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "M=8; #number of different signal elements\n", + "Fc=250; #carrier frequency in kHz\n", + "DelF=25; #kHz\n", + "Pe=10**-6;#probability of error\n", + "\n", + "#Calculations\n", + "TotalBW=2*M*DelF;\n", + "nb=2*math.log(M,2)/(M+3);\n", + "#Pe=7*Q(z) and z=approx(5.08)\n", + "z=5.08;\n", + "Eb_No=(z)**2/math.log(M,2);\n", + "bits_sym=math.log(M,2);\n", + "\n", + "#Results\n", + "print 'Total bandwidth required is %d kHz \\n '%TotalBW;\n", + "print 'The bandwidth efficiency is %.4f \\n '%nb;\n", + "print 'The required Eb/No is %.3f dB \\n '%(10*math.log10(Eb_No));\n", + "print 'Carried bits per symbol are %d \\n '%bits_sym;" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Total bandwidth required is 400 kHz \n", + " \n", + "The bandwidth efficiency is 0.5455 \n", + " \n", + "The required Eb/No is 9.346 dB \n", + " \n", + "Carried bits per symbol are 3 \n", + " \n" + ] + } + ], + "prompt_number": 10 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/Wireless_Communications_and_Networking_by_V._Garg/screenshots/EbbyNo.png b/Wireless_Communications_and_Networking_by_V._Garg/screenshots/EbbyNo.png Binary files differnew file mode 100755 index 00000000..8b71e082 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/screenshots/EbbyNo.png diff --git a/Wireless_Communications_and_Networking_by_V._Garg/screenshots/comparision_of_models.png b/Wireless_Communications_and_Networking_by_V._Garg/screenshots/comparision_of_models.png Binary files differnew file mode 100755 index 00000000..21f83b0e --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/screenshots/comparision_of_models.png diff --git a/Wireless_Communications_and_Networking_by_V._Garg/screenshots/multiplexing.png b/Wireless_Communications_and_Networking_by_V._Garg/screenshots/multiplexing.png Binary files differnew file mode 100755 index 00000000..913873f0 --- /dev/null +++ b/Wireless_Communications_and_Networking_by_V._Garg/screenshots/multiplexing.png diff --git a/sample_notebooks/ManikandanD/Chapter_2_Motion_in_a_straight_line.ipynb b/sample_notebooks/ManikandanD/Chapter_2_Motion_in_a_straight_line.ipynb new file mode 100755 index 00000000..5e1116e7 --- /dev/null +++ b/sample_notebooks/ManikandanD/Chapter_2_Motion_in_a_straight_line.ipynb @@ -0,0 +1,825 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:81e7e778194095c491cf9fdf7aefef02501d247d9b184528d44cff4b23142c68"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 2 :Motion in a straight line"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.1 , Page no:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "s=9 #miles\n",
+ "#since 45 min=3/4hr\n",
+ "t=3/4 #hr\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=(s/t)\n",
+ "\n",
+ "#RESULTS\n",
+ "print \"Velocity in min/hr =\",round(v);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in min/hr = 12.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.2 , Page no:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "s=(1100*3)\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Distance in ft =\",round(s);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance in ft = 3300.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.3 , Page no:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "s=1.5*10**11; #m\n",
+ "v=3*10**8; #ms\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "t=(s/v)\n",
+ "\n",
+ "#Result\n",
+ "print\"Time in second =\",round(t),\"sec\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time in second = 500.0 sec\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.4 , Page no:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "s=270; #mils\n",
+ "t=4.5; #hours\n",
+ "t2=7; #hours\n",
+ "s2=300; #mi\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=(s/t)\n",
+ "vt=(v*t2)\n",
+ "t3=(s2/v)\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Velocity in min/hr =\",round(v),\"mi/hr\";\n",
+ "print\"Distance in mile =\",round(vt),\"mils\";\n",
+ "print\"Time in hr =\",round(t3),\"hours\";"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in min/hr = 60.0 mi/hr\n",
+ "Distance in mile = 420.0 mils\n",
+ "Time in hr = 5.0 hours\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.5 , Page no:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "s=1000; #distance in mile\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=400+120; #velocity in mile/hr\n",
+ "t=s/v;\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Time in hr =\",round(t,1); "
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time in hr = 1.9\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.6 , Page no:11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v1=100; #speed in km/hr\n",
+ "v2=60; #speed in km/hr\n",
+ "v3=80; #speed in km/hr\n",
+ "t1=2; #time in hr\n",
+ "t2=2; #time in hr\n",
+ "t3=1; #time in hr\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=((v1*t1)+(v2*t2)+(v3*t3))/(t1+t2+t3)\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Velocity in km/hr =\",round(v);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in km/hr = 80.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.7 , Page no:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v=40; #velocity in ft/sec\n",
+ "t=10; #time in sec\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "a=v/t;\n",
+ "v1=a*t\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Accelaration in ft/sec square =\",round(a);\n",
+ "print\"Velocity in ft/sec =\",round(v1);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Accelaration in ft/sec square = 4.0\n",
+ "Velocity in ft/sec = 40.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.8 , Page no:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v=30; #velocity in min/hr\n",
+ "v0=20; #velocity in min/hr\n",
+ "t=1.5; #time in sec\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "a=((v-v0)/t); #calculating acc. \n",
+ "t1=(36-30)/a; #calculating time\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Accelaration in (min/h)/sec =\",round(a,3);\n",
+ "print\"Time in second =\",round(t1,2);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Accelaration in (min/h)/sec = 6.667\n",
+ "Time in second = 0.9\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.9 , Page no:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v=24; #velocity in m/sec\n",
+ "a=8; #acc. in m/sec square\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "t=v/a; #using t=v/a\n",
+ "s=(1/2)*(a*t*t); #kinematical equation\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Time in sec =\",round(t);\n",
+ "print\"Distance in metre =\",round(s);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time in sec = 3.0\n",
+ "Distance in metre = 36.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.10 , Page no:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v=30; #velocity in m/sec\n",
+ "a=6; #acc. in m/sec square\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "t=v/a; #using t=v/a\n",
+ "s=(1/2)*(a*t*t); #kinematical equation\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Time in sec =\",round(t);\n",
+ "print\"Distance in metre =\",round(s);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time in sec = 5.0\n",
+ "Distance in metre = 75.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.11 , Page no:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v=math.sqrt(2*5*600);\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Velocity in ft/sec =\",round(v);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in ft/sec = 77.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 11
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.12 , Page no:12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v=50; #velocity in m/sec\n",
+ "s=500; #distance in m\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "a=((v*v)/(2*s));\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Acc. in m/sec square =\",round(a,2)"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Acc. in m/sec square = 2.5\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.13 , Page no:13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v=15; #velocity in m/sec\n",
+ "v0=30; #velocity in m/sec\n",
+ "a=-2; #acc. in m/sec square\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "s=((v*v)-(v0*v0))/(2*a); #kinematical equation\n",
+ "v=0;\n",
+ "s1=(v*v)-(v0*v0)/(2*a);\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Distance in metre =\",round(s,2);\n",
+ "print\"Distance in metre =\",round(s1,2);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Distance in metre = 168.75\n",
+ "Distance in metre = 225.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.14 , Page no:13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "g=9.8; #gravitational constant in m/sec square\n",
+ "t=2.5; #time in sec\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=g*t;\n",
+ "h=(1/2)*g*t*t; #kinematical equation\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Velocity in m/sec =\",round(v,2);\n",
+ "print\"Height in m =\",round(h,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in m/sec = 24.5\n",
+ "Height in m = 30.625\n"
+ ]
+ }
+ ],
+ "prompt_number": 14
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.15 , Page no:13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "g=32; #gravitational constant in ft/sec square\n",
+ "h=64; #height in ft\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "t=(math.sqrt((2*h)/g)); #kinematical equation\n",
+ "v=g*t; #kinematical equation\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Time in sec =\",round(t);\n",
+ "print\"Velocity in ft/sec =\",round(v);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time in sec = 2.0\n",
+ "Velocity in ft/sec = 64.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.16 , Page no:13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "g=32; #gravitational constant in ft/sec square\n",
+ "h=100; #height in ft\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=math.sqrt(2*g*h); #calculating velocity \n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Velocity in ft/sec =\",round(v);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in ft/sec = 80.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 16
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.17 , Page no:13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "h=0.78; #height in m\n",
+ "g=9.8; #gravitational constant in m/sec square\n",
+ "v=0.5; #velocity in m/sec\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "t=math.sqrt((2*h)/g); #calculating t\n",
+ "s=v*t; #calculating distance\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Time required in sec =\",round(t,3);\n",
+ "print\"Horizontal distance in m =\",round(s,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time required in sec = 0.399\n",
+ "Horizontal distance in m = 0.199\n"
+ ]
+ }
+ ],
+ "prompt_number": 17
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.18 , Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v0=20; #velocity in ft/sec\n",
+ "g=32; #gravitational constant in ft/sec\n",
+ "t=2; #time in sec\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=v0+(g*t); #kinematical equation\n",
+ "s=(v0*t)+(1/2)*g*t*t; #kinematical equation\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Velocity in ft/sec =\",round(v);\n",
+ "print\"Distance in ft =\",round(s);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in ft/sec = 84.0\n",
+ "Distance in ft = 104.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.19 , Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "v0=20; #velocity in ft/sec\n",
+ "g=-32; #gravitational constant in ft/sec\n",
+ "t=0.5; #time in sec\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "v=v0+(g*t); #kinematical equation\n",
+ "t=2; #time in sec\n",
+ "s=v0+(g*t); #kinematical equation\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Velocity in ft/sec =\",round(v);\n",
+ "print\"Distance in ft =\",round(s);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Velocity in ft/sec = 4.0\n",
+ "Distance in ft = -44.0\n"
+ ]
+ }
+ ],
+ "prompt_number": 19
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 2.20 , Page no:14"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#initialisation of variables\n",
+ "h=6; #height in ft\n",
+ "g=32; #gravitaional constant in ft/sec square\n",
+ "\n",
+ "#CALCULATIONS\n",
+ "t=math.sqrt((2*h)/g); #calculating time\n",
+ "\n",
+ "#RESULTS\n",
+ "print\"Time in sec =\",round(t,3);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Time in sec = 0.612\n"
+ ]
+ }
+ ],
+ "prompt_number": 20
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/SandeshNaik/ch3.ipynb b/sample_notebooks/SandeshNaik/ch3.ipynb new file mode 100755 index 00000000..2f2e44d3 --- /dev/null +++ b/sample_notebooks/SandeshNaik/ch3.ipynb @@ -0,0 +1,189 @@ +{ + "metadata": { + "name": "", + "signature": "sha256:ab5dad51b8bb4848e05fe479e673fa81caef98b1e0130b3768c6e1580871f987" + }, + "nbformat": 3, + "nbformat_minor": 0, + "worksheets": [ + { + "cells": [ + { + "cell_type": "heading", + "level": 1, + "metadata": {}, + "source": [ + "Chapter 3: Negative Feedback" + ] + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.1, Page 75" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Aol=200;\n", + "f2_ol=10000; # in Hz\n", + "B=0.04;\n", + "\n", + "#Calculations&Results\n", + "Asp=Aol/(1+B*Aol);\n", + "print \"Asp %.2f \\n \"%Asp; #Result\n", + "print \"Approximately Asp =1/B equal to %.0f \\n\"%(1/B);#result\n", + "S=Aol/Asp;\n", + "print \"S =%.0f \\n\"%S;\n", + "f2_sp=f2_ol*S;\n", + "print \"f2_sp %.0f Hz\"%f2_sp; #Result" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Asp 22.22 \n", + " \n", + "Approximately Asp =1/B equal to 25 \n", + "\n", + "S =9 \n", + "\n", + "f2_sp 90000 Hz\n" + ] + } + ], + "prompt_number": 1 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.2, Page 76" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Asp1=20.\n", + "Asp=10**(Asp1/20);\n", + "\n", + "#Calculations&Results\n", + "print \"Asp =%.0f\\n\"%Asp;#Result\n", + "#Rf/Ri=Asp-1;\n", + "print \"Rf/Ri=%.0f \\n\"%(Asp-1);#Result\n", + "print \"Rf must be 9 times larger than Ri. \\n There are many possibilities \";#Result" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "Asp =10\n", + "\n", + "Rf/Ri=9 \n", + "\n", + "Rf must be 9 times larger than Ri. \n", + " There are many possibilities \n" + ] + } + ], + "prompt_number": 2 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.3, Page 82" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "Zin_ol=300*10**3; #in Ohms\n", + "Zout=100; #in Ohms\n", + "Aol=50000.;\n", + "Zout_ol=100.;\n", + "Asp=100;\n", + "\n", + "#Calculations&Results\n", + "S=Aol/Asp;\n", + "print \"S = %.0f\"%S;#Result\n", + "Zin_sp=S*Zin_ol;\n", + "print \"Zin_sp = %.0f Ohm\"%Zin_sp;#Result\n", + "Zout_sp=Zout_ol/S;\n", + "print \"Zout_sp = %.1f Ohm\"%Zout_sp;#Result\n" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "S = 500\n", + "Zin_sp = 150000000 Ohm\n", + "Zout_sp = 0.2 Ohm\n" + ] + } + ], + "prompt_number": 3 + }, + { + "cell_type": "heading", + "level": 2, + "metadata": {}, + "source": [ + "Example 3.4, Page 88" + ] + }, + { + "cell_type": "code", + "collapsed": false, + "input": [ + "#Variable declaration\n", + "R1=9000; # in Ohm\n", + "R2=1000.; #in Ohm\n", + "\n", + "#Calculations&Results\n", + "B=R2/(R1+R2);\n", + "print \"B is %.2f\\n\"%B;#Result\n", + "#Aps=1/B;\n", + "Aps=(R1+R2)/R2;\n", + "print \"Aps = %.0f \\n \"%Aps;#Result" + ], + "language": "python", + "metadata": {}, + "outputs": [ + { + "output_type": "stream", + "stream": "stdout", + "text": [ + "B is 0.10\n", + "\n", + "Aps = 10 \n", + " \n" + ] + } + ], + "prompt_number": 4 + } + ], + "metadata": {} + } + ] +}
\ No newline at end of file diff --git a/sample_notebooks/ShivaAmruthavakkula/chapter1.ipynb b/sample_notebooks/ShivaAmruthavakkula/chapter1.ipynb new file mode 100755 index 00000000..37ee420b --- /dev/null +++ b/sample_notebooks/ShivaAmruthavakkula/chapter1.ipynb @@ -0,0 +1,448 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the divergence of the beam is 8.05960631817e-05 in radians\n", + "the divergence of the beam is 0.00461781426568 in degrees\n" + ] + } + ], + "source": [ + "'''Example 1.1.1 :Divergence of a beam '''\n", + "\n", + "import math\n", + "\n", + " #decalring variables\n", + "Lambda=633*(10**-9) #wavelength of laser\n", + "s=10*10**-3 #spot size of the laser\n", + "w=s/2 # waist radius\n", + "\n", + "#calculations\n", + "\n", + "theta_radians=(4*Lambda)/(math.pi*(2*w))\n", + "num=math.pi*(w)\n", + "theta_degrees=math.degrees(theta_radians)\n", + "\n", + "#results\n", + "print \"the divergence of the beam is\",theta_radians,\"in radians\"\n", + "print \"the divergence of the beam is\",theta_degrees,\"in degrees\"\n" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "Materials EpsilonR squareroot(EpsilonR)\n", + "\n", + "------------------------------------------\n", + "\n", + "silicon \t11.9 \t3.44963766213 \n", + "\n", + "Diamond \t5.7 \t2.38746727726 \n", + "\n", + "GaAs \t13.1 \t3.61939221417 \n", + "\n", + "SiO2 \t3.84 \t1.95959179423 \n", + "\n", + "Water \t80 \t8.94427191 \n", + "\n" + ] + } + ], + "source": [ + "'''Example 1.2.1: relative permittivity and refractive index n'''\n", + "\n", + "\n", + "import math\n", + "\n", + "numbers=[0,1,2,3,4]\n", + "\n", + "#declaring array variables\n", + "materials=['silicon','Diamond','GaAs ','SiO2 ','Water '] #declaring the materials\n", + "relative_permittivity=[11.9,5.7,13.1,3.84,80] #declaring the relative permittivity at low frequencies\n", + "\n", + "#calculations\n", + "refractive_index=[] #declaring result set \n", + "for i in relative_permittivity:\n", + " t=math.sqrt(i)\n", + " refractive_index.append(t)\n", + " \n", + "#Results and Table\n", + "print \"Materials EpsilonR squareroot(EpsilonR)\\n\"\n", + "print \"------------------------------------------\\n\"\n", + "for j in numbers:\n", + " print materials[j],\"\\t\",relative_permittivity[j],\"\\t\",refractive_index[j],\"\\n\"" + ] + }, + { + "cell_type": "code", + "execution_count": 4, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The phase velocity is 206896551.724\n", + "The group velocity is 205479452.055\n" + ] + } + ], + "source": [ + "'''Example 1.3.2:Group and phase velocities'''\n", + "\n", + "import math\n", + "\n", + "#declaring variables\n", + "Lambda=1*10**-6 #wavelength of light\n", + "n=1.450 #refractive index\n", + "c=3*10**8 #velocity of light in free space\n", + "group_index=1.46 #Group index(available from graph)\n", + "\n", + "#calculations\n", + "phase_velocity=c/n #calculation of phase velocity\n", + "group_velocity=c/group_index #calculation of group velocity\n", + "\n", + "#results\n", + "\n", + "print \"The phase velocity is \",phase_velocity\n", + "print \"The group velocity is \",group_velocity" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "The Elctric field and Magnetic field of air are 86.7926073205 and 2.89308691068e-07 respectively\n", + "The Elctric field and Magnetic field of glass are 72.0773372269 and 3.48373796597e-07 respectively\n" + ] + } + ], + "source": [ + "'''Example 1.4.1: Electric and magnetic fields in light'''\n", + "\n", + "import math\n", + "\n", + "#Declaring variables\n", + "Irradiance=1*10**-3*10**4 #Declaring irradiance in standard units\n", + "ng=1.45 #declaring refractive index of glass\n", + "c=3*10**8 #declaring velocity of light\n", + "n=1 #Refractive index of free space\n", + "e=8.85*10**-12\n", + "\n", + "#calculations of magnitude of electrical and magnetic fields in air\n", + "El_air=math.sqrt((2*Irradiance)/(c*e*n)) #Electric field calculation(air)\n", + "B_air=(n*El_air)/c #Magnetic field calculation(air)\n", + "\n", + "#calculations of magnitude of electrical and magnetic fields in glass\n", + "El_glass=math.sqrt((2*Irradiance)/(c*e*ng)) #Electric field calculation(glass) \n", + "B_glass=(ng*El_glass)/c #magnetic field calculation(glass) \n", + "\n", + "#Results\n", + "print \"The Elctric field and Magnetic field of air are \",El_air,\"and\",B_air,\"respectively\"\n", + "print \"The Elctric field and Magnetic field of glass are \",El_glass,\"and\",B_glass,\"respectively\"" + ] + }, + { + "cell_type": "code", + "execution_count": 6, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A\n", + "the crirical angle is equal to 0.986206896552 \n", + "\n", + "B\n", + "The phase change in medium 1 at incident angle=85 degrees with electrical component perpendicular to the plane of incidence is 116.45255621 degrees\n", + "The phase change in medium 1 at incident angle=85 degrees with electrical component parallel to the plane of incidence is -62.1314255434 degrees\n", + "The phase change in medium 1 at incident angle=90 degrees with electrical component perpendicular to the plane of incidence is 180.0 degrees\n", + "The phase change in medium 1 at incident angle=90 degrees with electrical component parallel to the plane of incidence is -2.84217094304e-14 degrees \n", + "\n", + "C\n", + "The penetration depth of medium 2 at incident angle of 85 degrees is 7.80048054638e-07 meters\n", + "The penetration depth of medium 2 at incident angle of 90 degrees is 6.63145596216e-07 meters\n" + ] + } + ], + "source": [ + "'''Example 1.6.2'''\n", + "import math\n", + "\n", + "#declaration of variables\n", + "\n", + "n1=1.450 #refractive index of first medium\n", + "n2=1.430 #refractive index of second medium\n", + "Lambda=1*10**-6 #wavelength of light at standard units\n", + "theta_i1=85 #declaration of incidence angle 1\n", + "theta_i2=90 #declaration of incidence angle 2\n", + "\n", + "#Calculation of minimum incidence angle\n", + "theta_c=n2/n1 #calculation of critical angle\n", + "\n", + "#Calculation of phase change in medium 1 at incident angle 85 with perpendicular electrical component\n", + "tanphi_pp_85m1=math.sqrt(math.pow(math.sin(math.radians(theta_i1)),2)-math.pow((n2/n1),2))/math.cos(math.radians(theta_i1))\n", + "phi_pp_85im1=2*math.degrees(math.atan(tanphi_pp_85m1))\n", + "\n", + "#Calculation of phase change in medium 1 at incident angle 85 with parallel electrical component\n", + "tanphi_prll_85m1=math.pow((n1/n2),2)*tanphi_pp_85m1\n", + "phi_prll_85m1=2*(math.degrees(math.atan(tanphi_prll_85m1)))-math.degrees(math.pi)\n", + "phi_prll_inv_85m1=180+phi_prll_85m1\n", + "\n", + "#Calculation of phase change in medium 1 at incident angle 90 with perpendicular electrical component\n", + "tanphi_pp_90m1=math.sqrt(math.pow(math.sin(math.radians(theta_i2)),2)-math.pow((n2/n1),2))/math.cos(math.radians(theta_i2))\n", + "phi_pp_90m1=2*math.degrees(math.atan(tanphi_pp_90m1))\n", + "\n", + "#Calculation of phase change in medium 1 at incident angle 85 with parallel electrical component\n", + "tanphi_prll_90m1=math.pow((n1/n2),2)*tanphi_pp_90m1\n", + "phi_prll_90m1=2*(math.degrees(math.atan(tanphi_prll_90m1)))-math.degrees(math.pi)\n", + "phi_prll_inv_90m1=180+phi_prll_90m1\n", + "\n", + "#Calculation of penetration depth in medium 2 at incident angle 85\n", + "alpha_85=(2*math.pi*n2/Lambda)*(math.sqrt((math.pow((n1/n2),2)*math.pow(math.sin(math.radians(theta_i1)),2))-1))\n", + "delta_85=1/alpha_85\n", + "\n", + "#calculation of penetration depth in medium 2 at incident angle 90\n", + "alpha_90=(2*math.pi*n2/Lambda)*(math.sqrt((math.pow((n1/n2),2)*math.pow(math.sin(math.radians(theta_i2)),2))-1))\n", + "delta_90=1/alpha_90\n", + "\n", + "#Results\n", + "print \"A\"\n", + "print \"the crirical angle is equal to \",theta_c,\"\\n\"\n", + "print \"B\"\n", + "print \"The phase change in medium 1 at incident angle=85 degrees with electrical component perpendicular to the plane of incidence is\",phi_pp_85im1,\"degrees\"\n", + "print \"The phase change in medium 1 at incident angle=85 degrees with electrical component parallel to the plane of incidence is\",phi_prll_85m1,\"degrees\"\n", + "print \"The phase change in medium 1 at incident angle=90 degrees with electrical component perpendicular to the plane of incidence is\",phi_pp_90m1,\"degrees\"\n", + "print \"The phase change in medium 1 at incident angle=90 degrees with electrical component parallel to the plane of incidence is\",phi_prll_90m1,\"degrees \\n\"\n", + "print \"C\"\n", + "print \"The penetration depth of medium 2 at incident angle of 85 degrees is \",delta_85,\"meters\"\n", + "print \"The penetration depth of medium 2 at incident angle of 90 degrees is \",delta_90,\"meters\"" + ] + }, + { + "cell_type": "code", + "execution_count": 7, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "A\n", + "the reflection coefficient when light travels from air to glass is -0.2\n", + "the reflectance when light passes from air to glass is 0.04\n", + "The phase change of the reflected light is \n", + "180\n", + "B\n", + "the reflection coefficient when light travels from glass to air is 0.2\n", + "the reflectance when light passes from glass to air is 0.04\n", + "The phase change of the reflected light is \n", + "180\n", + "C\n", + "The polarisation angle is 56.309932474\n" + ] + } + ], + "source": [ + "'''Example 1.6.3: Reflection at normal Incidence.Internal and external reflection'''\n", + "import math\n", + "\n", + "#declaration of variables\n", + "nglass=1.5\n", + "nair=1\n", + "\n", + "#declaration of phase change\n", + "def phasechange(r):\n", + " if r<0:\n", + " return 180\n", + " else:\n", + " return 0 \n", + "#Calculation of reflection coefficient and intensity from air to glass\n", + "r_coeffag=(nair-nglass)/(nair+nglass) #reflection coefficient\n", + "Rag=math.pow(r_coeffag,2) #Reflectance\n", + "pag=phasechange(r_coeffag)\n", + "\n", + "\n", + "#Calculation of relection and intensity from glass to aie\n", + "r_coeffga=(nglass-nair)/(nglass+nair)\n", + "Rga=math.pow(r_coeffga,2)\n", + "pga=phasechange(r_coeffga)\n", + "\n", + "#calculation of polarisation angle\n", + "theta_p=math.degrees(math.atan(nglass/nair))\n", + "\n", + "#Results\n", + "print \"A\"\n", + "print\"the reflection coefficient when light travels from air to glass is \",r_coeffag\n", + "print \"the reflectance when light passes from air to glass is \",Rag\n", + "print \"The phase change of the reflected light is \\n\",pag\n", + "print \"B\"\n", + "print\"the reflection coefficient when light travels from glass to air is \",r_coeffga\n", + "print \"the reflectance when light passes from glass to air is \",Rga\n", + "print \"The phase change of the reflected light is \\n\",pag\n", + "\n", + "print \"C\"\n", + "print \"The polarisation angle is \",theta_p" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "the reflectance of the Silicon is 0.308641975309\n", + "the refractive index of coating must be 1.87082869339\n", + "the thickness of the coating is 9.21052631579e-08 meters\n" + ] + } + ], + "source": [ + "'''Example 1.6.4: Antireflection coatings on solarcells'''\n", + "import math\n", + "\n", + "#Declaration of variables\n", + "nair=1\n", + "nsi=3.5\n", + "ncoating=1.9\n", + "Lambda=700*10**-9\n", + "\n", + "#declaration of phase change\n", + "def phasechange(r):\n", + " if r<0:\n", + " return 180\n", + " else:\n", + " return 0 \n", + "\n", + "#Calculation of reflectance at Silicon\n", + "rsi=((nair-nsi)/(nair+nsi))\n", + "Rsi=math.pow(rsi,2)\n", + "psi=phasechange(rsi)\n", + "\n", + "#calculation of refractive index of coating\n", + "ncoating_theoritical=math.sqrt(nair*nsi)\n", + "\n", + "#calculation of thickness\n", + "d=Lambda/(4*ncoating)\n", + "\n", + "#results\n", + "print \"the reflectance of the Silicon is \",Rsi\n", + "print \"the refractive index of coating must be \",ncoating_theoritical\n", + "print \"the thickness of the coating is \",d,\" meters\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [ + "# '''Example 1.7.1: Resonator modes and spectral width'''\n", + "import math\n", + "\n", + "#declaration of variables\n", + "L=100*10**-6\n", + "R=0.9\n", + "Lambda=900*10**-9\n", + "c=3*10**8\n", + "\n", + "#Calculation of seperation of modes\n", + "delta_vm=c/(2*L)\n", + "\n", + "#calculation of finesse\n", + "F=((math.pi)*math.sqrt(R))/(1-R)\n", + "\n", + "#calculation of modewidth\n", + "del_vm=delta_vm/F\n", + "\n", + "#calculation of mode frequency\n", + "vm=c/Lambda\n", + "\n", + "#calculation of spectral width\n", + "del_lambda=(c/math.pow(vm,2))*del_vm\n", + "\n", + "#Results\n", + "print \"The seperation of modes is \",delta_vm,\" Hertz\"\n", + "print \"The spectral width is\", del_lambda,\" meters\"" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "collapsed": true + }, + "outputs": [], + "source": [] + } + ], + "metadata": { + "celltoolbar": "Edit 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.10" + } + }, + "nbformat": 4, + "nbformat_minor": 0 +} diff --git a/sample_notebooks/vedantharish/Chapter1.ipynb b/sample_notebooks/vedantharish/Chapter1.ipynb new file mode 100755 index 00000000..e0d93a7e --- /dev/null +++ b/sample_notebooks/vedantharish/Chapter1.ipynb @@ -0,0 +1,323 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:436cc68a3a8c24e3b7ac0015b43ecd16f91e5c0db4fe34a46ea3f2fb33073dd6"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1: Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1(a), Page No.: 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "V=0.5 #voltage of diode in V\n",
+ "I=2 #current of diode in mA\n",
+ "\n",
+ "#Calculation\n",
+ "R=(V/I)*1000 #resistance of diode,\n",
+ " #converting current in Ampere from mA in calculation\n",
+ "\n",
+ "#Result\n",
+ "print \"Resistance is \", R ,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance is 250.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1(b), Page No.: 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "V=0.8 #voltage of diode in V\n",
+ "I=20 #current of diode in mA\n",
+ "\n",
+ "#Calculation\n",
+ "R=(V/I)*1000 #resistance of diode,\n",
+ " #converting current in Ampere from mA in calculation\n",
+ "\n",
+ "#Result\n",
+ "print \"Resistance is \", R ,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance is 40.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1(c), Page No.:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "V= -10 #voltage of diode in V\n",
+ "I= -1 #current of diode in microAmpere\n",
+ "\n",
+ "#Calculation\n",
+ "R=(V/I)*1000*1000 #resistance of diode,\n",
+ " #converting current in Ampere from microAmpere in calculation\n",
+ "R=V/I*(1000/1000)*(1000/1000)#converting ohm into Mega-ohm \n",
+ "#Result\n",
+ "print \"Resistance is \", R ,\"Mega-ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance is 10 Mega-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2(a), Page NO.:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "I=2 #diode current in mA\n",
+ "I1=4 #diode current choosen by 2 mA swing above given diode current of 2 mA.\n",
+ "I2=0 #diode current choosen by 2 mA swing below given diode current of 2 mA.\n",
+ "V1=0.76 #diode voltage at I1= 4 mA.\n",
+ "V2=0.65 #diode voltage at I2= 0 mA.\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=((V1-V2)/(I1-I2))*1000 #R is AC resistance,\n",
+ " #V1-V2 is change in voltage and I1-I2 is chnage in current.\n",
+ " #multiplying by 1000 for converting current into A from mA.\n",
+ "#RESULT\n",
+ "print \"Ac resistance is\",R,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ac resistance is 27.5 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2(b),Page No.:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "I=25 #diode current in mA\n",
+ "I1=30 #diode current choosen by 5 mA swing above given diode current of 25 mA.\n",
+ "I2=20 #diode current choosen by 5 mA swing below given diode current of 25 mA.\n",
+ "V1=0.8 #diode voltage at I1= 30 mA.\n",
+ "V2=0.78 #diode voltage at I2= 20 mA.\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=((V1-V2)/(I1-I2))*1000 #R is AC resistance,\n",
+ " #V1-V2 is change in voltage and I1-I2 is chnage in current.\n",
+ " #multiplying by 1000 for converting current into A from mA.\n",
+ "#RESULT\n",
+ "print \"Ac resistance is\",R,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ac resistance is 2.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2(c), Page No.:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "I1=2 #diode current in mA. \n",
+ "V1=0.7 #diode voltage in V.\n",
+ "\n",
+ "I2=25 #diode current in mA.\n",
+ "V2=0.79 #diode voltage in V.\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=(V1/I1)*1000 #R1 is DC resistance, \n",
+ " #multiplying by 1000 for converting current into A from mA.\n",
+ "\n",
+ "R2=(V2/I2)*1000 #R2 is DC rresistance \n",
+ " #mulipying by 1000 for converting current into A from mA.\n",
+ "\n",
+ "#RESULT\n",
+ "print \"Dc resistance at 2 mA is\",R1,\"ohm, which far exceeds AC resistance of 27.5 ohm\"\n",
+ "\n",
+ "print \"DC resistance at 25 mA is\",R2,\"ohm, which far exceeds AC resistance of 2 ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dc resistance at 2 mA is 350.0 ohm, which far exceeds AC resistance of 27.5 ohm\n",
+ "DC resistance at 25 mA is 31.6 ohm, which far exceeds AC resistance of 2 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page No.: 48-49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "V=10 #zener voltage in V.\n",
+ "T=0.072 #Temperature coefficient.\n",
+ "T1=100 #given temperature in celsius.\n",
+ "To=25 #reference temperature in celsius\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "V1=(T*V*(T1-To))/100 #nominal voltage for zener diode in V.\n",
+ "\n",
+ " #Temperature coefficient is positive.\n",
+ " #new zener voltage is defined by V2.\n",
+ "V2=V+V1\n",
+ "\n",
+ "#RESULT\n",
+ "\n",
+ "print \"Voltage for zener diode is\",V2,\"V\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage for zener diode is 10.54 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file diff --git a/sample_notebooks/vedantharish/Chapter1_1.ipynb b/sample_notebooks/vedantharish/Chapter1_1.ipynb new file mode 100755 index 00000000..2a2734b5 --- /dev/null +++ b/sample_notebooks/vedantharish/Chapter1_1.ipynb @@ -0,0 +1,318 @@ +{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:3b07252198e90cfd9ac3c1a323508af3c3781f3c224f206ef55b7d5cdbd305fc"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 1: Semiconductor Diodes"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1(a), Page No.: 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "V=0.5 #voltage of diode in V\n",
+ "I=2 #current of diode in mA\n",
+ "\n",
+ "#Calculation\n",
+ "R=(V/I)*1000 #resistance of diode,\n",
+ " #converting current in Ampere from mA in calculation\n",
+ "\n",
+ "#Result\n",
+ "print \"Resistance is \", R ,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance is 250.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1(b), Page No.: 29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "V=0.8 #voltage of diode in V\n",
+ "I=20 #current of diode in mA\n",
+ "\n",
+ "#Calculation\n",
+ "R=(V/I)*1000 #resistance of diode,\n",
+ " #converting current in Ampere from mA in calculation\n",
+ "\n",
+ "#Result\n",
+ "print \"Resistance is \", R ,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance is 40.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.1(c), Page No.:29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "V= -10 #voltage of diode in V\n",
+ "I= -1 #current of diode in microAmpere\n",
+ "\n",
+ "#Calculation\n",
+ "R=(V/I)*1000*1000 #resistance of diode,\n",
+ " #converting current in Ampere from microAmpere in calculation\n",
+ "R=V/I*(1000/1000)*(1000/1000)#converting ohm into Mega-ohm \n",
+ "#Result\n",
+ "print \"Resistance is \", R ,\"Mega-ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Resistance is 10 Mega-ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2(a), Page NO.:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "I=2 #diode current in mA\n",
+ "I1=4 #diode current choosen by 2 mA swing above given diode current of 2 mA.\n",
+ "I2=0 #diode current choosen by 2 mA swing below given diode current of 2 mA.\n",
+ "V1=0.76 #diode voltage at I1= 4 mA.\n",
+ "V2=0.65 #diode voltage at I2= 0 mA.\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=((V1-V2)/(I1-I2))*1000 #R is AC resistance,\n",
+ " #V1-V2 is change in voltage and I1-I2 is chnage in current.\n",
+ " #multiplying by 1000 for converting current into A from mA.\n",
+ "#RESULT\n",
+ "print \"Ac resistance is\",R,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ac resistance is 27.5 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2(b),Page No.:31"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "I=25 #diode current in mA\n",
+ "I1=30 #diode current choosen by 5 mA swing above given diode current of 25 mA.\n",
+ "I2=20 #diode current choosen by 5 mA swing below given diode current of 25 mA.\n",
+ "V1=0.8 #diode voltage at I1= 30 mA.\n",
+ "V2=0.78 #diode voltage at I2= 20 mA.\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R=((V1-V2)/(I1-I2))*1000 #R is AC resistance,\n",
+ " #V1-V2 is change in voltage and I1-I2 is chnage in current.\n",
+ " #multiplying by 1000 for converting current into A from mA.\n",
+ "#RESULT\n",
+ "print \"Ac resistance is\",R,\"ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ac resistance is 2.0 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.2(c), Page No.:32"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "I1=2 #diode current in mA. \n",
+ "V1=0.7 #diode voltage in V.\n",
+ "\n",
+ "I2=25 #diode current in mA.\n",
+ "V2=0.79 #diode voltage in V.\n",
+ "\n",
+ "\n",
+ "#Calculation\n",
+ "\n",
+ "R1=(V1/I1)*1000 #R1 is DC resistance, \n",
+ " #multiplying by 1000 for converting current into A from mA.\n",
+ "\n",
+ "R2=(V2/I2)*1000 #R2 is DC rresistance \n",
+ " #mulipying by 1000 for converting current into A from mA.\n",
+ "\n",
+ "#RESULT\n",
+ "print \"Dc resistance at 2 mA is\",R1,\"ohm, which far exceeds AC resistance of 27.5 ohm\"\n",
+ "\n",
+ "print \"DC resistance at 25 mA is\",R2,\"ohm, which far exceeds AC resistance of 2 ohm\""
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Dc resistance at 2 mA is 350.0 ohm, which far exceeds AC resistance of 27.5 ohm\n",
+ "DC resistance at 25 mA is 31.6 ohm, which far exceeds AC resistance of 2 ohm\n"
+ ]
+ }
+ ],
+ "prompt_number": 9
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 1.3, Page No.: 48-49"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "#Variable Declaration\n",
+ "\n",
+ "V=10 #zener voltage in V.\n",
+ "T=0.072 #Temperature coefficient.\n",
+ "T1=100 #given temperature in celsius.\n",
+ "To=25 #reference temperature in celsius\n",
+ "\n",
+ "#calculation\n",
+ "\n",
+ "V1=(T*V*(T1-To))/100 #nominal voltage for zener diode in V.\n",
+ "\n",
+ " #Temperature coefficient is positive.\n",
+ " #new zener voltage is defined by V2.\n",
+ "V2=V+V1\n",
+ "\n",
+ "#RESULT\n",
+ "\n",
+ "print \"Voltage for zener diode is\",V2,\"V\"\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Voltage for zener diode is 10.54 V\n"
+ ]
+ }
+ ],
+ "prompt_number": 12
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+}
\ No newline at end of file |