diff options
author | Trupti Kini | 2016-11-03 23:30:59 +0600 |
---|---|---|
committer | Trupti Kini | 2016-11-03 23:30:59 +0600 |
commit | be1179aa3e045222977b245809266fc1492dadcb (patch) | |
tree | 4076e29b578cb12a2b284feb31af8eae7e1ab6d7 /sample_notebooks | |
parent | fadf9f31087e75d168429548e51633904b968372 (diff) | |
download | Python-Textbook-Companions-be1179aa3e045222977b245809266fc1492dadcb.tar.gz Python-Textbook-Companions-be1179aa3e045222977b245809266fc1492dadcb.tar.bz2 Python-Textbook-Companions-be1179aa3e045222977b245809266fc1492dadcb.zip |
Added(A)/Deleted(D) following books
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter1.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter10_qYi9AAs.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter11_EZtJ7kK.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter12_KsTKwv5.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter13_DZJQwFk.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter14_GYUnehZ.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter15_teB3fFs.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter16_fpjEDzx.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter17_szOwhWr.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter18_TVmT3rf.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter19_5sx3l6T.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter2.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter20_6AjJCXE.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter21_iYkzq89.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter22_OEH4UuY.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter3.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter4.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter5.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter6_s6H0KKG.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter7_dQdnyuw.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter8_oFmkmxA.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/Chapter9_8b0ahS6.ipynb
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/16.11_yr7v4ev.png
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/3.3_3S1AvbP.png
A Basic_And_Applied_Thermodynamics_by_P._K._Nag/screenshots/7.10_BFuA7JB.png
A Digital_Communications_by_S._Haykin/README.txt
A Modern_Digital_And_Analog_Communication_System_by_B._P._Lathi/README.txt
A sample_notebooks/SPANDANAARROJU/Chapter4_J3M7PEz.ipynb
A "sample_notebooks/Sadananda CharyArroju/Chapter2.ipynb"
Diffstat (limited to 'sample_notebooks')
-rw-r--r-- | sample_notebooks/SPANDANAARROJU/Chapter4_J3M7PEz.ipynb | 211 | ||||
-rw-r--r-- | sample_notebooks/Sadananda CharyArroju/Chapter2.ipynb | 319 |
2 files changed, 530 insertions, 0 deletions
diff --git a/sample_notebooks/SPANDANAARROJU/Chapter4_J3M7PEz.ipynb b/sample_notebooks/SPANDANAARROJU/Chapter4_J3M7PEz.ipynb new file mode 100644 index 00000000..e9783bbb --- /dev/null +++ b/sample_notebooks/SPANDANAARROJU/Chapter4_J3M7PEz.ipynb @@ -0,0 +1,211 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 4: Defects in Crystals" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 1, Page number 4.14" + ] + }, + { + "cell_type": "code", + "execution_count": 36, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "equilibrium concentration of vacancy at 300K is 7.577 *10**5\n", + "equilibrium concentration of vacancy at 900K is 6.502 *10**19\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "N=6.023*10**26; #avagadro number\n", + "T1=1/float('inf'); #temperature 0K(K)\n", + "T2=300;\n", + "T3=900; #temperature(K)\n", + "k=1.38*10**-23; #boltzmann constant \n", + "deltaHv=120*10**3*10**3/N; #enthalpy(J/vacancy)\n", + "\n", + "#Calculation\n", + "#n1=N*math.exp(-deltaHv/(k*T1)); #equilibrium concentration of vacancy at 0K\n", + "#value of n1 cant be calculated in python, as the denominator is 0 and it shows float division error\n", + "n2=N*math.exp(-deltaHv/(k*T2)); #equilibrium concentration of vacancy at 300K \n", + "n3=N*math.exp(-deltaHv/(k*T3)); #equilibrium concentration of vacancy at 900K \n", + "\n", + "#Result\n", + "#print \"equilibrium concentration of vacancy at 0K is\",n1\n", + "print \"equilibrium concentration of vacancy at 300K is\",round(n2/10**5,3),\"*10**5\"\n", + "print \"equilibrium concentration of vacancy at 900K is\",round(n3/10**19,3),\"*10**19\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 4.15" + ] + }, + { + "cell_type": "code", + "execution_count": 2, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "fraction of vacancies at 1000 is 8.5 *10**-7\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "nbyN1=1*10**-10; #fraction of vacancies\n", + "T1=500+273;\n", + "T2=1000+273;\n", + "\n", + "#Calculation\n", + "lnx=T1*math.log(nbyN1)/T2;\n", + "x=math.exp(lnx); #fraction of vacancies at 1000\n", + "\n", + "#Result\n", + "print \"fraction of vacancies at 1000 is\",round(x*10**7,1),\"*10**-7\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 4.16" + ] + }, + { + "cell_type": "code", + "execution_count": 5, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "concentration of schottky defects is 6.42 *10**11 per m**3\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "d=2.82*10**-10; #interionic distance(m)\n", + "T=300; #temperature(K)\n", + "k=1.38*10**-23; #boltzmann constant \n", + "e=1.6*10**-19; #charge(coulomb)\n", + "n=4; #number of molecules\n", + "deltaHs=1.971*e; #enthalpy(J)\n", + "\n", + "#Calculation\n", + "V=(2*d)**3; #volume of unit cell(m**3)\n", + "N=n/V; #number of ion pairs\n", + "x=deltaHs/(2*k*T);\n", + "n=N*math.exp(-x); #concentration of schottky defects(per m**3)\n", + "\n", + "#Result\n", + "print \"concentration of schottky defects is\",round(n*10**-11,2),\"*10**11 per m**3\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 4.17" + ] + }, + { + "cell_type": "code", + "execution_count": 16, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "concentration of schottky defects is 9.23 *10**12 per cm**3\n", + "amount of climb down by the dislocations is 0.1846 step or 0.3692 *10**-8 cm\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "N=6.026*10**23; #avagadro number \n", + "T=500; #temperature(K)\n", + "k=1.38*10**-23; #boltzmann constant \n", + "deltaHv=1.6*10**-19; #charge(coulomb)\n", + "V=5.55; #molar volume(cm**3)\n", + "nv=5*10**7*10**6; #number of vacancies\n", + "\n", + "#Calculation\n", + "n=N*math.exp(-deltaHv/(k*T))/V; #concentration of schottky defects(per m**3)\n", + "x=round(n/nv,4); #amount of climb down by the dislocations(step)\n", + "xcm=2*x*10**-8; #amount of climb down by the dislocations(cm)\n", + "\n", + "#Result\n", + "print \"concentration of schottky defects is\",round(n/10**12,2),\"*10**12 per cm**3\"\n", + "print \"amount of climb down by the dislocations is\",x,\"step or\",xcm*10**8,\"*10**-8 cm\" " + ] + } + ], + "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 +} diff --git a/sample_notebooks/Sadananda CharyArroju/Chapter2.ipynb b/sample_notebooks/Sadananda CharyArroju/Chapter2.ipynb new file mode 100644 index 00000000..51d55e0b --- /dev/null +++ b/sample_notebooks/Sadananda CharyArroju/Chapter2.ipynb @@ -0,0 +1,319 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# 2: Crystallography and Crystal Structures" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 2, Page number 2.21" + ] + }, + { + "cell_type": "code", + "execution_count": 3, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "spacing between (100) plane is 5.64 angstrom\n", + "spacing between (110) plane is 3.99 angstrom\n", + "answer for spacing between (110) plane given in the book is wrong\n", + "spacing between (111) plane is 3.26 angstrom\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a=5.64; #lattice constant(angstrom)\n", + "h1=1;\n", + "k1=0;\n", + "l1=0;\n", + "h2=1;\n", + "k2=1;\n", + "l2=0;\n", + "h3=1;\n", + "k3=1;\n", + "l3=1;\n", + "\n", + "#Calculation\n", + "d100=a/math.sqrt(h1**2+k1**2+l1**2); #spacing between (100) plane\n", + "d110=a/math.sqrt(h2**2+k2**2+l2**2); #spacing between (110) plane\n", + "d111=a/math.sqrt(h3**2+k3**2+l3**2); #spacing between (111) plane\n", + "\n", + "#Result\n", + "print \"spacing between (100) plane is\",d100,\"angstrom\"\n", + "print \"spacing between (110) plane is\",round(d110,2),\"angstrom\"\n", + "print \"answer for spacing between (110) plane given in the book is wrong\"\n", + "print \"spacing between (111) plane is\",round(d111,2),\"angstrom\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 3, Page number 2.22" + ] + }, + { + "cell_type": "code", + "execution_count": 8, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "number of atoms in (100) is 1.535 *10**13 atoms/mm**2\n", + "number of atoms in (110) is 1.085 *10**13 atoms/mm**2\n", + "number of atoms in (111) is 1.772 *10**13 atoms/mm**2\n", + "answers given in the book vary due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "a=3.61*10**-7; #lattice constant(mm)\n", + "\n", + "#Calculation\n", + "A100=a**2; #surface area(mm**2)\n", + "n=1+(4*(1/4));\n", + "N1=n/A100; #number of atoms in (100)(per mm**2)\n", + "A110=math.sqrt(2)*a**2; #surface area(mm**2)\n", + "N2=n/A110; #number of atoms in (110)(per mm**2)\n", + "A111=math.sqrt(3)*a**2/2; #surface area(mm**2)\n", + "N3=n/A111; #number of atoms in (110)(per mm**2)\n", + "\n", + "#Result\n", + "print \"number of atoms in (100) is\",round(N1/10**13,3),\"*10**13 atoms/mm**2\"\n", + "print \"number of atoms in (110) is\",round(N2/10**13,3),\"*10**13 atoms/mm**2\"\n", + "print \"number of atoms in (111) is\",round(N3/10**13,3),\"*10**13 atoms/mm**2\"\n", + "print \"answers given in the book vary due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 4, Page number 2.23" + ] + }, + { + "cell_type": "code", + "execution_count": 12, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "wavelength of x rays is 1.552 angstrom\n", + "answer varies due to rounding off errors\n", + "energy of x rays is 8 *10**3 eV\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "n=4; \n", + "A=107.87; #atomic weight\n", + "rho=10500; #density(kg/m**3)\n", + "N=6.02*10**26; #number of molecules\n", + "theta=19+(12/60); #angle(degrees)\n", + "h=1;\n", + "k=1;\n", + "l=1;\n", + "h0=6.625*10**-34; #planck constant\n", + "c=3*10**8; #velocity of light(m/s)\n", + "e=1.6*10**-19; #charge(coulomb)\n", + "\n", + "#Calculation\n", + "theta=theta*math.pi/180; #angle(radian)\n", + "a=(n*A/(N*rho))**(1/3);\n", + "d=a*10**10/math.sqrt(h**2+k**2+l**2); \n", + "lamda=2*d*math.sin(theta); #wavelength of x rays(angstrom)\n", + "E=h0*c/(lamda*10**-10*e); #energy of x rays(eV)\n", + "\n", + "#Result\n", + "print \"wavelength of x rays is\",round(lamda,3),\"angstrom\"\n", + "print \"answer varies due to rounding off errors\"\n", + "print \"energy of x rays is\",int(E/10**3),\"*10**3 eV\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 5, Page number 2.23" + ] + }, + { + "cell_type": "code", + "execution_count": 13, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "density is 2332 kg/m**3\n", + "answer varies due to rounding off errors\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "\n", + "#Variable declaration\n", + "n=8; #number of atoms\n", + "r=2.351*10**-10; #bond length(angstrom)\n", + "A=28.09; #Atomic wt. of NaCl\n", + "N=6.02*10**26 #Avagadro number\n", + "\n", + "#Calculation\n", + "a=4*r/math.sqrt(3); \n", + "rho=n*A/(N*a**3); #density(kg/m**3)\n", + "\n", + "#Result\n", + "print \"density is\",int(rho),\"kg/m**3\"\n", + "print \"answer varies due to rounding off errors\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 6, Page number 2.24" + ] + }, + { + "cell_type": "code", + "execution_count": 14, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "radius of largest sphere is 0.1547 r\n", + "maximum radius of sphere is 0.414 r\n" + ] + } + ], + "source": [ + "#importing modules\n", + "import math\n", + "from __future__ import division\n", + "from sympy import Symbol\n", + "\n", + "#Variable declaration\n", + "r=Symbol('r')\n", + "\n", + "#Calculation\n", + "a1=4*r/math.sqrt(3);\n", + "R1=(a1/2)-r; #radius of largest sphere\n", + "a2=4*r/math.sqrt(2);\n", + "R2=(a2/2)-r; #maximum radius of sphere\n", + "\n", + "#Result\n", + "print \"radius of largest sphere is\",round(R1/r,4),\"r\"\n", + "print \"maximum radius of sphere is\",round(R2/r,3),\"r\"" + ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "## Example number 7, Page number 2.25" + ] + }, + { + "cell_type": "code", + "execution_count": 15, + "metadata": { + "collapsed": false + }, + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "percent volume change is 0.5 %\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,1),\"%\"" + ] + } + ], + "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 +} |