#Input data
nsc=75 #The scavenging efficiency of the two stroke engine in percent
ns=20 #The scavenging efficiency is increased by in percent
#Calculations
import math
Rsc=math.log(1/(1-(nsc/100.0)))
nsc1=(nsc/100.0)+((nsc/100.0)*(ns/100.0))
Rsc1=math.log(1/(1-(nsc1)))
Rscr=((Rsc1-Rsc)/Rsc)*100 #Percentage increase in scavenging ratio in persent
#Output
print"The percentage change in the scavenging ratio = ",round(Rscr,1),"percent"
#Input data
d=0.12 #The bore diameter of the engine in m
l=0.15 #The stroke length of the engine in m
r=16.0 #The compression ratio
N=2000.0 #The speed of the engine in rpm
mf=(240/60.0) #Actual air flow per min in kg/min
T=300.0 #Air inlet temperature in K
p=1.025 #Exhaust pressure in bar
R=287 #Real gas constant in J/kg
#Calculations
import math
da=(p*10**5)/(R*T)
Vs=((math.pi)*(d**2)*l)/4.0
V=(r/(r-1))*Vs
m=da*V
m1=m*N
Rsc=mf/m1 #Scavenging ratio
nsc=((1-math.exp(-Rsc))*100)
ntr=((nsc/100.0)/Rsc)*100
#Output
print"(a) The scavenging ratio = ",round(Rsc,2)
print"(b) The scavenging efficiency = ",round(nsc,1),"percent "
print"(c) The trapping efficiency = ",round(ntr,1)," percent"
#Input data
mf=6.5 #Mass flow rate of fuel in kg/h
N=3000.0 #The speed of the engine in rpm
a=15 #The air fuel ratio
CV=44000 #The calorific value of the fuel in kJ/kg
pm=9 #The mean piston speed in m/s
pmi=4.8 #The mean pressure in bar
nsc=85 #The scavenging efficiency in percent
nm=80 #The mechanical efficiency in percent
R=290.0 #Real gas constant in J/kgK
p=1.03 #The pressure of the mixture in bar
T=288.0 #The temperature of the mixture in K
#Calculations
import math
ma=a*mf
L=((pm*60)/(2*N))*100
mac=mf+ma
mi=(mac)/(nsc/100.0)
da=(p*10**5)/(R*T)
d=(((mi/da)*(4/math.pi)*(1/(L/100.0))*(1/(60*N)))**(1/2.0))*100
ip=(pmi*10**5*(L/100)*((math.pi/4.0)*(d/100)**2)*N)/(60*1000)
bp=ip*(nm/100.0)
nth=(bp/((mf/3600.0)*CV))*100
#Output
print"The diameter of the bore = ",round(d,2),"cm"
print"The length of the stroke = ",L," cm"
print"The brake power = ",round(bp,2)," kW"
print"The brake thermal efficiency =",round(nth,2)," percent "
#Input data
d=0.08 #The diameter of the bore in m
L=0.1 #The length of the stroke in m
r=8.0 #The compression ratio
o=60.0 #The exhaust port open before BDC in degrees
v=60.0 #The exhaust port closes after BDC in degrees
a=15.0 #Air fuel ratio
T=300.0 #The temperature of the mixture entering into the engine in K
p=1.05 #The pressure in the cylinder at the time of clomath.sing
R=290.0 #Real gas constant in J/kgK
ma=150.0 #Mass flow rate of air in kg/h
N=4000.0 #The speed of the engine in rpm
#Calculations
import math
mf=ma/a
mac=ma+mf
r=(L*100)/2.0
Le=(r+(r*math.sin (math.pi/6.0)))/100.0
Vse=(math.pi*d**2*Le)/4.0
V=(r/(r-1))*Vse
V=0.00043 #Value in book after approximation
da=(p*10**5)/(R*T)
m=V*da
mi=m*60*N
Rsc=mac/mi
nsc=(1-(exp(-Rsc)))*100
ntr=nsc/Rsc
#Output
print"The scavenging ratio = ",round(Rsc,2)
print"The scavenging efficiency =",round(nsc,2)," percent "
print"The trapping efficiency = ",round(ntr,2),"percent"
#Input data
d=8.25 #The diameter of the bore in cm
L=11.25 #The length of the stroke in cm
r=8.0 #The compression ratio
N=2500.0 #The speed of the engine in rpm
ip=17.0 #Indicated power in kW
a=0.08 #Fuel air ratio
T=345.0 #Inlet temperature mixture in K
p=1.02 #Exhaust pressure in bar
CV=44000.0 #The calorific value of the fuel in kJ/kg
nth=0.29 #Indicated thermal efficiency
M=114.0 #Molar mass of fuel
R=8314.0 #Universal Gas constant in J/kgK
#Calculations
import math
Vs=(math.pi*d**2*L)/4 #Displacement volume in cm**3
V=(r/(r-1))*Vs #Total cylinder volume in m**3
ps=((29*p*10**5)/(R*T))*(1/(1+a*(29/M))) #The density of dry air in kg/m**3
nsc=((ip*1000)/((N/60)*V*10**-6*ps*a*CV*1000*nth))*100 #The scavenging efficiency in percent
#Output
print"The scavenging efficiency = ",round(nsc,2)," percent"
#given
S=15.0 #The speed of the math.piston in m/s
ps=0.35 #The scavenging pressure in bar
pa=1.03 #Atmospheric pressure in bar
r=18.0 #The compression ratio
t=35.0 #The inlet temperature in degree centigrade
Rsc=0.9 #The scavenging ratio
ta=15.0 #The atmospheric temperature in degree centigrade
nc=0.75 #Compressor efficiency
g=1.4 #Adiabatic index
R=287.0 #Real gas constant in J/kgK
Cp=1005.0 #Specific heat of gas in J/kgK
#Calculations
import math
pi=ps+pa #The scavenging pressure in bar
Ti=(273+ta)+t #The inlet temperature in K
pr=pa/math.pi #The ratio of the pressure for calculations
di=(pi*10**5)/(R*Ti) #The density in kg/m**3
ai=(g*R*Ti)**(1/2.0) #The sonic velocity in m/s
C=(Rsc)/(2*((r-1)/r)*(ai/S)*(pi/pa)*((2/(g-1))*(((pr)**(2/g))-((pr)**((g+1)/g))))**(1/2.0))
ds=(pa*10**5)/(R*Ti) #The density in kg/m**3
mep=(ds*Rsc*Cp*Ti*(((pi/pa)**((g-1)/g))-1))/((nc*((r-1)/r))*10**5) #Mean effective pressure in bar
#Output
print"The flow coefficient = ",round(C,3)
print"The compressor mean effective pressure = ",round(mep,1),"bar"