In [1]:

```
#Question:
"""Finding the emf induced in a coil."""
#Variable Declaration:
L=4 #Self inductance of the coil(in Henry)
di=4-10 #Change in current(in Amperes)
dt=0.1 #Time interval(in seconds)
#Calculations:
e=-L*(di/dt)
#Result:
print "The emf induced in the coil is %.2f V." %(e)
```

In [2]:

```
#Question:
"""Finding the inductance of a coil."""
#Variable Declaration:
N=150 #Number of turns in the coil
flux=0.01 #Flux linked with the coil(in Webers)
I=10 #Current in the coil(in Amperes)
#Calculations:
L=(N*flux)/I
di=-10-(10)
dt=0.01
e=-L*(di/dt)
#Result:
print "The inductance of the coil is %.2f H." %(L)
print "The induced emf is %.2f V." %(e)
```

In [3]:

```
#Question:
"""Finding the inductance of the coil and the emf induced."""
#Variable Declaration:
N=100 #Number of turns in the coil
#Calculations:
dflux=-0.4-0.4
di=-10-10
L=N*(dflux/di)
dt=0.01
e=-(L*(di/dt))/1000
#Result:
print "The inductance of the coil is %.2f mH." %(L)
print "The induced emf is %.2f V." %(e)
```

In [11]:

```
#Question:
"""Finding the energy stored in an air-cored solenoid."""
from math import pi,pow
""" All quantities expresssed in SI System."""
#Variable Declaration:
l=0.30 #Length of the solenoid(in metres)
d=0.015 #Internal diameter of the solenoid(in metres)
r=0.0075 #Internal radius of the solenoid(in metres)
N=900 #Number of turns in the coil
#Calculations:
A=pi*pow(r,2)
L=(pow(N,2)*4*pi*A)/(0.30*10000000)
I=5
W=0.5*L*pow(I,2)
#Result:
print "The inductance of the air-cored solenoid is %.2f mH." %(L*1000)
print "The amount of energy stored in the air-cored solenoid is %.2f mJ." %(W*1000)
```

In [13]:

```
#Question:
"""Finding the relative permeability of iron and the inductance of a coil."""
from math import pow,pi
#Variable Declaration:
r=0.01 #Radius of circular ring(in metres)
A=pi*pow(r,2) #Area of circular ring(in square metres)
N=3000 #Number of turns in the coil
I=0.5 #Current in the coil(in Amperes)
l=20.0/100 #Length of the iron rod(in metres)
B=1.2 #Magnitude of magnetic field(in Tesla)
#Calculations:
H=(N*I)/l
per=B/H
rel_per=(per*10000000)/(4*pi)
L=(N*B*A)/I
dflux=(0.1-1)*A*B
dt=0.01
e=-N*(dflux/dt)
#Result:
print "(a)The permeability of iron is %e Tm/A." %(per)
print "(b)The relative permeability of iron is %d." %(rel_per)
print "(c)The inductance of the coil is %.2f H." %(L)
print "(d)The voltage in the coil is %.2f V." %(e)
```

In [14]:

```
#Question:
"""Finding the potential difference across the terminals of a coil."""
#Variable Declaration:
R=3 #Resistance of the coil(in Ohms)
i=1 #Current in the coil(in Amperes)
di=10000 #Change in current(in Amperes)
dt=1 #Time interval(in seconds)
L=0.1/1000 #Self inductance of the coil(in Henry)
#Calculations:
V=(i*R)+(L*(di/dt))
#Result:
print "The potential difference that exists across the terminals of the coil is %.2f V." %(V)
```

In [16]:

```
#Question:
"""Finding the mutual inductance and emf induced in a search coil."""
from math import pi,pow
#Variable Declaration:
N1=2000 #Number of turns in the solenoid
N2=500 #Number of turns in the search coil
l=0.70 #Length of the solenoid(in metres)
k=1 #Coefficient of coupling
A=30.0/10000 #Mean area of the search coil(in square metres)
#Calculations:
per=(4*pi)/10000000.0
M=(k*N1*N2*per*A)/l
di1=260.0
dt=1
e=M*(di1/dt)
#Result:
print "(a)The mutual inductance is %.4f mH." %(M*1000)
print "(b)The emf induced in the search coil is %.2f V." %(e)
```

In [17]:

```
#Question:
"""Finding the mutual inductance and the coefficient of coupling between two coils."""
from math import pow,sqrt
#Variable Declaration:
N1=600.0 #Number of turns in the first coil
N2=1700.0 #Number of turns in the second coil
flux2=0.8/1000 #Magnetic flux produced in the second coil(in Webers)
I2=6 #Current in the second coil(in Amperes)
#Calculations:
L2=(N2*flux2)/I2
L1=L2*pow((N1/N2),2)
flux21=0.5/1000
k=flux21/flux2
M=k*sqrt(L1*L2)
#Result:
print "L1=%.4f H." %(L1)
print "L2=%.4f H." %(L2)
print "The coefficient of coupling(k)=%.4f." %(k)
print "M=%.4f H." %(M)
```

In [19]:

```
#Question:
"""Finding the mutual inductance and the coefficient of coupling between two coils."""
from math import sqrt
#Variable Declaration:
N1=1200.0 #Number of turns in the first coil
flux1=0.25/1000 #Magnetic flux produced in the first coil(in Webers)
I1=5 #Current in the first coil(in Amperes)
N2=800.0 #Number of turns in the second coil
flux2=0.15/1000 #Magnetic flux produced in the second coil(in Webers)
I2=5 #Current in the second coil(in Amperes)
#Calculations:
L1=(N1*flux1)/I1
L2=(N2*flux2)/I2
k=0.6
flux12=k*flux1
M=(N2*flux12)/I1
k_new=M/sqrt(L1*L2)
#Result:
print "The mutual inductance(M) is %.4f H." %(M)
print "The coefficient of coupling is %.4f." %(k_new)
```

In [20]:

```
#Question:
"""Finding the mutual inductance and the coefficient of coupling between two coils."""
from math import sqrt
#Variable Declaration:
Lsa=1.4/1000 #Net inductance in series-aiding connections(in Henry)
Lso=0.6/1000 #Net inductance in series-opposing connections(in Henry)
#Calculations:
M=(Lsa-Lso)/4
"""Lsa=L1+L2+2M
L1+L2=1 mH; As the two coils are similar L1=L2=0.5mH """
L1=0.5/1000
L2=0.5/1000
k=M/sqrt(L1*L2)
#Result:
print "The mutual inductance is %.2f mH." %(M*1000)
print "The coefficient of coupling(k) is %.2f." %(k)
```

In [21]:

```
#Question:
"""Finding the mutual inductance and the self-inductances of two coils. """
from math import sqrt
""" Equation 1 is L1+L2+(2*M)=1.8;
Equation 2 is L1+L2-(2*M)=0.8. """
#Variable Declaration:
k=0.6 #Coefficient of coupling
eq1=1.8 #Net inductance when fluxes are in same direction(in Henry)
eq2=0.8 #Net inductance when fluxes are in opposite direction(in Henry)
#Calculations:
M=(eq1-eq2)/4
sum=(eq1+eq2)/2
product=(M*M)/(k*k)
diff=sqrt((sum*sum)-(4*product))
L1=(sum+diff)/2
L2=(sum-diff)/2
#Result:
print "The mutual inductance of the two coils is %.3f H." %(M)
print "The self inducatnce of the first coil is %.3f H and the self inductance of the second coil is %.3f H." %(L1,L2)
```

In [25]:

```
#Question:
"""Finding the equivalent inductance of a combination of inductances connected in parallel."""
from math import sqrt
#Variable Declaration:
k=0.433 #Coefficient of coupling
L1=8 #Self-inductance of the first coil
L2=6 #Self-inductance of the second coil
#Calculations:
M=k*sqrt(L1*L2)
Lpa=((L1*L2)-(M*M))/(L1+L2-(2*M))
Lpo=((L1*L2)-(M*M))/(L1+L2+(2*M))
#Result:
print "(a)The equivalent inductance such that the mutual induction assists the self induction is %.3f H." %(Lpa)
print "(b)The equivalent inductance such that the mutual induction opposes the self induction is %.3f H." %(Lpo)
```

In [27]:

```
#Question:
"""Finding the number of turns in an air-cored coil."""
from math import sqrt
#Variable Declaration:
l=2.5e-02 #Length of the coil(in metres)
A=2e-04 #Average cross-sectional area of the coil(in square-metres)
L=400e-06 #Self-inductance of the coil(in Henry)
#Calculations:
abs_per=(4*pi)/(1e07)
N=sqrt((L*l)/(abs_per*A))
#Result:
print "The number of turns in the air-cored coil is %d." %(round(N,0))
```

In [30]:

```
#Question:
"""Finding the mutual inductance between two coils and their self inductances."""
from math import sqrt
#Variable Declaration:
k=0.75 #Coefficient of coupling between two coils
I1=3.0 #Current in the first coil(in Amperes)
N1=250.0 #Number of turns in the first coil
flux1=4e-03 #Flux produced in the first coil(in Webers)
V2=70.0 #Voltage induced in the second coil due to first coil(in Volts)
di1=3.0 #Change in current in the first coil(in Amperes)
dt=3e-03 #Time interval(in seconds)
#Calculations:
L1=N1*(flux1/I1)
M=(V2*dt)/di1
L2=(M*M)/(k*k*L1)
N2=N1*sqrt(L2/L1)
#Result:
print "L1=%.4f H." %(L1)
print "L2=%.4f H." %(L2)
print "M=%.4f H." %(M)
print "N2=%d." %(round(N2,0))
```

In [42]:

```
#Question:
"""Finding the mean value of self inductance of a coil."""
#Variable Declaration:
N=1000.0 #Number of turns in the coil
A=20e-04 #Cross-sectional area of the coil(in square-metre)
I1=4.0 #First current(in Amperes)
B1=1.0 #Flux density associated with the first current(in Weber per sqyare-metre)
I2=9.0 #Second current(in Amperes)
B2=1.4 #Flux density associated with the first current(in Weber per sqyare-metre)
dt=0.05 #Time interval(in seconds)
#Calculations:
L1=(N*B1*A)/I1
L2=(N*B2*A)/I2
L=(L1+L2)/2.0
di=I2-I1
e=L*(di/dt)
#Result:
print "The mean value of inductance between the given current limits is %.4f H." %(L)
print "The emf induced in the coil is %.2f V." %(e)
```

In [44]:

```
#Question:
"""Finding the mutual inductance between two coils and their respective self-inductances."""
from math import pi,sqrt
#Variable Declaration:
N1=100.0 #Number of turns in the first coil
N2=150.0 #Number of turns in the second coil
A=125e-04 #Area of cross-section(in square-metres)
l=200e-02 #Mean length(in metres)
rel_per=2000.0 #Relative permeability of iron
k=1 #Coefficient of coupling
""" NOTE: As the two coils are wound side by side,there is tight coupling. Therefore, k=1. """
#Calculations:
abs_per=(4*pi)/(1e07)
L1=(N1*N1*rel_per*abs_per*A)/l
L2=(N2*N2*rel_per*abs_per*A)/l
M=k*sqrt(L1*L2)
di1=5.0
dt=0.02
e2=M*(di1/dt)
#Result:
print "(a)The self inductances of the tow coils are: L1=%.3f mH and L2=%.3f mH." %((L1*1000.0),(L2*1000.0))
print "(b)The mutual inductance between the two coils is %.3f mH." %(M*1000.0)
print "(c)The emf induced in the second coil is %.2f V." %(e2)
```

In [39]:

```
#Question:
"""Finding the coeffcient of coupling and the self-inductance of two coils."""
from math import sqrt
#Variable Declaration:
Lsa=4.0 #Equivalent inductance of series aiding(in Henry)
Lso=0.8 #Equivalent inductance of series opposing(in Henry)
""" NOTE: Lsa=L+L+(2*M);
Lso=L+L-(2*M); """
#Calculations:
L=(Lsa+Lso)/4.0
M=(Lsa-Lso)/4.0
k=M/sqrt(L*L)
#Result:
print "The self inductance of each coil is %.2f H." %(L)
print "The coefficient of coupling is %.3f." %(round(k,3))
```

In [35]:

```
#Question:
"""Finding the equivalent inductance of different combinations of two coils."""
from math import sqrt
#Variable Declaration:
L1=200e-03 #Self-inductance of the first coil(in Henry)
L2=800e-03 #Self-inductance of the second coil(in Henry)
k=0.5 #Coefficient of coupling between two coils
#Calculations:
M=k*sqrt(L1*L2)
Lsa=L1+L2+(2*M)
Lso=L1+L2-(2*M)
Lpa=((L1*L2)-(M*M))/Lso
Lpo=((L1*L2)-(M*M))/Lsa
#Result:
print "(a)The equivalent inductance of series aiding is %.3f mH." %(Lsa*1000.0)
print "(b)The equivalent inductance of series opposing is %.3f mH." %(Lso*1000.0)
print "(c)The equivalent inductance of parallel aiding is %.3f mH." %(Lpa*1000.0)
print "(d)The equivalent inductance of parallel opposing is %.3f mH." %(Lpo*1000.0)
```

In [31]:

```
#Question:
"""Finding the exciting current for a horse-shoe magnet."""
from math import sqrt
#Variable Declaration:
l=45e-02 #Length of the iron path(in metres)
A=6e-04 #Cross-sectional area of the wrought iron bar(in square-metres)
N=500.0 #Number of turns in exciting coil
load=60.0 #Load to be lifted(in kilograms)
rel_per=800.0 #Relative permeability of iron
g=9.8 #Accelaration due to gravity(in metre per square-seconds)
#Calculations:
abs_per=(4*pi)/(1e07)
F=(load/2.0)*g
B=sqrt((2*abs_per*F)/A)
H=B/(abs_per*rel_per)
At=H*l
I=At/(N*2)
#Result:
print "The exciting current needed for the magnet is %.5f A." %(I)
```