Chapter 3: Electromechanical-Energy-Conversion-Principles

Example 3.1, Page number: 114

In [2]:
from __future__ import division
import math
from sympy import *

#Variable declaration:
I=10                            #current in the coil(A)
Bo=0.02                         #magnetic field (T)
R=0.05                          #radius of the rotor(m)
l=0.3                           #rotor length(m)


#Calculations:
q=symbols('q')                  #Direction of torque
F1=-2*I*l*Bo*sin(q)             #Force on the coil(N)
T=F1*R                          #Torque scting in theta direction(Nm)


#Results:
print "Force per unit length:",T,"Nm"
Force per unit length: -0.006*sin(q) Nm

Example 3.2, Page number: 121

In [3]:
from __future__ import division
from sympy import *


#Variable declaration
N=1000                   #No of winding turns
g=2                      #Air gap width(mm)
d=0.15                  #Magnetic core width,d (m)
l=0.1                    #thickness of core(0.1)
x,d=symbols('x d')       #where h is height of plunger(m) 
                         #Lx is inductance as a function of x(H)
i=10                     #Current in the winding(A)
uo=4*3.14*10**-7           #permeability of free space(H/m)

#Calculations:
Lx=(uo*N**2*l*d)/(2*g*10**-3)*(1-x/d)
Wfld=(1./2)*Lx*i**2


#Results:
print "The magnetic energy stored, Wfld:","236*(1-x/d) J"
The magnetic energy stored, Wfld: 236*(1-x/d) J

Example 3.3, Page number: 124

In [3]:
from __future__ import division
%matplotlib inline
import numpy as np
from pylab import *

#Variable declaration:
xdata=[0.0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6, 1.8, 2.0]     #(cm)
Ldata=[2.8, 2.26, 1.78, 1.52, 1.34, 1.26, 1.20, 1.16, 1.13, 1.11, 1.10]   #(mH)
I = 0.75                                                #(A)


#Calculations:
x=0.01*np.array(xdata)
L=0.001*np.array(Ldata)
length=len(x)
xmax=x[length-1]
a=polyfit(x,L,4)
xfit=[0]*102
Lfit=[0]*102
for n in range(1,102,1):
    xfit[n-1]=xmax*(n-1)/100
    Lfit[n-1]=a[0]*xfit[n-1]**4+a[1]*xfit[n-1]**3+a[2]*xfit[n-1]**2+a[3]*xfit[n-1]+a[4]

#Plot the data and then the fit to compare (convert xfit to cm and Lfit to mH)
plot(xdata,Ldata,'o')
plot(100*np.array(xfit),1000*np.array(Lfit),'g.')
xlabel('x [cm] ')
ylabel('L [mH] ')
title('Inductance,L vs length,l')
grid()
print "The required plots are shown below:"
show()

#set current to 0.75 A
I=0.75
F=[0]*102
for n in range(1,102,1):
    xfit[n-1]=0.002+0.016*(n-1)/100
    F[n-1]=4*a[0]*xfit[n-1]**3+3*a[1]*xfit[n-1]**2+2*a[2]*xfit[n-1]**1+a[3]
    F[n-1]=(I**2/2)*F[n-1]
plot(100*np.array(xfit),F,'b.')
xlabel('x  [cm]')
ylabel('Force [N]')
title('Force, F vs length,l')
grid()

#Results:
show()
The required plots are shown below:

Example 3.4, Page number: 128

In [5]:
from __future__ import division
from sympy import *

#Variable declaration:
Lo=10.6*10**-3                          #Initial inductance(H)
L2=2.7*10**-3                           #H


#Calculations:
theta,i=symbols('theta i')
L=Lo+L2*cos(2*theta)
i=2                                     #Coil current,A
def T(theta):
    return i**2*diff(L,theta)/2
                                    

#Results:
print "Torque,Tfld =",T(theta)," N.m"
Torque,Tfld = -0.0108*sin(2*theta)  N.m

Example 3.6, Page number: 134

In [29]:
from __future__ import division

#Variable declaration:
r1=2.5*10**-2                            #radius of rotor(m)
h=1.8*10**-2                             #Axial length(m)
g=3*10**-3                               #Air gap length(m)
Bag=1.65                                #Magnetic field(T)
uo=4*pi*10**-7                          #permeability of free space(H/m)

#Calculations:
H=Bag/uo
Ni=2*g*H
T=uo*(Ni)**2*h*(r1+0.5*g)/(4*g)

#Results:
print "The maximum torque:", round(T,2),"Nm"
The maximum torque: 3.1 Nm

Example 3.7, Page number: 140

In [4]:
from __future__ import division
%matplotlib inline
from matplotlib import *

#Variable declaration:
i1=0.8
i2=0.01


#Calculations & Results:
def df(f,x,h=0.1e-10):
    return ( f(x+h/2) - f(x-h/2) )/h



def l11(x):
    return (3+cos(2*x))/1000.0

def l12(x):
    return (0.3*cos(x))

def l22(x):
    return (30+10*cos(2*x))

def g(x):
    return ((i1**2)/2)*df(l11,x) + ((i2**2)/2)*df(l22,x) + (i1*i2)*df(l12,x)

def r(x):
    return ((i1**2)/2)*df(l11,x) + ((i2**2)/2)*df(l22,x)
def s(x):
    return (i1*i2)*df(l12,x)

x=linspace(-pi,pi,100000)


plot(x,r(x))
plot(x,s(x))
plot(x,g(x))
grid()
annotate("Total torque",xy=(-0.5,0.003))
annotate("Reluctance torque",xy=(-2,-0.0015))
annotate("Mutual Interaction torque",xy=(1.6,-0.0026))
xlabel("Theta [radians]")
ylabel("Torque [N.m]")
xlim(-pi,pi)


#Results
print "Tfld = -1.64*10**-3*sin(2*x)- 2.4*10**-3*sin(x)"
show()
Tfld = -1.64*10**-3*sin(2*x)- 2.4*10**-3*sin(x)

Example 3.9, Page number: 148

In [31]:
from __future__ import division


#Variable declaration:
W=4.0*10**-2                            #width of plunger lower arm(m)
W1=4.5*10**-2                           #width of plunger upper arm(m)
D=3.5*10**-2                            #depth of plunger (m)
d=8*10**-3                              #length of magnet(m)
go=1*10**-3                             #air gap length(m)
uo=4*pi*10**-7                          #Permeability of free space(A.turns/m)
ur=1.06*uo                              #Relativity permeability
Hc1=-940                                #Magnetising force(kA/m)
Bt=1.25                                 #Magnetic field induction(T)
N=1500                                  #No of turns
x=3*10**-3                              #Position of plunger(m)

#Calculation:
Ni=-Hc1*d*10**3
Rx=x/(uo*W1*D)
Ro=go/(uo*W*D)
Rm=d/(ur*W*D)
f=-((Ni)**2)/(uo*W1*D*(Rx+Ro+Rm)**2)



#Results:
print "The x-directed force:",round(f,1),"N"
print "Current in the excitation winding:",round(Ni/N,2),"A"
The x-directed force: -703.3 N
Current in the excitation winding: 5.01 A