summaryrefslogtreecommitdiff
path: root/Engineering_Physics_by_Uma_Mukherji/Chapter1.ipynb
blob: 81c066a493cd54aad23b62adfe5966f02adb6177 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:b22f521510881a8fff0ac38eb4b560555d5bde9f0fb22681533a13e45849f4b7"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "1: Crystallography and Crystal imperfection"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 1.1, Page number 40"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "n=4;          #number of atoms per unit cell(FCC)\n",
      "M=63.54;            #atomic weight of Cu(gm)\n",
      "N=6.023*10**23;         #avagadro number(per g mole)\n",
      "d111=2.08;       #interplanar spacing(angstrom)\n",
      "h=1;\n",
      "k=1;\n",
      "l=1;\n",
      "\n",
      "#Calculation\n",
      "d111=d111*10**-8;       #interplanar spacing(m)     \n",
      "a=d111*math.sqrt((h**2)+(k**2)+(l**2));      \n",
      "D=(n*M)/(N*(a**3));          #density of Cu(g/cc)\n",
      "\n",
      "#Result\n",
      "print \"density of Cu metal is\",round(D,3),\"g/cc\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "density of Cu metal is 9.024 g/cc\n"
       ]
      }
     ],
     "prompt_number": 1
    }
   ],
   "metadata": {}
  }
 ]
}