diff options
Diffstat (limited to 'sample_notebooks/Sadananda CharyArroju')
-rwxr-xr-x | sample_notebooks/Sadananda CharyArroju/Chapter1.ipynb | 412 | ||||
-rwxr-xr-x | sample_notebooks/Sadananda CharyArroju/Chapter10.ipynb | 431 | ||||
-rwxr-xr-x | sample_notebooks/Sadananda CharyArroju/Chapter1_1.ipynb | 412 |
3 files changed, 1255 insertions, 0 deletions
diff --git a/sample_notebooks/Sadananda CharyArroju/Chapter1.ipynb b/sample_notebooks/Sadananda CharyArroju/Chapter1.ipynb new file mode 100755 index 00000000..55497994 --- /dev/null +++ b/sample_notebooks/Sadananda CharyArroju/Chapter1.ipynb @@ -0,0 +1,412 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#1: Bonding in Solids"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.1, Page number 10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "bond energy is 3.84 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r0=23.6*10**-10; #equilibrium distance(m)\n",
+ "I=5.14; #ionisation energy(eV)\n",
+ "EA=3.65; #electron affinity(eV)\n",
+ "N=8; #born constant\n",
+ "\n",
+ "#Calculation\n",
+ "x=1-(1/N);\n",
+ "V=(e**2)*x/(4*e*math.pi*epsilon0*r0); #potential(V)\n",
+ "E=I-EA; #net energy(eV)\n",
+ "BE=round(V*10,2)-E; #bond energy(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"bond energy is\",BE,\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.2, Page number 10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "compressibility is -25.1095 *10**14\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r0=0.41*10**-3; #equilibrium distance(m)\n",
+ "A=1.76; #madelung constant\n",
+ "n=0.5; #repulsive exponent value\n",
+ "\n",
+ "#Calculation\n",
+ "beta=72*math.pi*epsilon0*r0**4/(A*e**2*(n-1)); #compressibility\n",
+ "\n",
+ "#Result\n",
+ "print \"compressibility is\",round(beta/10**14,4),\"*10**14\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.3, Page number 10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "cohesive energy is -3.065 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r0=0.314*10**-9; #equilibrium distance(m)\n",
+ "A=1.75; #madelung constant\n",
+ "N=5.77; #born constant\n",
+ "I=4.1; #ionisation energy(eV)\n",
+ "EA=3.6; #electron affinity(eV)\n",
+ "\n",
+ "#Calculation\n",
+ "V=-A*e**2*((N-1)/N)/(4*e*math.pi*epsilon0*r0);\n",
+ "PE=round(V,2)/2; #potential energy per ion(eV)\n",
+ "x=(I-EA)/2;\n",
+ "CE=PE+x; #cohesive energy(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"cohesive energy is\",CE,\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.4, Page number 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "binding energy is 665.0 *10**3 kJ/kmol\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration \n",
+ "N=6.02*10**26; #Avagadro Number\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r0=0.324*10**-9; #equilibrium distance(m)\n",
+ "A=1.75; #madelung constant\n",
+ "n=8.5; #repulsive exponent value\n",
+ "\n",
+ "#Calculations\n",
+ "U0=(A*e/(4*math.pi*epsilon0*r0))*(1-1/n); \n",
+ "U=round(U0,1)*N*e; #binding energy(J/kmol)\n",
+ "\n",
+ "#Result\n",
+ "print \"binding energy is\",round(U/10**6),\"*10**3 kJ/kmol\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.5, Page number 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "density of CsClis 4.389 *10**3 kg/m**3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "rCs=0.165*10**-9; #radius(m)\n",
+ "rCl=0.181*10**-9; #radius(m)\n",
+ "MCs=133; #atomic weight\n",
+ "MCl=35.5; #atomic weight\n",
+ "N=6.02*10**26; #Avagadro Number\n",
+ "\n",
+ "#Calculation\n",
+ "a=2*(rCl+rCs)/math.sqrt(3); #lattice constant(m)\n",
+ "M=(MCs+MCl)/N; #mass of 1 molecule(kg)\n",
+ "V=a**3; #volume of unit cell(m**3)\n",
+ "rho=M/V; #density of CsCl(kg/m**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"density of CsClis\",round(rho/10**3,3),\"*10**3 kg/m**3\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.6, Page number 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "effective charge is 0.72 *10**-19 coulomb\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",
+ "dm=1.98*(10**-29)*(1/3); #dipole moment\n",
+ "l=0.92*10**-10; #bond length(m)\n",
+ "\n",
+ "#Calculation\n",
+ "ec=dm/l; #effective charge(coulomb)\n",
+ "\n",
+ "#Result\n",
+ "print \"effective charge is\",round(ec*10**19,2),\"*10**-19 coulomb\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.7, Page number 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "energy required is -1.9 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r=0.5*10**-9; #distance(m)\n",
+ "I=5; #ionisation energy(eV)\n",
+ "E=4; #electron affinity(eV)\n",
+ "\n",
+ "#Calculation\n",
+ "C=e**2/(4*math.pi*epsilon0*e*r); #coulomb energy(eV)\n",
+ "Er=I-E-C; #energy required(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"energy required is\",round(Er,1),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.9, Page number 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "-2*a/r**3 + 90*b/r**11\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from sympy import *\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "n=1;\n",
+ "m=9;\n",
+ "a=Symbol('a')\n",
+ "b=Symbol('b')\n",
+ "r=Symbol('r')\n",
+ "\n",
+ "#Calculation\n",
+ "y=(-a/(r**n))+(b/(r**m));\n",
+ "y=diff(y,r);\n",
+ "y=diff(y,r);\n",
+ "\n",
+ "#Result\n",
+ "print y"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "young's modulus is 157 GPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#since the values of a,b,r are declared as symbols in the above cell, it cannot be solved there. hence it is being solved here with the given variable declaration\n",
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=7.68*10**-29; \n",
+ "r0=2.5*10**-10; #radius(m)\n",
+ "\n",
+ "#Calculation\n",
+ "b=a*(r0**8)/9;\n",
+ "y=((-2*a*r0**8)+(90*b))/r0**11; \n",
+ "E=y/r0; #young's modulus(Pa)\n",
+ "\n",
+ "#Result\n",
+ "print \"young's modulus is\",int(E/10**9),\"GPa\""
+ ]
+ }
+ ],
+ "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/Sadananda CharyArroju/Chapter10.ipynb b/sample_notebooks/Sadananda CharyArroju/Chapter10.ipynb new file mode 100755 index 00000000..bd43d700 --- /dev/null +++ b/sample_notebooks/Sadananda CharyArroju/Chapter10.ipynb @@ -0,0 +1,431 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#10: Superconductivity"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.1, Page number 224"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical field is 3.365 *10**3 A/m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T=5; #temperature(K)\n",
+ "Tc=7.2; #critical temperature(K)\n",
+ "H0=6.5*10**3; #critical magnetic field(A/m)\n",
+ "\n",
+ "#Calculation\n",
+ "Hc=H0*(1-(T/Tc)**2); #critical field(A/m)\n",
+ "\n",
+ "#Result\n",
+ "print \"critical field is\",round(Hc/10**3,3),\"*10**3 A/m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.2, Page number 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical field is 1.567 *10**3 A/m\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T=2.5; #temperature(K)\n",
+ "Tc=3.5; #critical temperature(K)\n",
+ "H0=3.2*10**3; #critical magnetic field(A/m)\n",
+ "\n",
+ "#Calculation\n",
+ "Hc=H0*(1-(T/Tc)**2); #critical field(A/m)\n",
+ "\n",
+ "#Result\n",
+ "print \"critical field is\",round(Hc/10**3,3),\"*10**3 A/m\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.3, Page number 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 7,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical temperature is 6.928 K\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",
+ "Hc=5*10**3; #critical magnetic field(A/m)\n",
+ "T=6; #temperature(K)\n",
+ "H0=2*10**4; #critical magnetic field(A/m)\n",
+ "\n",
+ "#Calculation\n",
+ "Tc=T/math.sqrt(1-(Hc/H0)); #critical temperature(K)\n",
+ "\n",
+ "#Result\n",
+ "print \"critical temperature is\",round(Tc,3),\"K\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.4, Page number 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 9,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical current is 251.3 amp\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Hc=2*10**3; #critical magnetic field(A/m)\n",
+ "r=0.02; #radius(m)\n",
+ "\n",
+ "#Calculation\n",
+ "Ic=2*math.pi*r*Hc; #critical current(amp)\n",
+ "\n",
+ "#Result\n",
+ "print \"critical current is\",round(Ic,1),\"amp\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.5, Page number 225"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 11,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "isotopic mass is 191.75 amu\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "T1=5; #temperature(K)\n",
+ "T2=5.1; #temperature(K)\n",
+ "M1=199.5; #isotopic mass(amu)\n",
+ "\n",
+ "#Calculation\n",
+ "M2=M1*(T1/T2)**2; #isotopic mass(amu)\n",
+ "\n",
+ "#Result\n",
+ "print \"isotopic mass is\",round(M2,2),\"amu\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.6, Page number 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 19,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical field is 3.0469 *10**4 A/m\n",
+ "critical current is 287.161 amp\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",
+ "T=5; #temperature(K)\n",
+ "Tc=8; #critical temperature(K)\n",
+ "H0=5*10**4; #critical magnetic field(A/m)\n",
+ "r=1.5*10**-3; #radius(m)\n",
+ "\n",
+ "#Calculation\n",
+ "Hc=H0*(1-(T/Tc)**2); #critical field(A/m)\n",
+ "Ic=2*math.pi*r*Hc; #critical current(amp)\n",
+ "\n",
+ "#Result\n",
+ "print \"critical field is\",round(Hc/10**4,4),\"*10**4 A/m\"\n",
+ "print \"critical current is\",round(Ic,3),\"amp\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.7, Page number 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 22,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical temperature is 4.1447 K\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tc1=4.185; #critical temperature(K)\n",
+ "M1=199.5; #isotopic mass(amu)\n",
+ "M2=203.4; #isotopic mass(amu)\n",
+ "\n",
+ "#Calculation\n",
+ "Tc2=Tc1*math.sqrt(M1/M2); #critical temperature(K)\n",
+ "\n",
+ "#Result\n",
+ "print \"critical temperature is\",round(Tc2,4),\"K\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.8, Page number 226"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 31,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "frequency is 4.105 *10**11 Hz\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; #charge(c)\n",
+ "h=6.626*10**-36; #plank constant\n",
+ "V=8.5*10**-6; #voltage(V)\n",
+ "\n",
+ "#Calculation\n",
+ "new=2*e*V/h; #frequency(Hz)\n",
+ "\n",
+ "#Result\n",
+ "print \"frequency is\",round(new/10**11,3),\"*10**11 Hz\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.9, Page number 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "critical temperature is 30.0 K\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "Tc1=5; #critical temperature(K)\n",
+ "P1=1; #pressure(mm)\n",
+ "P2=6; #pressure(mm)\n",
+ "\n",
+ "#Calculation\n",
+ "Tc2=Tc1*P2/P1; #critical temperature(K)\n",
+ "\n",
+ "#Result\n",
+ "print \"critical temperature is\",Tc2,\"K\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 10.10, Page number 227"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 34,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "maximum critical temperature is 7.782 K\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",
+ "Hc=6*10**5; #critical magnetic field(A/m)\n",
+ "Tc=8.7; #critical temperature(K)\n",
+ "H0=3*10**6; #critical magnetic field(A/m)\n",
+ "\n",
+ "#Calculation\n",
+ "T=Tc*math.sqrt(1-(Hc/H0)); #maximum critical temperature(K)\n",
+ "\n",
+ "#Result\n",
+ "print \"maximum critical temperature is\",round(T,3),\"K\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ }
+ ],
+ "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/Sadananda CharyArroju/Chapter1_1.ipynb b/sample_notebooks/Sadananda CharyArroju/Chapter1_1.ipynb new file mode 100755 index 00000000..55497994 --- /dev/null +++ b/sample_notebooks/Sadananda CharyArroju/Chapter1_1.ipynb @@ -0,0 +1,412 @@ +{
+ "cells": [
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "#1: Bonding in Solids"
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.1, Page number 10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 15,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "bond energy is 3.84 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r0=23.6*10**-10; #equilibrium distance(m)\n",
+ "I=5.14; #ionisation energy(eV)\n",
+ "EA=3.65; #electron affinity(eV)\n",
+ "N=8; #born constant\n",
+ "\n",
+ "#Calculation\n",
+ "x=1-(1/N);\n",
+ "V=(e**2)*x/(4*e*math.pi*epsilon0*r0); #potential(V)\n",
+ "E=I-EA; #net energy(eV)\n",
+ "BE=round(V*10,2)-E; #bond energy(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"bond energy is\",BE,\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.2, Page number 10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 10,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "compressibility is -25.1095 *10**14\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r0=0.41*10**-3; #equilibrium distance(m)\n",
+ "A=1.76; #madelung constant\n",
+ "n=0.5; #repulsive exponent value\n",
+ "\n",
+ "#Calculation\n",
+ "beta=72*math.pi*epsilon0*r0**4/(A*e**2*(n-1)); #compressibility\n",
+ "\n",
+ "#Result\n",
+ "print \"compressibility is\",round(beta/10**14,4),\"*10**14\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.3, Page number 10"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 18,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "cohesive energy is -3.065 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r0=0.314*10**-9; #equilibrium distance(m)\n",
+ "A=1.75; #madelung constant\n",
+ "N=5.77; #born constant\n",
+ "I=4.1; #ionisation energy(eV)\n",
+ "EA=3.6; #electron affinity(eV)\n",
+ "\n",
+ "#Calculation\n",
+ "V=-A*e**2*((N-1)/N)/(4*e*math.pi*epsilon0*r0);\n",
+ "PE=round(V,2)/2; #potential energy per ion(eV)\n",
+ "x=(I-EA)/2;\n",
+ "CE=PE+x; #cohesive energy(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"cohesive energy is\",CE,\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.4, Page number 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 32,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "binding energy is 665.0 *10**3 kJ/kmol\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration \n",
+ "N=6.02*10**26; #Avagadro Number\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r0=0.324*10**-9; #equilibrium distance(m)\n",
+ "A=1.75; #madelung constant\n",
+ "n=8.5; #repulsive exponent value\n",
+ "\n",
+ "#Calculations\n",
+ "U0=(A*e/(4*math.pi*epsilon0*r0))*(1-1/n); \n",
+ "U=round(U0,1)*N*e; #binding energy(J/kmol)\n",
+ "\n",
+ "#Result\n",
+ "print \"binding energy is\",round(U/10**6),\"*10**3 kJ/kmol\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.5, Page number 11"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 36,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "density of CsClis 4.389 *10**3 kg/m**3\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "rCs=0.165*10**-9; #radius(m)\n",
+ "rCl=0.181*10**-9; #radius(m)\n",
+ "MCs=133; #atomic weight\n",
+ "MCl=35.5; #atomic weight\n",
+ "N=6.02*10**26; #Avagadro Number\n",
+ "\n",
+ "#Calculation\n",
+ "a=2*(rCl+rCs)/math.sqrt(3); #lattice constant(m)\n",
+ "M=(MCs+MCl)/N; #mass of 1 molecule(kg)\n",
+ "V=a**3; #volume of unit cell(m**3)\n",
+ "rho=M/V; #density of CsCl(kg/m**3)\n",
+ "\n",
+ "#Result\n",
+ "print \"density of CsClis\",round(rho/10**3,3),\"*10**3 kg/m**3\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.6, Page number 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 37,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "effective charge is 0.72 *10**-19 coulomb\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",
+ "dm=1.98*(10**-29)*(1/3); #dipole moment\n",
+ "l=0.92*10**-10; #bond length(m)\n",
+ "\n",
+ "#Calculation\n",
+ "ec=dm/l; #effective charge(coulomb)\n",
+ "\n",
+ "#Result\n",
+ "print \"effective charge is\",round(ec*10**19,2),\"*10**-19 coulomb\"\n",
+ "print \"answer given in the book is wrong\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.7, Page number 12"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 42,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "energy required is -1.9 eV\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "e=1.6*10**-19; #charge(coulomb)\n",
+ "epsilon0=8.85*10**-12; \n",
+ "r=0.5*10**-9; #distance(m)\n",
+ "I=5; #ionisation energy(eV)\n",
+ "E=4; #electron affinity(eV)\n",
+ "\n",
+ "#Calculation\n",
+ "C=e**2/(4*math.pi*epsilon0*e*r); #coulomb energy(eV)\n",
+ "Er=I-E-C; #energy required(eV)\n",
+ "\n",
+ "#Result\n",
+ "print \"energy required is\",round(Er,1),\"eV\""
+ ]
+ },
+ {
+ "cell_type": "markdown",
+ "metadata": {},
+ "source": [
+ "##Example number 1.9, Page number 13"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 43,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "-2*a/r**3 + 90*b/r**11\n"
+ ]
+ }
+ ],
+ "source": [
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "from sympy import *\n",
+ "import numpy as np\n",
+ "\n",
+ "#Variable declaration\n",
+ "n=1;\n",
+ "m=9;\n",
+ "a=Symbol('a')\n",
+ "b=Symbol('b')\n",
+ "r=Symbol('r')\n",
+ "\n",
+ "#Calculation\n",
+ "y=(-a/(r**n))+(b/(r**m));\n",
+ "y=diff(y,r);\n",
+ "y=diff(y,r);\n",
+ "\n",
+ "#Result\n",
+ "print y"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 44,
+ "metadata": {
+ "collapsed": false
+ },
+ "outputs": [
+ {
+ "name": "stdout",
+ "output_type": "stream",
+ "text": [
+ "young's modulus is 157 GPa\n"
+ ]
+ }
+ ],
+ "source": [
+ "#since the values of a,b,r are declared as symbols in the above cell, it cannot be solved there. hence it is being solved here with the given variable declaration\n",
+ "#importing modules\n",
+ "import math\n",
+ "from __future__ import division\n",
+ "\n",
+ "#Variable declaration\n",
+ "a=7.68*10**-29; \n",
+ "r0=2.5*10**-10; #radius(m)\n",
+ "\n",
+ "#Calculation\n",
+ "b=a*(r0**8)/9;\n",
+ "y=((-2*a*r0**8)+(90*b))/r0**11; \n",
+ "E=y/r0; #young's modulus(Pa)\n",
+ "\n",
+ "#Result\n",
+ "print \"young's modulus is\",int(E/10**9),\"GPa\""
+ ]
+ }
+ ],
+ "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
+}
|