diff options
Diffstat (limited to 'sample_notebooks')
-rw-r--r-- | sample_notebooks/AdityaAnand/Chapter_8_-_Gravitation_2.ipynb | 445 | ||||
-rw-r--r-- | sample_notebooks/SINDHUARROJU/Chapter12.ipynb | 665 | ||||
-rw-r--r-- | sample_notebooks/SPANDANAARROJU/Chapter11.ipynb | 608 | ||||
-rw-r--r-- | sample_notebooks/SundeepKatta/Chapter2.ipynb | 441 |
4 files changed, 2159 insertions, 0 deletions
diff --git a/sample_notebooks/AdityaAnand/Chapter_8_-_Gravitation_2.ipynb b/sample_notebooks/AdityaAnand/Chapter_8_-_Gravitation_2.ipynb new file mode 100644 index 00000000..b60fb136 --- /dev/null +++ b/sample_notebooks/AdityaAnand/Chapter_8_-_Gravitation_2.ipynb @@ -0,0 +1,445 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "# Chapter 8 : Gravitation"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {
+ "collapsed": true
+ },
+ "source": [
+ "## Example 8.1 , page : 185"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 1,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ " The planet will take a longer time to traverse BAC than CPB\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Importing module\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "\n",
+ "mp=1 # For convenience,mass is assumed to be unity \n",
+ "rp=1 # For convenience,sun-planet distance at perihelton is assumed to be unity \n",
+ "vp=1 # For convenience,speed of the planet at perihelton is assumed to be unity \n",
+ "ra=1 # For convenience,sun-planet distance at aphelton is assumed to be unity \n",
+ "va=1 # For convenience,speed of the planet at aphelton is assumed to be unity \n",
+ "Lp=mp*rp*vp # Angular momentum at perihelton\n",
+ "La=mp*ra*va # Angular momentum at ahelton\n",
+ "\n",
+ "# Result\n",
+ "\n",
+ "# From angular momentum conservation, mp*rp*vp = mp*ra*va or vp/va = rp/ra\n",
+ "# From Kepler’s second law, equal areas are swept in equal times\n",
+ "print(\" The planet will take a longer time to traverse BAC than CPB\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.2 , page : 187 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 2,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(a) The force acting = [0.0, 2.5849394142282115e-26, 0.0] ≈ 0\n",
+ "(b) The force acting = 2 Gm²\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Importing module\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "\n",
+ "G=6.67*pow(10,-11) # Gravitational constant\n",
+ "m=1 # For convenience,mass is assumed to be unity \n",
+ "x=30 # The angle between GC and the positive x-axis is 30° and so is the angle between GB and the negative x-axis\n",
+ "y=math.radians(x) # The angle in radians\n",
+ "a=math.cos(y)\n",
+ "b=math.sin(y)\n",
+ "v1=(0,1,0)\n",
+ "v2=(-a,-b,0)\n",
+ "v3=(a,-b,0)\n",
+ "c=(2*G*pow(m,2))/1 # 2Gm²/1\n",
+ "\n",
+ "# Calculation\n",
+ "\n",
+ "#(a)\n",
+ "F1=[y * c for y in v1] # F(GA)\n",
+ "F2=[y * c for y in v2] # F(GB)\n",
+ "F3=[y * c for y in v3] # F(GC)\n",
+ "# From the principle of superposition and the law of vector addition, the resultant gravitational force FR on (2m) is given by\n",
+ "Fa=[sum(x) for x in zip(F1,F2,F3)]\n",
+ "\n",
+ "#(b)\n",
+ "# By symmetry the x-component of the force cancels out and the y-component survives\n",
+ "Fb=4-2 # 4Gm² j - 2Gm² j\n",
+ "\n",
+ "# Result\n",
+ "\n",
+ "print(\"(a) The force acting =\",Fa,\"≈ 0\")\n",
+ "print(\"(b) The force acting =\",Fb,\"Gm²\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.3 , page : 192 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Potential energy of a system of four particles = -5.414213562373095 Gm²/l\n",
+ "The gravitational potential at the centre of the square = -5.65685424949238 Gm²/l\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Importing module\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "\n",
+ "G=6.67*pow(10,-11) # Gravitational constant\n",
+ "m=1 # For convenience,mass is assumed to be unity \n",
+ "l=1 # For convenience,side of the square is assumed to be unity \n",
+ "c=(G*pow(m,2))/l\n",
+ "n=4 # Number of particles\n",
+ "\n",
+ "# Calculation\n",
+ "\n",
+ "d=math.sqrt(2)\n",
+ "# If the side of a square is l then the diagonal distance is √2l\n",
+ "# We have four mass pairs at distance l and two diagonal pairs at distance √2l \n",
+ "# Since the Potential Energy of a system of four particles is -4Gm²/l) - 2Gm²/dl\n",
+ "w=(-n-(2/d)) \n",
+ "# If the side of a square is l then the diagonal distance from the centre to corner is \n",
+ "# Since the Gravitational Potential at the centre of the square\n",
+ "u=-n*(2/d)\n",
+ "\n",
+ "# Result\n",
+ "\n",
+ "print (\"Potential energy of a system of four particles =\",w,\"Gm²/l\")\n",
+ "print(\"The gravitational potential at the centre of the square =\",u,\"Gm²/l\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.4 , page : 193 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Minimum speed of the projectile to reach the surface of the second sphere = ( 0.6 GM/R ) ^(1/2)\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Importing module\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "\n",
+ "R=1 # For convenience,radii of both the spheres is assumed to be unity \n",
+ "M=1 # For convenience,mass is assumed to be unity \n",
+ "m1=M # Mass of the first sphere\n",
+ "m2=6*M # Mass of the second sphere\n",
+ "m=1 # Since the mass of the projectile is unknown,take it as unity\n",
+ "d=6*R # Distance between the centres of both the spheres\n",
+ "r=1 # The distance from the centre of first sphere to the neutral point N\n",
+ "\n",
+ "G=6.67*pow(10,-11) # Gravitational constant\n",
+ "\n",
+ "# Calculation\n",
+ "\n",
+ "# Since N is the neutral point; GMm/r² = 4GMm/(6R-r)² and we get\n",
+ "r=2*R\n",
+ "# The mechanical energy at the surface of M is; Et = m(v^2)/2 - GMm/R - 4GMm/5R\n",
+ "# The mechanical energy at N is; En = -GMm/2R - 4GMm/4R\n",
+ "# From the principle of conservation of mechanical energy; Et = En and we get\n",
+ "v_sqr=2*((4/5)-(1/2))\n",
+ "\n",
+ "# Result\n",
+ "\n",
+ "print(\"Minimum speed of the projectile to reach the surface of the second sphere =\",\"(\",round(v_sqr,5),\"GM/R\",\")\",\"^(1/2)\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.5 , page : 195 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "(i) Mass of Mars = 6.475139697520706e+23 kg\n",
+ "(ii) Period of revolution of Mars = 684.0033777694376 days\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Importing module\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "\n",
+ "π=3.14 # Constant pi\n",
+ "G=6.67*pow(10,-11) # Gravitational constant\n",
+ "R=9.4*pow(10,3) # Orbital radius of Mars in km\n",
+ "T=459*60\n",
+ "Te=365 # Period of revolution of Earth\n",
+ "r=1.52 # Ratio of Rms/Res, where Rms is the mars-sun distance and Res is the earth-sun distance. \n",
+ "\n",
+ "# Calculation\n",
+ "\n",
+ "# (i) \n",
+ "R=R*pow(10,3)\n",
+ "# Using Kepler's 3rd law:T²=4π²(R^3)/GMm\n",
+ "Mm=(4*pow(π,2)*pow(R,3))/(G*pow(T,2))\n",
+ "\n",
+ "# (ii)\n",
+ "# Using Kepler's 3rd law: Tm²/Te² = (Rms^3/Res^3)\n",
+ "Tm=pow(r,(3/2))*365\n",
+ "\n",
+ "\n",
+ "# Result\n",
+ "\n",
+ "print(\"(i) Mass of Mars =\",Mm,\"kg\")\n",
+ "print(\"(ii) Period of revolution of Mars =\",Tm,\"days\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.6 , page : 195 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 6,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Mass of the Earth = 5.967906881559221e+24 kg\n",
+ "Mass of the Earth = 6.017752855396305e+24 kg\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Importing module\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "\n",
+ "g=9.81 # Acceleration due to gravity\n",
+ "G=6.67*pow(10,-11) # Gravitational constant\n",
+ "Re=6.37*pow(10,6) # Radius of Earth in m\n",
+ "R=3.84*pow(10,8) # Distance of Moon from Earth in m\n",
+ "T=27.3 # Period of revolution of Moon in days\n",
+ "π=3.14 # Constant pi\n",
+ "\n",
+ "# Calculation\n",
+ "\n",
+ "# I Method\n",
+ "# Using Newton's 2nd law of motion:g = F/m = GMe/Re²\n",
+ "Me1=(g*pow(Re,2))/G\n",
+ "\n",
+ "# II Method\n",
+ "# Using Kepler's 3rd law: T²= 4π²(R^3)/GMe\n",
+ "T1=T*24*60*60\n",
+ "Me2=(4*pow(π,2)*pow(R,3))/(G*pow(T1,2))\n",
+ "\n",
+ "#Result\n",
+ "\n",
+ "print(\"Mass of the Earth =\",Me1,\"kg\")\n",
+ "print(\"Mass of the Earth =\",Me2,\"kg\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.7 , page : 195 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Period of revolution of Moon = 27.5 days\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Importing module\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "\n",
+ "k=pow(10,-13) # A constant = 4π² / GME\n",
+ "Re=3.84*pow(10,5) # Distance of the Moon from the Earth in m\n",
+ "\n",
+ "# Calculation\n",
+ "\n",
+ "k=pow(10,-13)*(pow(1/(24*60*60),2))*(1/pow((1/1000),3))\n",
+ "T2=k*pow(Re,3)\n",
+ "T=math.sqrt(T2) # Period of revolution of Moon in days\n",
+ "\n",
+ "# Result\n",
+ "\n",
+ "print(\"Period of revolution of Moon =\",round(T,1),\"days\")"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "## Example 8.8 , page : 196 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Change in Kinetic Energy = 3124485000.0 J\n",
+ "Change in Potential Energy = 6248970000.0 J\n"
+ ]
+ }
+ ],
+ "source": [
+ "# Importing module\n",
+ "\n",
+ "import math\n",
+ "\n",
+ "# Variable declaration\n",
+ "\n",
+ "m=400 # Mass of satellite in kg\n",
+ "Re=6.37*pow(10,6) # Radius of Earth in m\n",
+ "g=9.81 # Acceleration due to gravity\n",
+ "\n",
+ "# Calculation\n",
+ "\n",
+ "# Change in energy is E=Ef-Ei\n",
+ "ΔE=(g*m*Re)/8 # Change in Total energy\n",
+ "# Since Potential Energy is twice as the change in Total Energy (V = Vf - Vi)\n",
+ "ΔV=2*ΔE # Change in Potential Energy in J\n",
+ "\n",
+ "# Result\n",
+ "\n",
+ "print(\"Change in Kinetic Energy =\",round(ΔE,4),\"J\")\n",
+ "print(\"Change in Potential Energy =\",round(ΔV,4),\"J\")"
+ ]
+ }
+ ],
+ "metadata": {
+ "kernelspec": {
+ "display_name": "Python 3",
+ "language": "python",
+ "name": "python3"
+ },
+ "language_info": {
+ "codemirror_mode": {
+ "name": "ipython",
+ "version": 3
+ },
+ "file_extension": ".py",
+ "mimetype": "text/x-python",
+ "name": "python",
+ "nbconvert_exporter": "python",
+ "pygments_lexer": "ipython3",
+ "version": "3.4.3"
+ }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 0
+}
diff --git a/sample_notebooks/SINDHUARROJU/Chapter12.ipynb b/sample_notebooks/SINDHUARROJU/Chapter12.ipynb new file mode 100644 index 00000000..09a71a18 --- /dev/null +++ b/sample_notebooks/SINDHUARROJU/Chapter12.ipynb @@ -0,0 +1,665 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#12: Fiber Optics"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.1, Page number 12.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 52,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "acceptance angle is 20.41 degrees\n",
+ "answer 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.54; #Core refractive index\n",
+ "n2=1.50; #Cladding refractive index\n",
+ "\n",
+ "#Calculation\n",
+ "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n",
+ "alpha_m=math.asin(NA); #acceptance angle(radian)\n",
+ "alpha_m=alpha_m*180/math.pi; #acceptance angle(degrees)\n",
+ "\n",
+ "#Result\n",
+ "print \"acceptance angle is\",round(alpha_m,2),\"degrees\"\n",
+ "print \"answer in the book varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.2, Page number 12.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 53,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "numerical aperture is 0.387\n",
+ "acceptance angle is 22.8 degrees\n",
+ "critical angle is 75 degrees\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.45; #Cladding refractive index\n",
+ "\n",
+ "#Calculation\n",
+ "delta=(n1-n2)/n1; #fractional index change\n",
+ "NA=n1*math.sqrt(2*delta); #numerical aperture\n",
+ "alpha_m=math.asin(NA); #acceptance angle(radian)\n",
+ "alpha_m=alpha_m*180/math.pi; #acceptance angle(degrees)\n",
+ "thetac=math.asin(n2/n1)*180/math.pi; #critical angle(degrees)\n",
+ "\n",
+ "#Result\n",
+ "print \"numerical aperture is\",round(NA,3)\n",
+ "print \"acceptance angle is\",round(alpha_m,1),\"degrees\"\n",
+ "print \"critical angle is\",int(thetac),\"degrees\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.3, Page number 12.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 54,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical angle is 77.16 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",
+ "p=2.5; #percentage(%)\n",
+ "\n",
+ "#Calculation\n",
+ "n2=n1*(100-p)/100; #Cladding refractive index\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 12.4, Page number 12.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 55,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "numerical aperture is 0.28\n",
+ "acceptance angle is 16.26 degrees\n",
+ "critical angle is 79.1 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "delta=0.018; #fractional difference\n",
+ "n1=1.50; #Core refractive index\n",
+ "\n",
+ "#Calculation\n",
+ "NA=round(n1*math.sqrt(2*delta),2); #numerical aperture\n",
+ "alpha_m=math.asin(NA); #acceptance angle(radian)\n",
+ "alpha_m=alpha_m*180/math.pi; #acceptance angle(degrees)\n",
+ "n2=n1-(delta*n1); #Cladding refractive index\n",
+ "thetac=math.asin(n2/n1)*180/math.pi; #critical angle(degrees)\n",
+ "\n",
+ "#Result\n",
+ "print \"numerical aperture is\",NA\n",
+ "print \"acceptance angle is\",round(alpha_m,2),\"degrees\"\n",
+ "print \"critical angle is\",round(thetac,1),\"degrees\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.5, Page number 12.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 56,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "total number of guided modes is 490.0\n",
+ "number of modes of graded index fibre is 245.0\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=50*10**-6; #diameter(m)\n",
+ "lamda=1*10**-6; #wavelength(m)\n",
+ "NA=0.2; #numerical aperture\n",
+ "\n",
+ "#Calculation\n",
+ "NSI=4.9*(d*NA/lamda)**2; #total number of guided modes\n",
+ "NGI=NSI/2; #number of modes of graded index fibre\n",
+ "\n",
+ "#Result\n",
+ "print \"total number of guided modes is\",NSI\n",
+ "print \"number of modes of graded index fibre is\",NGI"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.6, Page number 12.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 57,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "numerical aperture is 0.47\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "delta=0.05; #fractional difference\n",
+ "n1=1.5; #Core refractive index\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 12.7, Page number 12.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 58,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of modes that can be propagated is 1\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "d=5*10**-6; #diameter(m)\n",
+ "lamda=1*10**-6; #wavelength(m)\n",
+ "NA=0.092; #numerical aperture\n",
+ "\n",
+ "#Calculation\n",
+ "N=4.9*(d*NA/lamda)**2; #number of modes that can be propagated\n",
+ "\n",
+ "#Result\n",
+ "print \"number of modes that can be propagated is\",int(N)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.8, Page number 12.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 59,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "V number is 94.7\n",
+ "maximum number of modes is 4485.7\n",
+ "answer 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.53; #Core refractive index\n",
+ "n2=1.50; #Cladding refractive index\n",
+ "a=50*10**-6; #radius(m)\n",
+ "lamda=1*10**-6; #wavelength(m)\n",
+ "\n",
+ "#Calculation\n",
+ "NA=math.sqrt(n1**2-n2**2); #numerical aperture\n",
+ "Vn=2*math.pi*a*NA/lamda; #V number\n",
+ "N=Vn**2/2; #maximum number of modes\n",
+ "\n",
+ "#Result\n",
+ "print \"V number is\",round(Vn,1)\n",
+ "print \"maximum number of modes is\",round(N,1)\n",
+ "print \"answer in the book varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.9, Page number 12.27"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 60,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of propagating modes is 49177\n",
+ "answer in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=100*10**-6; #radius(m)\n",
+ "lamda=0.85*10**-6; #wavelength(m)\n",
+ "NA=0.3; #numerical aperture\n",
+ "\n",
+ "#Calculation\n",
+ "N=4*math.pi**2*a**2*NA**2/lamda**2; #number of propagating modes\n",
+ "\n",
+ "#Result\n",
+ "print \"number of propagating modes is\",int(N)\n",
+ "print \"answer in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.10, Page number 12.28"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 61,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Core refractive index is 1.6025\n",
+ "acceptance angle is 8.638 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "NA=0.2; #numerical aperture\n",
+ "n2=1.59; #Cladding refractive index\n",
+ "n0=1.33; #refractive index\n",
+ "\n",
+ "#Calculation\n",
+ "n1=round(math.sqrt(NA**2+n2**2),4); #Core refractive index\n",
+ "NA1=math.sqrt(n1**2-n2**2)/n0; #numerical aperture\n",
+ "alpha_m=math.asin(NA1); #acceptance angle(radian)\n",
+ "alpha_m=alpha_m*180/math.pi; #acceptance angle(degrees)\n",
+ "\n",
+ "#Result\n",
+ "print \"Core refractive index is\",n1\n",
+ "print \"acceptance angle is\",round(alpha_m,3),\"degrees\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.11, Page number 12.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 62,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of photons is 13.675 *10**15\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "h=6.63*10**-34; #plank's constant(Js)\n",
+ "lamda=680*10**-9; #wavelength(m)\n",
+ "P=4*10**-3; #power(W)\n",
+ "\n",
+ "#Calculation\n",
+ "delta_E=c*h/lamda; #energy(J)\n",
+ "N=P/delta_E; #number of photons\n",
+ "\n",
+ "#Result\n",
+ "print \"number of photons is\",round(N/10**15,3),\"*10**15\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.12, Page number 12.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 64,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "Cladding refractive index is 1.49925\n",
+ "numerical aperture is 0.0474\n",
+ "critical angle is 88.2 degrees\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "delta=0.0005; #fractional difference\n",
+ "n1=1.5; #Core refractive index\n",
+ "\n",
+ "#Calculation\n",
+ "n2=n1-(delta*n1); #Cladding refractive index\n",
+ "NA=n1*math.sqrt(2*delta); #numerical aperture\n",
+ "thetac=math.asin(n2/n1)*180/math.pi; #critical angle(degrees)\n",
+ "\n",
+ "#Result\n",
+ "print \"Cladding refractive index is\",n2\n",
+ "print \"numerical aperture is\",round(NA,4)\n",
+ "print \"critical angle is\",round(thetac,1),\"degrees\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.13, Page number 12.29"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 65,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "fraction of initial intensity after 2km is 0.363\n",
+ "fraction of initial intensity after 5km is 0.048\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "alpha=2.2; #attenuation coefficient(dB/km)\n",
+ "L1=2; #distance(km)\n",
+ "L2=6; #distance(km)\n",
+ "\n",
+ "#Calculation\n",
+ "x1=-alpha*L1/10; \n",
+ "x2=-alpha*L2/10;\n",
+ "P1=10**x1; #fraction of initial intensity after 2km\n",
+ "P2=10**x2; #fraction of initial intensity after 5km\n",
+ "\n",
+ "#Result\n",
+ "print \"fraction of initial intensity after 2km is\",round(P1,3)\n",
+ "print \"fraction of initial intensity after 5km is\",round(P2,3)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.14, Page number 12.30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 66,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "attenuation coefficient is 1.41 dB/km\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L=0.5; #distance(km)\n",
+ "Pout=1; #output power(W)\n",
+ "Pin=85/100; #input power(W)\n",
+ "\n",
+ "#Calculation\n",
+ "alpha=10*math.log10(Pout/Pin)/L; #attenuation coefficient(dB/km)\n",
+ "\n",
+ "#Result\n",
+ "print \"attenuation coefficient is\",round(alpha,2),\"dB/km\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 12.15, Page number 12.30"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 67,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "attenuation coefficient is 1.7 dB/km\n",
+ "overall signal attenuation is 17 dB\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "L=10; #distance(km)\n",
+ "Pout=2; #output power(W)\n",
+ "Pin=100; #input power(W)\n",
+ "\n",
+ "#Calculation\n",
+ "alpha=10*math.log10(Pin/Pout)/L; #attenuation coefficient(dB/km)\n",
+ "o_alpha=round(alpha,1)*L; #overall signal attenuation\n",
+ "\n",
+ "#Result\n",
+ "print \"attenuation coefficient is\",round(alpha,1),\"dB/km\"\n",
+ "print \"overall signal attenuation is\",int(o_alpha),\"dB\""
+ ]
+ }
+ ],
+ "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/sample_notebooks/SPANDANAARROJU/Chapter11.ipynb b/sample_notebooks/SPANDANAARROJU/Chapter11.ipynb new file mode 100644 index 00000000..d0036604 --- /dev/null +++ b/sample_notebooks/SPANDANAARROJU/Chapter11.ipynb @@ -0,0 +1,608 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#11: Lasers"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.1, Page number 11.55"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "intensity of laser beam is 1.5 *10**4 watt/m**2\n",
+ "answer given in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P=20*10**-3; #power(watt)\n",
+ "r=1.3/2; #radius(mm)\n",
+ "\n",
+ "#Calculation\n",
+ "r=r*10**-3; #radius(m)\n",
+ "I=P/(math.pi*r**2); #intensity of laser beam(watt/m**2)\n",
+ "\n",
+ "#Result\n",
+ "print \"intensity of laser beam is\",round(I/10**4,1),\"*10**4 watt/m**2\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.2, Page number 11.56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "mode seperation in frequency is 2.5 *10**8 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "L=0.6; #distance(m)\n",
+ "\n",
+ "#Calculation\n",
+ "delta_v=c/(2*L); #mode seperation in frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print \"mode seperation in frequency is\",delta_v/10**8,\"*10**8 Hz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.3, Page number 11.56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "coherence length is 1.5 *10**-2 m\n",
+ "band width is 2.0 *10**10 Hz\n",
+ "line width is 0.026 nm\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "delta_t=0.05*10**-9; #time(s)\n",
+ "lamda=623.8*10**-9; #wavelength(m)\n",
+ "\n",
+ "#Calculation\n",
+ "cl=c*delta_t; #coherence length(m)\n",
+ "delta_v=1/delta_t; #band width(Hz)\n",
+ "delta_lamda=lamda**2*delta_v/c; #line width(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"coherence length is\",cl*10**2,\"*10**-2 m\"\n",
+ "print \"band width is\",delta_v/10**10,\"*10**10 Hz\"\n",
+ "print \"line width is\",round(delta_lamda*10**9,3),\"nm\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.4, Page number 11.56"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 21,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "energy difference is 1.96 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "h=6.63*10**-34; #plank's constant(Js)\n",
+ "lamda=632.8*10**-9; #wavelength(m)\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "\n",
+ "#Calculation\n",
+ "E=c*h/(lamda*e); #energy difference(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"energy difference is\",round(E,2),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.5, Page number 11.57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio of population is 8.95 *10**-32\n",
+ "answer given in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "h=6.63*10**-34; #plank's constant(Js)\n",
+ "lamda=6928*10**-10; #wavelength(m)\n",
+ "Kb=1.38*10**-23; #boltzmann constant(J/K)\n",
+ "T=291; #temperature(K)\n",
+ "\n",
+ "#Calculation\n",
+ "delta_E=c*h/lamda;\n",
+ "N=math.exp(-delta_E/(Kb*T)); #ratio of population\n",
+ "\n",
+ "#Result\n",
+ "print \"ratio of population is\",round(N*10**32,2),\"*10**-32\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.6, Page number 11.57"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 26,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "wavelength is 632 *10**-9 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Kb=1.38*10**-23; #boltzmann constant(J/K)\n",
+ "T=330; #temperature(K)\n",
+ "delta_E=3.147*10**-19; #energy(J)\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "h=6.63*10**-34; #plank's constant(Js)\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=c*h/delta_E; #wavelength(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"wavelength is\",int(lamda*10**9),\"*10**-9 m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.7, Page number 11.58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 28,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "laser beam divergence is 0.5 *10**-3 radian\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "r1=2*10**-3; #radius(m)\n",
+ "r2=3*10**-3; #radius(m)\n",
+ "d1=2; #distance(m)\n",
+ "d2=4; #distance(m)\n",
+ "\n",
+ "#Calculation\n",
+ "delta_theta=(r2-r1)/(d2-d1); #laser beam divergence(radian)\n",
+ "\n",
+ "#Result\n",
+ "print \"laser beam divergence is\",delta_theta*10**3,\"*10**-3 radian\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.8, Page number 11.58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 4,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio of population is 1.127 *10**30\n",
+ "answer given in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "h=6.63*10**-34; #plank's constant(Js)\n",
+ "lamda=6943*10**-10; #wavelength(m)\n",
+ "Kb=1.38*10**-23; #boltzmann constant(J/K)\n",
+ "T=300; #temperature(K)\n",
+ "\n",
+ "#Calculation\n",
+ "new=c/lamda;\n",
+ "N=math.exp(h*new/(Kb*T)); #ratio of population\n",
+ "\n",
+ "#Result\n",
+ "print \"ratio of population is\",round(N*10**-30,3),\"*10**30\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.9, Page number 11.58"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 8,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "wavelength is 8632.8 angstrom\n",
+ "answer given in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "h=6.63*10**-34; #plank's constant(Js)\n",
+ "Eg=1.44*1.6*10**-19; #band gap(J)\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=c*h/Eg; #wavelength(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"wavelength is\",round(lamda*10**10,1),\"angstrom\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.10, Page number 11.59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "energy gap is 0.8 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "lamda=1.55; #wavelength(micro m)\n",
+ "\n",
+ "#Calculation\n",
+ "Eg=1.24/lamda; #energy gap(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"energy gap is\",Eg,\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.11, Page number 11.59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 13,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "coherence length is 12 *10**3 m\n",
+ "spectral half width is 4.56 *10**-17 m\n",
+ "purity factor is 1.6 *10**10\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "tow=4*10**-5; #time(sec)\n",
+ "lamda=740*10**-9; #wavelength(m)\n",
+ "\n",
+ "#Calculation\n",
+ "L=tow*c; #coherence length(m)\n",
+ "delta_lamda=lamda**2/L; #spectral half width(m)\n",
+ "Q=lamda/delta_lamda; #purity factor\n",
+ "\n",
+ "#Result\n",
+ "print \"coherence length is\",int(L/10**3),\"*10**3 m\"\n",
+ "print \"spectral half width is\",round(delta_lamda*10**17,2),\"*10**-17 m\"\n",
+ "print \"purity factor is\",round(Q/10**10,1),\"*10**10\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.12, Page number 11.59"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 16,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio of emissions is 8.4 *10**4\n",
+ "answer given in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "new=5.9*10**14; #frequency(Hz)\n",
+ "h=6.63*10**-34; #plank's constant(Js)\n",
+ "Kb=1.38*10**-23; #boltzmann constant(J/K)\n",
+ "T=2500; #temperature(K)\n",
+ "\n",
+ "#Calculation\n",
+ "R=math.exp(h*new/(Kb*T))-1; #ratio of emissions\n",
+ "\n",
+ "#Result\n",
+ "print \"ratio of emissions is\",round(R/10**4,1),\"*10**4\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.13, Page number 11.60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "beam divergence is 1.02 *10**-4 radian\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "lamda=1.06*10**-6; #wavelength(m)\n",
+ "d=2.54*10**-2; #distance(m)\n",
+ "\n",
+ "#Calculation\n",
+ "theta=2.44*lamda/d; #beam divergence(radian)\n",
+ "\n",
+ "#Result\n",
+ "print \"beam divergence is\",round(theta*10**4,2),\"*10**-4 radian\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 11.14, Page number 11.60"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of photons/minute is 4.39 *10**17\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "P=2.3*10**-3; #power(W)\n",
+ "c=3*10**8; #velocity of light(m/sec)\n",
+ "h=6.63*10**-34; #plank's constant(Js)\n",
+ "lamda=6328*10**-10; #wavelength(m)\n",
+ "\n",
+ "#Calculation\n",
+ "n=P*lamda*60/(c*h); #number of photons/min\n",
+ "\n",
+ "#Result\n",
+ "print \"number of photons/minute is\",round(n/10**17,2),\"*10**17\""
+ ]
+ }
+ ],
+ "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/sample_notebooks/SundeepKatta/Chapter2.ipynb b/sample_notebooks/SundeepKatta/Chapter2.ipynb new file mode 100644 index 00000000..601cae27 --- /dev/null +++ b/sample_notebooks/SundeepKatta/Chapter2.ipynb @@ -0,0 +1,441 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#2: Crystal Structures"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.1, Page number 2.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "lattice constant is 4.0 *10**-10 m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "M=60.2; #molecular weight\n",
+ "Na=6.023*10**26; #avagadro number(kg/mole)\n",
+ "n=4; \n",
+ "rho=6250; #density(kg/m**3)\n",
+ "\n",
+ "#Calculation\n",
+ "a=(n*M/(rho*Na))**(1/3); #lattice constant(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"lattice constant is\",round(a*10**10),\"*10**-10 m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.2, Page number 2.23"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "density is 8.93 gm/cm**3\n",
+ "answer 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",
+ "M=63.5; #molecular weight\n",
+ "Na=6.023*10**26; #avagadro number(kg/mole)\n",
+ "n=4; \n",
+ "r=1.278*10**-8; #atomic radius(cm)\n",
+ "\n",
+ "#Calculation\n",
+ "a=2*math.sqrt(2)*r; #lattice constant(m)\n",
+ "rho=n*M/(a**3*Na); #density(kg/cm**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"density is\",round(rho*10**3,2),\"gm/cm**3\"\n",
+ "print \"answer in the book varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.3, Page number 2.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "ratio of densities is 0.92\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "pf_BCC=math.pi*math.sqrt(3)/8; #packing factor for BCC\n",
+ "pf_FCC=math.pi/(3*math.sqrt(2)); #packing factor of FCC\n",
+ "\n",
+ "#Calculation\n",
+ "r=pf_BCC/pf_FCC; #ratio of densities\n",
+ "\n",
+ "#Result\n",
+ "print \"ratio of densities is\",round(r,2)"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.4, Page number 2.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 14,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "lattice constant is 2.8687 angstrom\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "M=55.85; #molecular weight\n",
+ "Na=6.02*10**26; #avagadro number(kg/mole)\n",
+ "n=2; \n",
+ "rho=7860; #density(kg/m**3)\n",
+ "\n",
+ "#Calculation\n",
+ "a=(n*M/(rho*Na))**(1/3); #lattice constant(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"lattice constant is\",round(a*10**10,4),\"angstrom\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.5, Page number 2.24"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "lattice constant is 5.6 angstrom\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "M=58.5; #molecular weight\n",
+ "Na=6.02*10**26; #avagadro number(kg/mole)\n",
+ "n=4; \n",
+ "rho=2189; #density(kg/m**3)\n",
+ "\n",
+ "#Calculation\n",
+ "a=(n*M/(rho*Na))**(1/3); #lattice constant(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"lattice constant is\",round(a*10**10,1),\"angstrom\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.6, Page number 2.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 23,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "lattice constant is 3.517 angstrom\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "M=6.94; #molecular weight\n",
+ "Na=6.02*10**26; #avagadro number(kg/mole)\n",
+ "n=2; \n",
+ "rho=530; #density(kg/m**3)\n",
+ "\n",
+ "#Calculation\n",
+ "a=(n*M/(rho*Na))**(1/3); #lattice constant(m)\n",
+ "\n",
+ "#Result\n",
+ "print \"lattice constant is\",round(a*10**10,3),\"angstrom\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.7, Page number 2.25"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 29,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "percent volume change is 0.493 %\n",
+ "answer 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",
+ "r1=1.258*10**-10; #radius(m)\n",
+ "r2=1.292*10**-10; #radius(m)\n",
+ "\n",
+ "#Calculation\n",
+ "a_bcc=4*r1/math.sqrt(3);\n",
+ "v=a_bcc**3;\n",
+ "V1=v/2;\n",
+ "a_fcc=2*math.sqrt(2)*r2;\n",
+ "V2=a_fcc**3/4;\n",
+ "V=(V1-V2)*100/V1; #percent volume change is\",V,\"%\"\n",
+ "\n",
+ "#Result\n",
+ "print \"percent volume change is\",round(V,3),\"%\"\n",
+ "print \"answer in the book varies due to rounding off errors\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.8, Page number 2.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "number of atoms/m**3 is 1.77 *10**29\n",
+ "density of diamond is 3534.47 kg/m**3\n",
+ "answer in the book is wrong\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=0.356*10**-9; #cube edge(m)\n",
+ "w=12; #atomic weight\n",
+ "Na=6.02*10**26; #avagadro number(kg/mole)\n",
+ "\n",
+ "#Calculation\n",
+ "n=8/(a**3); #number of atoms/m**3\n",
+ "m=w/Na; #mass(kg)\n",
+ "rho=m*n; #density of diamond(kg/m**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"number of atoms/m**3 is\",round(n/10**29,2),\"*10**29\"\n",
+ "print \"density of diamond is\",round(rho,2),\"kg/m**3\"\n",
+ "print \"answer in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.9, Page number 2.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "maximum radius of sphere is 0.414 r\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from sympy import *\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=Symbol('r')\n",
+ "\n",
+ "#Calculation\n",
+ "a=4*r/math.sqrt(2);\n",
+ "R=(4*r/(2*math.sqrt(2)))-r; #maximum radius of sphere\n",
+ "\n",
+ "#Result\n",
+ "print \"maximum radius of sphere is\",round(R/r,3),\"r\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 2.10, Page number 2.26"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 35,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "radius of largest sphere is 0.155 r\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from sympy import *\n",
+ "\n",
+ "#Variable declaration\n",
+ "r=Symbol('r')\n",
+ "\n",
+ "#Calculation\n",
+ "a=4*r/math.sqrt(3);\n",
+ "R=(a/2)-r; #radius of largest sphere\n",
+ "\n",
+ "#Result\n",
+ "print \"radius of largest sphere is\",round(R/r,3),\"r\""
+ ]
+ }
+ ],
+ "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
+}
|