# 5: Magnetostatics¶

## Example number 5.1, Page number 118¶

In [12]:
#importing modules
import math
from __future__ import division

#Variable declaration
m=1.7*10**-27;     #mass of proton(kg)
q=1.6*10**-19;   #charge of proton(C)
KE=6*10**6*q;   #kinetic energy of proton(J)
B=2;   #intensity of magnetic field(Wb/m**2)

#Calculation
v=math.sqrt(2*KE/m);    #velocity(m/s)
Fb=q*v*B*math.sin(theta);   #force acting on proton(N)

#Result
print "force acting on proton is",round(Fb*10**11,3),"*10**-11 N"
print "answer given in the book is wrong"

force acting on proton is 1.075 *10**-11 N
answer given in the book is wrong


## Example number 5.2, Page number 119¶

In [13]:
#importing modules
import math
from __future__ import division

#Variable declaration
r=6.4*10**6;    #radius of earth(m)
P=6.4*10**21;    #magnetic moment(Amp m**2)

#Calculation
A=math.pi*(r**2);    #area(m**2)
i=P/A;    #current(amp)

#Result
print "current is",round(i/10**7),"*10**7 Amp"

current is 5.0 *10**7 Amp


## Example number 5.3, Page number 119¶

In [14]:
#importing modules
import math
from __future__ import division

#Variable declaration
B0=1.7*10**-5;    #magnetic flux density(Wb/m**2)
mew0=4*math.pi*10**-7;

#Calculation
H=B0/mew0;    #magnetic intensity(Amp/m)

#Result
print "magnetic intensity is",round(H,1),"Amp/m"

magnetic intensity is 13.5 Amp/m


## Example number 5.4, Page number 119¶

In [20]:
#importing modules
import math
from __future__ import division

#Variable declaration
l=30*10**-2;   #length(m)
A=10**-4;    #area(m**2)
N=300;    #number of turns
i=0.032;   #current(ampere)
phi=2*10**-6;   #magnetic flux(Wb)
mew0=4*math.pi*10**-7;

#Calculation
B=phi/A;    #magnetic flux density(wb/m**2)
H=N*i/l;    #magnetising force(amp turns/m)
mew=B/H;    #permeability of ion(Wb/Amp m)
mewr=mew/mew0;   #relative permeability

#Result
print "magnetic flux density is",B*10**2,"*10**-2 wb/m**2"
print "magnetising force is",H,"amp turns/m"
print "permeability of ion is",mew*10**4,"*10**-4 Wb/Amp m"
print "relative permeability is",round(mewr)
print "answer for relative permeability differs due to round off errors"

magnetic flux density is 2.0 *10**-2 wb/m**2
magnetising force is 32.0 amp turns/m
permeability of ion is 6.25 *10**-4 Wb/Amp m
relative permeability is 497.0
answer for relative permeability differs due to round off errors


## Example number 5.5, Page number 120¶

In [23]:
#importing modules
import math
from __future__ import division

#Variable declaration
M=600;   #magnetic moment(cgs units)
V=20;    #volume(cm**3)
H=50;    #magnetic field(oersteds)

#Calculation
I=M/V;   #intensity of magnetisation(cgs units)
B=H+(4*math.pi*I);   #flux density(guass)

#Result
print "flux density is",round(B),"guass"
print "answer given in the book is wrong"

flux density is 427.0 guass
answer given in the book is wrong


## Example number 5.6, Page number 120¶

In [24]:
#importing modules
import math
from __future__ import division

#Variable declaration
m=12000;   #mass(gm)
d=7.5;   #density(g/cm**3)
new=50;   #frequency(Hz)
a=3000;   #area of hysterisis curve(erg/cm**3)

#Calculation
V=m/d;   #volume of core(cm**3)
El=a*V;  #energy loss in 1 cycle(erg)
n=new*60*60;   #number of cycles per hour
EL=El*n/10**7;   #energy loss per hour(J)

#Result
print "energy loss per hour is",EL/10**4,"*10**4 J"

energy loss per hour is 8.64 *10**4 J


## Example number 5.7, Page number 121¶

In [25]:
#importing modules
import math
from __future__ import division

#Variable declaration
B=8*math.pi;    #magnetic flux density(wb/m**2)
H=2000;   #magnetic field(amp turn/m)
mew0=4*math.pi*10**-7;

#Calculation
mewr=B/(mew0*H);     #relative permeability
chi=mewr-1;    #susceptibility

#Result
print "susceptibility is",chi

susceptibility is 9999.0


## Example number 5.8, Page number 121¶

In [29]:
#importing modules
import math
from __future__ import division

#Variable declaration
q=1.6*10**-19;     #charge on electron(C)
i1=3;
j1=2;
k1=3;    #components of vector
i2=3;
j2=4;
k2=0;    #components of vector
i3=0;
j3=4;
k3=1;    #components of vector

#Calculation
i4=(j2*k3)-(j3*k2);
j4=(i2*k3)-(i3*k2);
k4=(i2*j3)-(i3*j2);    #components of derived vector
i5=i1+i4;
j5=j1+j4;
k5=k1+k4;
F=q*math.sqrt((i5**2)+(j5**2)+(k5**2));    #Lorentz force(N)

#Result
print "Lorentz force is",round(F*10**19,2),"*10**-19 N"
print "answer given in the book is wrong"

Lorentz force is 27.67 *10**-19 N
answer given in the book is wrong