import math
# Given
Mat = 55.85*10**-3 # in Kg/mol
NA = 6.022*10**23 # in mol**-1
p = 7.86*10**3 # in kg/m3
Msat = 1.75*10**6 # in A/m
# funcprot(0)
beta = 9.27*10**-24 # in J/tesla
# Calculations and Results
n_at = p*NA/Mat
x = Msat/(n_at*beta)
print("In the solid each Fe atom contributes only {0:.4f} bohr magneton".format(x))
import math
# Given
u_o = 4*math.pi*10**-7 # in H/m
u_ri = 2*10**3
N = 200.0 # no. of turns
d = 0.005 # in m
D = 2.5*10**-2 # in m
# Calculations and Results
A = math.pi*(d**2)/4
l = math.pi*D
L = u_ri*u_o*N**2*A/l
print("Approximate inductance of the coil in Henry is {0:.4f}".format(L))
import math
# Given
N = 500.0 # no.of turns
B = 5.0 # in Tesla
l = 1.0 # in m
r = 10**-3 # in m
uo = 4*math.pi*10**-7 # in H/m
d = 10*10**-2 # in m
# Calculations and Results
I = (B*l)/(uo*N)
print("current in Amperes is {0:.4f}".format(I))
E_vol = B**2/(2*uo)
v = math.pi*l*d**2/4.0
E = E_vol*v
print("Energy stored in the solenoid in joules is {0:.4f}".format(E))