Week 2 Air standard Cycle
%otto cycle
clear all
close all
clc
%input
gamma=1.4;
p1=101325;
t3=2300;
%engine kinematics
%compression ratio
cr=12;
%bore (m)
bore=0.1;
%stroke (m)
stroke=0.1;
con_rod=0.15;
%swept volume
v_s=pi*bore^2*stroke/4;
%clearance volume
v_c=v_s/(cr-1);
%state point1
v1=v_c+v_s;
t1=500;
%state point2
v2=v_c;
p2=p1*cr^gamma;
t2=t1*cr^(gamma-1);
%for volume trace
Constant_c=p1*v1^gamma;
V_compression=engine_kinematics(bore,stroke,con_rod,cr,180,0);
P_compression=Constant_c./(V_compression).^gamma;
%state point3
v3=v2;
p3=p2*t3/t2;
%state point4
v4=v1;
p4=p3*(v3/v1)^(gamma);
V_expansion=engine_kinematics(bore,stroke,con_rod,cr,180,360);
Expansion_constant=p3*v3^gamma;
P_expansion=Expansion_constant./(V_expansion).^gamma;
%thermal efficiency
efficiency=(1-(1/(cr)^(gamma-1)))*100 ;
display(['Thermal Efiiciency=',num2str(efficiency),'%'])
figure(1)
hold on
plot(v1,p1,'*','color','r')
plot(v2,p2,'*','color','r')
plot(V_compression,P_compression)
plot(v3,p3,'*','color','r')
plot(v4,p4,'*','color','r')
plot(V_expansion,P_expansion)
grid on
title('P-V diagram')
xlabel('volume axis')
ylabel('pressure axis')
plot([v2 v3],[p2 p3])
plot([v1 v4],[p1 p4])
results:-