Project

Air standard Cycle

PROGRAM :-

clear all
close all
clc

% state variable 
p1=101325
t1=500

% engine geometric parameters
bore=0.1;
stroke=0.1;
con_rod=0.15;
cr=12;

%input
gamma=1.4;
t3=2500;

% calculating the swept volume and the clearance volume

v_swept=(pi/4)*bore^2*stroke;
v_clearance=v_swept/(cr-1)

v1=v_swept+v_clearance 
v2=v_clearance

% state variable at state point 2
%p2v2^gamma=p1v1^gamma
%p2=p1*(v1/v2)^gamma=p1*cr^gamma
p2=p1*cr^gamma;

%p1v1/t1=p2v2/t2 | t2=p2*v2*t1/(p1*v1)
t2=p2*v2*t1/(p1*v1);

constant_c=p1*v1^gamma;
v_compression = engine_kinematics(bore,stroke,con_rod,cr,180,0)
p_compression=constant_c./v_compression.^gamma;

% state varaible at state point 3
v3=v2

% p3v3/t3=p2v2/t2 | p3=p2*t3/t2 
p3=p2*t3/t2 

constant_c=p3*v3^gamma;
v_expansion=engine_kinematics(bore,stroke,con_rod,cr,0,180)
p_expansion=constant_c./v_expansion.^gamma;


% state variable at state point 4
v4=v1

% p3v3^gamma = p4v4^gamma | p4=p3*(v3/v4)^gamma
 p4=p3*(v3/v4)^gamma
 
 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)
 plot(v4,p4,'*','color','r')
 line([v2 v3],[p2 p3],'color','b')
 line([v4 v1],[p4 p1],'color','b')
 
 figure(2)
 plot([v1 v2 v3 v4 v1],[p1 p2 p3 p4 p1],'color','b')
 
 % thermal efficiency
 thermal_efficiency=(1-(v2/v1)^(gamma-1))*100


FUNCTION:-



function [v] =engine_kinematics(bore,stroke,con_rod,cr,starting_crank,ending_crank)

a=stroke/2
R=con_rod/a


v_swept= (pi/4)*bore^2*stroke;
v_clearance= v_swept/(cr-1);


 theta= linspace(starting_crank,ending_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_clearance;
 
 
end

explanation:-

First we have to create the State variable p1 and t1 then u have to give Engine geometric parameters value for Bore,Stroke,Connecting rod,Crank,gamma.

Calculate the Swept volume and The Clearance volume assume as v1 and v2.

In state variable at state point 2 p2v2^gamma & p1v1^gamma are equal. After that pressure p2=p1*cr^gamma.

Then temperature t2=p2*v2*t1/(p1*v1).

after that we have to apply the constant c=p1*v1^gamma

In volume compression v_compression= engine_kinematics(bore,stroke,con_rod,cr,180,0)

presssure compression p_compression=constant_c./v_compression.^gamma.

then it will created the cure p1 v1 & p2 v2 for compression stroke.

In state variable at 3 v3=v4 then u have give equation for pressure3 equal to pressure 2

p3=p2*t3/t2. after that pressure cyle we have to give the constant c for expansion cycle .

then it will created the curve p3 v3 & p4 v4 for expansion stroke.

In state variable 4 v4=v1. then pressure cycle 4 p4=p3*(v3/v4)^gamma.

after that we have to figure it out by using the plot command. It show only the point that has to been plotted in.

then we have to close the point by using line command to join the line [v2 v3 p2 p3] & [v4 v1 p4 p1]. after that p-v diagram has been created.

To create the thermal efficiency by using formula

thermal_efficiency=(1-(v2/v1)^(gamma-1))*100 .

Error faced while programming :-

In call function we dont give clear all close all clc . otherwise i give you error message in command window will running the programe.Like

Result:-

P-v Diagram (figure1):-

Without using comprasion and expansion ( figure 2):-

Thermal efficiency :-

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.