AIR STANDARD CYCLE EFFICIENCY
Writing a program for anair standard cycle efficiency:
function [v] = engine_piston_kinematics(bore, stroke, cond_rod, cr, start_crank, end_crank)
a = stroke/2;
R = cond_rod/a;
%calculation formula for swept volume v_s
v_s = (pi/4)*bore^2*stroke;
%calculation formula for clearance volume v_c
v_c = v_s/(cr-1);
theta = linspace(start_crank,end_crank,100);
term1 = 0.5*(cr-1);
term2 = R+1 - cosd(theta);
term3 = (R^2 - sind(theta).^2).^0.5;
v = (1 + term1*(term2 - term3))*v_c;
end
clear all
close all
clc
%Step - 1
%Inputs
gamma = 1.4
%Engine geometric parameters
bore = 0.1;
stroke = 0.1;
con_rod = 0.15;
cr = 12;
%Step - 2
%calculate the swept volume & the clearance volume
v_swept = (pi/4)*bore^2*stroke;
v_clearance = v_swept/(cr-1);
v1 = v_swept + v_clearance;
v2 = v_clearance;
%Step-3
% state variables at state point 1
p1 = 101325 % unit pa
t1 = 500 % Temperature in 'K'
t3 = 2300 % Assumed Temperature in 'K'
%Step -4 To Find P2,T2,Compression Stroke
%state variables at state point 2
%p2 = p1*(v1/v2)^gamma / =p1*(cr)^gamma
p2 = p1*cr^gamma
%using ideal gas law cycle to find t2
%p1v1/t1 = p2v2/t2 / t2 = p2*v2*t1/(p1*v1)
t2 = p2*v2*t1/(p1*v1)
constant_c = p1*v1^gamma;
v_compression = engine_piston_kinematics(bore, stroke, con_rod,cr,180,0)
p_compression = constant_c./v_compression.^gamma
%Step - 5 To Find P3,V3
%state variables at state point 3
%End point of constant volume combustion process V3 = V2
%using ideal gas law cycle to find p3
%p3v3/t3 = p2.v2/t2
v3 = v2
p3 = p2*(t3/t2)
constant_c = p3*v3^gamma;
v_expansion = engine_piston_kinematics(bore, stroke, con_rod,cr,0,180)
p_expansion = constant_c./v_expansion.^gamma
%Step -6 To Find P4,T4
%state variables at state point 4(v4=v1):
% using relation to find out p4
v4 = v1
%p3/v3^gamma = p4/v4^gamma / p4 = p3*(v3/v4)^gamma
p4 = p3*(v3/v4)^gamma
%using ideal gas law cycle to find t4
%p3v3/t3 = p4v4/t4 / t4 = p3*v3*t3(p4*v4)
t4 = p3*v3*t3/(p4*v4)
%Step-7 plotting
figure(1)
hold on
plot(v1,p1,'*','color','r');
plot(v_compression, p_compression);
plot(v2,p2,'*','color','r');
plot(v3,p3,'*','color','r');
plot(v_expansion, p_expansion,'b')
plot(v4,p4,'*','color','r')
plot([v2 v3],[p2 p3])
plot([v4 v1],[p4 p1])
xlabel('volume v')
ylabel('pressure p')
title('P-V Diagram For Otto Cycle')
% Step-8 To Find efficiency of the engine
% Thermal Efficiency
n = (1-( 1/(cr^(gamma-1))))*100