#Input data
Tmax=477+273 #Temperature limits for the engine 477 degree celcius
Tmin=27+273 #Temperature limits for the engine 27 degree celcius
wd=150 #Carnot cycle produce in KJ
#Calculatkion
eta=(1-(Tmin/Tmax)) #Thermal efficiency of the carnot cycle in %
Qs=(wd/eta) #Added during the process in Kj
#Output
print("thermal efficiency of the carnot cycle eta=",100*(eta),"%")
print("added during the process Qs=",Qs,"KJ")
#Input data
QR=1.5 #tau=QS-QR
#T=Tmax-Tmin
T=300 #temperature limit of the cycle in degree celsius
#Calculation
#QR=1.5*(QS-QR)
QR=(1.5/2.5) #Engin work on carnot cycle
eta=(1-QR) #Thermal effeciency
Tmax=(T/eta)-273.15 #Maximum temperataure
Tmin=(Tmax-T) #Minimum temperataure
#Output
print("Engin work on carnot cycle=",QR,"QS")
print("Thermal effeciency=",100*(eta),"%")
print("Maximum temperataure=",round(Tmax,),"degree celsius")
print("Minimum temperataure=",round(Tmin,),"degree celsius")
#Input data
#Refer figure
import math
T1=300 #Carnot engine work in minimum temperature in kelvin
T2=750 #Carnot engine work in maximum temperature kelvin
P2=50 #pressure of carnot engine N/m**2
P4=1 #pressure of carnot engine N/m**
#considering air as the working fluid therefore
R=0.287 #Air as the working fluid in KJ/Kg K
Cp=1.005 #KJ/Kg K
Cv=0.718 #KJ/Kg K
K=1.4
gamma=1.4
#Calculation
#T2/T1=(P2/P1)**(gamma-1)/gamma
P1=P2*(T1/T2)**(gamma/(gamma-1)) #Pressure at intermediate salient points(1-2) in bar
P3=P4*(T2/T1)**(gamma/(gamma-1)) #Pressure at intermediate salient points(3-4) in bar
QS=R*T2*math.log(P2/P3 ) #Heat supplied and rejected per Kg of air in KJ/Kg
QR=R*T1*math.log(P1/P4 ) #Heat supplied and rejected per Kg of air in KJ/Kg
W=QS-QR #Work done in KJ/Kg
eta=(1-(T1/T2)) #Thermal of the carnot cycle
#Output
print("pressure at intermediate salient points(1-2)=",round(P1,2),"bar")
print("pressure at intermediate salient points(3-4)=",round(P3,1),"bar")
print("heat supplied and rejected per Kg of air(2-3)=",round(QS,1),"KJ/Kg")
print("heat supplied and rejected per Kg of air(4-1)=",round(QR,2),"KJ/Kg")
print("work done=",round(W,1),"KJ/Kg")
print("thermal of the carnot cycle=",100*(eta),"%")
#input data
import math
T2=377+273 #Carnot cycle temperature in bar
P2=20*10**5 #Carnot cycle pressure in bar
V2=1
V1=5
V3=2
#consider air as the working fluid therefore
R=0.287 #In KJ/Kg K
Cp=1.005 #In KJ/Kg K
Cv=0.718 #In KJ/Kg K
K=1.4
gamma=1.4
#calculation
T1=T2*((V2/V1)**(gamma-1)) #Minimum temp in degree celsius
Qs=R*T2*math.log(V3/V2) #Heat supplied process in KJ/Kg
QR=R*T1*math.log((V1/V2)*(V2/V3)*((T2/T1)**(1/(gamma-1)))) #Heat Rejected Process in KJ/Kg
etath=(1-(T1/T2))*100 #Thermal Effeiciency of the carnot cycle in %
#output
print("Minimum temp= ",round(T1,1),"degree celsius")
print("Heat supplied process= ",round(Qs,1),"KJ/Kg")
print("Heat Rejected Process= ",round(QR,1),"KJ/Kg")
print("Thermal Effeiciency of the carnot cycle= ",round(etath,1)," %")
#Input data
P1=1 #Isentropic Compression in bar
P2=20 #Isentropic Compression in bar
#consider air as the working fluid therefore
gamma=1.4
#Calculation
r=(P2/P1)**(1/gamma) #Isentropic process
eta=100*(1-(1/(r**(gamma-1))))#Otto cycle air standard effeciency in %
#Output
print("compression ratio=",round(r,2),)
print("standard efficiency=",round(eta,1),"%")
#Input data
T1=27+273 #Initial temp in degree celsius
T2=450+273 #Final temp in degree celsius
#calculation
r=(T2/T1)**(1/(gamma-1)) #Isentropic process
eta=100*(1-(1/(r**(gamma-1)))) #Otto cycle air standard effeciency in %
#output
print("compression ratio=",round(r),)
print("standard efficiency=",round(eta,1),"%")
#Input data
D=200*10**-3 #Otto cycle cylindrical bore in mm
L=450*10**-3 #Otto cycle Stroke in mm
vc=2*10**-3 #Clearance volume in mm**3
gamma=1.4
pi=3.142
#calculation
vs=(pi/4)*(D**2*L) #Swept volume
r=((vs+vc)/vc) #Compression ratio
eta=100*(1-(1/(r**(gamma-1)))) #Standard efficiency
#output
print("Swept volume=",round(vs,6),"m**3")
print("compression ratio=",round(r,3),)
print("standard efficiency=",round(eta,1),"%")
#Input data
P1=0.1*10**6 #Otto cycle air
T1=35+273 #Otto cycle temp degree celsius
r=9 #Compression ratio
Qs=1800 #Supplied heat in kJ/kg
v1=9
v2=1
R=0.287*10**3
gamma=1.4
Cv=0.718
#calculation
T2=(T1*((v1/v2)**(gamma-1))) #Temperature at point 2 in K
P2=(P1*((v1/v2)**1.4))*10**-6 #pressure at point 2 in MPa
T3=((Qs/Cv)+(T2)) #Max temp of cycle in degree celsius
P3=(T3/T2*P2) #Max pressure of cycle in MPa
eta=100*(1-(1/(r**(gamma-1))))#Otto cycle thermal efficiency in %
WD=(Qs*eta)*10**-2 #Work done during the cycle in KJ/Kg
v1=((R*T1)/P1) #Char gass equation in m**3/Kg
v2=v1/r #Char gass equation in m**3/Kg
Sv=v1-v2 #Swept volume in m**3/Kg
Pme=(WD/Sv)*10**-3 #Mean effective pressure in MPa
alpha=P3/P2 #Explosion ratio
Pm=(((P1*r)/((r-1)*(gamma-1)))*(((r**(gamma-1))-1)*(alpha-1)))*10**-6#Mean effective pressure in MPa
#Output
print("Temperature at point=",round(T2,1),"K")
print("pressure at point=",round(P2,3),"MPa")
print("Max temp of cycle=",round(T3,3),"K")
print("Max pressure= ",round(P3,1),"MPa")
print("Otto cycle thermal efficiency=",round(eta,1),"%")
print("Work done during the cycle=",round(WD,),"J/Kg")
print("Char gass equation=",round(v1,3),"m**3/Kg")
print("Char gass equation=",round(v2,4),"m**3/Kg")
print("Swept volume=",round(Sv,4),"m**3/Kg")
print("Mean effective pressure=",round(Pme,2),"MPa")
print("Explosion ratio=",round(alpha,2))
print("Mean effective pressure=",round(Pm,2),"MPa")
#Input data
P1=0.1 #Beginning compression in MPa
T1=40+273 #Beginning temp in degree celsius
eta=0.55 #Standard effeciency in %
QR=540 #Rejected heat in KJ/Kg
r=7.36 #Compression ratio
#calculation
#eta=(1-(1/(r**(gamma-1))))
QS=(-QR/(eta-1)) #Heat supplied/unit mass in KJ/Kg
WD=QS-QR #Work done per Kg of air in KJ/Kg
T2=T1*(r**(gamma-1)) #Temp at end of compression in K
P2=P1*((r)**gamma) #pressure at point 2 in MPa
T3=(QS/Cv)+T2 #max temp of the cycle in K
P3=(T3/T2)*P2 #max pressure of the cycle in MPa
#output
print("Heat supplied/unit mass=",round(QS,),"KJ/Kg")
print("Work done per Kg of air= ",round(WD,),"KJ/Kg")
print("Temp at end of compression=",round(T2,1),"K")
print("pressure at point two=",round(P2,3)," MPa")
print("max temp of the cycle=",round(T3,1),"K")
print("max pressure of the cycle=",round(P3,3)," MPa")
#Input data
T1=300 #Initial temp in K
T3=2500 #Final temp in K
P1=1 #Initial pressure in N/m**2
P3=50 #Final pressure in N/m**2
gamma=1.4
Cv=0.718
#calculation
r=(P3*T1)/(P1*T3) #Compression ratio
eta=(1-(1/r**(gamma-1))) #Standard effeciency in %
T2=T1*((P3/P1)**((gamma-1)/gamma)) #Middle temperature in K
Qs=Cv*(T3-T2) #Heat supplied in KJ/Kg
WD=eta*Qs #Work done KJ/Kg
#output
print("Compression ratio=",r,"")
print("Standard effeciency=",round(eta,4),"%")
print("Middle temperature=",round(T2,2),"K")
print("Heat supplied=",round(Qs,2),"KJ/Kg")
print("Work done=",round(WD,1),"KJ/Kg")
#input data
r=18 #compression ratio of diesel engine
K=6 #cut-off ratio of the stroke in%
rho=2.02
#calculation
#diesel engine air standard efficiency
eta=100*((1-(1/r**(gamma-1)))*(1/gamma*(rho**(gamma-1)/(rho-1))))
#output
print("diesel engine air standard efficiency",round(eta,1),"%")
#Input Data
r=22 #compression ratio of diesel engine r=v1/v2
r1=11 #expansion ratio r1=v4/v3
gamma=1.4
rho=1.4
#calculation
rho=r/r1 #cut-off ratio
#diesel engine air standard efficiency
eta=100*((1-(1/r**(gamma-1)))*(1/gamma*(rho**(gamma-1)/(rho-1))))
#output
print("cut-off ratio=",rho,)
print("diesel engine air standard efficiency=",round(eta,2),"%")
#Input data
Vc=10/100 #Clearance volume in %
Vs=Vc/0.1
K=0.05 #Cut-off of the strok in
gamma=1.4
#Calculation
r=((Vs+Vc)/(Vc)) #Compression ratio
rho=1+K*(r-1) #Cut-off ratio
#Effeciency in %
eta=(1-(1/r**(gamma-1))*((1/gamma)*(((rho**(gamma))-1)/(rho-1))))*100
#output
print("Compression ratio=",r,"Vs")
print("Cut-off ratio=",rho,)
print("Effeciency=",round(eta,2),"%")
#Input data
T1=50+273 #Temperature at the beginning of the compression
T2=700+273 #Temperature at the end of the compression
T3=2000+273 #Temperature at the beginning of the expansion
#Calculation
r=((T2/T1)**(1/(gamma-1))) #Compression ratio
rho=(T3/T2) #Cut-off ratio
K=((rho-1)/(r-1)) #Also cut-off ratio
#Air standard efficiency
eta=(1-(1/r**(gamma-1))*((1/gamma)*(((rho**(gamma))-1)/(rho-1))))*100
#Output
print("compression ratio=",round(r,2),"")
print("cut-off ratio=",round(rho,3),)
print("also cut-off ratio=",round(K,2),"")
print("air standard efficiency=",round(eta,2),"%")
#Input data
P1=0.1 #Diesel cycle is supplied# with air in MPa
T1=40+273 #Diesel cycle is supplied with temperature in degree celsius
r=18 #Compression ratio
Qs=1500 #Heat supplied
v1=18
v2=1
Cp=1.005
#Calculation
T2=T1*((v1/v2)**(gamma-1)) #For isentropic process the temperature is
P2=P1*((v1/v2)**(gamma)) #For isentropic process the pressure is
T3=(Qs/Cp)+T2 #Maximum temperatureof the cycle
rho=T3/T2 #Cut-off ratio
#Air standard efficiency
eta=(1-(1/r**(gamma-1))*((1/gamma)*(((rho**(gamma))-1)/(rho-1))))*100
NWD=(Qs*eta)*10**-2 #Net work done
#Output
print("for isentropic process the temperature=",round(T2,1),"K")
print("for isentropic process the pressure=",round(P2,2),"MPa")
print("maximum temperatureof the cycle=",round(T3,2),"K")
print("cut-off ratio=",round(rho,1),"MPa")
print("air standard efficiency=",round(eta,2),"%")
print("net work done=",round(NWD,),"KJ/Kg")
#Input data
r=14 #compression ratio of standard diesel cycle
P1=1 #compression stroke in bar
T1=300 #temperature of air in k
T3=2774 #temperature rises in k
CP=1.005
v1=14
v2=1
gamma=1.4
Qs=1921.43
R=0.287*10**3
#calculation
T2=T1*((v1/v2)**(gamma-1)) #constant pressure
rho=T3/T2 #cut-off ratio
eta=(1-(1/r**(gamma-1))*((1/gamma)*(((rho**(gamma))-1)/(rho-1))))*100 #air standard efficiency
HS=(CP*(T3-T2)) #heat supplied
WD=(Qs*eta)*10**-2 #Net work done
v1=(R*T1/P1) *10**-5 #characteristics gas equation
v2=(v1/r ) #characteristics gas equation
Sv=(v1-v2) #Swept volume
Pme=(WD/Sv )*10**-2 #Mean effective pressur
Pm=((P1*r)/((r-1)*(gamma-1)))*((gamma*(r**(gamma-1)))*(rho-1)-((rho**(gamma))-1))# mean effective pressure
#output
print("constant pressure=",round(T2,2),"K")
print("cut-off ratio= ",round(rho,2),)
print("air standard efficiency=",round(eta,2),"%")
print("heat supplied= ",round(HS,2),"KJ/Kg")
print("Net work done= ",round(WD,2),"KJ/Kg")
print("characteristics gas equation= ",round(v1,3),"m**3/Kg")
print("characteristics gas equation= ",round(v2,4),"m**3/Kg")
print("Swept volume= ",round(Sv,4),"m**3/Kg")
print("Mean effective pressure= ",round(Pme,1),"bar")
print("Mean effective pressure= ",round(Pm,1),"bar")