summaryrefslogtreecommitdiff
path: root/Engineering_Physics_Aruldhas/Chapter6_1.ipynb
blob: 0de100697b8af0d34a5ed0177daab28753e853ec (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
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
{
 "metadata": {
  "name": "",
  "signature": "sha256:1812f754f8541ce5ac6b5aaa71f7eac9ff30ca728d742f618ea7c5d3873d8a96"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "6: Crystallography"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.1, Page number 134"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "M = 23+35.5;        #Molecular weight of NaCl(kg/k-mole)\n",
      "d = 2.18*10**3;     #Density of rock salt(kg/m**3)\n",
      "n = 4;    #Number of atoms per unit cell for an fcc lattice of NaCl crystal\n",
      "N = 6.02*10**26;    #Avogadro's No., atoms/k-mol\n",
      "\n",
      "#Calculation\n",
      "a = (n*M/(d*N))**(1/3);     #Lattice constant of unit cell of NaCl(m)\n",
      "a = a*10**9;      ##Lattice constant of unit cell of NaCl(nm)\n",
      "a = math.ceil(a*10**3)/10**3;     #rounding off the value of a to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"Lattice parameter for the NaCl crystal is\",a, \"nm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Lattice parameter for the NaCl crystal is 0.563 nm\n"
       ]
      }
     ],
     "prompt_number": 1
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.2, Page number 134"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "m = 3;\n",
      "n = 2; \n",
      "p = 1;     #Coefficients of intercepts along three axes\n",
      "\n",
      "#Calculation\n",
      "#reciprocals of the intercepts are 1/m, 1/n, 1/p i.e 1/3, 1/2, 1\n",
      "#multiplying by LCM the reciprocals become 2, 3, 6\n",
      "\n",
      "#Result\n",
      "print \"The required miller indices are : (2, 3, 6)\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required miller indices are : (2, 3, 6)\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.3, Page number 135"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "\n",
      "#Variable declaration\n",
      "m = 2;  #Coefficient of intercept along x-axis\n",
      "#n = infinite    Coefficient of intercept along y-axis\n",
      "p = 3/2;    #Coefficient of intercept along z-axis\n",
      "\n",
      "#Calculation\n",
      "#reciprocals of the intercepts are 1/m, 1/n, 1/p i.e 1/2, 0, 2/3\n",
      "#multiplying by LCM the reciprocals become 3, 0, 4\n",
      "\n",
      "#Result\n",
      "print \"The required miller indices are : (3, 0, 4)\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The required miller indices are : (3, 0, 4)\n"
       ]
      }
     ],
     "prompt_number": 3
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.4, Sketching not possible"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.5, Page number 136"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "#For (110) planes\n",
      "h1 = 1;\n",
      "k1 = 1;\n",
      "l1 = 0;    #Miller Indices for planes in a cubic crystal\n",
      "a1 = 0.43;     #Interatomic spacing(nm)\n",
      "#For (212) planes\n",
      "h2 = 2; \n",
      "k2 = 1;\n",
      "l2 = 2;    #Miller Indices for planes in a cubic crystal\n",
      "a2 = 0.43;     #Interatomic spacing(nm)\n",
      "\n",
      "#Calculation\n",
      "d1 = a1/(h1**2+k1**2+l1**2)**(1/2);  #The interplanar spacing for cubic crystals(nm)\n",
      "d1 = math.ceil(d1*10**4)/10**4;     #rounding off the value of d1 to 4 decimals\n",
      "d2 = a2/(h2**2+k2**2+l2**2)**(1/2);    #The interplanar spacing for cubic crystals(nm)\n",
      "d2 = math.ceil(d2*10**4)/10**4;     #rounding off the value of d2 to 4 decimals\n",
      "\n",
      "#Result\n",
      "print \"The interplanar spacing between consecutive (110) planes is\",d1, \"nm\";\n",
      "print \"The interplanar spacing between consecutive (212) planes is\",d2, \"nm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The interplanar spacing between consecutive (110) planes is 0.3041 nm\n",
        "The interplanar spacing between consecutive (212) planes is 0.1434 nm\n"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.6, Page number 136"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "h = 2;\n",
      "k = 3;\n",
      "l = 1;      #Miller Indices for planes in a cubic crystal\n",
      "r = 0.175;    #Atomic radius of fcc lattice(nm)\n",
      "\n",
      "#Calculation\n",
      "a = 2*math.sqrt(2)*r;     #Interatomic spacing of fcc lattice(nm)\n",
      "d = a/(h**2+k**2+l**2)**(1/2);    #The interplanar spacing for cubic crystals(nm)\n",
      "d = math.ceil(d*10**4)/10**4;     #rounding off the value of d to 4 decimals\n",
      "\n",
      "#Result\n",
      "print \"The interplanar spacing between consecutive (231) planes is\",d, \"nm\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The interplanar spacing between consecutive (231) planes is 0.1323 nm\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.7, Page number 136"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "lamda = 1.44;      #Wavelength of X-rays(A)\n",
      "d = 2.8;     #Interplanar spacing of rocksalt crystal(A)\n",
      "n1 = 1;      #For 1st Order diffraction\n",
      "n2 = 2;     #For 2nd Order diffraction\n",
      "\n",
      "#Calculation\n",
      "theta1 = math.asin(n1*lamda/(2*d));    #Angle of diffraction(radians)\n",
      "theeta1 = theta1*57.2957795;       #Angle of diffraction(degrees)\n",
      "theeta1 = math.ceil(theeta1*10**2)/10**2;     #rounding off the value of theeta1 to 2 decimals\n",
      "theta2 = math.asin(n2*lamda/(2*d));     #Angle of diffraction(radians)\n",
      "theeta2 = theta2*57.2957795;       #Angle of diffraction(degrees)\n",
      "theeta2 = math.ceil(theeta2*10**2)/10**2;     #rounding off the value of theeta2 to 2 decimals\n",
      "\n",
      "#Result\n",
      "print \"The angle of diffraction for first order maxima is\",theeta1, \"degrees\"\n",
      "print \"The angle of diffraction for second order maxima is\",theeta2, \"degrees\"\n"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The angle of diffraction for first order maxima is 14.91 degrees\n",
        "The angle of diffraction for second order maxima is 30.95 degrees\n"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.8, Page number 136"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "a = 1;     #For convenience, assume interatomic spacing to be unity(m)\n",
      "\n",
      "#Calculation\n",
      "N = 8*(1/8) + 6*(1/2);      #total number of spheres in a unit cell\n",
      "r = a/(2*math.sqrt(2));    #The atomic radius(m)\n",
      "V_atom = N*(4/3)*math.pi*r**3;    #Volume of atoms(m**3)\n",
      "V_uc = a**3;       #Volume of unit cell(m**3)\n",
      "PV = (V_atom/V_uc)*100;      #percentage of actual volume\n",
      "PV = math.ceil(PV*10)/10;     #rounding off the value of PV to 1 decimal\n",
      "\n",
      "#Result\n",
      "print \"The percentage of actual volume occupied by the spheres in fcc structure is\",PV, \"percent\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The percentage of actual volume occupied by the spheres in fcc structure is 74.1 percent\n"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.9, Page number 137"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "#For (221) planes\n",
      "h = 2; \n",
      "k = 2; \n",
      "l = 1;    #Miller Indices for planes in a cubic crystal\n",
      "a = 2.68;    #Interatomic spacing(A)\n",
      "n1 = 1;      #First Order of diffraction \n",
      "n2 = 2;    #Second order of diffraction\n",
      "theta1 = 8.5;    #Glancing angle at which Bragg's reflection occurs(degrees)\n",
      "\n",
      "#Calculation\n",
      "theta1 = theta1*0.0174532925;     #Glancing angle at which Bragg's reflection occurs(radians)\n",
      "a = a*10**-10;      #Interatomic spacing(m)\n",
      "d = a/(h**2+k**2+l**2)**(1/2);   #The interplanar spacing for cubic crystal(m)\n",
      "lamda = 2*d*math.sin(theta1)/n1;     #Bragg's Law for wavelength of X-rays(m)\n",
      "lamda_A = lamda*10**10;        #Bragg's Law for wavelength of X-rays(A)\n",
      "lamda_A = math.ceil(lamda_A*10**4)/10**4;     #rounding off the value of lamda_A to 4 decimals\n",
      "theta2 = math.asin(n2*lamda/(2*d));    #Angle at which second order Bragg reflection occurs(radians)\n",
      "theta2 = theta2*57.2957795;       #Angle at which second order Bragg reflection occurs(degrees)\n",
      "theta2 = math.ceil(theta2*10)/10;     #rounding off the value of theta2 to 1 decimal\n",
      "\n",
      "#Result\n",
      "print \"The interplanar spacing between consecutive (221) planes is\",d, \"m\"\n",
      "print \"The wavelength of X-rays is\",lamda_A, \"angstrom\"\n",
      "print \"The angle at which second order Bragg reflection occurs is\",theta2, \"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The interplanar spacing between consecutive (221) planes is 8.93333333333e-11 m\n",
        "The wavelength of X-rays is 0.2641 angstrom\n",
        "The angle at which second order Bragg reflection occurs is 17.2 degrees\n"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.10, Page number 137"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "h = 1; \n",
      "k = 1;\n",
      "l = 0;    #Miller Indices for planes in a cubic crystal\n",
      "n = 1;    #First Order of diffraction \n",
      "theta = 25;    #Glancing angle at which Bragg's reflection occurs(degrees)\n",
      "lamda = 0.7;     #Wavelength of X-rays(A)\n",
      "\n",
      "#Calculation\n",
      "theta = theta*0.0174532925;     #Glancing angle at which Bragg's reflection occurs(radians)\n",
      "d = n*lamda/(2*math.sin(theta));    #Interplanar spacing of cubic crystal(A)\n",
      "a = d*(h**2+k**2+l**2)**(1/2);      #The lattice parameter for cubic crystal(A)\n",
      "a = math.ceil(a*10**3)/10**3;     #rounding off the value of a to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"The lattice parameter for cubic crystal is\",a, \"angstrom\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The lattice parameter for cubic crystal is 1.172 angstrom\n"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.11, Page number 138"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "d = 0.31;      #Interplanar spacing(nm)\n",
      "n = 1;    #First Order of diffraction \n",
      "theta = 9.25;    #Glancing angle at which Bragg's reflection occurs(degrees)\n",
      "theta_max = 90;     #Maximum possible angle at which reflection can occur(degrees)\n",
      "theta_max = theta_max*0.0174532925;      #Maximum possible angle at which reflection can occur(radians)\n",
      "\n",
      "#Calculation\n",
      "theta = theta*0.0174532925;    #Glancing angle at which Bragg's reflection occurs(radians)\n",
      "lamda = 2*d*math.sin(theta)/n;    #Wavelength of X-rays(nm) (Bragg's Law)\n",
      "lamda = math.ceil(lamda*10**5)/10**5;     #rounding off the value of lamda to 5 decimals\n",
      "n = 2*d*math.sin(theta_max)/lamda;    #Maximum possible order of diffraction\n",
      "\n",
      "#Result\n",
      "print \"The wavelength of X-rays is\",lamda, \"nm\"\n",
      "print \"The Maximum possible order of diffraction is\",round(n)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The wavelength of X-rays is 0.09967 nm\n",
        "The Maximum possible order of diffraction is 6.0\n"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.12, Page number 138"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "#For (110) planes\n",
      "h1 = 1;\n",
      "k1 = 1;\n",
      "l1 = 0;     #Miller indices for (110) planes\n",
      "d_110 = 0.195;     #Interplanar spacing between (110) planes(nm)\n",
      "#For (210) planes\n",
      "h2 = 2;\n",
      "k2 = 1; \n",
      "l2 = 0;     #Miller indices for (110) planes\n",
      "n = 2;     #Second Order of diffraction \n",
      "lamda = 0.071;     #Wavelength of X-rays(nm)\n",
      "\n",
      "#Calculation\n",
      "a = d_110*(h1**2 + k1**2 + l1**2)**(1/2);     #Lattice parameter for bcc crystal(nm)\n",
      "d_210 = a/(h2**2 + k2**2 + l2**2)**(1/2);     #Interplanar spacing between (210) planes(nm)\n",
      "theta = math.asin(n*lamda/(2*d_210));      #Bragg reflection angle for the second order diffraction(radians)\n",
      "theeta = theta*57.2957795;      #Bragg reflection angle for the second order diffraction(degrees)\n",
      "theeta = math.ceil(theeta*10**3)/10**3;     #rounding off the value of theeta to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"Bragg reflection angle for the second order diffraction is\",theeta, \"degrees\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Bragg reflection angle for the second order diffraction is 35.149 degrees\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.13, Page number 138"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "d = 2182;       #Density of rock salt(kg/m**3)\n",
      "n = 4;        #Number of atoms per unit cell for an fcc lattice of NaCl crystal\n",
      "N = 6.02*10**26;    #Avogadro's number(atoms/k-mol)\n",
      "\n",
      "#Calculation\n",
      "M = 23+35.5;         #Molecular weight of NaCl(kg/k-mole)\n",
      "#V = a^3 = M*n/(N*d)\n",
      "a = (n*M/(d*N))**(1/3);      #Lattice constant of unit cell of NaCl(m)\n",
      "D = a/2;       #distance between nearest neighbours(m)\n",
      "D = D*10**9;    #distance between nearest neighbours(nm)\n",
      "D = math.ceil(D*10**4)/10**4;     #rounding off the value of D to 4 decimals\n",
      "\n",
      "#Result\n",
      "print \"The distance between nearest neighbours of NaCl structure is\",D, \"nm\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The distance between nearest neighbours of NaCl structure is 0.2814 nm\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 6.14, Page number 139"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "\n",
      "\n",
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "r1 = 1.258;     #Atomic radius of bcc structure of iron(A)\n",
      "N1 = 2;     #Number of atoms per unit cell in bcc structure\n",
      "#For fcc structure\n",
      "r2 = 1.292;     #Atomic radius of fcc structure of iron(A)\n",
      "N2 = 4;     #Number of atoms per unit cell in fcc structure\n",
      "\n",
      "#Calculation\n",
      "a1 = 4*r1/math.sqrt(3);    #Lattice parameter of bcc structure of iron(A)\n",
      "V1 = a1**3;     #Volume of bcc unit cell(A)\n",
      "V_atom_bcc = V1/N1;    #Volume occupied by one atom(A)\n",
      "a2 = 2*math.sqrt(2)*r2;     #Lattice parameter of fcc structure of iron(A)\n",
      "V2 = a2**3;     #Volume of fcc unit cell(A)\n",
      "V_atom_fcc = V2/N2;     #Volume occupied by one atom(A)\n",
      "delta_V = (V_atom_bcc-V_atom_fcc)/V_atom_bcc*100;    #Percentage change in volume due to structural change of iron\n",
      "delta_V = math.ceil(delta_V*10**3)/10**3;     #rounding off the value of delta_V to 3 decimals\n",
      "\n",
      "#Result\n",
      "print \"The percentage change in volume of iron is\",delta_V, \"percent\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "The percentage change in volume of iron is 0.494 percent\n"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}