import math
# Variables :
T = 10.; #N-m
N = 1500.; #rpm
IP = 1.85; #KW
#Calculation
BP = T*2*math.pi*N/60/1000; #KW
FP = IP-BP; #KW
# Results
print "Friction power(KW) : %.2f"%FP
import math
# Variables :
d = 18./100; #m
L = 26./100; #m
N = 400.; #rpm
positive_mep = 6; #bar
negative_mep = -0.3; #bar
n = 180.; #strokes/min
Etta_m = 0.75;
#Calculation
Pm = positive_mep+negative_mep; #bar
A = math.pi/4*d**2; #m**2
IP = Pm*10**5*A*L*n/60/1000; #KW
BP = IP*Etta_m; #KW
# Results
print "B.P. of engine in KW : %.3f"%BP
import math
# Variables :
r = 6.; #cm
d = 10./100; #m
L = 12.5/100; #m
Pmi = 2.6; #bar
W = 60.; #N
S = 19.; #N
R = 40./100; #m
mf = 1.; #Kg/hr
mf = mf/60/60; #Kg/sec
CV = 42000.; #KJ/Kg
N = 2000.; #rpm
#Calculation and Results
A = math.pi/4*d**2; #m**2
n = N/2; #no. of strokes/min
IP = Pmi*10**5*A*L*n/60/1000; #KW
print "Indicated Power in KW : %.3f"%IP
BP = (W-S)*R*2*math.pi*N/60/1000; #KW
print "Brake Power in KW : %.3f"%BP
Etta_m = BP/IP*100; #%
print "Mechanical efficiency in %% : %.2f"%Etta_m
Etta_o = BP/mf/CV*100; #%
print "Overall efficiency in %% : %.2f"%Etta_o
Gamma = 1.4; #consmath.tant
Etta_a = (1-1/(r**(Gamma-1)))*100 ; #%
print "Air standard efficiency in %% : %.2f"%Etta_a
Etta_r = Etta_o/Etta_a*100; #%
print "Relative efficiency in %% : %.2f"%Etta_r
import math
# Variables :
IP = 50.; #KW
Vf = 16.; #litre/hr
Sp_gravity_fuel = 0.755;
CV = 44500.; #KJ/Kg
N = 3000.; #rpm
Pmi = 5.2; #bar
#Calculation and Results
mf = Vf*10**-3*Sp_gravity_fuel*1000; #Kg/hr
mf = mf/3600; #Kg/s
Etta_i = IP/mf/CV*100; #%
print "Indicated thermal efficiency in %% : %.2f"%Etta_i
#IP = Pmi*10**5*math.pi/4*d**2*L*N/2/60/1000; #KW
d = (IP*60*1000/Pmi/10**5/(math.pi/4)/1.1/(N/2))**(1./3); #meter(L = 1.1*d)
print "Bore in cm : %.2f"%(d*100)
L = 1.1*d; #meter
print "Length of stroke in cm : %.3f"%(L*100)
# Variables :
Vs = 5.7; #litre
Vs = Vs/1000; #m**3
Pm = 600.; #KN/m**2
N = 800.; #rpm
#Calculation
n = N/2; #No. of strokes/min
IP = Pm*Vs*n/60; #KW
# Results
print "Indicated power of Engine in KW : ",IP
import math
# Variables :
n1 = 6.; #cylinders
IP = 100.; #KW
N = 800.; #rpm
Lbyd = 1.25; #stroke to bore ratio
Etta_m = 80./100;
bmep = 5.; #bar
#Calculation
n = N/2; #No. of strokes/min
#IP = Pm*math.pi/4*d**2*d*Lbyd*n/60000
d = (IP/(bmep*math.pi/4*Lbyd*n/60000))**(1/3); #m
L = Lbyd*d; #m
# Results
print "Diameter in meter : ",d
print "Length ofstroke in meter : ",L
#Solution is not complete in the book.
import math
# Variables :
d = 110./1000; #m
L = 140./1000; #m
Pmi = 600.; #KN/m**2
N = 1000.; #rpm
n = N; #strokes/min(for 2 stroke)
# Calculations
A = math.pi/4*d**2; #m**2
IP = Pmi*A*L*n/60; #KW
# Results
print "Indicated power of the engine in KW : %.3f"%IP
import math
# Variables :
n1 = 6.; #cylinders
IP = 150.; #KW
N = 800.; #rpm
TwoLN = 320.; #m/s
Lbyd = 1.2; #stroke to bore ratio
Pmi = 650.; #Kn/m**2
#Calculation
#IP = n1*Pmi*(math.pi/4*d**2)*L*n/60; #KW
d = math.sqrt(IP/n1/Pmi/(math.pi/4)*2/TwoLN*2*60); #meter(L*N replaced by TwoLN/2)
L = Lbyd*d; #in meter
N = TwoLN/2/L; #rpm
# Results
print "Engine crank shaft speed in rpm : %.2f"%N
import math
# Variables :
d = 250./1000; #meter
L = 400./1000; #meter
Pmi = 6.50; #bar
N = 250.; #rpm
NetBrakeLoad = 1080.; #N
Db = 1.5; #meter
mf = 10.; #Kg/hr
mf = mf/60./60; #Kg/sec
CV = 44300.; #KJ/Kg
#Calculation and Results
n = N/2; #stroke/min
IP = Pmi*10**5*(math.pi/4*d**2)*L*n/60/1000; #KW
print "Indicated Power in KW : %.2f"%IP
Rb = Db/2; #meter
BP = NetBrakeLoad*Rb*2*math.pi*N/60/1000; #KW
print "Brake Power in KW : %.3f"%BP
Etta_m = BP/IP*100; #%
print "Mechanical Efficiency in %% : %.2f"%Etta_m
Etta_i = IP/mf/CV*100; #%
print "Indicated Thermal Efficiency in %% : %.2f"%Etta_i
# Variables :
mf = 20.; #Kg/hr
BP = 80.; #KW
Etta_m = 80./100;
CV = 45000.; #KJ/Kg
# Calculations and Results
bsfc = mf/BP; #break specified fuel consumption in Kg/KWh
print "Break specified fuel consumption in Kg/KWh : ",bsfc
IP = BP/Etta_m; #KW
mf = mf/60/60; #Kg/s
n = mf/100; #Kg/KWh
Etta_b = BP/mf/CV*100; #%
print "Break Efficiency in % : ",Etta_b
Etta_I = Etta_b/Etta_m; #
print "Indicated thermal Efficiency in % : ",Etta_I
import math
# Variables :
d = 270./1000; #meter
L = 380./1000; #meter
Pmi = 6.; #bar
N = 350.; #rpm
WsubS = 1000.; #N
Db = 1.5; #meter
mf = 10.; #Kg/hr
CV = 44400.; #KJ/Kg
# Calculations and Results
IP = Pmi*10**5*(math.pi/4*d**2)*L*N/2/60/1000; #KW
print "Indicated Power in KW : %.3f"%IP
BP = (WsubS)*math.pi*Db*N/60/1000; #KW
print "Brake Power in KW : %.2f"%BP
Etta_m = BP/IP*100; #%
print "Mechanical Efficiency in %% : %.1f"%Etta_m
mf = mf/60/60; #Kg/s
Etta_b = BP/mf/CV*100; #
print "Indicated thermal Efficiency in %% : %.2f"%Etta_b