diff options
author | Jovina Dsouza | 2014-07-25 00:00:07 +0530 |
---|---|---|
committer | Jovina Dsouza | 2014-07-25 00:00:07 +0530 |
commit | cc0f90b966a13e6edc60165bc4d4d36844af4f2b (patch) | |
tree | 896d9488c2766babf34c3c9d895b0f9f730b0e54 /Engineering_Physics/Chapter2_1.ipynb | |
parent | a4206084fd8c2bd696ea4ae4012aa83534979456 (diff) | |
download | Python-Textbook-Companions-cc0f90b966a13e6edc60165bc4d4d36844af4f2b.tar.gz Python-Textbook-Companions-cc0f90b966a13e6edc60165bc4d4d36844af4f2b.tar.bz2 Python-Textbook-Companions-cc0f90b966a13e6edc60165bc4d4d36844af4f2b.zip |
adding book
Diffstat (limited to 'Engineering_Physics/Chapter2_1.ipynb')
-rwxr-xr-x | Engineering_Physics/Chapter2_1.ipynb | 191 |
1 files changed, 15 insertions, 176 deletions
diff --git a/Engineering_Physics/Chapter2_1.ipynb b/Engineering_Physics/Chapter2_1.ipynb index 3d6c503f..fff10b22 100755 --- a/Engineering_Physics/Chapter2_1.ipynb +++ b/Engineering_Physics/Chapter2_1.ipynb @@ -1,7 +1,7 @@ { "metadata": { - "name": "", - "signature": "sha256:2693d83b10c8e62fc8d3ef78c9959c4d8327c36ed1f7884372585d33796bcbc3" + "name": "Chapter2", + "signature": "sha256:ac80f9dfe1725f11a5d4ce0fbda5ffed825d99c680f116629e5e3fcb8b69c198" }, "nbformat": 3, "nbformat_minor": 0, @@ -12,231 +12,70 @@ "cell_type": "heading", "level": 1, "metadata": {}, - "source": [ - "2: Electromagnetic Theory" - ] + "source": "2: Lasers" }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 2.1, Page number 46" - ] + "source": "Example number 2.1, Page number 52" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "from sympy import *\n", - "import math\n", - "\n", - "#Variable declaration\n", - "C = 10; #Capacitance of the capacitor(pF)\n", - "#given V=0.2*sin(120*math.pi*t) in volts\n", - "\n", - "#Calculation\n", - "C=C*10**-12; #Capacitance of the capacitor(F)\n", - "x, y, z, t = symbols('x y z t')\n", - "k, m, n = symbols('k m n', integer=True)\n", - "f, g, h = symbols('f g h', cls=Function)\n", - "#I = C*dV/dt\n", - "#let dV/dt be a\n", - "a=diff(0.2*sin(120*math.pi*t),t) #dV/dt\n", - "#value of dV/dt is 75.398223686155*cos(376.991118430775*t)\n", - "#for cosine function peak value occurs when 120*math.pi*t = 0\n", - "#therefore value of dV/dt becomes d = 75.398223686155\n", - "d = 75.398223686155; #value of dV/dt \n", - "I=C*d; #displacement current(A)\n", - "\n", - "#Result\n", - "print \"value of dV/dt is\",a\n", - "print \"displacement current is\",I, \"A\"" - ], - "language": "python", - "metadata": {}, - "outputs": [ - { - "output_type": "stream", - "stream": "stdout", - "text": [ - "value of dV/dt is 75.398223686155*cos(376.991118430775*t)\n", - "displacement current is 7.53982236862e-10 A\n" - ] - } - ], - "prompt_number": 2 - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 2.2, Page number 46" - ] - }, - { - "cell_type": "code", - "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "from sympy import *\n", - "import math\n", - "\n", - "#Variable declaration\n", - "epsilon_r = 1; #Relative electrical permittivity of free space\n", - "epsilon_0 = 8.854*10**-12; #Absolute electrical permittivity of free space(F/m)\n", - "#given E=sin(120*math.pi*t) in volts\n", - "\n", - "#Calculation\n", - "x, y, z, t = symbols('x y z t')\n", - "k, m, n = symbols('k m n', integer=True)\n", - "f, g, h = symbols('f g h', cls=Function)\n", - "#J2 = epsilon*dE/dt\n", - "epsilon=epsilon_0*epsilon_r;\n", - "#let dE/dt be a\n", - "a=diff(sin(120*math.pi*t),t) #dE/dt\n", - "#value of dE/dt is 376.991118430775*cos(376.991118430775*t)\n", - "#for cosine function peak value occurs when 120*math.pi*t = 0\n", - "#therefore value of dE/dt becomes d = 376.991118430775\n", - "d = 376.991118430775; #value of dE/dt\n", - "J2=epsilon*d; #displacement current density(A/m**2)\n", - "\n", - "#Result\n", - "print \"value of dE/dt is\",a\n", - "print \"The peak value of displacement current density is\",J2, \"A/m**2\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 590; #wavelength(nm)\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/s)\nk = 1.38*10**-23; #boltzmann's constant\nT = 523; #temperature(Kelvin)\n\n#Calculation\nlamda = lamda*10**-9; #wavelength(m) \n#n1byn2 = math.exp(-(E2-E1)/(k*T))\n#but E2-E1 = h*new and new = c/lamda\n#therefore n1byn2 = math.exp(-h*c/(lamda*k*T))\nn1byn2 = math.exp(-h*c/(lamda*k*T));\n\n#Result\nprint \"relative population of Na atoms is\",n1byn2", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "value of dE/dt is 376.991118430775*cos(376.991118430775*t)\n", - "The peak value of displacement current density is 3.33787936259e-09 A/m**2\n" - ] + "text": "relative population of Na atoms is 5.36748316686e-21\n" } ], - "prompt_number": 3 + "prompt_number": 1 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 2.3, Page number 47 (Theoritical proof)" - ] - }, - { - "cell_type": "heading", - "level": 2, - "metadata": {}, - "source": [ - "Example number 2.4, Page number 47" - ] + "source": "Example number 2.2, Page number 53" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "p = 60; #Power rating of bulb(W)\n", - "d = 0.5; #Distance from the bulb(m)\n", - "\n", - "#Calculation\n", - "A=4*math.pi*d**2; #area(m**2)\n", - "P = p/A; #Value of Poynting vector(W/m**2)\n", - "P = math.ceil(P*100)/100; #rounding off value of P to 1 decimal\n", - "\n", - "#Result\n", - "print \"The value of Poynting vector is\",P, \"W/m**2\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 590; #wavelength(nm)\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/s)\nk = 1.38*10**-23; #boltzmann's constant\nT = 523; #temperature(Kelvin)\n\n#Calculation\nlamda = lamda*10**-9; #wavelength(m) \n#n21dashbyn21 = 1/(math.exp(h*new/(k*T))-1)\n#but new = c/lamda\n#therefore n21dashbyn21 = 1/(math.exp(h*c/(lamda*k*T))-1)\nA = math.exp(h*c/(lamda*k*T))-1;\nn21dashbyn21 = 1/A; \n\n#Result\nprint \"ratio of stimulated to spontaneous emission is\",n21dashbyn21\nprint \"answer given in the book is wrong\"", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The value of Poynting vector is 19.1 W/m**2\n" - ] + "text": "ratio of stimulated to spontaneous emission is 5.36748316686e-21\nanswer given in the book is wrong\n" } ], - "prompt_number": 4 + "prompt_number": 2 }, { "cell_type": "heading", "level": 2, "metadata": {}, - "source": [ - "Example number 2.5, Page number 47" - ] + "source": "Example number 2.3, Page number 53" }, { "cell_type": "code", "collapsed": false, - "input": [ - " \n", - "#importing modules\n", - "from __future__ import division\n", - "import math\n", - "\n", - "#Variable declaration\n", - "E_peak = 6; #Peak value of electric field intensity(V/m)\n", - "c = 3*10**8; #Speed of electromagnetic wave in free space(m/s)\n", - "mew_0 = 4*math.pi*10**-7; #Absolute permeability of free space(Tm/A)\n", - "epsilon_0 = 8.854*10**-12; #Absolute permittivity of free space(F/m)\n", - "mew_r = 1; #Relative permeability of medium\n", - "epsilon_r = 3; #Relative permittivity of the medium\n", - "\n", - "#Calculation\n", - "v = c/math.sqrt(mew_r*epsilon_r); #Wave velocity(m/s)\n", - "v = v/10**8;\n", - "v = math.ceil(v*10**4)/10**4; #rounding off the value of v to 4 decimals\n", - "eta = math.sqrt((mew_0/epsilon_0)*(mew_r/epsilon_r)); #Intrinsic impedance of the medium(ohm)\n", - "eta = math.ceil(eta*10)/10; #rounding off the value of v to 1 decimal\n", - "H_P = E_peak/eta; #Peak value of the magnetic intensity(A/m)\n", - "H_P = H_P*10**2;\n", - "H_P = math.ceil(H_P*10**2)/10**2; #rounding off the value of v to 2 decimals\n", - "\n", - "#Result\n", - "print \"The wave velocity is\",v,\"*10**8 m/s\"\n", - "print \"The intrinsic impedance of the medium is\",eta, \"ohm\"\n", - "print \"The peak value of the magnetic intensity is\",H_P,\"*10**-2 A/m\"" - ], + "input": "#importing modules\nimport math\n\n#Variable declaration\nlamda = 632.8; #wavelength of laser(nm)\nh = 6.625*10**-34; #planck's constant\nc = 3*10**8; #velocity of light(m/s)\np = 3.147; #output power(mW)\n\n#Calculation\np = p*10**-3; #output power(W)\nlamda = lamda*10**-9; #wavelength(m) \nnew = c/lamda; #frequency(Hz)\nE = h*new; #energy of each photon(J)\nEm = p*60; #energy emitted per minute(J/min)\nN = Em/E; #number of photons emitted per second\n\n#Result\nprint \"number of photons emitted per second is\",N", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", - "text": [ - "The wave velocity is 1.7321 *10**8 m/s\n", - "The intrinsic impedance of the medium is 217.6 ohm\n", - "The peak value of the magnetic intensity is 2.76 *10**-2 A/m\n" - ] + "text": "number of photons emitted per second is 6.01183879245e+17\n" } ], - "prompt_number": 11 - }, - { - "cell_type": "code", - "collapsed": false, - "input": [], - "language": "python", - "metadata": {}, - "outputs": [] + "prompt_number": 3 } ], "metadata": {} |