In [1]:

```
#Variable declaration
A = 6e-04; # Cross-sectional area of pole face, metre-square
phi = 30e-06; # Flux, Wb
#Calculations
B = phi/A; # Flux density, T
#Result
print "The flux density at the pole face = %2d mT"%(B/1e-03)
```

In [2]:

```
#Variable declaration
A = 45e-06; # Cross sectional area of pole face, metre-square
B = 0.6; # Flux density, T
#Calculations
# Using formula B = phi/A, solving for phi
phi = B*A; # Flux, Wb
#Result
print "The flux produced by pole face = %2d micro-wWb"%(phi/1e-06);
```

In [3]:

```
#Variable declaration
N = 1500; # Number of turns in a coil
A = 5e-04; # Cross- sectional area of of coil, metre-square
phi = 0.2e-03; # Flux, Wb
I = 0.75; # Coil-current, A
#Calculations
# Since m.m.f is the product of the current and the number of turns, therefore, we have
F = N*I; # Magnetomotive force, At
B = phi/A; # Flux density, T
#Result
print "The m.m.f and flux density produced are %4d At and %3.1f T respectively"%(F, B);
```

In [4]:

```
#Variable declaration
N = 600; # Number of turns in a coil
F = 1500.; # Magnetomotive force, At
#Calculations
# Since magnetomotive force,F = N*I, solving for I
I = F/N; # Excitation-current, A
#Result
print "The excitation current required = %3.1f A"%I;
```

In [5]:

```
import math
#Variable declaration
I = 0.4; # Current, A
N = 550; # Number of turns in a coil
d = 8e-02; # Diameter, m
l = (math.pi*d); # Average length of the magnetic circuit, m
#Calculations
# Since magnetic field strength is defined as the mmf per metre length of the magnetic circuit, therefore, we have
H = (N*I)/l; # Magnetic field strength, At/m
#Result
print "The magnetic field strength inside the toroid = %6.2f At/m"%H
```

In [6]:

```
#Variable declaration
A = 15e-04; # Cross-sectional area of core, metre-square
mew_r1 = 65; # Relative permeability of core
phi_1 = 2e-04; # Flux, Wb
mew_r2 = 800.; # Changed relative permeability of core
#Calculations
B_1 = phi_1/A; # Flux density, T
mew_r = mew_r2/mew_r1; # Relative permeability of core
# Since cross-sectional area of core A remains constant, therefore, we have mew_r = B_1/B_2 , solving for B_2
B_2 = mew_r*B_1; # New flux density, T
# Since B_2 = phi_2/A, solving for phi_2
phi_2 = B_2*A; # New flux, Wb
#Result
print "The new flux and flux density are %5.3f mWb and %5.3f T respectively"%(phi_2/1e-03, B_2);
```

In [8]:

```
import math
#Variable declaration
r = 0.04; # Mean radius of torod, m
A = 3e-04; # Csa of toroid, m^2
mew_o = 4*(math.pi)*1e-07; # Permeability of free space
mew_r = 150; # Relative permeability of toroid
N = 900; # Number of turns on coil
I = 1.5; # Coil current, A
l = 2*(math.pi)*r; # Effective length of toroid, m
#Calculations&Results
# Part (a)
# Since m.m.f is the product of the current and the number of turns, therefore, we have
F = N*I; # Magnetomotive force, At
print "The m.m.f of toroid = %4d At"%F
# Part (b)
# Since magnetic field strength is defined as the mmf per metre length of the magnetic circuit, therefore, we have
H = F/l; # Magnetic field strength, At/m
print "The magnetic field strength = %6.1f At/m"%H;
# Part (c)
B = (mew_r*mew_o*H); # Flux density, T
phi = B*A; # Flux, Wb
print "The flux and flux density are %6.2f micro-weber and %6.4f T respectively"%(phi/1e-06,B)
```

In [9]:

```
import math
#Variable declaration
r = 3e-02; # Radius of toroid, m
A = 4.5e-04; # Cross-sectional area of toroid, metre-square
N = 500; # Number of turns
phi = 250e-06; # Flux, Wb
mew_o = 4*(math.pi)*(1e-07); # Permeability of free space
mew_r = 300; # Relative permeability
#Calculations
l = 2*(math.pi)*r; # Effective length, m
B = phi/A; # Flux density, T
# Since B = (mew_r)*(mew_o)*H, solving for H
H = B /((mew_r)*(mew_o)); # Magnetic field strength, At/m
# Since H = F/l, solving for F
F = H*l; # Magnetomotive force, At
# Since mmf,F = N*I, solving for I
I = F/N; # Electric current, A
#Result
print "The value of current needs to be passed through the coil = %4.2f A"%I
```

In [10]:

```
import math
#Variable declaration
# Part (a)
I = 0.2; # Electric current, A
l = 5e-02; # Effective length, m
A = 7e-04; # Cross-sectional area, metre-square
d = 0.5e-03; # Diameter, m
mew_r = 1; #Relative permeability for wood
#Calculations
mew_o = 4*(math.pi)*1e-07; # Permeability for free space
N = l/d; # Number of turns
# Since mmf is the product of the current and the number of turns, therefore, we have
F = N*I; # Magnetomotive force, At
# Part (b)
# Since magnetic field strength is defined as the mmf per metre length of the magnetic circuit, therefore, we have
H = F/l; # Magnetic field strength, At/m
B = ( mew_r * mew_o * H ); # Flux density, T
# Part (c)
phi = B * A; # Flux, Wb
#Result
print "The mmf produced = %2d At"%F
print "The flux density produced = %3d micro-tesla"%(B/1e-06);
print "The flux produced = %5.3f micro-weber"%(phi/1e-06);
```

In [11]:

```
import math
#Variable declaration
N = 1000; # Number of turns on coil
r = 0.1; # Mean radius of toroid, m
phi = 0.1775e-03; # Flux density(value from graph), Wb
A = math.pi*1e-04; # Csa of toroid, m^2
H = 88; # Magnetic field strength(value from graph), At/m
B = phi/A; # Flux density, T
#Calculations&Results
# Part (a)
l = 2*math.pi*r; # Effective length of toroid, m
# Since H = (N*I)/l, solving for I
I = (H*l)/N ; # Electric current in coil, A
print "Coil current = %4.1f mA"%(I/1e-03);
# Part (b)
mew_o = 4*(math.pi)*1e-07; # Permeability for free space
# Since B = mew_o * mew_r * H, solving for mew_r
mew_r = B/(mew_o*H); #Relative permeability of toroid
print "The relative permeability of toroid = %4d"%mew_r;
```

In [12]:

```
import math
#Variable declaration
mew_o = 4*(math.pi)*1e-07; # Permeability for free space
l = 0.15; # Mean length, m
N = 2500; # Number of turns
I = 0.3; # Electric current, A
#Calculations
# Since magnetic field strength is defined as the mmf per metre length of the magnetic circuit, therefore, we have
H = (N*I)/l; # Magnetic field strength, At/m
B = 0.75; # Flux density( value taken from graph ), T
# Since B = ( mew_r * mew_o * H ), solving for mew_r
mew_r = B/(mew_o * H); # Relative permeability
#Results
print "The flux density of given toroid = %3.2f T "%B
print "The relative permeability of given toroid = %5.1f"%mew_r
```

In [13]:

```
import math
#Variable declaration
mew_o = 4*(math.pi)*1e-07; # Permeability for free space
l = 0.1875; # Mean length, m
A = 8e-05; # Cross- sectional area of of coil, metre-square
N = 750; # Number of turns
phi = 112e-06; # Flux, Wb
l_gap = 0.5e-03; # Average length of the magnetic circuit,m
B = phi/A; # Flux density, Wb
H = 2000; # Magnetic field strength( value taken from graph ), At/m
#Calculations
F_Fe = H*l; # The m.m.f in the iron part of the circuit, At
# Since F = I*N, solving for I
I = F_Fe/N; # Coil current under normal conditions, A
# Since B = mew_o * H_gap, solving for H_gap
H_gap = B/mew_o; # Magnetic field strength, At/m
# Since H_gap = F_gap/l_gap, solving for F_gap
F_gap = H_gap * l_gap; # The mmf in the air part of the circuit, At
F = F_Fe + F_gap; # Total circuit mmf, At
I_new = F/N; # Current required to maintain the flux at its original value, A
#Results
print "The coil current required to produce a flux of %3d micro-weber in the toroid = %3.1f A "%(phi/1e-06, I);
print "Current required to maintain the flux at its original value = %5.3f A"%(I_new);
```

In [14]:

```
#Variable declaration
l_A = 0.25; # Mean length of circuit A, m
l_B = 0.15; # Mean length of circuit A, m
A_A = 11.5e-04; # Cross-sectional area of circuit A, metre-square
A_B = 12e-04; # Cross-sectional area of circuit B, metre-square
phi = 1.5e-03; # Flux, Wb
N = 1000; # Number of turns
#Calculations
B_A = phi/A_A; # Flux density linked with circuit A, T
B_B = phi/A_B; # Flux density linked with circuit B, T
H_A = 1470; # Magnetic field strength of circuit A( value taken from graph ), At/m
H_B = 845; # Magnetic field strength of circuit B( value taken from graph ), At/m
# Since H = F/l, solving for F
F_A = H_A * l_A; # Magnetic field strength of circuit A, At/m
F_B = H_B * l_B; # Magnetic field strength of circuit B, At/m
F = F_A + F_B; # Total circuit m.m.f, At/m
I = F/N; # Coil current, A
#Result
print "Coil current in the magnetic circuit = %5.3f A"%I
```

In [15]:

```
import math
#Variable declaration
A = 8e-04; # Cross-sectional area, metre-square
d = 24e-02; # Mean diameter of iron ring, m
phi = 1.2e-03; # Flux, Wb
mew_r = 1200; # Relative permeability
mew_o = 4*(math.pi)*1e-07; # Permeability for free space
mew_air = 1; # Permeability for air
l_gap = 3e-03; # Mean length, m
#Calculations
l_Fe = (math.pi) * d; # Mean length of iron circuit, m
S_Fe = l_Fe/(mew_r * mew_o *A); # Reluctance of iron circuit, At/Wb
S_gap = l_gap/(mew_air * mew_o *A); # Reluctance of gap, At/Wb
S = S_Fe + S_gap; # Total circuit reluctance, At/Wb
# Since phi = F/S, solving for F
F = phi*S; # Magnetomotive force, At
#Result
print "The required mmf = %5.1f At"%F
```

In [16]:

```
import math
#Variable declaration
N = 500; # Number of turns on first section's coil
phi = 2e-03; # Flux produced by first section, Wb
l_1 = 85e-02; # Length of first section, m
l_2 = 65e-02; # Length of second section, m
l_3 = 0.1e-02; # Length of third section, m
A_1 = 10e-04; # Csa of first section, m^2
A_2 = 15e-04; # Csa of second section, m^2
A_3 = 12.5e-04; # Csa of second section, m^2
mew_o = 4*(math.pi)*1e-07; # Permeability for free space
mew_r1 = 600; # Relative permeability of first section
mew_r2 = 950; # Relative permeability of second section
mew_r3 = 1; # Relative permeability of third section
#Calculations&Results
# Part (a)
S_1 = l_1/(mew_r1 * mew_o * A_1); # Reluctance of first section, At/Wb
S_2 = l_2/(mew_r2 * mew_o * A_2); # Reluctance of first section, At/Wb
S_3 = l_3/(mew_r3 * mew_o * A_3); # Reluctance of first section, At/Wb
S = S_1 + S_2 + S_3; # Total reluctance of the circuit, At/Wb
print "Total reluctance of the circuit = %4.2fe+06 At/Wb"%(S*1e-06);
# Part (b)
# Since phi = F/S, solving for F
F = phi*S; # Magnetomotive force, At
# Since F = N*I, solving for I
I = F/N; # Electric current in first section, A
print "Electric current in first section = %4.2f A"%I
```