summaryrefslogtreecommitdiff
path: root/sample_notebooks/AvinashReddy/Chapter6_1.ipynb
diff options
context:
space:
mode:
authorhardythe12015-04-07 15:58:05 +0530
committerhardythe12015-04-07 15:58:05 +0530
commitc7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131 (patch)
tree725a7d43dc1687edf95bc36d39bebc3000f1de8f /sample_notebooks/AvinashReddy/Chapter6_1.ipynb
parent62aa228e2519ac7b7f1aef53001f2f2e988a6eb1 (diff)
downloadPython-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.tar.gz
Python-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.tar.bz2
Python-Textbook-Companions-c7fe425ef3c5e8804f2f5de3d8fffedf5e2f1131.zip
added books
Diffstat (limited to 'sample_notebooks/AvinashReddy/Chapter6_1.ipynb')
-rwxr-xr-xsample_notebooks/AvinashReddy/Chapter6_1.ipynb424
1 files changed, 424 insertions, 0 deletions
diff --git a/sample_notebooks/AvinashReddy/Chapter6_1.ipynb b/sample_notebooks/AvinashReddy/Chapter6_1.ipynb
new file mode 100755
index 00000000..cb976487
--- /dev/null
+++ b/sample_notebooks/AvinashReddy/Chapter6_1.ipynb
@@ -0,0 +1,424 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:a9319dae2c5d735f752461f1c0fd8a354f31bcf1559eeff72f9ee135bfdbd607"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Chapter 6 - Optical Sources"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3.1 :Pg 6.7"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# variable initialisation\n",
+ "x=0.07\n",
+ "\n",
+ "# calculations\n",
+ "Eg=1.424+1.266*x+0.266*math.pow(x,2)\n",
+ "lamda=1.24/Eg # computing wavelength\n",
+ "\n",
+ "# Results\n",
+ "print '%s %.3f %s' %(\"\\nWavlength is \",lamda,\"micrometer \")\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Wavlength is 0.819 micrometer \n"
+ ]
+ }
+ ],
+ "prompt_number": 1
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.3.2 : Pg 6.12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable initialisation\n",
+ "n=1.7 #refractive index\n",
+ "L=5*math.pow(10,-2) #distance between mirror\n",
+ "c=3*math.pow(10,8) #speed of light\n",
+ "lamda=0.45*math.pow(10,-6) #wavelength\n",
+ "\n",
+ "# Calculations\n",
+ "k=2*n*L/lamda #computing number of modes\n",
+ "delf=c/(2*n*L) #computing mode separation\n",
+ "delf=delf*math.pow(10,-9)\n",
+ "\n",
+ "# Results\n",
+ "print '%s %.2e %s %.2f %s' %(\"\\nNumber of modes are \",k,\"\\nFrequency separation is \",delf,\" GHz.\")\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Number of modes are 3.78e+05 \n",
+ "Frequency separation is 1.76 GHz.\n"
+ ]
+ }
+ ],
+ "prompt_number": 2
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.21.1 : Pg 6.59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable initialisation\n",
+ "tr=50.0 #radiative recombination lifetime\n",
+ "tnr=85.0 #non-radiative recombination lifetime\n",
+ "h=6.624*math.pow(10,-34) #plank's constant\n",
+ "c=3*math.pow(10,8) #speed of light\n",
+ "q=1.6*math.pow(10,-19) #charge of electron\n",
+ "i=35*math.pow(10,-3) #current\n",
+ "lamda=0.85*math.pow(10,-6) #wavelength\n",
+ "\n",
+ "# Calculations\n",
+ "t=tr*tnr/(tr+tnr) #computing total recombination time\n",
+ "eta=t/tr #computing internal quantum efficiency\n",
+ "Pint=eta*h*c*i/(q*lamda) #computing internally generated power\n",
+ "Pint=Pint*math.pow(10,3)\n",
+ "\n",
+ "# Results\n",
+ "\n",
+ "print '%s %.2f %s %.3f %s %.1f %s' %(\"\\nTotal recombinaiton time is \",t,\" ns.\\nInternal quantum efficiency is \",eta,\".\\nInternally generated power is \",Pint,\" mW.\")\n",
+ "\n",
+ "#answer in the book for Internal quantum efficiency is 0.629, deviation of 0.001.\n",
+ "#answer in the book for Internally generated power is 32.16 mW, deviation of 0.04 mW.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Total recombinaiton time is 31.48 ns.\n",
+ "Internal quantum efficiency is 0.630 .\n",
+ "Internally generated power is 32.2 mW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 3
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.21.2 : Pg 6.59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable initialisation\n",
+ "tr=30.0 #radiative recombination lifetime\n",
+ "tnr=100.0 #non-radiative recombination lifetime\n",
+ "h=6.624*math.pow(10,-34) #plank's constant\n",
+ "c=3*math.pow(10,8) #speed of light\n",
+ "q=1.6*math.pow(10,-19) #charge of electron\n",
+ "i=40*math.pow(10,-3) #current\n",
+ "lamda=1310*math.pow(10,-9) #wavelength\n",
+ "\n",
+ "# Calculations\n",
+ "t=tr*tnr/(tr+tnr) #computing total recombination time\n",
+ "eta=t/tr #computing internal quantum efficiency\n",
+ "Pint=eta*h*c*i/(q*lamda) #computing internally generated power\n",
+ "Pint=Pint*math.pow(10,3)\n",
+ "\n",
+ "print '%s %.2f %s %.3f %s %.2f %s' %(\"\\nTotal recombinaiton time is \",t,\" ns.\\nInternal quantum efficiency is \",eta,\".\\nInternally generated power is \",Pint,\" mW.\")\n",
+ "\n",
+ "#answer in the book for Total recombinaiton time is 23.07 ns, deviation of 0.01ns.\n",
+ "\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Total recombinaiton time is 23.08 ns.\n",
+ "Internal quantum efficiency is 0.769 .\n",
+ "Internally generated power is 29.17 mW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 4
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.21.3 : Pg 6.60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "# Example 6.21.3 page 6.60\n",
+ "\n",
+ "import math\n",
+ "# Variable initialisation\n",
+ "\n",
+ "tr=50.0 #radiative recombination lifetime\n",
+ "tnr=110.0 #non-radiative recombination lifetime\n",
+ "h=6.624*math.pow(10,-34) #plank's constant\n",
+ "c=3*math.pow(10,8) #speed of light\n",
+ "q=1.6*math.pow(10,-19) #charge of electron\n",
+ "i=40*math.pow(10,-3) #current\n",
+ "lamda=0.87*math.pow(10,-6) #wavelength\n",
+ "\n",
+ "# Calculations\n",
+ "t=tr*tnr/(tr+tnr) #computing total recombination time\n",
+ "eta=t/tr #computing internal quantum efficiency\n",
+ "Pint=eta*h*c*i/(q*lamda) #computing internally generated power\n",
+ "Pint=Pint*math.pow(10,3)\n",
+ "\n",
+ "print '%s %.2f %s %.4f %s %.2f %s' %(\"\\nTotal recombinaiton time is \",t,\"ns.\\nInternal quantum efficiency is \",eta,\".\\nInternally generated power is \",Pint,\"mW.\")\n",
+ "\n",
+ "#answers in the book with slight deviaitons\n",
+ "#Total recombinaiton time is 34.37 ns, deviation of 0.01ns.\n",
+ "#Internal quantum efficiency is 0.6874, deviaiton of 0.0001.\n",
+ "#Internally generated power is 39.24 mW, deviation of 0.02mW.\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Total recombinaiton time is 34.38 ns.\n",
+ "Internal quantum efficiency is 0.6875 .\n",
+ "Internally generated power is 39.26 mW.\n"
+ ]
+ }
+ ],
+ "prompt_number": 5
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.22.1 : Pg 6.68"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable initialisation\n",
+ "f1=10*math.pow(10,6) #frequency\n",
+ "f2=100*math.pow(10,6)\n",
+ "t=4*math.pow(10,-9)\n",
+ "Pdc=280*math.pow(10,-6) #optincal output power\n",
+ "\n",
+ "# Calculations\n",
+ "w1=2*math.pi*f1 #computing omega\n",
+ "Pout1=Pdc*math.pow(10,6)/(math.sqrt(1+math.pow((w1*t),2))) #computing output power\n",
+ "\n",
+ "w2=2*math.pi*f2 #computing omega\n",
+ "Pout2=Pdc*math.pow(10,6)/(math.sqrt(1+math.pow((w2*t),2))) #computing output power\n",
+ "\n",
+ "print '%s %.2f %s %.2f %s' %(\"Ouput power at 10 MHz is \",Pout1,\"microwatt.\\nOuput power at 100 MHz is \",Pout2,\"microwatt.\\nConclusion when device is drive at higher frequency the optical power reduces.\\nNOTE - calculation error. In the book square term in the denominator is not taken.\")\n",
+ "BWopt = math.sqrt(3)/(2*math.pi*t)\n",
+ "BWelec = BWopt/math.sqrt(2)\n",
+ "BWopt=BWopt*math.pow(10,-6)\n",
+ "BWelec=BWelec*math.pow(10,-6)\n",
+ "\n",
+ "print '%s %.2f %s %.2f %s' %(\"\\n3 dB optical power is \",BWopt,\" MHz.\\n3 dB electrical power is \",BWelec,\" MHz.\")\n",
+ "\n",
+ "\n",
+ "#calculation error. In the book square term in the denominater is not taken.\n",
+ "#answers in the book - \n",
+ "#Ouput power at 10 MHz is 228.7 microwatt.(incorrect)\n",
+ "#Ouput power at 100 MHz is 175 microwatt.(incorrect)\n",
+ "#3 dB optical power is 68.8 MHz, deviation of 0.12\n",
+ "#3 dB electrical power is 48.79 MHz, deviation of 0.06 \n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "Ouput power at 10 MHz is 271.55 microwatt.\n",
+ "Ouput power at 100 MHz is 103.52 microwatt.\n",
+ "Conclusion when device is drive at higher frequency the optical power reduces.\n",
+ "NOTE - calculation error. In the book square term in the denominator is not taken.\n",
+ "\n",
+ "3 dB optical power is 68.92 MHz.\n",
+ "3 dB electrical power is 48.73 MHz.\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.22.2 : Pg 6.69"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable initialisation\n",
+ "n1=3.5 #refractive index\n",
+ "n=1 #refractive index of air\n",
+ "F=0.69 #transmission factor\n",
+ "\n",
+ "# Calculations\n",
+ "eta = 100*math.pow((n1*math.pow((n1+1),2)),-1) #computing eta\n",
+ "\n",
+ "# Results\n",
+ "print '%s %.1f %s' %(\"\\neta external is \",eta,\" percent i.e. small fraction of intrnally generated opticalpower is emitted from the device.\")\n",
+ "print \"\\n\\n OR we can also arrive at solution,\\n\" \n",
+ "\n",
+ "r= 100*F*math.pow(n,2)/(4*math.pow(n1,2)) #computing ratio of Popt/Pint\n",
+ "\n",
+ "print '%s %.1f %s' %(\"\\n Popt/Pint is \",r,\"percent\")\n",
+ "\n",
+ "print \"\\nNOTE - printing mistake at final answer.\\nThey have printed 40 percent it should be 1.4 percent\"\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "eta external is 1.4 percent i.e. small fraction of intrnally generated opticalpower is emitted from the device.\n",
+ "\n",
+ "\n",
+ " OR we can also arrive at solution,\n",
+ "\n",
+ "\n",
+ " Popt/Pint is 1.4 percent\n",
+ "\n",
+ "NOTE - printing mistake at final answer.\n",
+ "They have printed 40 percent it should be 1.4 percent\n"
+ ]
+ }
+ ],
+ "prompt_number": 7
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example 6.22.3 : Pg 6.73"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "import math\n",
+ "\n",
+ "# Variable initialisation\n",
+ "beta0=1.85*math.pow(10,7)\n",
+ "T=293 #temperature\n",
+ "k=1.38*math.pow(10,-23) #Boltzman constant\n",
+ "Ea=0.9*1.6*math.pow(10,-19)\n",
+ "theta=0.65 #threshold\n",
+ "\n",
+ "# Calculations\n",
+ "betar=beta0*math.pow(math.e,(-Ea/(k*T)))\n",
+ "t=-math.log(theta)/betar\n",
+ "\n",
+ "# Result\n",
+ "print '%s %.2e %s %.1e %s' %(\"\\nDegradation rate is \",betar,\" per hour.\\nOperating lifetime is \",t,\" hour.\")\n",
+ "\n",
+ "#answer in the book for Degradation rate is 6.4e-09 per hour, deviation of 0.08e-9\n",
+ "#answer in the book for Operating lifetime is 6.7e+07 hour, deviaiton of 0.1e1\n"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "\n",
+ "Degradation rate is 6.32e-09 per hour.\n",
+ "Operating lifetime is 6.8e+07 hour.\n"
+ ]
+ }
+ ],
+ "prompt_number": 8
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file