Electric Machinery Fundamentals 5th edition

Chapter 1 (Code examples)

Example 1-10

Calculate and plot the velocity of a linear motor as a function of load.

Import the PyLab namespace (provides set of useful commands and constants like $\pi$)


In [1]:
%pylab notebook


Populating the interactive namespace from numpy and matplotlib

Define all the parameters:


In [2]:
VB = 120.0    # Battery voltage (V)
r = 0.3       # Resistance (ohms)
l = 1.0       # Bar length (m)
B = 0.6       # Flux density (T)

Select the forces to apply to the bar:


In [3]:
F = arange(0,51,10)    # Force (N)
F   # Lets print the variable to check. 
# Can you exaplain why "arange(0,50,10)" gives not the array below?


Out[3]:
array([ 0, 10, 20, 30, 40, 50])

Calculate the currents flowing in the motor:


In [4]:
i = F / (l * B)   # Current (A)

Calculate the induced voltages on the bar:


In [5]:
eind = VB - i * r    # Induced voltage (V)

Calculate the velocities of the bar:


In [6]:
v_bar = eind / (l * B);   # Velocity (m/s)

Plot the velocity of the bar versus force:


In [8]:
plot(F, v_bar);
rc('text', usetex=True)   # enable LaTeX commands for plot
title(r'\textbf{Plot of velocity versus applied force}')
xlabel(r'\textbf{Force (N)}')
ylabel(r'\textbf{Velocity (m/s)}')
axis([0, 50, 0, 200])
grid()