summaryrefslogtreecommitdiff
path: root/Engineering_Physics_by_Shyam_Rajeev/Chapter10.ipynb
blob: 66376214c946b62145855b52c8bf64ef6f3f09f8 (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
{
 "metadata": {
  "name": "",
  "signature": "sha256:32a1f58679b12138480dc1b5e5c18d84b4eee7617fb55dd2b494b13bcfd310c8"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "heading",
     "level": 1,
     "metadata": {},
     "source": [
      "10: Magnetic properties of materials"
     ]
    },
    {
     "cell_type": "heading",
     "level": 2,
     "metadata": {},
     "source": [
      "Example number 10.1, Page number 247"
     ]
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "#importing modules\n",
      "import math\n",
      "from __future__ import division\n",
      "\n",
      "#Variable declaration\n",
      "r = 0.052;         #radius of orbit(nm)\n",
      "B = 1;           #magnetic field(Wb/m**2)\n",
      "e = 1.6*10**-19;       #charge of electron(c)\n",
      "m = 9.1*10**-31;        #mass of electron(kg)\n",
      "\n",
      "#Calculation\n",
      "r = r*10**-9;        #radius of orbit(m)\n",
      "delta_mew = (e**2)*(r**2)*B/(4*m);       #change in magnetic moment(Am**2)\n",
      "\n",
      "#Result\n",
      "print \"change in magnetic moment is\",round(delta_mew/1e-29,3),\"*10**-29 Am**2\"\n",
      "print \"answer given in the book is wrong\""
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "change in magnetic moment is 1.902 *10**-29 Am**2\n",
        "answer given in the book is wrong\n"
       ]
      }
     ],
     "prompt_number": 5
    }
   ],
   "metadata": {}
  }
 ]
}