Electric Machinery Fundamentals 5th edition

Chapter 1 (Code examples)

Example 1-1:

Import the PyLab namespace (provides set of useful commands and constants like Pi)


In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

Define all the parameters:


In [2]:
l1 = 0.45                 # Length of region 1
l2 = 1.3                  # Length of region 2
a1 = 0.01                 # Area of region 1
a2 = 0.015                # Area of region 2
ur = 2500                 # Relative permeability
u0 = 4*pi*1e-7            # Permeability of free space
n = 200                   # Number of turns on core
i = 1                     # Current in amps

Calculate the first reluctance:


In [3]:
r1 = l1 / (ur * u0 * a1)

Calculate the second reluctance:


In [4]:
r2 = l2 / (ur * u0 * a2)

Calculate the total reluctance


In [5]:
rtot = r1 + r2

Calculate the mmf


In [6]:
mmf = n * i

Finally, get the flux in the core:


In [7]:
flux = mmf / rtot

Display the result:


In [8]:
print('r1 = {}'.format(r1))
print('r2 = {}'.format(r2))
print('Flux = {}'.format(flux))


r1 = 14323.944878270579
r2 = 27586.856802595194
Flux = 0.004772039473807281

(I'm using the new style PyFormat in order to make the output above a bit nicer.)