In [1]:

```
#INPUT DATA
P = 4; #no of poles
N1 = 500; #no of turns per pole
phi = 0.02; #magnetic flux in wb/pole
t = 0.02; #time in sec
rphi = 0.002; #residual flux in wb/pole
#CALCULATIONS
N = P*N1; #total no of turns
di = P*phi; #total initial flux in wb
dR = P*rphi; #total residual flux in wb
dphi = di-dR; #change in flux in wb
dt = 0.02; #time of opening the circuit in sec
E = N*(dphi/dt); #induced emf in volts
#OUTPUT
print "Thus the average voltage that is induced across field terminals is %4.0f volts "%(E);
print "The direction of this emf is the same as that of the original direction of the exciting current";
```

In [2]:

```
#INPUT DATA
R = 150; #resistance of the coil in ohms
phi1 = 0.1; #magnetic flux in milli webers
N = 500; #no of turns
Rgal = 450; #resistance of galvanometer in ohms
dt = 0.1; #time in sec required to move coil from given field(m) to another field (m2)
phi2 = 0.3; #magnetic flux of new field in milli webers
#CALCULATIONS
dphi = phi2-phi1; #change of flux in milli webers
E = N*(dphi/dt)*10**-3; #average induced emf in volts(V)
I = E/(R+Rgal); #average induced current in coil in amperes(A)
#OUTPUT
print 'Average induced emf and current are %1.0f V and %1.4f A'%(E,I);
```

In [4]:

```
import math
#INPUT DATA
l = 0.1; #conductor length (10 cm) = (0.1 m)
I = 60; #current in amperes (A)
H = 1000; #magnetic field strength in ampere/metre (A/m)
v = 1; #conductor speed in metre/second(m/s)
u0 = 4*math.pi*10**-7; #permeability in free space in henry/m
#CALCULATIONS
B = u0*1000; #magnetic flux density in (wb/m**2)
F = B*I*l; #force in Newtons(N)
P = F*v; #power in watt
E = B*l*v; #emf induced in conductor
#OUTPUT
print "The force acting on conductor %1.4f N "%(F);
print "The mechanical power to move this conductor is %1.4f watt "%(P);
print "The induced emf in conductor is %1.5f V "%(E);
```

In [1]:

```
import math
#INPUT DATA
l = 0.3; #mean length of toroidal coil in meters (30cm = 0.3m)
N = 480; #no of turns of coil
a = 5*10**-4; #cross sectional area in metres (1 cm**2 = 10**-4 m**2)
I = 4; #current in amps
dt = 60*10**-3; #time in sec
u0 = 4*math.pi*10**-7; #permeability in free space in henry/m
ur = 1; #relative permeability for air
#CALCULATIONS
L = (u0*ur*a*N*N)/(l); #inductance of coli in henry
di = I-(-I); #change in current in amps
E = L*(di/dt); #average induced emf
#OUTPUT
print 'The inductance of the coil is %1.6f H '%(L)
print 'average induced emf is %1.3f V '%(E)
```

In [2]:

```
import math
#INPUT DATA
L1 = 0.25; #self inductance of coil in henry(H)
N1 = 500; #no of turns of coil 1
N2 = 10500; #no of turns of coil 2
phi2 = 0.6*L1; #60 % of flux of first coil(m1) is linked with second coil(m2)
z = 100; #rate of change of current(dii/dt) in A/sec
#CALCULATIONS
x = L1/N1; #flux/ampere in first coil(phi1/I1)
y = 0.6*(x); #flux linking the second coil(phi2/I1)
M = N2*(y); #mutual inductance between the two coils in H
E = M*(z); #induced emf in V
#OUTPUT
print "Thus the mutual inductance between two coils is %1.2f H "%(M);
print "The induced emf in second coil when current changes in first coil is %3.0f V "%(E);
```

In [5]:

```
import math
#INPUT DATA
N1 = 250; #no of turns in a coil
I1 = 2; #current in coil in A
phi1 = 0.3; #flux in coil in wb
dt = 2 #time in millisec
Em2 = 63.75 #induced voltage in V
K = 0.75
#CALCULATIONS
L1 = N1*(phi1/I1); #self inductance of first coil in H
M = Em2*(dt/I1); #mutual inductance of two coils in H
L2 = ((Em2/K)**2)/(L1); #self inductance of second coil in H
phi2 = K*phi1; #flux in second coil in wb
N2 = (Em2*dt)/phi2; #no of turns in second coil
#OUTPUT
print "Thus the self inductance of first coil is %2.1f mH "%(L1);
print "mutual inductance of two coils %2.2f mH "%(M);
print "self inductance of second coil %4.0f mH "%(L2);
print "no of turns in second coil %3.0f turns "%(N2);
#note:the answer given for N2 in textbook is wrong .please check the calculations
```

In [6]:

```
import math
#INPUT DATA
l = 1; #length of wire in m
v = 50; #velocity in m/sec
B = 1; #magnetic flux density in wb/m**2
theta1 = 90; #the angle of conductor in degrees to the field in case 1
theta2 = 30; #the angle of conductor in degrees to the field in case 2
#CALCULATIONS
E1 = B*l*v*math.sin (theta1*math.pi/180); #emf induced in conductor in case 1(1degree = 3.14/180 radians)
E2 = B*l*v*math.sin ((360+theta2)*math.pi/180); #emf induced in conductor in case 2(1degree = 3.14/180 radians)
#OUTPUT
print "Thus the emf induced in case 1 is %2.0f volts "%(E1);
print "Thus the emf induced in case 2 is %2.0f volts "%(E2);
#note:convert angle in degrees to radians and compute it.
```

In [7]:

```
import math
#INPUT DATA
N = 1000; #no of turns in a coil
a = 10*10**-4; #crossectional area in m**2
i1 = 4.2; #current in A in case 1
i2 = 9.2; #current in A in case 2
B1 = 1; #flux density in wb/m**2 when current is i1
B2 = 1.42; #flux density in wb/m**2 when current is
dt = 0.05; #time in sec where current reduces from 9.2A to 4.2A
#CALCULATIONS
db = (B2-B1) #difference in flux densities
di = (i2-i1); #difference in currents
di1 = (i1-i2); #difference in currents
L = N*a*(db)/di; #average inductance between the limits in H
E = -(L*di1/dt); #emf induced
#OUTPUT
print "Thus the average inductance between the limits is %1.3f H "%(L);
print "emf induced is %1.1f volts"%(E);
```

In [8]:

```
import math
#Chapter-3, Example 3.9, Page 113
#INPUT DATA
N1 = 1600; #no of turns of solenoid
l = 0.5; #length of wire of solenoid in m
N2 = 600; #no of turns of second coil
a = 18*10**-4; #area of second coil in m**2
u0 = 4*math.pi*10**-7; #permeability in free space
z = 300; #rate of change of current(di1/dt) in A/sec
#CALCULATIONS
B = (u0*N1)/(l); #flux density in solenoid
M = (B*a*N2); #mutual inductance in mH
E = M*(z); #voltage induced
#OUTPUT
print "Thus the mutual inductance is %f H "%(M);
print "Thus the voltage induced is %f V "%(E);
#note:answer given for voltage in text book is wrong.please check the calculations
```

In [9]:

```
import math
#INPUT DATA
NA = 15000; #no of turns in coil A
IA = 6; #current in coil A in Amp(A)
phiA = 0.05*10**-3; #flux in coil A in wb
NB = 12000; #no of turns in coil B
IB = 6; #current in coil B in Amp(A)
phiB = 0.08*10**-3; #flux in coil B in wb
phiAB = 0.55*0.05*10**-3; #mutual flux in wb
#CALCULATIONS
LA = phiA*NA/IA; #self inductance of coil A in H
LB = phiB*NB/IB; #self inductance of coil B in H
LAB = phiAB*NB/IB; #mutual inductance of coils in H
K = LAB/math.sqrt(LA*LB); #coefficient of coupling
#OUTPUT
print "Thus the self inductance of coil A is %1.3f H"%(LA);
print "Thus the self inductance of coil B is %1.2f H "%(LB);
print "Thus the mutual inductance of coils is %1.3f H "%(LAB);
print "Thus the coefficient of coupling is %1.3f "%(K)
```