#To calculate the magnitude and direction of magnetic moment
#importing modules
import math
#Variable declaration
I = 12; #current(Ampere)
A = 7.5*10**-4 #area of loop(m**2)
#Calculation
M = I*A; #magnetic moment(Am**2)
M = M*10**3;
#Result
print "magnetic moment is",M,"*10**-3 Am**2"
print "M is directed away from the observer and is perpendicular to the plane of the loop"
#To calculate the magnetic moment
#importing modules
import math
#Variable declaration
r = 0.5; #radius of orbit(Angstrom)
e = 1.6*10**-19; #charge of electron(C)
new = 10**16; #frequency(rps)
#Calculation
r = r*10**-10; #radius of orbit(m)
I = e*new; #current(Ampere)
A = math.pi*r**2; #area enclosed(m**2)
M = I*A; #magnetic moment(Am**2)
#Result
print "magnetic moment is",M,"Am**2"
#To calculate the magnetic susceptibility
#importing modules
import math
#Variable declaration
mew_r = 5000; #relative permeability
#Calculation
chi_m = mew_r-1; #magnetic susceptibility
#Result
print "magnetic susceptibility is",chi_m
#To calculate the permeability
#importing modules
import math
#Variable declaration
H = 1800; #magnetic field(A/m)
phi = 3*10**-5; #magnetic flux(Wb)
A = 0.2; #cross sectional area(cm**2)
#Calculation
A = A*10**-4; #cross sectional area(m**2)
B = phi/A; #magnetic flux density(Wb/m**2)
mew = B/H; #permeability(H/m)
mew = mew*10**4;
mew=math.ceil(mew*100)/100; #rounding off to 2 decimals
#Result
print "permeability is",mew,"*10**-4 H/m"
#To calculate the magnetic moment
#importing modules
import math
#Variable declaration
B = 0.65; #magnetic induction(Wb/m**2)
rho = 8906; #density(kg/m**3)
M = 58.7; #atomic weight
mew0 = 4*math.pi*10**-7;
mb = 9.27*10**-24;
Na = 6.023*10**26; #avagadro constant
#Calculation
N = rho*Na/M; #number of atoms per unit volume(atoms/m**3)
mew_r = B/(N*mew0); #relative permeability(A/m**2)
M = mew_r/mb; #magnetic moment in mew_B
M=math.ceil(M*10**3)/10**3; #rounding off to 3 decimals
#Result
print "magnetic moment is",M,"mew_B"