# Chapter 5: ELECTROMAGNETISM¶

## Example 5.1,Page number: 143¶

In [1]:
#Question:
"""Finding the current necessary to produce a magnetic field inside the solenoid."""

from math import pi

#Variable Declaration:
B=20e-03                #Magnitude of magnetic field inside the solenoid(in Tesla)
n=20e02                 #Number of turns per cm in the long solenoid

#Calculations:
abs_per=(4*pi)*(1e-07)
I=B/(abs_per*n)

#Result:
print "The required current is %.2f A." %(I)

The required current is 7.96 A.


## Example 5.2,Page number: 143¶

In [4]:
#Question:
"""Finding the magnetic field near the centre and the ends of a solenoid."""

from math import pi

#Variable Declaration:
abs_per=4*pi*(1e-07)      #Absolute permeability of free space(in Henry per metre)
I=6.0                     #Current carried by the solenoid(in Amperes)
l=50e-02                  #Length of solenoid(in metres)
r=1.4e-02                 #Radius of the lowest layer(in metres)
turns_per_layer=350       #Number of turns per layer
number_of_layers=4        #Number of layers

#Calculations:
n=(turns_per_layer*number_of_layers)/l
B_centre=abs_per*n*I
B_end=(abs_per*n*I)/2

#Result:
print "(a)The magnetic field inside the solenois is quite uniform,its strength near the centre on its axis and"
print "   off its axis is the same and its magnitude is %e T." %(B_centre)
print "(b)The magnetic field strength at the end of the solenoid is %e T." %(B_end)
print "(c)The magnetic field far outside the solenoid near its axis is negligible,compared to the internal field."

(a)The magnetic field inside the solenois is quite uniform,its strength near the centre on its axis and
off its axis is the same and its magnitude is 2.111150e-02 T.
(b)The magnetic field strength at the end of the solenoid is 1.055575e-02 T.
(c)The magnetic field far outside the solenoid near its axis is negligible,compared to the internal field.


## Example 5.3,Page number: 148¶

In [7]:
#Question:
"""Finding the force between two long straight parallel wires."""

from math import pi

#Variable Declaration:
r=2                      #Distance between the parallel current carrying wires(in metres)
abs_per=(4*pi)*(1e-07)   #Absolute permeability of free space(in Henry per metre)
I1=80                    #Current in the first wire(in Amperes)
I2=30                    #Current in the second wire(in Amperes)

#Calculations:
F=(abs_per*I1*I2)/(2*pi*r)

#Result:
print "The magnitude of the force between the two wires is %e N/m." %(F)
print "Since the two currents are in the same direction,the force will be attractive."

The magnitude of the force between the two wires is 2.400000e-04 N/m.
Since the two currents are in the same direction,the force will be attractive.


## Example 5.4,Page number: 148¶

In [6]:
#Question:
"""Finding the force due to current flowing in two straight,parallel wires."""

from math import pi

#Variable Declaration:
I1=4.0                 #Current in the first wire(in Amperes)
I2=6.0                 #Current in the second wire(in Amperes)
r=3e-02                #Distance between the parallel current carrying wires(in metres)
abs_per=(4*pi)*(1e-07) #Absolute permeability of free space(in Henry per metre)

#Calculations:
F=(abs_per*I1*I2)/(2*pi*r)
l=15e-02
F_net=F*l

#Result:
print "The net force on 15cm(=0.15 m) section of wire B near its centre is %e N." %(F_net)
print "Since the currents are in opposite directions,the force F_net is repulsive."
print "It means that its direction is normal to wire A away from it."

The net force on 15cm(=0.15 m) section of wire B near its centre is 2.400000e-05 N.
Since the currents are in opposite directions,the force F_net is repulsive.
It means that its direction is normal to wire A away from it.


## Example 5.5,Page number: 154¶

In [8]:
#Question:
"""Finding the emf produced in a conductor placed in an uniform magnetic field."""

#Variable Declaration:
B=0.5                  #Magnitude of magnetic field(in Tesla)
l=20e-02               #Active length of the conductor(in metres)
v=5                    #Velocity of the conductor(in metres per second)

#Calculations:
angle_a=0
angle_b=90
angle_c=30

#Result:
print "(a)The emf induced in the straight conductor when its motion is parallel to the magnetic field is %.2f V." %(e_a)
print "(b)The emf induced in the straight conductor when its motion is perpendicular to the magnetic field is %.2f V." %(e_b)
print "(c)The emf induced in the straight conductor when its motion is at an angle 30 degrees to the magnetic field is %.2f V." %(e_c)

(a)The emf induced in the straight conductor when its motion is parallel to the magnetic field is 0.00 V.
(b)The emf induced in the straight conductor when its motion is perpendicular to the magnetic field is 0.50 V.
(c)The emf induced in the straight conductor when its motion is at an angle 30 degrees to the magnetic field is 0.25 V.


## Example 5.6,Page number: 154¶

In [12]:
#Question:
"""Finding the emf generated between the wing-tips of an aeroplane."""

#Variable Declaration:
l=52                      #Wing span of the aeroplane(in metres)
B=38e-06                  #Magnitude of magnetic field(in Tesla)
v=1100.0*(1000.0/3600.0)  #Velocity of the aeroplane(in metres per second)
angle=90                  #Angle between the magnetic field vector and the velocity vector(in degrees)

#Calculations:

#Result:
print "The emf generated between the wing tips is %.5f V." %(e)

The emf generated between the wing tips is 0.60378 V.


## Example 5.7,Page number: 154¶

In [13]:
#Question:
"""Finding the emf developed between the centre and the metallic ring."""

from math import pi

#Variable Declaration:
""" A=(1/2)*R*R*theta; where theta is the angle between the rod and the rod OP(in figure) at time t  """
B=1.0       #Magnitude of magnetic field(in Tesla)
R=1         #Radius of circular ring(in metres)
f=50        #Frequency of rotation(in revolutions per second)

""" B=d(flux)/dt= d(B*A)/dt= (1/2)*B*R*R*d(theta)/dt= (1/2)*B*R*R*ang_freq """

#Calculations:
ang_freq=2*pi*f
e=(1.0/2)*B*R*R*ang_freq

#Result:
print "The emf developed between the centre and the metallic ring is %.2f V." %(e)

The emf developed between the centre and the metallic ring is 157.08 V.


## Example 5.8,Page number: 155¶

In [15]:
#Question:
"""Finding the force needed to pull a rectangular loop placed in an uniform magnetic field."""

#Variable Declaration:
B=0.5                 #Magnitude of magnetic field(in Tesla)
w=3e-02               #Width of the rectangular loop(in metres)
l=10e-02              #Length of the rectangular loop(in metres)
v=1e-02               #Velocity of the rectangular loop(in metre per second)

#Calculations:
e1=B*w*v
t1=l/v
e2=B*l*v
t2=w/v
R=1e-03
F_a=(pow((B*w),2)*v)/R
F_b=(pow((B*l),2)*v)/R

#Result:
print "(a)The induced emf is %e V and the time for which the induced voltage lasts is %.2f secs." %(e1,t1)
print "(b)The induced emf is %e V and the time for which the induced voltage lasts is %.2f secs." %(e2,t2)
print "(c)Because of the gap,no current can flow.Hence there is no heat produced(or no I*I*R losses)."
print "   If we neglect friction,no force is required to pull the coil."
print "(d)The force required to pull the loop if it has no cut and has a resistance of 1 mill ohm is :"
print "   For fig (a): F=%e N." %(F_a)
print "   For fig (b): F=%e N." %(F_b)

(a)The induced emf is 1.500000e-04 V and the time for which the induced voltage lasts is 10.00 secs.
(b)The induced emf is 5.000000e-04 V and the time for which the induced voltage lasts is 3.00 secs.
(c)Because of the gap,no current can flow.Hence there is no heat produced(or no I*I*R losses).
If we neglect friction,no force is required to pull the coil.
(d)The force required to pull the loop if it has no cut and has a resistance of 1 mill ohm is :
For fig (a): F=2.250000e-03 N.
For fig (b): F=2.500000e-02 N.


## Example 5.9,Page number: 156¶

In [17]:
#Question:
"""Finding the magnetic field due  to a line caryying current."""

from math import pi

#Variable Declaration:
I=90.0                #Current flowing through the line(in Amperes)
x=1.5                 #Distance of point of observation from the line(in metres)

#Calculations:
abs_per=(4*pi)/(1e07)
B=(abs_per*I)/(2*pi*x)

#Result:
print "The magnetic field due to the current at a point 1.5 m below the line is %e T." %(B)
print "By applying the right-hand thumb rule,we find that the direction of the magnetic field is from north to south."

The magnetic field due to the current at a point 1.5 m below the line is 1.200000e-05 T.
By applying the right-hand thumb rule,we find that the direction of the magnetic field is from north to south.


## Example 5.10,Page number: 156¶

In [18]:
#Question:
"""Finding the force per unit length on a current carrying wire."""

#Variable Declaration:
I=8.0                 #Current flowing through the wire(in Amperes)
B=0.15                #Magnitude of uniform magnetic field(in Tesla)
angle=30              #Angle between the direction of current and the uniform magnetic field(in degrees)

#Calculations:

#Result:
print "The force per unit length of the wire is %.2f N/m." %(Fu)

The force per unit length of the wire is 0.60 N/m.


## Example 5.11,Page number: 156¶

In [29]:
#Question:
"""Finding the torque experienced by a square coil."""

#Variable Declaration:
I=12.0                #Current flowing through the square coil(in Amperes)
N=20.0                #Number of turns in the square coil
l=10e-02              #Length of each side of the square coil(in metres)
B=0.8                 #Magnitude of uniform horizontal magnetic field(in Tesla)
angle=30.0            #Angle made by normal to the plane of the coil with the direction of horizontal magnetic field(in degrees)

#Calculations:
F=I*B*l*N
T=F*x

#Result:
print "The torque experienced by the coil is %.3f Nm." %(T)

The torque experienced by the coil is 0.960 Nm.


## Example 5.12,Page number: 156¶

In [31]:
#Question:
"""Finding the net force on a rectangular loop."""

from math import pi

#Variable Declaration:
I1=15.0               #Current carried by the rectangular loop(in Amperes)
I2=25.0               #Current carried by the straight conductor(in Amperes)
l=25e-02              #Length of the rectangular loop(in metres)
w=10e-02              #Width of the rectangular loop(in metres)
r=2e-02               #Separation between the nearer side of the loop and the conductor(in metres)

#Calculations:
abs_per=(4*pi)/(1e07)
"""Parts AD and BC do not experience any force,since these conductors are at right angles to the long straight conductor.

The current I1 in AB and the current I2 in the straight conductor are in the same direction.
Hence,the force F_AB is attractive."""

F_AB=((abs_per*I1*I2)/(2*pi*r))*l

"""  The current I1 in CD and the current I2 in the straight conductor are in opposite directions.
Hence,the force F_CD is repulsive."""

F_CD=((abs_per*I1*I2)/(2*pi*(r+w)))*l
F_net=F_AB-F_CD

#Result:
print "The net force on the rectangular loop is %.5f mN." %(F_net*1000.0)

The net force on the rectangular loop is 0.78125 mN.


## Example 5.13,Page number: 157¶

In [24]:
#Question:
"""Finding the location of a point where the resultant magnetic field is zero."""

from math import pi

#Variable Declaration:
I=10.0                #Current flowing through the wire(in Amperes)
B=2.0e-03             #Horizontal component of Earth's magnetic field(in Tesla)

#Calculations:
""" To make the resultant magnetic field zero,the magnetic filed produced by the long vertical wire must be equal and opposite
to the horizontal component of Earth's magnetic field.This is possible at a point P,west of the wire. """

abs_per=(4*pi)/(1e07)
x=(abs_per*I)/(2*pi*B)

#Result:
print "The distance between the required point from the wire is %e m,to the west of the wire." %(x)

The distance between the required point from the wire is 1.000000e-03 m,to the west of the wire.


## Example 5.14,Page number: 157¶

In [22]:
#Question:
"""Finding the force per unit length between two current carrying wires."""

from math import pi

#Variable Declaration:
I=300.0               #Current flowing through each wire(in Amperes)
r=1.5e-02             #Separation between the wires(in metres)
l=70e-02              #Length of each wire(in metres)

#Calculations:
abs_per=(4*pi)/(1e07)
"""Since the length of the wires is 70 cm and their separation is only 1.5 cm(i.e, l>>r),
we can conclude that for the given separation the two wires are infinitely long. """
F=(abs_per*I*I)/(2*pi*r)

#Result:
print "The force per unit length between the two wires is %.2f N/m." %(F)
print "Since the currents in the two wires are in the opposite directions,the force between them will be repulsive."""

The force per unit length between the two wires is 1.20 N/m.
Since the currents in the two wires are in the opposite directions,the force between them will be repulsive.


## Example 5.15,Page number: 158¶

In [21]:
#Question:
"""Finding the counter torque to prevent a coil from turning."""

#Variable Declaration:
N=30.0                #Number of turns in the circular coil
r=8e-02               #Radius of circular coil(in metres)
I=6.0                 #Current flowing through the circular coil(in Amperes)
B=1.0                 #Magnitude of uniform magnetic field(in Tesla)
angle=60              #Angle made by the field lines with the normal to the coil(in degrees)

#Calculations:
"""The counter torque required to prevent the coil from moving must be equal(and opposite) to the torque developed."""
A=pi*r*r

#Result:
print "The counter torque that must be applied to prevent the coil from turning is %.2f Nm." %(tor)

The counter torque that must be applied to prevent the coil from turning is 3.13 Nm.


## Example 5.16,Page number: 158¶

In [19]:
#Question:
"""Finding the maximum voltage induced in a coil."""

#Variable Declaration:
A=300e-04             #Area of circular coil(in square-m)
N=25.0                #Number of turns in the circular coil
w=40.0                #Angluar frequency(in radians per second)
B=0.05                #Magnitude of uniform magnetic field(in Tesla)

#Calculations:
Em=N*B*A*w

#Result:
print "The maximum value of emf induced in the coil is %.2f V." %(Em)

The maximum value of emf induced in the coil is 1.50 V.


## Example 5.17,Page number: 158¶

In [32]:
#Question:
"""Finding the induces emf in a circular conducting loop."""

from math import pi

#Variable Declaration:
B=0.02                #Magnitude of uniform magnetic field(in Tesla)
r=2e-02               #Radius of the circular loop(in metres)
rate=1.0e-03          #Rate of shrinking of the radius(in metre per second)

#Calculations:
""" flux=B*A; A=(pi*r*r);
e=d(flux)/dt;

e=(B*pi*2*r)*(dr/dt);  """

e=B*pi*2*r*rate

#Result:
print "The emf induced in the loop at an instant when the radius is 2 cm is %e V." %(e)

The emf induced in the loop at an instant when the radius is 2 cm is 2.513274e-06 V.