summaryrefslogtreecommitdiff
path: root/Solid_State_Physics_by_Dr._M._Arumugam/Chapter2_CYtbJvj.ipynb
blob: 51d55e0b1e1d2a44310fb23f582d3f21faa4101a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
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
}