summaryrefslogtreecommitdiff
path: root/Engineering_Physics_Marikani/Chapter_2.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Engineering_Physics_Marikani/Chapter_2.ipynb')
-rw-r--r--Engineering_Physics_Marikani/Chapter_2.ipynb304
1 files changed, 271 insertions, 33 deletions
diff --git a/Engineering_Physics_Marikani/Chapter_2.ipynb b/Engineering_Physics_Marikani/Chapter_2.ipynb
index f57dc5cb..b54dc631 100644
--- a/Engineering_Physics_Marikani/Chapter_2.ipynb
+++ b/Engineering_Physics_Marikani/Chapter_2.ipynb
@@ -1,6 +1,7 @@
{
"metadata": {
- "name": "Chapter 2"
+ "name": "",
+ "signature": "sha256:86128ebcddc1aace30166722ef06d4489b2c11f53b2c59c5d439d37f83881533"
},
"nbformat": 3,
"nbformat_minor": 0,
@@ -11,25 +12,54 @@
"cell_type": "heading",
"level": 1,
"metadata": {},
- "source": "Laser"
+ "source": [
+ "Laser"
+ ]
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.1, Page number 59 "
+ "source": [
+ "Example number 2.1, Page number 59 "
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the number of photons emitted by laser\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nlamda=632.8*10**-9; #wavelength in m\nP=5*10**-3; #output power in W\n\n#Calculation\nE=(h*c)/lamda; #energy of one photon\nE_eV=E/(1.6*10**-19); #converting J to eV\nE_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals\nN=P/E; #number of photons emitted\n\n\n#Result\nprint(\"energy of one photon in eV is\",E_eV);\nprint(\"number of photons emitted per second is\",N);\n",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.626*10**-34;\n",
+ "c=3*10**8;\n",
+ "lamda=632.8*10**-9; #wavelength in m\n",
+ "P=5*10**-3; #output power in W\n",
+ "\n",
+ "#Calculation\n",
+ "E=(h*c)/lamda; #energy of one photon\n",
+ "E_eV=E/(1.6*10**-19); #converting J to eV\n",
+ "E_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals\n",
+ "N=P/E; #number of photons emitted\n",
+ "\n",
+ "\n",
+ "#Result\n",
+ "print(\"energy of one photon in eV is\",E_eV);\n",
+ "print(\"number of photons emitted per second is\",N);\n"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('energy of one photon in eV is', 1.964)\n('number of photons emitted per second is', 1.5917094275077976e+16)\n"
+ "text": [
+ "('energy of one photon in eV is', 1.964)\n",
+ "('number of photons emitted per second is', 1.5917094275077976e+16)\n"
+ ]
}
],
"prompt_number": 1
@@ -38,19 +68,41 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.2, Page number 60"
+ "source": [
+ "Example number 2.2, Page number 60"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the energy of emitted photons\n\n#importing modules\nimport math\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nlamda=632.8*10**-9; #wavelength in m\n\n#Calculation\nE=(h*c)/lamda; #energy of one photon\nE_eV=E/(1.6*10**-19); #converting J to eV\nE_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals\n\n#Result\nprint(\"energy of one photon in eV is\",E_eV);\n",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.626*10**-34;\n",
+ "c=3*10**8;\n",
+ "lamda=632.8*10**-9; #wavelength in m\n",
+ "\n",
+ "#Calculation\n",
+ "E=(h*c)/lamda; #energy of one photon\n",
+ "E_eV=E/(1.6*10**-19); #converting J to eV\n",
+ "E_eV=math.ceil(E_eV*1000)/1000; #rounding off to 3 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"energy of one photon in eV is\",E_eV);\n"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('energy of one photon in eV is', 1.964)\n"
+ "text": [
+ "('energy of one photon in eV is', 1.964)\n"
+ ]
}
],
"prompt_number": 2
@@ -59,19 +111,46 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.3, Page number 60"
+ "source": [
+ "Example number 2.3, Page number 60"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the value of E3\n\n#importing modules\nimport math\n\n#Variable declaration\nE1=0; #value of 1st energy level in eV\nE2=1.4; #value of 2nd energy level in eV\nlamda=1.15*10**-6;\nh=6.626*10**-34;\nc=3*10**8;\n\n#Calculation\nE=(h*c)/lamda; #energy of one photon\nE_eV=E/(1.6*10**-19); #converting J to eV\nE3=E2+E_eV;\nE3=math.ceil(E3*100)/100; #rounding off to 2 decimals\n\n#Result\nprint(\"value of E3 in eV is\",E3);\n\n#answer given in the book for E3 is wrong",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "E1=0; #value of 1st energy level in eV\n",
+ "E2=1.4; #value of 2nd energy level in eV\n",
+ "lamda=1.15*10**-6;\n",
+ "h=6.626*10**-34;\n",
+ "c=3*10**8;\n",
+ "\n",
+ "#Calculation\n",
+ "E=(h*c)/lamda; #energy of one photon\n",
+ "E_eV=E/(1.6*10**-19); #converting J to eV\n",
+ "E3=E2+E_eV;\n",
+ "E3=math.ceil(E3*100)/100; #rounding off to 2 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"value of E3 in eV is\",E3);\n",
+ "\n",
+ "#answer given in the book for E3 is wrong"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('value of E3 in eV is', 2.49)\n"
+ "text": [
+ "('value of E3 in eV is', 2.49)\n"
+ ]
}
],
"prompt_number": 3
@@ -80,19 +159,41 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.4, Page number 60"
+ "source": [
+ "Example number 2.4, Page number 60"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the wavelength of laser beam\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nE2=3.2; #value of higher energy level in eV\nE1=1.6; #value of lower energy level in eV\n\n#Calculation\nE=E2-E1; #energy difference in eV\nE_J=E*1.6*10**-19; #converting E from eV to J\nlamda=(h*c)/E_J; #wavelength of photon\n\n#Result\nprint(\"energy difference in eV\",E);\nprint(\"wavelength of photon in m\",lamda);\n",
+ "input": [
+ "\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.626*10**-34;\n",
+ "c=3*10**8;\n",
+ "E2=3.2; #value of higher energy level in eV\n",
+ "E1=1.6; #value of lower energy level in eV\n",
+ "\n",
+ "#Calculation\n",
+ "E=E2-E1; #energy difference in eV\n",
+ "E_J=E*1.6*10**-19; #converting E from eV to J\n",
+ "lamda=(h*c)/E_J; #wavelength of photon\n",
+ "\n",
+ "#Result\n",
+ "print(\"energy difference in eV\",E);\n",
+ "print(\"wavelength of photon in m\",lamda);\n"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('energy difference in eV', 1.6)\n('wavelength of photon in m', 7.76484375e-07)\n"
+ "text": [
+ "('energy difference in eV', 1.6)\n",
+ "('wavelength of photon in m', 7.76484375e-07)\n"
+ ]
}
],
"prompt_number": 6
@@ -101,19 +202,36 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.5, Page number 60"
+ "source": [
+ "Example number 2.5, Page number 60"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the wavelength of laser beam\n\n#Variable declaration\nh=6.626*10**-34;\nc=3*10**8;\nE=1.42*1.6*10**-19; #band gap of GaAs in J\n\n#Calculation\nlamda=(h*c)/E; #wavelength of laser\n\n#Result\nprint(\"wavelength of laser emitted by GaAs in m\",lamda);\n",
+ "input": [
+ "\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.626*10**-34;\n",
+ "c=3*10**8;\n",
+ "E=1.42*1.6*10**-19; #band gap of GaAs in J\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=(h*c)/E; #wavelength of laser\n",
+ "\n",
+ "#Result\n",
+ "print(\"wavelength of laser emitted by GaAs in m\",lamda);\n"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('wavelength of laser emitted by GaAs in m', 8.74911971830986e-07)\n"
+ "text": [
+ "('wavelength of laser emitted by GaAs in m', 8.74911971830986e-07)\n"
+ ]
}
],
"prompt_number": 8
@@ -122,19 +240,46 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.6, Page number 61"
+ "source": [
+ "Example number 2.6, Page number 61"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the relative population of energy levels\n\n#importing modules\nimport math\n\n#Variable declaration\nT=300; #temperature in K\nlamda=500*10**-9; #wavelength in m\nh=6.626*10**-34;\nc=3*10**8;\nk=1.38*10**-23;\n\n#Calculation\n#from maxwell and boltzmann law, relative population is given by\n#N1/N2=exp(-E1/kT)/exp(-E2/kT)\n#hence N1/N2=exp(-(E1-E2)/kT)=exp((h*new)/(k*T));\n#new=c/lambda\nR=(h*c)/(lamda*k*T);\nRP=math.exp(R);\n\n#Result\nprint(\"relative population between N1 and N2 is\",RP);\n",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "T=300; #temperature in K\n",
+ "lamda=500*10**-9; #wavelength in m\n",
+ "h=6.626*10**-34;\n",
+ "c=3*10**8;\n",
+ "k=1.38*10**-23;\n",
+ "\n",
+ "#Calculation\n",
+ "#from maxwell and boltzmann law, relative population is given by\n",
+ "#N1/N2=exp(-E1/kT)/exp(-E2/kT)\n",
+ "#hence N1/N2=exp(-(E1-E2)/kT)=exp((h*new)/(k*T));\n",
+ "#new=c/lambda\n",
+ "R=(h*c)/(lamda*k*T);\n",
+ "RP=math.exp(R);\n",
+ "\n",
+ "#Result\n",
+ "print(\"relative population between N1 and N2 is\",RP);\n"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('relative population between N1 and N2 is', 5.068255595981255e+41)\n"
+ "text": [
+ "('relative population between N1 and N2 is', 5.068255595981255e+41)\n"
+ ]
}
],
"prompt_number": 9
@@ -143,19 +288,42 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.7, Page number 61"
+ "source": [
+ "Example number 2.7, Page number 61"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To examine the possibility of stimulated emission\n\n#importing modules\nimport math\n\n#Variable declaration\nT=300; #temperature in K\nh=6.626*10**-34;\nc=3*10**8;\nk=1.38*10**-23;\nlamda=600*10**-9; #wavelength in m\n\n#Calculation\nR=(h*c)/(lamda*k*T);\nRs=1/(math.exp(R)-1);\n\n#Result\nprint(\"the ratio between stimulated emission to spontaneous emission is\",Rs);\n",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "T=300; #temperature in K\n",
+ "h=6.626*10**-34;\n",
+ "c=3*10**8;\n",
+ "k=1.38*10**-23;\n",
+ "lamda=600*10**-9; #wavelength in m\n",
+ "\n",
+ "#Calculation\n",
+ "R=(h*c)/(lamda*k*T);\n",
+ "Rs=1/(math.exp(R)-1);\n",
+ "\n",
+ "#Result\n",
+ "print(\"the ratio between stimulated emission to spontaneous emission is\",Rs);\n"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('the ratio between stimulated emission to spontaneous emission is', 1.7617782449453023e-35)\n"
+ "text": [
+ "('the ratio between stimulated emission to spontaneous emission is', 1.7617782449453023e-35)\n"
+ ]
}
],
"prompt_number": 11
@@ -164,19 +332,40 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.8, Page number 62"
+ "source": [
+ "Example number 2.8, Page number 62"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the efficiency of a He-Ne laser\n\n#importing modules\nimport math\n\n#Variable declaration\nP=5*10**-3; #output power in W\nI=10*10**-3; #current in A\nV=3*10**3; #voltage in V\n\n#Calculation\ne=(P*100)/(I*V);\ne=math.ceil(e*10**6)/10**6; #rounding off to 6 decimals\n\n#Result\nprint(\"efficiency of laser in % is\",e);\n",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "P=5*10**-3; #output power in W\n",
+ "I=10*10**-3; #current in A\n",
+ "V=3*10**3; #voltage in V\n",
+ "\n",
+ "#Calculation\n",
+ "e=(P*100)/(I*V);\n",
+ "e=math.ceil(e*10**6)/10**6; #rounding off to 6 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"efficiency of laser in % is\",e);\n"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('efficiency of laser in % is', 0.016667)\n"
+ "text": [
+ "('efficiency of laser in % is', 0.016667)\n"
+ ]
}
],
"prompt_number": 14
@@ -185,19 +374,40 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.9, Page number 62"
+ "source": [
+ "Example number 2.9, Page number 62"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the intensity of laser beam\n\n#importing modules\nimport math\n\n#Variable declaration\nP=1e-03; #output power in W\nd=1e-06; #diameter in m\n\n#Calculation\nr=d/2; #radius in m\nI=P/(math.pi*r**2); #intensity\nI=I/10**9;\nI=math.ceil(I*10**4)/10**4; #rounding off to 4 decimals\n\n#Result\nprint(\"intensity of laser in W/m^2 is\",I,\"*10**9\");",
+ "input": [
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "P=1e-03; #output power in W\n",
+ "d=1e-06; #diameter in m\n",
+ "\n",
+ "#Calculation\n",
+ "r=d/2; #radius in m\n",
+ "I=P/(math.pi*r**2); #intensity\n",
+ "I=I/10**9;\n",
+ "I=math.ceil(I*10**4)/10**4; #rounding off to 4 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"intensity of laser in W/m^2 is\",I,\"*10**9\");"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('intensity of laser in W/m^2 is', 1.2733, '*10**9')\n"
+ "text": [
+ "('intensity of laser in W/m^2 is', 1.2733, '*10**9')\n"
+ ]
}
],
"prompt_number": 1
@@ -206,19 +416,47 @@
"cell_type": "heading",
"level": 2,
"metadata": {},
- "source": "Example number 2.10, Page number 62"
+ "source": [
+ "Example number 2.10, Page number 62"
+ ]
},
{
"cell_type": "code",
"collapsed": false,
- "input": "#To calculate the angular speed and divergence of laser beam\n\n#importing modules\nimport math\n\n#Variable declaration\nlamda=632.8*10**-9; #wavelength in m\nD=5; #distance in m\nd=1*10**-3; #diameter in m\n\n#Calculation\ndeltatheta=lamda/d; #angular speed\ndelta_theta=deltatheta*10**4;\nr=D*deltatheta;\nr1=r*10**3; #converting r from m to mm\nA=math.pi*r**2; #area of the spread\n\n#Result \nprint(\"angular speed in radian is\",delta_theta,\"*10**-4\");\nprint(\"radius of the spread in mm is\",r1);\nprint(\"area of the spread in m^2 is\",A);\n",
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "lamda=632.8*10**-9; #wavelength in m\n",
+ "D=5; #distance in m\n",
+ "d=1*10**-3; #diameter in m\n",
+ "\n",
+ "#Calculation\n",
+ "deltatheta=lamda/d; #angular speed\n",
+ "delta_theta=deltatheta*10**4;\n",
+ "r=D*deltatheta;\n",
+ "r1=r*10**3; #converting r from m to mm\n",
+ "A=math.pi*r**2; #area of the spread\n",
+ "\n",
+ "#Result \n",
+ "print(\"angular speed in radian is\",delta_theta,\"*10**-4\");\n",
+ "print(\"radius of the spread in mm is\",r1);\n",
+ "print(\"area of the spread in m^2 is\",A);\n"
+ ],
"language": "python",
"metadata": {},
"outputs": [
{
"output_type": "stream",
"stream": "stdout",
- "text": "('angular speed in radian is', 6.328, '*10**-4')\n('radius of the spread in mm is', 3.164)\n('area of the spread in m^2 is', 3.1450157329451454e-05)\n"
+ "text": [
+ "('angular speed in radian is', 6.328, '*10**-4')\n",
+ "('radius of the spread in mm is', 3.164)\n",
+ "('area of the spread in m^2 is', 3.1450157329451454e-05)\n"
+ ]
}
],
"prompt_number": 2
@@ -226,7 +464,7 @@
{
"cell_type": "code",
"collapsed": false,
- "input": "",
+ "input": [],
"language": "python",
"metadata": {},
"outputs": []