summaryrefslogtreecommitdiff
path: root/Engineering_Physics_by_A._Marikani/Chapter_4.ipynb
diff options
context:
space:
mode:
Diffstat (limited to 'Engineering_Physics_by_A._Marikani/Chapter_4.ipynb')
-rwxr-xr-xEngineering_Physics_by_A._Marikani/Chapter_4.ipynb765
1 files changed, 765 insertions, 0 deletions
diff --git a/Engineering_Physics_by_A._Marikani/Chapter_4.ipynb b/Engineering_Physics_by_A._Marikani/Chapter_4.ipynb
new file mode 100755
index 00000000..d2b8123c
--- /dev/null
+++ b/Engineering_Physics_by_A._Marikani/Chapter_4.ipynb
@@ -0,0 +1,765 @@
+{
+ "metadata": {
+ "name": "",
+ "signature": "sha256:e581747b76e15afc0096179446c0fbd68c3566f21f4931be3d8fc722fc1225b8"
+ },
+ "nbformat": 3,
+ "nbformat_minor": 0,
+ "worksheets": [
+ {
+ "cells": [
+ {
+ "cell_type": "heading",
+ "level": 1,
+ "metadata": {},
+ "source": [
+ "Quantum Physics"
+ ]
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.1, Page number 133 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.63*10**-34; #plancks constant in Js\n",
+ "m0=9.1*10**-31; #mass of the electron in kg\n",
+ "c=3*10**8; #velocity of light in m/s\n",
+ "phi=135; #angle of scattering in degrees\n",
+ "phi=phi*0.0174532925 #converting degrees to radians \n",
+ "\n",
+ "#Calculation\n",
+ "delta_lamda=(h*(1-math.cos(phi)))/(m0*c);\n",
+ "\n",
+ "#Result\n",
+ "print(\"change in wavelength in metres is\",delta_lamda);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('change in wavelength in metres is', 4.1458307496867315e-12)\n"
+ ]
+ }
+ ],
+ "prompt_number": 6
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.2, Page number 134 "
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.63*10**-34; #plancks constant in Js\n",
+ "m0=9.1*10**-31; #mass of the electron in kg\n",
+ "c=3*10**8; #velocity of light in m/s\n",
+ "lamda=2; #wavelength in angstrom\n",
+ "lamdaA=lamda*10**-10; #converting lamda from Angstrom to m\n",
+ "phi=90; #angle of scattering in degrees\n",
+ "phi=phi*0.0174532925 #converting degrees to radians \n",
+ "\n",
+ "#Calculation\n",
+ "delta_lamda=(h*(1-math.cos(phi)))/(m0*c);\n",
+ "delta_lamda=delta_lamda*10**10; #converting delta_lamda from m to Angstrom\n",
+ "delta_lamda=math.ceil(delta_lamda*10**5)/10**5; #rounding off to 5 decimals\n",
+ "lamda_dash=delta_lamda+lamda;\n",
+ "lamdaA_dash=lamda_dash*10**-10; #converting lamda_dash from Angstrom to m\n",
+ "#energy E=h*new-h*new_dash\n",
+ "E=h*c*((1/lamdaA)-(1/lamdaA_dash));\n",
+ "EeV=E/(1.602176565*10**-19); #converting J to eV\n",
+ "EeV=math.ceil(EeV*10**3)/10**3; #rounding off to 3 decimals\n",
+ "new=c/lamda;\n",
+ "new_dash=c/lamda_dash;\n",
+ "theta=math.atan((h*new*math.sin(phi))/((h*new)-(h*new_dash*math.cos(phi))));\n",
+ "theta=theta*57.2957795; #converting radians to degrees\n",
+ "\n",
+ "#Result\n",
+ "print(\"change in compton shift in Angstrom is\",delta_lamda);\n",
+ "print(\"wavelength of scattered photons in Angstrom is\",lamda_dash);\n",
+ "print(\"energy of recoiling electron in J is\",E);\n",
+ "print(\"energy of recoiling electron in eV is\",EeV);\n",
+ "print(\"angle at which recoiling electron appears in degrees is\",int(theta));\n",
+ "\n",
+ "#answers given in the book are wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('change in compton shift in Angstrom is', 0.02429)\n",
+ "('wavelength of scattered photons in Angstrom is', 2.02429)\n",
+ "('energy of recoiling electron in J is', 1.1933272900621974e-17)\n",
+ "('energy of recoiling electron in eV is', 74.482)\n",
+ "('angle at which recoiling electron appears in degrees is', 45)\n"
+ ]
+ }
+ ],
+ "prompt_number": 10
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.3, Page number 135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "m0=9.1*10**-31; #mass of the electron in kg\n",
+ "c=3*10**8; #velocity of light in m/s\n",
+ "phi=60; #angle of scattering in degrees\n",
+ "phi=phi*0.0174532925; #converting degrees to radians\n",
+ "E=10**6; #energy of photon in eV\n",
+ "E=E*1.6*10**-19; #converting eV into J\n",
+ "\n",
+ "#Calculation\n",
+ "delta_lamda=(h*(1-math.cos(phi)))/(m0*c);\n",
+ "delta_lamda=delta_lamda*10**10; #converting metre to angstrom\n",
+ "delta_lamda=math.ceil(delta_lamda*10**4)/10**4; #rounding off to 4 decimals\n",
+ "lamda=(h*c)/E;\n",
+ "lamdaA=lamda*10**10; #converting metre to angstrom\n",
+ "lamda_dash=delta_lamda+lamdaA;\n",
+ "lamda_dash=math.ceil(lamda_dash*10**3)/10**3; #rounding off to 3 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"compton shift in angstrom is\",delta_lamda);\n",
+ "print(\"energy of incident photon in m\",lamda);\n",
+ "print(\"wavelength of scattered photons in angstrom is\",lamda_dash);\n",
+ "\n",
+ "#answer for wavelength of scattered photon given in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('compton shift in angstrom is', 0.0122)\n",
+ "('energy of incident photon in m', 1.242375e-12)\n",
+ "('wavelength of scattered photons in angstrom is', 0.025)\n"
+ ]
+ }
+ ],
+ "prompt_number": 13
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.4, Page number 135"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "c=3*10**8; #velocity of light in m/s\n",
+ "lamda=5893; #wavelength in angstrom\n",
+ "P=60; #output power in Watt\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=lamda*10**-10; #wavelength in metre\n",
+ "E=(h*c)/lamda;\n",
+ "EeV=E/(1.602176565*10**-19); #converting J to eV\n",
+ "EeV=math.ceil(EeV*10**4)/10**4; #rounding off to 4 decimals\n",
+ "N=P/E;\n",
+ "\n",
+ "#Result\n",
+ "print(\"energy of photon in J is\",E);\n",
+ "print(\"energy of photon in eV is\",EeV);\n",
+ "print(\"number of photons emitted per se cond is\",N);\n",
+ "\n",
+ "#answer for energy in eV given in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('energy of photon in J is', 3.373154590191753e-19)\n",
+ "('energy of photon in eV is', 2.1054)\n",
+ "('number of photons emitted per se cond is', 1.7787503773015396e+20)\n"
+ ]
+ }
+ ],
+ "prompt_number": 15
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.5, Page number 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "c=3*10**8; #velocity of light in m/s\n",
+ "lamda=10; #wavelength in angstrom\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=lamda*10**-10; #wavelength in metre\n",
+ "E=(h*c)/lamda;\n",
+ "EeV=E/(1.602176565*10**-19); #converting J to eV\n",
+ "EeV=EeV*10**-3; #converting eV to keV\n",
+ "EeV=math.ceil(EeV*10**3)/10**3; #rounding off to 3 decimals\n",
+ "P=h/lamda;\n",
+ "M=h/(lamda*c);\n",
+ "\n",
+ "#Result\n",
+ "print(\"energy of photon in J is\",E);\n",
+ "print(\"energy of photon in keV is\",EeV);\n",
+ "print(\"momentum in kg m/sec is\",P);\n",
+ "print(\"mass of photon in kg is\",M);\n",
+ "\n",
+ "#answer for energy of photon in keV given in the book is wrong by 1 decimal"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('energy of photon in J is', 1.9878e-16)\n",
+ "('energy of photon in keV is', 1.241)\n",
+ "('momentum in kg m/sec is', 6.626e-25)\n",
+ "('mass of photon in kg is', 2.2086666666666664e-33)\n"
+ ]
+ }
+ ],
+ "prompt_number": 18
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.6, Page number 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "m=9.1*10**-31; #mass of the electron in kg\n",
+ "e=1.602*10**-19;\n",
+ "V=1.25; #potential difference in kV\n",
+ "\n",
+ "#Calculation\n",
+ "V=V*10**3; #converting kV to V\n",
+ "lamda=h/math.sqrt(2*m*e*V);\n",
+ "lamda=lamda*10**10; #converting metre to angstrom\n",
+ "lamda=math.ceil(lamda*10**4)/10**4; #rounding off to 4 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"de Broglie wavelength in angstrom is\",lamda);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('de Broglie wavelength in angstrom is', 0.3471)\n"
+ ]
+ }
+ ],
+ "prompt_number": 21
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.7, Page number 136"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "E=45; #energy of electron in eV\n",
+ "E=E*1.6*10**-19; #energy in J\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "m=9.1*10**-31; #mass of the electron in kg\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=h/math.sqrt(2*m*E);\n",
+ "lamda=lamda*10**10; #converting metres to angstrom\n",
+ "lamda=math.ceil(lamda*10**4)/10**4; #rounding off to 4 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"de Broglie wavelength in angstrom is\",lamda);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('de Broglie wavelength in angstrom is', 1.8305)\n"
+ ]
+ }
+ ],
+ "prompt_number": 24
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.8, Page number 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "v=10**7; #velocity of electron in m/sec\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "m=9.1*10**-31; #mass of the electron in kg\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=h/(m*v);\n",
+ "lamda=lamda*10**10; #converting metres to angstrom\n",
+ "lamda=math.ceil(lamda*10**4)/10**4; #rounding off to 4 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"de Broglie wavelength in angstrom is\",lamda);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('de Broglie wavelength in angstrom is', 0.7282)\n"
+ ]
+ }
+ ],
+ "prompt_number": 25
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.9, Page number 137"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "V=1000; #potential difference in V\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "m=1.67*10**-27; #mass of proton in kg\n",
+ "e=1.6*10**-19; #charge of electron in J\n",
+ "\n",
+ "#Calculation\n",
+ "lamda=h/math.sqrt(2*m*e*V);\n",
+ "\n",
+ "#Result\n",
+ "print(\"de Broglie wavelength of alpha particle in metre is\",lamda);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('de Broglie wavelength of alpha particle in metre is', 9.063964727801313e-13)\n"
+ ]
+ }
+ ],
+ "prompt_number": 26
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.10, Page number 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "L=25; #width of potential in armstrong\n",
+ "delta_x=0.05; #interval in armstrong\n",
+ "n=1; #particle is in its least energy\n",
+ "x=L/2; #particle is at the centre\n",
+ "pi=180; #angle in degrees\n",
+ "\n",
+ "#Calculation\n",
+ "pi=pi*0.0174532925; #angle in radians\n",
+ "L=L*10**-10; #width in m\n",
+ "delta_x=delta_x*10**-10; #interval in m\n",
+ "#probability P = integration of (A**2)*(math.sin(n*pi*x/L))**2*delta_x\n",
+ "#but A=math.sqrt(2/L)\n",
+ "#since the particle is in a small interval integration need not be applied\n",
+ "#therefore P=2*(L**(-1))*(math.sin(n*pi*x/L))**2*delta_x\n",
+ "P=2*(L**(-1))*((math.sin(n*pi*x/L))**2)*delta_x;\n",
+ "P=math.ceil(P*10**3)/10**3; #rounding off to 3 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"probability of finding the particle is\",P);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('probability of finding the particle is', 0.004)\n"
+ ]
+ }
+ ],
+ "prompt_number": 27
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.11, Page number 138"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n=1;\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "m=9.1*10**-31; #mass of the electron in kg\n",
+ "L=1; #width of potential well in angstrom\n",
+ "\n",
+ "#Calculation\n",
+ "L=L*10**-10; #converting angstrom into metre\n",
+ "E=((n**2)*h**2)/(8*m*L**2);\n",
+ "EeV=E/(1.6*10**-19); #converting J to eV\n",
+ "EeV=math.ceil(EeV*10**3)/10**3; #rounding off to 3 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"lowest energy of electron in J is\",E);\n",
+ "print(\"lowest energy of electron in eV is\",EeV);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('lowest energy of electron in J is', 6.030752197802197e-18)\n",
+ "('lowest energy of electron in eV is', 37.693)\n"
+ ]
+ }
+ ],
+ "prompt_number": 28
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.12, Page number 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "n=1;\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "m=9.1*10**-31; #mass of the electron in kg\n",
+ "L=1; #width of potential well in angstrom\n",
+ "\n",
+ "#Calculation\n",
+ "L=L*10**-10; #converting angstrom into metre\n",
+ "E=(2*(n**2)*h**2)/(8*m*L**2);\n",
+ "E=E/(1.6*10**-19); #converting J to eV\n",
+ "E=math.ceil(E*10**3)/10**3; #rounding off to 3 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"lowest energy of system in eV is\",E);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('lowest energy of system in eV is', 75.385)\n"
+ ]
+ }
+ ],
+ "prompt_number": 29
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.13, Page number 139"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "m=9.1*10**-31; #mass of the electron in kg\n",
+ "L=1; #width of potential well in angstrom\n",
+ "\n",
+ "#Calculation\n",
+ "L=L*10**-10; #converting angstrom into metre\n",
+ "#according to pauli's exclusion principle, 1st electron occupies n1=1 and second electron occupies n2=2\n",
+ "n1=1;\n",
+ "n2=2;\n",
+ "E=((2*(n1**2)*h**2)/(8*m*L**2))+(((n2**2)*h**2)/(8*m*L**2));\n",
+ "E=E/(1.6*10**-19); #converting J to eV\n",
+ "E=math.ceil(E*10**3)/10**3; #rounding off to 3 decimals\n",
+ "\n",
+ "#Result\n",
+ "print(\"lowest energy of system in eV is\",E);\n",
+ "print(\"quantum numbers are\");\n",
+ "print(\"n=1,l=0,mL=0,mS=+1/2\");\n",
+ "print(\"n=1,l=0,mL=0,mS=-1/2\");\n",
+ "print(\"n=2,l=0,mL=0,mS=+1/2\");"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('lowest energy of system in eV is', 226.154)\n",
+ "quantum numbers are\n",
+ "n=1,l=0,mL=0,mS=+1/2\n",
+ "n=1,l=0,mL=0,mS=-1/2\n",
+ "n=2,l=0,mL=0,mS=+1/2\n"
+ ]
+ }
+ ],
+ "prompt_number": 30
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.14, Page number 140"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "#Variable declaration\n",
+ "n=1;\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "L=100; #width of potential well in angstrom\n",
+ "\n",
+ "#Calculation\n",
+ "L=L*10**-10; #converting angstrom into metre\n",
+ "E=0.025; #lowest energy in eV\n",
+ "E=E*(1.6*10**-19); #converting eV to J\n",
+ "m=((n**2)*h**2)/(8*E*L**2);\n",
+ "\n",
+ "#Result\n",
+ "print(\"mass of the particle in kg is\",m);"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('mass of the particle in kg is', 1.3719961249999998e-31)\n"
+ ]
+ }
+ ],
+ "prompt_number": 31
+ },
+ {
+ "cell_type": "heading",
+ "level": 2,
+ "metadata": {},
+ "source": [
+ "Example number 4.15, Page number 141"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [
+ "\n",
+ "\n",
+ "#importing modules\n",
+ "import math\n",
+ "\n",
+ "#Variable declaration\n",
+ "k=1.38*10**-23;\n",
+ "T=6000; #temperature in K\n",
+ "h=6.626*10**-34; #plancks constant in Js\n",
+ "c=3*10**8; #velocity of light in m/s\n",
+ "lamda1=450; #wavelength in nm\n",
+ "lamda2=460; #wavelength in nm\n",
+ "\n",
+ "#Calculation\n",
+ "lamda1=lamda1*10**-9; #converting nm to metre\n",
+ "lamda2=lamda2*10**-9; #converting nm to metre\n",
+ "new1=c/lamda1;\n",
+ "new2=c/lamda2;\n",
+ "new=(new1+new2)/2;\n",
+ "A=math.exp((h*new)/(k*T));\n",
+ "rho_v=(8*math.pi*h*new**3)/(A*c**3);\n",
+ "\n",
+ "#Result\n",
+ "print(\"energy density of the black body in J/m^3 is\",rho_v);\n",
+ "\n",
+ "#answer given in the book is wrong"
+ ],
+ "language": "python",
+ "metadata": {},
+ "outputs": [
+ {
+ "output_type": "stream",
+ "stream": "stdout",
+ "text": [
+ "('energy density of the black body in J/m^3 is', 9.033622836188887e-16)\n"
+ ]
+ }
+ ],
+ "prompt_number": 32
+ },
+ {
+ "cell_type": "code",
+ "collapsed": false,
+ "input": [],
+ "language": "python",
+ "metadata": {},
+ "outputs": []
+ }
+ ],
+ "metadata": {}
+ }
+ ]
+} \ No newline at end of file