#Given 
i=90                #A
a=1.5               #m
b=2
l=10**7
#Calculation
u=l*((b*i)/a)
#Result
print"Magnitude of the magnetic field is",u*10**-9,"10**-5","T"
print"Direction of the magnetic field is south"
#Given
I=3                  #A
a=0.15               #m
e=10**-7
b=2
#Calculation
Z=(e*b*I)/a
#Result
print"The magnitude of the magnetic field is",Z*10**6,"10**-6","T"
#Given
l=10                     #A
a=0.05                   #cm
b=10**-7
a1=45                      #degree
#Calculation
import math
B=b*(l/a)*(math.sin(a1*3.14/180.0)+math.sin(a1*3.14/180.0))
B1=4*B
#Result
print"Magnetic field induction is",round(B1*10**4,2),"*10**-4 T"
#Given
n=10
a=0.08                          #m
l=2                             #A
v=10**-7
#Calculation
import math
B=(v*l*math.pi*n*l)/a
#Result
print"Magnitude of the magnetic field is", round(B*10**4,2),"*10**-4 T"
print"Direction of the field is vertically downward."
#Given
v=2.2*10**6                           #m/s
a=0.5*10**-10                          #m
e=1.6*10**-19
m=10**-7                                #N/a**2
#Calculation
import math
I=e*v/(2*math.pi*a)
B=m*2*math.pi*I/a
#Result
print"Magnetic field produced at the centre is", B,"T"
#Given
I=10                           #A
a=0.03                          #m
a1=360                         #degree
a2=90
a3=10**-7
#Calculation
import math
A=a1-a2
B=a3*I*3*math.pi/(a*2.0)
#Result
print"Magnitude of magnetic field is", round(B*10**4,2),"*10**-4 T"
#Given
n=500
I=7                            #A
a=0.05                          #m
x=0.12                           #m
m=10**-7
#Calculation
import math
B=(2*math.pi*n*I*a**2)/(a**2+x**2)**1.5
B1=m*2*math.pi*n*I/a
#Result
print"(a) Magnetic field at the point on the axis is", round(B*10**-4,1),"*10**-3 tesla"
print"(b)Magnetic field at the centre of the coil is",round(B1*10**2,2),"*10**-2 tesla"
#Given
B=2.52*10**-3                    #T
l=0.5                             #m
N=500
#Calculation
import math
n=N/l
I=B/(4*math.pi*10**-7*n)
#Result
print"Current in the solenoid is", round(I,0),"A"
#Given
I=5                     #A
l=2.0                       #m
n=1000
n1=5
#Calculation
N=n*n1
n2=N/l
B=4*math.pi*10**-7*n2*I
#Result
print"Magnetic field at the center is", round(B*10**2,2),"*10**-2 T"
#Given
a=16.0*10**-2                      #m
n=20
I=16                              #A
b=10**-7
a1=10.0*10**-2
n1=25
I1=18
#Calculation
import math
B=b*2*math.pi*n*I/a
B1=b*2*math.pi*n1*I1/a1
B2=B1-B
#Result
print"Magnitude of the magnetic field is", round(B1*10**4,2),"*10**-4 T"
print"Direction is towards west"
#Given
l=11                     #A
s=3500
r1=25                     #cm
r2=26
#Calculation
import math
w=((r1+r2)/2.0)
l1=2*math.pi*w
n=s/l1
B=4*math.pi*10**-7*n*l
#Result
print"(a) Magnetic field outside the toroid is zero"
print"(b) Magnetic field inside the core is",round(B*10**4,2),"*10**-2 T"
print"(c) Magnetic field in the empty space is zero"