import math
#initialisation of variables
# to calculate no of parrallel path
S=12.0 #no of commutator segments
P=4
#Calculations
Y_cs=S/P #slots
Y_b=2*Y_cs+1
y_f=Y_b-2
#Results
print(y_f,'no of parralel path')
import math
#initialisation of variables
# to find spacing b/w brushes
S=22.0
P=4
#Calculations
Y_cs=math.floor(S/P)
U=6 #coil sides/slot
Y_b=Y_cs*U+1
y_f=Y_b-2
n=(1.0/2)*U*S #no of commutator segments
A=4 #no of brushes
sp=n/A
#Results
print(sp,'spacing b/w adjacent brushes')
import math
#initialisation of variables
#to calculate relevant pitches for wave windings
S=16
P=6
#Calculations
Y_cs=math.floor(S/P)
U=2
Y_b=Y_cs*U+1
C=16
y_c=U*(C-1)/P
y_f=2*y_c-Y_b
#Results
print(y_f,'no of pitches')
import math
#initialisation of variables
# to find distance b/w brushes
S=28.0
P=4.0
U=8.0
#Calculations
c=U*S/2
y_c=2*(c-1)/P
Y_c=55.0
C=(P/2)*Y_c+1
Y_cs=math.floor(S/P)
Y_b=Y_cs*U+1
y_f=2*Y_c-Y_b
d=C/P
#Results
print(d,'dis b/w brushes')
import math
#initialisation of variables
# to find the torque and gross mech power developed
D=.3
l=.2
p=4
fd=.4 #flux density
#Calculations
phi=math.pi*(D/p)*l*fd #flux/pole
n=1500
Z=400
A=4
E_a=phi*n*Z*(p/A)/60
I_a=25
mp=E_a*I_a
#Results
print(mp,'gross mech power developed(W)')
T=mp/(2*math.pi*n/60)
print(T,'torque developed(Nm)')
import math
#initialisation of variables
# to calculate ratio of generator speed to motor speed
V=220.0
P=4000.0
I_a=P/V
r_a=.4 #armature resistance
#Calculations
E_ag=V+I_a*r_a
E_am=V-I_a*r_a
a=1.1 #phi_m/phi_g
n=(E_ag/E_am)*a
#Results
print(n,'n_g/n_m')
import math
#initialisation of variables
# to calculate speed of motor
V=230.0
R_f=115.0 #field resistance
I_f=V/R_f
P_g=100000.0 #electric power (m/c running as generator)
#Calculations
I_L=P_g/V
I_a=I_f+I_L
R_a=.08 #armature resitance
E_ag=V+I_a*R_a
n_g=750 #speed
P_m=9000 #m/c running as motor
I_l=P_m/V
I_A=I_l-I_f
E_am=V-I_A*R_a
n_m=(E_am/E_ag)*n_g
#Results
print(n_m,'motor speed(rpm)')
import math
#initialisation of variables
#to calculate electomagnetic power and torque
E_a=250
R_a=.05
n=3000
w_m=(n*2*math.pi)/60
#Calculations
print('when terminal voltage is 255V')
V_t=255
I_a=(V_t-E_a)/R_a
P_in=E_a*I_a
print(P_in,'electromagnetic power(W)')
T=P_in/w_m
print(T,'torque(Nm)')
print('when terminal voltage is 248V')
V_t=248
I_a=(E_a-V_t)/R_a
P_in=E_a*I_a
#Results
print(P_in,'electromagnetic power(W)')
T=P_in/w_m
print(T,'torque(Nm)')
import math
#initialisation of variables
#to calculate electomagnetic power
n_f=3000.0 #field speed
n_a=2950.0 #armature speed
E=250.0
#Calculations
E_a=E*(n_a/n_f)
V_t=250
R_a=0.05
I_a=(V_t-E_a)/R_a
P_in=V_t*I_a
#Results
print(P_in,'power(W)')
P=E_a*I_a
print(P,'electromagnetic power(W)')
import math
#initialisation of variables
# to calculate cross and demagnetising turns/pole
P=250000.0
V=400.0
I_a=P/V #armature current
n=6 #no of parallel path
#Calculations
I_c=I_a/n #conductor current
Z=720 #lap wound conductors
AT_a=(1/2)*Z*I_c/n
B=2.5*n/2 #brush leadof 2.5 angular degrees(mech) from geo neutral
AT_c=AT_a*(1-(2*B)/180)
#Results
print(AT_c,'cross magnetising ampere turns(AT/pole)')
AT_d=AT_a*((2*B)/180)
print(AT_d,'demagnetising ampere turns(AT/pole)')
import math
#initialisation of variables
#to calculate no of conductors on each pole piece
Z=256
A=6
P=6
#Calculations
r=.71 #ratio of pole arc to pole pitch
N_cw=(Z/(2*A*P))*r
N_cc=math.ceil(2*N_cw)
#Results
print(N_cc,'compensating conductors/pole')
import math
#initialisation of variables
#to calculate no of turns reqd on each interpole
P=25000
V=440
I_a=P/V
Z=846
A=2
P=4
B_i=.5
#Calculations
u_o=4*math.pi*10**-7
l_gi=.003
AT_i=((I_a*Z)/(2*A*P))+(B_i*l_gi)/u_o
N_i=math.ceil(AT_i/I_a)
#Results
print(N_i,'no of turns')
import math
#initialisation of variables
#to calculate terminal voltage and rated output current and calculate no of series turns/pole
P=100000.0
V=200.0
I_L=P/V
I_f=5
I_a=I_L+I_f
I_se=I_a
N_se=5
N_f=1200
#Calculations
I_feq=I_f+(N_se/N_f)*I_se
n=1000
E_a=225
nn=950
E_aa=E_a*(nn/n)
R_a=0.03
R_se=0.004
V_t=E_aa-I_a*(R_a+R_se)
print(V_t,'terminal voltage(V)')
I_fd=0.001875*I_a
V_t=200
E_a=V_t+I_a*(R_a+R_se)
E_aa=E_a*(n/nn)
I_fnet=7.5
N_f=1000
N_se=math.ceil((I_fnet+I_fd-I_f)*(N_f/I_a))
#Results
print(N_se,'no of series turns/pole')
import math
#initialisation of variables
# to compute terminal voltage at rated voltage current
R_a=0.05
R_se=.01
N_f=1000
N_se=3
I_sf=5.6 #shunt field current
I_L=200
#Calculations
I_a=I_L+I_sf
N=N_f*I_sf+I_a*N_se #excitation ampere turns
I_freq=N/N_f
E_a=282
n=1200
nn=1150
Ea=E_a*(nn/n)
V_t=Ea-I_a*(R_a+R_se)
#Results
print(V_t,'terminal voltage(V)')
import math
#initialisation of variables
#to find generator output
P=20000.0
V=250.0
I_a=P/V
R_a=.16
vd=I_a*R_a
#Calculations
def output(E_a):
V_t=E_a-vd
P_o=I_a*V_t
print(P_o,'generator output(W)')
return P_o
print('at I_f=1A')
E_a=150.0
P_o=output(E_a)
print('at I_f=2A')
E_a=257.5
P_o=output(E_a)
print('at I_f=2.5A')
E_a=297.5
P_o=output(E_a)
print('at speed 1200rpm')
def ratio(E_a):
Ea=.8*E_a
return Ea
print('at I_f=1A')
E_a=150
Ea=ratio(E_a)
P_o=output(Ea)
print('at I_f=2A')
E_a=257.5
Ea=ratio(E_a)
P_o=output(Ea)
#Results
print('at I_f=2.5A')
E_a=297.5
Ea=ratio(E_a)
P_o=output(Ea)
import math
#initialisation of variables
#to find power to the load
R_L=3
R_a=.16
#Calculations
def output(E_a):
I_a=E_a/(R_a+R_L)
P_o=I_a**2*R_L
print(P_o,'power fed to the load(W)')
return P_o
print('at I_f=1A')
E_a=150
P_o=output(E_a)
print('at I_f=2A')
E_a=257.5
P_o=output(E_a)
#Results
print('at I_f=2.5A')
E_a=297.5
P_o=output(E_a)
import math
#initialisation of variables
#to compute the generator induced emf when fully loaded in long shunt compound and short shunt compound
P=75000.0
V_t=250.0
I_L=P/V_t
R_a=.04
R_se=.004
R_f=100
#Calculations
print('case of long shunt')
I_f=V_t/R_f
I_a=I_L+I_f
V_b=2
E_aLS=V_t+I_a*(R_a+R_se)+V_b
print(E_aLS,'generator induced emf(V)')
print('case of short shunt')
V_b=V_t+I_L*R_se
I_f=V_b/R_f
I_a=I_L+I_f
E_aSS=V_t+(I_a*R_a)+2
#Results
print(E_aSS,'generator induced emf(V)')
d=(E_aLS-E_aSS)*100/V_t
print(d,'percent diff')
import math
#initialisation of variables
# to find field current and field resistance at rated terminal voltage, em power and torque
V_o=250 #no load voltage
I_f=1.5
R_f=V_o/I_f
print(R_f,'field resistance(ohm)')
P=25000
V_t=220
I_L=P/V_t
I_a=I_L
#Calculations
print(I_a,'field current(A)')
R_a=.1
E_a=V_t+I_a*R_a
I_f=1.1
R_f=V_t/I_f
print(R_f,'field resistance(ohm)')
I_a=I_L-I_f
emp=E_a*I_a
print(emp,'em power(W)')
n=1600
emt=emp/(n*2*math.pi/60)
print(emt,'torque(Nm)')
I_fa=1.25 #actual I_f
I_c=I_fa-I_f
#Results
print(I_c,'I_f needed to counter effect armature current')
import math
#initialisation of variables
#to determine the reduction of flux/pole due to armature rxn
V=250
R_a=.7
def arxn(I_a,n):
phi=(V-I_a*R_a)/n
return phi
#Calculations
phinl=arxn(1.6,1250)
print(phinl,'flux/pole no load')
phil=arxn(40,1150)
print(phil,'flux/pole load')
d=(phinl-phil)*100/phinl
#Results
print(d,'reduction in phi due to armature rxn(%)')
import math
#initialisation of variables
#to determine internal em torque developed
V=250.0
I_a=85.0
R_a=.18
E_a=V-I_a*R_a
n=1100
T=E_a*I_a/(n*2*math.pi/60)
#Calculations
print(T,'torque(Nm)')
T_1=.8*T
print(T_1,'new torque(Nm)')
#T=K_a'*K_f*I_f*I_a=K_a'*K_f*.8*I_f*I_a1 so
I_a1=I_a/.8
E_a1=V-I_a1*R_a
#E_a=K_a'*K_f*I_f*n
#E_a1=K_a'*K_f*.8*I_f*n1 so
n1=(E_a1/E_a)*n/.8
#Results
print(n1,'speed is(rpm)')
import math
#initialisation of variables
#to determine speed, calculate internal torque developed on load and no load
V=220.0
R_f=110.0
I_f=V/R_f
I_L=5
I_a0=I_L-I_f
R_a=.25
E_a0=V-I_a0*R_a
n=1200
#Calculations
T_0=(E_a0*I_a0)/(2*math.pi*n/60)
print(T_0,'torque at no load(Nm)')
I_L=62
I_a1=I_L-I_f
E_a1=V-I_a1*R_a
n1=(E_a1/E_a0)*n/.95
print(n1,'speed(rpm)')
T_1=(E_a1*I_a1)/(2*math.pi*n1/60)
#Results
print(T_1-T_0,'torque at on load(Nm)')
import math
#initialisation of variables
#to sketch speed the speed-torque characteristicsof the series motor connectedto mains by calculating speed and torque values at diff values of armature current
Ise=[75,100,200,300,400]
V=250
Ra=.08
#Calculations
def Eaa(Ise):
Ea=V-Ra*Ise
return Ea
def speed(Ea,Eav):
nn=n*Ea/Eav
return nn
Eav=[121.5,155,250,283,292]
n=1200.0
def torque(nn,Ea,Ise):
T=(60*Ea*Ise/(2*math.pi*nn))
return T
Ise=75
Ea=Eaa(Ise)
Eav=121.5
nn1=speed(Ea,Eav)
T1=torque(nn1,Ea,Ise)
Ise=100
Ea=Eaa(Ise)
Eav=155
nn2=speed(Ea,Eav)
T2=torque(nn2,Ea,Ise)
Ise=200
Ea=Eaa(Ise)
Eav=250
nn3=speed(Ea,Eav)
T3=torque(nn3,Ea,Ise)
Ise=300
Ea=Eaa(Ise)
Eav=283
nn4=speed(Ea,Eav)
T4=torque(nn4,Ea,Ise)
Ise=400
Ea=Eaa(Ise)
Eav=292
nn5=speed(Ea,Eav)
T5=torque(nn5,Ea,Ise)
nn=[nn1,nn2,nn3,nn4,nn5]
#Results
print(nn,'speed(rpm)')
T=[T1,T2,T3,T4,T5]
print(T,'torque(Nm)')
import math
#initialisation of variables
#to determine the power delivered to the fan,torque developed by the motor and calculate external resistance to be added to armature ckt
V=220
Ra=.6
Rse=.4
Ia=30
Ea=V-(Ra+Rse)*Ia
P=Ea*Ia
print(P,'Power(W)')
n=400
w=2*math.pi*n/60
T=P/w
#Calculations
print(T,'torque(Nm)')
nn=200
T1=T*(nn/n)**2
Iaa=Ia*nn/n
w1=2*math.pi*nn/60
P1=T1*w1
print(P1,'power developed when n=200 rpm((W))')
Ea1=P1/Iaa
Rext=(V-Ea1)/Iaa-(Ra+Rse)
#Results
print(Rext,'external resistance(ohm)')
import math
#initialisation of variables
# to determine the starting torque developed
P=180000.0
V=600.0
Ia=P/V
Ra=.105
Ea=V-Ia*Ra
n=600.0
nn=500.0
#Calculations
Eaa=Ea*nn/n
Iaa=282 #from magnetising curve
Iad=Ia-Iaa
Ias=500 #at start
k=Iad/Ia**2
Iae=Ias-Iad*k
Eas=590 #from magnetising curve
Ts=Eas*Ias/(2*math.pi*nn/60)
#Results
print(Ts,'T_start(Nm)')
#initialisation of variables
#to determine speed and mech power
k=.2*10**-3
Ia=250
Iad=k*Ia**2
Ianet=Ia-Iad
Ea=428 #from magnetising curve
V=600
Ra=.105
#Calculations
Eaact=V-Ia*Ra
n=500
nn=n*Eaact/Ea
print(nn,'speed(rpm)')
Pmech=Eaact*Ia
print(Pmech,'mech power debeloped(W)')
T=Pmech/(2*math.pi*nn/60)
#Results
print(T,'torque(Nm)')
import math
#initialisation of variables
#to calculate the mmf per pole on no load and speed developed
ATsefl=2400.0
ATsenl=(3.0/25)*ATsefl
ATsh=ATsefl
#Calculations
ATnet=ATsenl+ATsh
print(ATnet,'mmf/pole(AT)')
Ea=148 #from magnetising curve
V=240
vd=3
Eanl=V-vd
n=850
nnl=n*Eanl/Ea
#Results
print(nnl,'speed(rpm)')
import math
#initialisation of variables
#to calculate demagnetisising ampeare turns, em torque,starting torque and no of turns of the series field
P=10000.0
Vt=240.0
Ia=P/Vt
If=.6
Ra=.18
Ri=0.025
Ea=Vt-Ia*(Ra+Ri)
n=1218
Eaa=Ea*Vt/Ea
#Calculations
Iff=.548 #from n-If characteristics
Ifd=If-Iff
N_s=2000 #shunt field turns
ATd=N_s*Ifd
print(ATd,'demagnetising ampere turns')
T=Ea*Ia/(2*math.pi*n/60)
print(T,'torque(Nm)')
Rf=320
If=Vt/Rf
ATd=165 #given
Ifd=ATd/N_s
Ifnet=If-Ifd
n=1150 #from n-If characteristics
#Ea=Ka*phi*w Ka*phi=k
k=Vt/(2*math.pi*n/60)
Iastart=75
Tstart=Iastart*k
#Results
print(Tstart,'starting torque(Nm)')
n_0=1250
Ea=240
If=.56 #from n-If characteristics
n=1200
Rse=.04
R=Rse+Ra+Ri
Eaa=Ea-Ia*R
nn=n*Ea/Eaa
Ifnet=.684 #from n-If characteristics
Ifd=Ifnet-If
Nse=N_s*Ifd/Ia
print(math.ceil(Nse),'no of turns of the series field')
import math
#initialisation of variables
#to find the no of starter sections reqd,and resistance of each section
I1=55.0
I2=35.0
g=I1/I2
V1=220.0
R1=V1/I1
Ra=.4
#Calculations
n=math.log((R1/Ra)-g)+1
print((n),'no of starter sections reqd')
def res(re):
R=(1.0/g)*re
return R
R_1=R1-res(R1)
#Results
print(R_1,'R1(ohm)')
R_2=res(R_1)
print(R_2,'R2(ohm)')
import math
#initialisation of variables
#to find the lower current limit, motor speed at each stud
Pop=25.0*1000
Vt=230.0
Ra=.12
rf=120.0
Nfl=2000.0
#Calculations
Iafl=Pop/Vt
Iamax=1.5*Iafl
k=5
I1=Iamax
R1=Vt/I1
r=(R1/Ra)**(1.0/(k-1))
I2=I1/r
def res(re):
R=(1.0/r)*re
return R
R_1=R1-res(R1)
#Results
print(R_1,'R1(ohm)')
R_2=res(R_1)
print(R_2,'R2(ohm)')
R_3=res(R_2)
print(R_3,'R3(ohm)')
R_4=res(R_3)
print(R_4,'R4(ohm)')
Iaf1=103.7
Ea=Vt-Iaf1*Ra
Ka=Ea/Nfl
def speed(r):
Ea=Vt-I2*r
n=Ea/Ka
return n
r1=R1
n1=speed(r1)
print(n1,'n1(rpm)')
r2=r1-R_1
n2=speed(r2)
print(n2,'n2(rpm)')
r3=r2-R_2
n3=speed(r3)
print(n3,'n3(rpm)')
r4=r3-R_3
n4=speed(r4)
print(n4,'n4(rpm)')
import math
#initialisation of variables
#to calculate the ratio of full load speed to no load speed
V=400.0
Rf=200.0
If=V/Rf
Inl=5.6
#Calculations
I_a0=Inl-If
vd=2 #voltage drop
Ra=.18
E_a0=V-Ra*I_a0-vd
Ifl=68.3
Iafl=Ifl-If
E_afl=V-Ra*Iafl-vd
e=.03 #armature rxn weakens the field by 3%
k=(E_afl/E_a0)*(1/(1-e))
#Results
print(k,'n_fl/n_nl')
import math
#initialisation of variables
#to calculate load torque, motor speed and line current
V=250.0
Rf=41.67
If1=V/Rf
Ia=126.0
Ia1=Ia-If1
Ra=.03
#Calculations
Ea1=V-Ra*Ia1
n1=1105 #rpm
w1=2*math.pi*n1/60
Ka=Ea1/(If1*w1)
T=Ka*If1*Ia1
print(T,'torque(Nm)')
If2=5
Ia2=Ia1*(If1/If2)
I_L2=Ia2+2
print(I_L2,'motor current(A) initial')
Ea2=V-Ra*Ia2
w2=Ea2/(Ka*If2)
If1=6
Voc1=267
n=1200
k1=Voc1/(2*math.pi*n/60) #k=Ka*phi
If1=5
Voc2=250
n=1200
k2=Voc2/(2*math.pi*n/60) #k=Ka*phi
Ia2=Ia1*(k1/k2)
I_L2=Ia2+2
print(I_L2,'motor current(A) final')
Ea2=V-Ra*Ia2
w2=Ea2/k2
#Results
print(w2,'motor speed(rad/s)')
import math
#initialisation of variables
#to calculate armature current,speed and value of external resistance in field ckt
V=250.0
Ia=5.0
Ra=.6
n=1000.0
#Calculations
k=(V-Ia*Ra)/(2*math.pi*n/60)
T=100.0
Ia=T/k
print(Ia,'armature current(A)')
w_m=(V-Ia*Ra)/k
n=(60*w_m)/(2*math.pi)
print(n,'speed(rpm)')
Rf=150
If=V/Rf
kk=k/If
Iaa=44.8
nn=1200
Iff=(V-Iaa*Ra)/(kk*2*math.pi*nn/60)
Rftot=V/Iff
Rfext=Rftot-Rf
#Results
print(Rfext,'external resistance(ohm)')
import math
#initialisation of variables
#to determine speed and torque of the motor
Ra=0.035
Rf=0.015
V=220
I=200
#Calculations
Ea=V-I*(Ra+Rf)
print('full field winding')
n=900
nn=n*Ea/V
print(nn,'speed(rpm)')
T=(Ea*I/2)/(2*math.pi*nn/60)
print(T,'torque(Nm)')
print('field winding reduced to half')
Rse=Rf/2
Rtot=Rse+Ra
Ea=V-I*(Rtot)
Iff=I/2
V=150 #from magnetisation characteristic
nn=n*Ea/V
print(nn,'speed(rpm)')
T=(Ea*I)/(2*math.pi*nn/60)
print(T,'torque(Nm)')
print('divertor across series field')
Ra=0.03
Rse=.015
Kd=1/((Rse/Ra)+1)
Ise=Kd*I
V1=192
I1=150
V2=150
I2=100
v=V2+((V1-V2)/(I1-I2))*(Ise-I2)
R=(2/3)*Rse
Ea=V-I*(Ra+R)
nn=n*Ea/v
#Results
print(nn,'speed(rpm)')
T=(Ea*I)/(2*math.pi*nn/60)
print(T,'torque(Nm)')
import math
#initialisation of variables
#to determine speed regulation, load speed and power regulation and compare power wasted in both cases
V=230.0
Ra=2.0
Ia=5.0
Ea=V-Ia*Ra
n=1250.0
w=2*math.pi*n/60
k=Ea/w #k=Ka*phi
Re=15
Ia0=1
#Calculations
Ea=V-Ia0*(Ra+Re)
w0=Ea/k
Ia=5
Ea=V-Ia*(Ra+Re)
w=Ea/k
wr=(w0-w)*100/w
print(wr,'(i)speed regulation(%)')
R1=10
R2=15
B=R2/(R1+R2)
V_TH=V*B
R_TH=R1*B
Ea=V_TH-Ia0*(R_TH+Ra)
w0=Ea/k
Ia=5
Ea=V_TH-Ia*(R_TH+Ra)
w=Ea/k
wr=(w0-w)*100/w
print(wr,'(ii)speed regulation(%)')
Pe=Ia**2*Re
#Results
print(Pe,'power loss by rheostat control(W)')
Ra=2
Ea=98
Va=Ea+Ra*Ia
P2=Va**2/R2
I2=Va/R2
I1=I2+Ia
P1=I1**2*R1
Pe=P1+P2
print(Pe,'power loss by shunted armature control(W)')
import math
#initialisation of variables
#to determine armature current
n1=1600.0
Ia1=120.0
n2=400.0
#Calculations
Ia2=(n1*Ia1)/n2 #P=K*Ia*n
#Results
print(Ia2,'Ia(A)')
import math
#to find speed and ratio of mech o/p
V=400.0
Ra=.25
Ia1=25.0
Ea1=V-Ra*Ia1
n1=1200
Rr=2.75
Ia2=15
#Calculations
Ea2=V-(Ra+Rr)*Ia2
phi=.7 #phi=(phi(15)/phi(25))
n2=(Ea2/Ea1)*n1/phi
print(n2,'speed(rpm)')
Po2=Ea2*I2
Po1=Ea1*I1
#Results
print(Po2/Po1,'ratio of mech o/p')
Ia=120 #Ia is constant indep of speed
print(Ia,'Ia(A)')
import math
#initialisation of variables
#to calculate the armature voltage reqd
V=500.0
Ra=.28
Ia1=128.0
#Calculations
Ea1=V-Ia1*Ra
#(Vt2-.28*Ia2)-->n1/math.sqrt(2) (i)
#Ea1-->n1 (ii)
Vt2=(Ea1/math.sqrt(2))+(Ia1*Ra)
#Results
print(Vt2,'armature voltage(V)')
import math
#initialisation of variables
#to calculate m/c eff as a generator and max eff when generating and motoring.
Pop=10*1000.0
Vt=250.0
Ra=.8
Rf=275.0
Ia=3.91
Psh=Vt**2/Rf
Prot=Vt*Ia-Ia**2*Ra
print(Prot,'rotational loss(W)')
I1=Pop/Vt
If=Vt/Rf
Ia=I1+If
Ploss=Prot+Psh+Ia**2*Ra
Eff_gen=(1-Ploss/(Ploss+Pop))*100
print(Eff_gen,'generator eff(%)')
#Calculations
Ia=I1-If
Ploss=Prot+Psh+Ia**2*Ra
Eff_motor=(1-Ploss/(Pop))*100
print(Eff_motor,'motor eff(%)')
Ia=math.sqrt((Prot+Psh)/Ra)
Ploss_tot=2*(Prot+Psh)
print(Ploss_tot,'total loss(W)')
I1=Ia-If
Pout=Vt*I1
Eff_gen_max=((1-Ploss_tot/(Ploss_tot+Pout)))*100
print(Eff_gen_max,'max generator eff(%)')
I1=Ia+If
Pin=Vt*I1
Eff_motor_max=((1-Ploss_tot/(Pin)))*100
#Results
print(Eff_motor_max,'max motor eff(%)')
import math
#initialisation of variables
#to determine rotational loss, no load armature current and speed and also find speed regulation and to calculate armature current for given em torque
Pout=60.0*1000
eff=.85
P_L=((1.0/eff)-1)*Pout
Pin=Pout+P_L
V=600.0
I_L=Pin/V
Rf=100
If=V/Rf
Ia=I_L-If
Ra=.16
Ea=V-Ia*Ra
n=900
#Calculations
Prot=P_L-Ia**2*Ra-V*If
print(Prot,'rotational loss(W)')
Iao=Prot/V
print(Iao,'no load armature current(A)')
Eao=V
n0=n*Eao/Ea
print(n0,'no load speed(rpm)')
reg=(n0-n)*100.0/n
print(reg,'speed regulation(%)')
K=Ea/(2*math.pi*n/60) #K=Ka*phi
T=600
Ia=T/K
#Results
print(Ia,'reqd armature current(A)')
import math
#initialisation of variables
#to determine load torque and motor eff,armature current for max motor eff and ots value
V=250.0
Ia=35.0
Ra=.5
Ea=V-Ia*Ra
Poutg=Ea*Ia
Prot=500
Pout_net=Poutg-Prot
n=1250
w=2*math.pi*n/60
T_L=Pout_net/w
print(T_L,'load torque(Nm)')
Rf=250.0
If=V/Rf
I_L=If+Ia
Pin=I_L*V
eff=Pout_net*100/Pin
print(eff,'efficiency(%)')
#Calculations
Pk=Prot+V*If
Ia=math.sqrt(Pk/Ra)
print(Ia,'armature current(A)')
Tloss=2*Pk
I_L=If+Ia
Pin=I_L*V
eff_max=1-(Tloss/Pin)
print(eff_max*100,'max efficiency(%)')
Ea1=V-Ia*Ra
n1=n*Ea1/Ea
print(n1,'speed(rpm)')
w=2*math.pi*n1/60
Poutg=Ea1*Ia
Pout_net=Poutg-Prot
T_L=Pout_net/w
#Results
print(T_L,'load torque(Nm)')
import math
#initialisation of variables
#to calculate rotational loss ,armature resistance,eff,line current and speed
Pshaft=20000.0
eff=.89
P_L=((1.0/eff)-1)*Pshaft
Pin=Pshaft+P_L
V=250
I_L=Pin/V
print(I_L,'line current(A)')
Rf=125
If=V/Rf
Ia=I_L-If
#Calculations
Ploss=P_L/2
Ra=Ploss/Ia**2
print(Ra,'armature resistance(ohm)')
Psh=V*If
Prot=Ploss-Psh
print(Prot,'rotational loss(W)')
Ea=V-I_L*Ra
n=850
Ia=100
Pc=Ia**2*Ra
P_L=Pc+Ploss
Pin=V*I_L
eff=(1-P_L/Pin)*100
Ea1=V-Ia*Ra
n1=n*Ea1/Ea
#Results
print(n1,'speed(rpm)')
import math
#initialisation of variables
#to calculate eff of motor and generator
Iag=60.0
Ia=15.0
Iam=Iag+Ia
Vt=250.0
Ram=.2
Rag=.2
#Calculations
Pstray=.5*(Vt*Ia-Iam**2*Ram-Iag**2*Rag)
Ifm=2
Pinm=Vt*(Iam+Ifm)
P_Lm=(Pstray+Vt*Ifm)+Iam**2*Ram
eff_M=1-(P_Lm/Pinm)
print(eff_M*100,'efficiency of motor(%)')
Iag=60
Ifg=2.5
P_Lg=(Pstray+Vt*Ifg)+Iag**2*Rag
Poutg=Vt*Iag
eff_G=1-(P_Lg/(Poutg+P_Lg))
#Results
print(eff_G*100,'efficiency of generator(%)')
import math
#initialisation of variables
#to calculaate torque constt,value of rotational loss,stalled torque and stalled current of motor, armature current anad eff, motor o/p and eff
Vt=6.0
Iao=.0145
n=12125
w=2*math.pi*n/60
Ra=4.2
Ea=Vt-Iao*Ra
Km=Ea/w
#Calculations
print(Km,'torque constt')
Prot=Ea*Iao
print(Prot,'rotational loss(W)')
Ia_stall=Vt/Ra
print(Ia_stall,'stalled current(A)')
Tstall=Km*Ia_stall
print(Tstall,'stalled torque(Nm)')
Poutg=1.6
def quad(a,b,c):
d=math.sqrt(b**2-4*a*c)
x1=(-b+d)/(2*a)
x2=(-b-d)/(2*a)
if x1>x2 :
x=x2
else :
x=x1
return x
#Ea*Ia=1.6
#(Vt-Ra*Ia)*Ia=Poutg
Ia=quad(Ra,-Vt,Poutg)
Ea=Vt-Ia*Ra
wo=Ea/Km
Proto=Prot*(w/wo)**2
Pout_net=Poutg-Prot
Pi=Vt*Ia
eff=Pout_net/Pi
print(eff*100,'efficiency(%)')
n1=10250
w1=2*math.pi*n1/60
Km=.004513
Ea1=Km*w1
Ia=(Vt-Ea1)/Ra
Pout_gross=Ea1*Ia
Prot1=Prot*(n1/n)
Pout_net=Pout_gross-Prot1
print(Pout_net,'o/p power(W)')
Pin=Vt*Ia
eff=Pout_net/Pin
#Results
print(eff*100,'efficiency(%)')