# Variables
m = 1; #in kg
R = 0.287; #Universal Gas Consmath.tant
r = 7; #Compression Ratio
P1 = 1; #in bar
T1 = 24+273; #in K
T3 = 2000; #in K
G = 1.4; #Gamma
# Calculations and Results
ASE = (1-(1./(r)**(G-1)))*100;
print 'Air standand Efficiency is %3.1f Percent'%(ASE);
P2 = P1*(r)**G;
print 'Pressure at end of Compression is %3.2f Bar'%(P2);
T2 = T1*((r)**(G-1));
print 'Temperature at end of Compression is %3.2f K'%(T2);
Cv = 0.718;
Q = Cv*(T3-T2);
print 'Heat Supplied is %3.2f kJ/kg'%(Q);
W = ASE*Q/100;
V1 = (m*R*T1)/(P1*100);
V2 = V1/r;
V = V1-V2;
Pm = W/V;
print 'Mean Effective Pressure is %3.2f kPa'%(Pm);
# Variables
T1 = 323.; #in K
T2 = 673.; #in K
G = 1.4;
# Calculations and Results
r_G = T2/T1;
r = (r_G)**(1./(G-1));
print 'Compression Ratio is %2.2f '%(r);
Eff = 100*(1-(1./(r**(G-1))));
print 'Air standand Efficiency is %2.0f Percent '%(Eff);
# Variables
P1 = 97.; #in kPa
T1 = 323.; #in K
r = 5.; #Compression Ratio
Q = 930.; #in kJ/kg
G = 1.4;
Cv = 0.718;
# Calculations and Results
T2 = T1*(r**(G-1));
T3 = (Q/Cv)+T2;
print 'Maximum Temperature Attained is %2.2f K'%(T3);
Eff = 100*(1-(1./(r)**(G-1)));
print 'Thermal Efficiency of cycle is %2.1f Percent'%(Eff);
W = Eff*Q/100;
print 'Work Done is %2.2f kJ/kg'%(W);
# Variables
T1 = 57.+273; #in K
T2 = 603.+273; #in K
T3 = 1950.+273; #in K
T4 = 870.+273; #in K
G = 1.4;
P1 = 1.; #in bar
Cp = 1.005;
Cv = 0.718;
# Calculations and Results
P2 = P1*((T2/T1)**((G)/(G-1)));
print 'Maximum Pressure attained is %2.1f bar'%(P2);
Qs = Cp*(T3-T2); #Heat Supplied
Qr = Cv*(T4-T1); #Heat Rejected
Eff = 100*(1-(Qr/Qs));
print 'Efficiency is %2.0f Percent'%(Eff);
# Variables
V2 = 0.2; #in cm**3
V3 = V2;
Vc = V2;
Vs = 1.2; #in cm**3
V1 = V2+Vs;
G = 1.4;
# Calculations
r = (V1/V2);
Eff = 100*(1-(1./(r**(G-1))));
# Results
print 'Efficiency of Engine is %2.0f Percent'%(Eff);
# Variables
rc = 14.; #Adiabatic Compression Ratio
ra = 8.; #Adiabatic Expansion Ratio
G = 1.4;
Z = rc/ra; #Cutoff Ratio
# Calculations
#It is a diesel Cycle
Eff = 100*(1-((1./(rc**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));
# Results
print 'Efficiency is %2.1f Percent'%(Eff);
# Variables
Eff = 0.6; #Efficiency
T2 = 283; #in K
# Calculations
T1 = T2/(1-Eff);
# Results
print 'Initial Temperature is %2.1f K'%(T1);
# Variables
D = 10; #Diameter in cm
L = 15; #Length in cm
Vs = (22./7)*(1./4)*D*D*L; #in cm**3
Vc = 250; #in cm**3
V2 = Vc;
V1 = Vs+Vc;
r = V1/V2;
G = 1.4;
# Calculations
Eff = 100*(1-(1./(r**(G-1))));
# Results
print 'Efficiency is %2.1f Percent'%(Eff);
import math
# Variables
T3 = 15+273; #in K
T4 = T3;
P3 = 1.1; #in bar
P4 = 4; #in bar
P1 = 12; #in bar
N = 150; #in rpm
G = 1.4;
# Calculations and Results
T1 = T4*((P1/P4)**((G-1)/G));
Eff = 100*(1-(T4/T1));
print 'The Efficiency is %3.2f Percent'%(Eff);
r = P4/P3;
R = 0.287;
m = 1;
W = m*R*(T1-T3)*(math.log(r));
P = W*(N/60);
print 'The Power is %3.1f kW'%(P);
# Variables
T3 = 1350+273; #in K
T1 = 30+273; #in K
Qs = 750; #in kJ/kg
Cv = 0.718;
G = 1.4;
# Calculations and Results
#For Process 2-3
T2 = T3-(Qs/Cv);
r = (T2/T1)**(1./(G-1));
print 'The compression Ratio is %3.2f '%(r);
Eff = 100*(1-(1./(r**(G-1))));
print 'The Efficiency is %3.1f Percent'%(Eff);
W = Eff*Qs/100;
print 'The Work Output is %3.0f kJ/kg'%(W);
P21 = (r**G);
P32 = T3/T2;
P31 = P21*P32;
print 'Ratio of maximum to minimum pressure is %3.2f '%(P31);
# Variables
Vs = 500; #in cm**3
Vc = 55; #in cm**3
T1 = 30+273; #in K
P1 = 1; #in bar
T3 = 1450+273; #in K
G = 1.4;
R = 0.287;
Cv = 0.718;
# Calculations and Results
r = (Vs+Vc)/Vc;
Eff = 100*(1-(1./(r**(G-1))));
print 'The standand air Efficiency is %3.2f Percent'%(Eff);
T2 = T1*(r**(G-1));
Qs = Cv*(T3-T2);
W = Eff*Qs;
V1 = Vc+Vs;
m = (P1*100*V1*(10**-6))/(R*T1);
Pm = (W*m)/(100*(Vs*(10**-6)));
print 'The Mean Effective Pressure is %3.1f kPa'%(Pm);
# Variables
r = 6; #Compression Ratio
T1 = 20+273; #in K
G = 1.4;
Cv = 0.718;
Qs = 1900;
# Calculations and Results
Eff = 100*(1-(1./(r**(G-1))));
print 'The Efficiency is %3.2f Percent'%(Eff);
T2 = T1*(r**(G-1));
print 'The value of T2 is %3.0f K'%(T2);
T3 = (Qs/Cv)+T2;
print 'The value of T3 is %3.0f K'%(T3);
T4 = T3/(r**(G-1));
print 'The value of T4 is %3.0f K'%(T4);
W = Qs*Eff/100;
print 'The Work Output is %3.0f kJ/kg'%(W);
# Variables
D = 0.1; #Diameter
L = 0.12; #Length
V = (22./7)*(1./4)*D*D*L;
T1 = 19+273;
r = 6.5; #Compression ratio
P1 = 1; #in bar
G = 1.4; #Gamma
Vs = 9.425*(10**-4);
# Calculations and Results
Vc = Vs/(r-1);
V1 = Vc+Vs;
print 'V1 = %3.5f m**3'%(V1);
V2 = Vc;
V3 = Vc;
P2 = P1*(r**G);
print 'P2 = %3.1f bar'%(P2);
T2 = T1*(r**(G-1));
print 'T2 = %3.1f K'%(T2);
#For process 2-3
Qs = 1900;
Cv = 0.718;
T3 = (Qs/Cv)+T2;
print 'T3 = %3.1f K'%(T3);
P3 = P2*(T3/T2);
print 'P3 = %3.1f bar'%(P3);
#For process 4-1
V4 = V1;
P4 = P3*((V3/V4)**G);
print 'P4 = %3.1f bar'%(P4);
T4 = T1*(P4/P1);
print 'T4 = %3.1f K'%(T4);
Eff = 100*(1-(1./(r**(G-1))));
print 'Efficiency = %3.1f Percent'%(Eff);
R = 0.287;
m = (P1*100*V1)/(R*T1);
Pm = (Eff*Qs*m)/(10000*Vs);
print 'Mean Effective Pressure = %3.1f bar'%(Pm);
# Variables
P1 = 1.; #in bar
T1 = 20.+273; #in K
P2 = 39.; #in bar
P3 = P2;
T3 = 1100.+273; #in K
G = 1.4;
# Calculations
#For reversible Adiabatic Process 1-2
T2 = T1*((P2/P1)**((G-1)/G));
r = (P2/P1)**(1./G);
Z = T3/T2;
Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));
# Results
print 'Efficiency: %2.2f Percent'%(Eff);
# Variables
r = 16.; #Compression Ratio
D = 0.21; #Diameter
L = 0.3; #Length
P1 = 1; #in bar
G = 1.4;
T1 = 17+273; #in K
Z = (0.1*(r-1)+1)
# Calculations and Results
Vs = (22./7)*(1./4)*D*D*L;
Vc = Vs/15;
V2 = Vc;
print 'Vc = V2 = %2.6f m**3'%(Vc);
V1 = Vc+Vs;
print 'V1 = %2.4f m**3'%(V1);
V3 = (0.1*(Vs))+(V2);
print 'V3 = %2.4f m**3'%(V3);
#For Process 1-2
P2 = r**G;
print 'P2 = %2.1f bar'%(P2);
T2 = T1*(r**(G-1));
print 'T2 = %2.1f K'%(T2);
T3 = Z*T2;
print 'T3 = %2.1f K'%(T3);
P3 = P2;
P4 = P3*((V3/V1)**G);
print 'P4 = %2.1f bar'%(P4);
T4 = T3*((V3/V1)**(G-1));
print 'T4 = %2.1f K'%(T4);
Cv = 0.718;
Cp = 1.005;
Eff = 100*(1-((Cv*(T4-T1))/(Cp*(T3-T2))));
print 'Efficiency: %2.1f Percent'%(Eff);
R = 0.287;
m = (P1*100*V1)/(R*T1);
Pm = (m*((Cp*(T3-T2))-(Cv*(T4-T1))))/(Vs);
print 'Mean Effective Pressure = %2.1f kPa'%(Pm);
N = 300; #Cycles per minute
W = 10.41;
EP = W*(N/60);
print 'Engine Power = %2.2f kW'%(EP);
# Variables
r = 19.; #Compression Ratio
P1 = 1.; #in bar
T1 = 17.+273; #in K
Qs = 730.; #in kJ/cycle
G = 1.4;
# Calculations and Results
#For process 1-2
m = 1; #in kg
R = 0.287; #Universal Gas Consmath.tant
V1 = (m*R*T1)/(P1*100);
print 'V1 = %2.4f m**3/kg'%(V1);
V2 = V1/r;
print 'V2 = %2.4f m**3/kg'%(V2);
P2 = P1*(r**G);
print 'P2 = %2.1f bar'%(P2);
T2 = T1*(r**(G-1));
print 'T2 = %2.1f K'%(T2);
#For Process 2-3
Cv = 0.718;
T3 = (Qs/(Cv*m))+T2;
print 'T3 = %2.1f K'%(T3);
P3 = P2;
print 'P3 = %2.1f bar'%(P3);
#As pressure is consmath.tant
V3 = (T3/T2)*V2;
print 'V3 = %2.4f m**3/kg'%(V3);
#For process 3-4
V4 = V1;
T4 = T3*((V3/V4)**(G-1));
print 'T4 = %2.1f K'%(T4);
P4 = P3*((V3/V4)**G);
print 'P4 = %2.2f bar'%(P4);
Cp = 1.005;
W = ((Cp)*(T3-T2))-((Cv*(T4-T1)));
print 'Work Done = %2.1f kJ/kg'%(W);
Eff = 100*(W/(Cp*(T3-T2)));
print 'Efficiency = %2.2f Percent'%(Eff);
Pm = W/(V1-V2);
print 'Mean Effective Pressure = %2.2f kPa'%(Pm);
# Variables
r = 19.; #Compression Ratio
Re = 9.1; #Expansion Ratio
Z = r/Re;
G = 1.4;
# Calculations
Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));
# Results
print 'Efficiency: %2.2f Percent'%(Eff);
import math
# Variables
D = 16.; #in cm
L = 24.; #in cm
Vc = 340.;
V2 = Vc;
G = 1.4;
# Calculations
Vs = (22./7)*(1./4)*D*D*L;
V1 = Vs+Vc;
r = V1/V2;
#Cut-off is 6% of the stroke
Co1 = 0.06;
V3 = (Co1*(V1-V2))+V2;
Z = V3/V2;
x = (Z**G)-1;
y = (r**(G-1))*(G)*(Z-1);
Eff1 = 100*(1-((x)/(y)));
#Cut-off is 10% of the stroke
Co2 = 0.10;
V3 = (Co2*(V1-V2))+V2;
Z = V3/V2;
x = (Z**G)-1;
y = (r**(G-1))*(G)*(Z-1);
Eff2 = 100*(1-((x)/(y)));
Loss = ((Eff1-Eff2)*100)/Eff1;
# Results
print 'Loss: %2.2f Percent'%(r);
import math
# Variables
T3 = 1000.+273; #in K
T1 = 27.+273; #in K
G = 1.25;
# Calculations and Results
r = (T3/T1)**G;
print 'Compression Ratio: %2.1f '%(r);
T2 = math.sqrt(T1*T3);
T4 = T2;
print 'T2 = T4 = %2.0f K'%(T2);
Cv = 0.718;
W = Cv*((math.sqrt(T3))-(math.sqrt(T1)))**2;
print 'Maximum Work Done: %2.0f kJ/kg'%(W);
# Variables
r = 6; #Compression Ratio
G = 1.4;
# Calculations and Results
Eff = 100*(1-(1./(r**(G-1))));
print 'Efficiency: %2.2f Percent'%(Eff);
m = 1.; #in kg
R = 0.287; #Universal Gas Consmath.tant
T1 = 27.+273; #in K
P1 = 1.; #in bar
V1 = (m*R*T1)/(P1*100);
V2 = V1/r;
Vc = V2;
Vs = V1-Vc;
T2 = T1*(r**(G-1));
Cv = 0.718;
Qs = 1046;
T3 = (Qs/Cv)+T2;
T4 = T3/(r**(G-1));
W = Qs-(Cv*(T4-T1));
Pm = W/Vs;
print 'Effective Mean Pressure: %2.2f kPa'%(Pm);
# Variables
T1 = 87.+273; #in K
r = 14.; #Compression Ratio
T3 = 1795.+273; #in K
T4 = 677.+273; #in K
G = 1.4;
# Calculations and Results
T2 = T1*(r**(G-1));
print 'T2 = %2.1f K'%(T2);
Cp = 1.005;
Cv = 0.718;
W = (Cp*(T3-T2))-(Cv*(T4-T1))
Qs = Cp*(T3-T2);
Eff = (W*100)/Qs;
print 'Efficiency: %2.1f Percent'%(Eff);
# Variables
r = 16.; #Compression Ratio
P1 = 1.; #in bar
T1 = 20.+273; #in K
T3 = 1431.+273; #in K
G = 1.4;
T2 = T1*(r**(G-1))
m = 1;
R = 0.287;
V1 = (m*R*T1)/(P1*100);
V2 = V1/r;
# Calculations and Results
#For Constant Pressure Process 2-3
V3 = V2*(T3/T2);
Z = V3/V2;
Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));
print 'Efficiency is %2.1f Percent'%(Eff);
Cp = 1.005;
Qs = Cp*(T3-T2);
W = Qs*Eff/100;
Vs = V1-V2;
Pm = W/Vs;
print 'Effective Mean Pressure %2.1f kPa'%(Pm);
# Variables
r = 8.;
T1 = 310.; #in K
T3 = 1600.; #in K
G = 1.4;
Cv = 0.717;
# Calculations and Results
#For process 1-2
T2 = T1*(r**(G-1));
#Now Heat Supplied
Qs = Cv*(T3-T2);
print 'Heat Supplied = %2.1f kJ/kg'%(Qs);
#Efficiency of Cycle
Eff = 100*(1-(1./(r**(G-1))))
print 'Efficiency is %2.1f Percent'%(Eff);
# Variables
r = 15.; #Compression Ratio
P1 = 100.; #in kPa
T1 = 27.+273;
Cp = 1.006;
Cv = 0.717;
G = 1.4;
# Calculations and Results
#Cut off takes place at 12% of Working Stroke
T2 = T1*(r**(G-1));
print 'T2 = %2.1f K'%(T2);
P2 = P1*(r**G);
print 'P2 = %2.1f kPa'%(P2);
Z = (0.12*(r-1))+1;
Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));
print 'Efficiency is %2.1f Percent'%(Eff);
# Variables
T1 = 288.; #in K
T3 = 1673.; #in K
Qs = 800.; #in kJ/kg
G = 1.4;
Cv = 0.718;
R = 0.287;
P1 = 1.;
# Calculations and Results
Cp = Cv*G;
T2 = T3-(Qs/Cp);
x = T2/T1;
r = x**(1./(G-1));
print 'Compression Ratio %2.1f '%(r);
Eff = 100*(1-(1./(r**(G-1))))
print 'Efficiency is %2.1f Percent'%(Eff);
P3 = r*T3*P1/T1;
print 'P3 = %2.1f bar'%(P3);
# Variables
T2 = 293; #in K
Eff = 0.7;
# Calculations
T1 = T2/(1-Eff);
# Results
print 'T1 = %2.1f K'%(T1);
# Variables
T1 = 330.; #in K
T2 = 876.; #in K
T3 = 2223.; #in K
T4 = 1143.; #in K
P1 = 1.; #in bar
G = 1.4;
# Calculations and Results
Cv = 0.718;
Cp = 1.005;
Eff = 100*(1-((Cv*(T4-T1))/(Cp*(T3-T2))));
print 'Efficiency is %2.1f Percent'%(Eff);
#For Process 1-2
P2 = P1*((T2/T1)**(G/(G-1)));
print 'Maximum Pressure %2.2f bar'%(P2);
# Variables
T1 = 25.+273; #in K
T3 = 1500.+273; #in K
Qa = 900.; #in kJ/kg
Cv = 0.718;
G = 1.4;
# Calculations and Results
T2 = T3-(Qa/Cv);
r = (T2/T1)**(1./(G-1));
print 'Compression Ratio is %2.1f '%(r);
Eff = 100*(1-(1./(r**(G-1))));
print 'Efficiency is %2.1f Percent'%(Eff);
Px = r**G; #Max Pressure
Py = T3/T2; #1./Min Pressure
P = Px*Py;
print 'Pressure Ratio %2.1f '%(P);
# Variables
P1 = 1.; #in bar
T1 = 15.+273; #in K
P2 = 15.; #in bar
P3 = 40.; #in bar
G = 1.4;
Cv = 0.718;
# Calculations and Results
r = (P2/P1)**(1./G);
print 'Compression Ratio is %2.1f '%(r);
Eff = 100*(1-(1./r**(G-1)))
print 'Efficiency is %2.1f Percent'%(Eff);
T2 = T1*(r**(G-1));
T3 = T2*(P3/P2);
T4 = T3/(r**(G-1));
W = Cv*(T3-T2+(T1-T4))
R = 0.287;
V1 = (R*T1)/P1;
V2 = V1/r;
Pm = W/(V1-V2);
print 'Mean Effective Pressure %2.4f bar'%(Pm);
# Variables
P2 = 44.; #in bar
P3 = P2;
T3 = 1600.+273; #in K
P1 = 1.; #in bar
T1 = 27.+273; #in K
G = 1.4;
# Calculations
T2 = T1*((P2/P1)**((G-1)/G))
R = 0.287;
V1 = (R*T1)/(P1*100);
r = (P2/P1)**(1./G);
Z = T3/T2;
Eff = 100*(1-((1./(r**(G-1)))*(1./G)*((Z**G)-1)/(Z-1)));
# Results
print 'Efficiency is %2.2f Percent'%(Eff);
# Variables
r = 16.; #Compression Ratio
P1 = 1.; #in bar
T1 = 20.+273;
T3 = 1431.+273; #in K
G = 1.4;
# Calculations and Results
T2 = T1*(r**(G-1));
Z = T3/T2;
T4 = (Z**G)*T1;
Eff = 100*(1-((T4-T1)/(G*(T3-T2))))
print 'Efficiency is %2.1f Percent'%(Eff);
Cp = 1.005;
Qs = Cp*(T3-T2);
W = Eff*(Qs/100);
R = 0.287;
V1 = (R*T1)/(P1*100);
V2 = V1/r;
V = V1-V2;
Pm = W/(V);
print 'Mean Effective Pressure %2.1f kPa'%(Pm);
# Variables
P1 = 1.; #in bar
T1 = 15.+273; #in K
P2 = 15.; #in bar
P3 = 40.; #in bar
G = 1.4;
# Calculations and Results
r = (P2/P1)**(1./G);
Eff = 100*(1-(1./(r**(G-1))))
print 'Efficiency is %2.1f Percent'%(Eff);
T2 = T1*((P2/P1)**((G-1)/G))
T3 = T2*(P3/P2);
Cv = 0.718;
Qs = Cv*(T3-T2);
W = Eff*Qs;
R = 0.287;
V1 = (R*T1)/(P1*100);
V2 = V1/r;
Vs = V1-V2;
Pm = W/(Vs*100);
print 'Mean Effective Pressure is %2.1f kPa'%(Pm);