{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# 5: Fiber Optics" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 1, Page number 166" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "critical angle is 78.5 degrees\n", "numerical aperture is 0.3\n", "acceptance angle is 17.4 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.50; #Core refractive index\n", "n2=1.47; #Cladding refractive index\n", "\n", "#Calculation\n", "phic=math.asin(n2/n1); #critical angle(radian)\n", "phic=phic*180/math.pi; #critical angle(degrees)\n", "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n", "phimax=math.asin(NA); #acceptance angle(radian)\n", "phimax=math.asin(NA)*180/math.pi; #acceptance angle(degrees)\n", "\n", "#Result\n", "print \"critical angle is\",round(phic,1),\"degrees\"\n", "print \"numerical aperture is\",round(NA,1)\n", "print \"acceptance angle is\",round(phimax,1),\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 2, Page number 166" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "numerical aperture is 0.46\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.46; #Core refractive index\n", "delta=0.05; #relative refractive index difference\n", "\n", "#Calculation\n", "NA=n1*math.sqrt(2*delta); #numerical aperture\n", "\n", "#Result\n", "print \"numerical aperture is\",round(NA,2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 3, Page number 166" ] }, { "cell_type": "code", "execution_count": 14, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "acceptance angle for meridional rays is 17.46 degrees\n", "acceptance angle for skew rays is 25.104 degrees\n", "answer for acceptance angle for skew rays given in the textbook varies due to rounding off errors\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "NA=0.3; #numerical aperture\n", "gama=45*math.pi/180; #angle(radian)\n", "\n", "#Calculation\n", "thetaa1=math.asin(NA); #acceptance angle for meridional rays(radian)\n", "thetaa1=thetaa1*180/math.pi; #acceptance angle for meridional rays(degrees)\n", "thetaa2=math.asin(NA/math.cos(gama))*180/math.pi; #acceptance angle for skew rays(degrees)\n", "\n", "#Result\n", "print \"acceptance angle for meridional rays is\",round(thetaa1,2),\"degrees\"\n", "print \"acceptance angle for skew rays is\",round(thetaa2,3),\"degrees\"\n", "print \"answer for acceptance angle for skew rays given in the textbook varies due to rounding off errors\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 4, Page number 166" ] }, { "cell_type": "code", "execution_count": 15, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "numerical aperture is 0.303\n", "acceptance angle is 17.633 degrees\n", "answer for acceptance angle given in the textbook varies due to rounding off errors\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.53; #Core refractive index\n", "delta=0.0196; #relative refractive index difference\n", "\n", "#Calculation\n", "NA=n1*math.sqrt(2*delta); #numerical aperture\n", "thetaa=math.asin(NA)*180/math.pi; #acceptance angle(degrees)\n", "\n", "#Result\n", "print \"numerical aperture is\",round(NA,3)\n", "print \"acceptance angle is\",round(thetaa,3),\"degrees\"\n", "print \"answer for acceptance angle given in the textbook varies due to rounding off errors\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 5, Page number 166" ] }, { "cell_type": "code", "execution_count": 30, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "critical angle is 83.38 degrees\n", "fibre length is 430.82 micro m\n", "answer for fibre length given in the book is wrong\n", "number of reflections is 2321\n", "total distance travelled by light is 1.0067 m\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.5; #Core refractive index\n", "n2=1.49; #Cladding refractive index\n", "a=25*10**-6; #radius of core(m)\n", "L=1; #distance(m)\n", "\n", "#Calculation\n", "phic=round(math.asin(n2/n1)*180/math.pi,2); #critical angle(degrees)\n", "phicr=phic*math.pi/180; #critical angle(radian) \n", "l=2*a*math.tan(phicr); #fibre length(m) \n", "r=1/l; #number of reflections\n", "od=L/math.sin(phicr); #total distance travelled by light(m)\n", "\n", "#Result\n", "print \"critical angle is\",phic,\"degrees\"\n", "print \"fibre length is\",round(l*10**6,2),\"micro m\"\n", "print \"answer for fibre length given in the book is wrong\"\n", "print \"number of reflections is\",int(r)\n", "print \"total distance travelled by light is\",round(od,4),\"m\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 6, Page number 167" ] }, { "cell_type": "code", "execution_count": 34, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "signal attenuation per unit length is 1.7 dB km-1\n", "overall signal attenuation is 17 dB\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "Pi=100; #input power(micro W)\n", "Po=2; #output power(micro W)\n", "L=10; #length(m)\n", "\n", "#Calculation\n", "sa=(10/L)*math.log10(Pi/Po); #signal attenuation per unit length(dB km-1)\n", "osa=sa*L; #overall signal attenuation(dB) \n", "\n", "#Result\n", "print \"signal attenuation per unit length is\",round(sa,1),\"dB km-1\"\n", "print \"overall signal attenuation is\",int(round(osa)),\"dB\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 7, Page number 167" ] }, { "cell_type": "code", "execution_count": 42, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "total dispersion is 1343.3 ns\n", "bandwidth length product is 37.22 *10**5 Hz km\n", "answer for bandwidth length product given in the book is wrong\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n=1.55; #Core refractive index\n", "L=10; #length(m)\n", "delta=0.026; #relative refractive index difference\n", "C=3*10**5;\n", "\n", "#Calculation\n", "deltaT=L*n*delta/C; #total dispersion(s)\n", "blp=L/(2*deltaT); #bandwidth length product(Hz km)\n", "\n", "#Result\n", "print \"total dispersion is\",round(deltaT*10**9,1),\"ns\"\n", "print \"bandwidth length product is\",round(blp/10**5,2),\"*10**5 Hz km\"\n", "print \"answer for bandwidth length product given in the book is wrong\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 8, Page number 167" ] }, { "cell_type": "code", "execution_count": 44, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "numerical aperture is 0.391\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.55; #Core refractive index\n", "n2=1.50; #Cladding refractive index\n", "\n", "#Calculation\n", "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n", "\n", "#Result\n", "print \"numerical aperture is\",round(NA,3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 9, Page number 167" ] }, { "cell_type": "code", "execution_count": 50, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "numerical aperture is 0.4461\n", "acceptance angle is 26 degrees 29.5 minutes\n", "answer for acceptance angle in minutes given in the book varies due to rounding off errors\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.563; #Core refractive index\n", "n2=1.498; #Cladding refractive index\n", "\n", "#Calculation\n", "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n", "phimax=math.asin(NA); #acceptance angle(radian)\n", "phimax=math.asin(NA)*180/math.pi; \n", "phimaxd=int(phimax); #acceptance angle(degrees)\n", "phimaxm=60*(phimax-phimaxd); #acceptance angle(minutes)\n", "\n", "#Result\n", "print \"numerical aperture is\",round(NA,4)\n", "print \"acceptance angle is\",phimaxd,\"degrees\",round(phimaxm,1),\"minutes\"\n", "print \"answer for acceptance angle in minutes given in the book varies due to rounding off errors\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 10, Page number 168" ] }, { "cell_type": "code", "execution_count": 54, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Core refractive index is 1.2333\n", "answer given in the book varies due to rounding off errors\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "NA=0.39; #numerical aperture\n", "delta=0.05; #relative refractive index difference\n", "\n", "#Calculation\n", "n1=NA/math.sqrt(2*delta); #Core refractive index\n", "\n", "#Result\n", "print \"Core refractive index is\",round(n1,4)\n", "print \"answer given in the book varies due to rounding off errors\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 11, Page number 168" ] }, { "cell_type": "code", "execution_count": 56, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "fractional index change is 0.0416\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.563; #Core refractive index\n", "n2=1.498; #Cladding refractive index\n", "\n", "#Calculation\n", "delta=(n1-n2)/n1; #fractional index change\n", "\n", "#Result\n", "print \"fractional index change is\",round(delta,4)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 12, Page number 168" ] }, { "cell_type": "code", "execution_count": 59, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "numerical aperture is 0.2965\n", "angle of acceptance is 17 degrees 15 minutes\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.48; #Core refractive index\n", "n2=1.45; #Cladding refractive index\n", "\n", "#Calculation\n", "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n", "thetamax=math.asin(NA)*180/math.pi; \n", "thetamaxd=int(thetamax); #angle of acceptance(degrees)\n", "thetamaxm=60*(thetamax-thetamaxd); #angle of acceptance(minutes)\n", "\n", "#Result\n", "print \"numerical aperture is\",round(NA,4)\n", "print \"angle of acceptance is\",thetamaxd,\"degrees\",int(round(thetamaxm)),\"minutes\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 13, Page number 168" ] }, { "cell_type": "code", "execution_count": 61, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "refractive index of core is 1.233\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "NA=0.39; #numerical aperture\n", "delta=0.05; #fractional index change\n", "\n", "#Calculation\n", "n1=NA/math.sqrt(2*delta); #refractive index of core\n", "\n", "#Result\n", "print \"refractive index of core is\",round(n1,3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 14, Page number 169" ] }, { "cell_type": "code", "execution_count": 63, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "fractional index change is 0.04159\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.563; #Core refractive index\n", "n2=1.498; #Cladding refractive index\n", "\n", "#Calculation\n", "delta=(n1-n2)/n1; #fractional index change\n", "\n", "#Result\n", "print \"fractional index change is\",round(delta,5)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 15, Page number 169" ] }, { "cell_type": "code", "execution_count": 66, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "numerical aperture is 0.39\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.55; #Core refractive index\n", "n2=1.50; #Cladding refractive index\n", "\n", "#Calculation\n", "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n", "\n", "#Result\n", "print \"numerical aperture is\",round(NA,2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 16, Page number 169" ] }, { "cell_type": "code", "execution_count": 69, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "numerical aperture is 0.4461\n", "acceptance angle is 26.49 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.563; #Core refractive index\n", "n2=1.498; #Cladding refractive index\n", "\n", "#Calculation\n", "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n", "theta0=math.asin(NA)*180/math.pi; #acceptance angle(degrees)\n", "\n", "#Result\n", "print \"numerical aperture is\",round(NA,4)\n", "print \"acceptance angle is\",round(theta0,2),\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 17, Page number 170" ] }, { "cell_type": "code", "execution_count": 71, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "critical angle is 68.14 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.53; #Core refractive index\n", "n2=1.42; #Cladding refractive index\n", "\n", "#Calculation\n", "thetac=math.asin(n2/n1)*180/math.pi; #critical angle(degrees)\n", "\n", "#Result\n", "print \"critical angle is\",round(thetac,2),\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 18, Page number 170" ] }, { "cell_type": "code", "execution_count": 75, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "numerical aperture is 0.582\n", "acceptance angle is 35.6198 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.6; #Core refractive index\n", "n2=1.4; #Cladding refractive index\n", "n0=1.33; #water refractive index\n", "\n", "#Calculation\n", "NA=math.sqrt(n1**2-n2**2)/n0; #numerical aperture\n", "theta0=math.asin(NA)*180/math.pi; #acceptance angle(degrees)\n", "\n", "#Result\n", "print \"numerical aperture is\",round(NA,3)\n", "print \"acceptance angle is\",round(theta0,4),\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 19, Page number 171" ] }, { "cell_type": "code", "execution_count": 76, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "fractional index change is 0.133\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.5; #Core refractive index\n", "n2=1.3; #Cladding refractive index\n", "\n", "#Calculation\n", "delta=(n1-n2)/n1; #fractional index change\n", "\n", "#Result\n", "print \"fractional index change is\",round(delta,3)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 20, Page number 171" ] }, { "cell_type": "code", "execution_count": 82, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "angle of reflection is 57.03 degrees\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n1=1.55; #Core refractive index\n", "n2=1.6; #Cladding refractive index\n", "theta1=60*math.pi/180; #angle of incidence(radian)\n", "\n", "#Calculation\n", "x=n1*math.sin(theta1)/n2; \n", "theta2=math.asin(x)*180/math.pi; #angle of reflection(degrees)\n", "\n", "#Result\n", "print \"angle of reflection is\",round(theta2,2),\"degrees\"" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 21, Page number 171" ] }, { "cell_type": "code", "execution_count": 84, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "Core refractive index is 1.51\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "n2=1.3; #Cladding refractive index\n", "delta=0.14; #fractional index change\n", "\n", "#Calculation\n", "n1=n2/(1-delta); #Core refractive index\n", "\n", "#Result\n", "print \"Core refractive index is\",round(n1,2)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example number 22, Page number 172" ] }, { "cell_type": "code", "execution_count": 87, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "numerical aperture is 0.45088\n" ] } ], "source": [ "#importing modules\n", "import math\n", "from __future__ import division\n", "\n", "#Variable declaration\n", "theta0=26.80*math.pi/180; #acceptance angle(radian)\n", "\n", "#Calculation\n", "NA=math.sin(theta0); #numerical aperture\n", "\n", "#Result\n", "print \"numerical aperture is\",round(NA,5)" ] } ], "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.11" } }, "nbformat": 4, "nbformat_minor": 0 }