AIR STANDARD CYCLE
AIR STANDARD CYCLE
AIM:
To Solve the Ottocycle using matlab and writing a code for pv diagram of an air standard cycle(Ottocycle). calculate the ouput for thermal efficiency of the Engine.
SOFTWARE : MATLAB
OBJECTIVE:
- To calculate the thermal efficiency of the engine.
- To create pv diagram using matlab.
- To understand the difference between the ideal ottocycle and actual ottocycle.
PROCEDURE:
P-V Diagram of Ottocycle

Ideal ottocycle has-
- 1-2 = isentropic compression
- 2-3 =constant volume heat addition
- 3-4 =isentropic expansion
- 4-1 =constant volume heat rejection
Inputs-
v1 =volume at point 1
v2 =volume at point 2
v3 =volume at point 3
v4 =volume at point 4
p1 =pressure at point 1
p2 =pressure at point 2
p3 =pressure at point3
p4 =pressure at point4
t1 = temperature at point1
t2 = temperature at point2
t3 =temperature at point3
These are the different pressures,temperatures and volume at point 1,2 and 3,4.At the begin of the program engine geomentric parameters are given with inputs of gamma and p1,t1,t3.which are gamma=1.4,t3=2300,p1=101325,t1=500.
Engine geomentric parameters
- Bore
- stroke
- connecting rod
- compression ratio
These parameters are used for Calculating the swept volume and clearence volume. with calculation of the swept and clearence volume ,we can find volume at point 1 and 2.
v_swept= (pi/4)*bore^2*stroke
v_clearence= v_swept/(cr-1)
(cr-compression ratio)
v1=v_swept+v_compression
v2=v_clearence
for finding the pressure at point 2
p2=p1*(cr)^gamma;
for finding the temperature at point 2
t2=p2*v2*t1/(p1*v1);
process 2-3:
constant volume heat addition process volume is constant .then,volume at the point 2 is equal to volume at the point 3.
so, v3=v2;
for finding pressure at point 3
p3=(p2*p3)/t2;
process 4-1:
constant volume heat rejection process volume is again constant .so,v4=v1;
for finding pressure at point 4
p4=p3*(v3/v4)^gamma;
Matlab code for finding the pressure, temperature and volume and plotting the points for the variable.
clear all
close all
clc
%inputs
gamma=1.4;
t3=2300;
%state variable
p1= 101325;
t1= 500;
%engine geomentric parameters
bore = 0.1;
stroke=0.1;
con_rod=0.15;
cr=12;
%calculating the swept volume and the clearence volume
v_swept=(pi/4)*bore^2*stroke;
v_clearence=v_swept/(cr-1);
v1=v_swept+v_clearence;
v2=v_clearence;
%state variable at state point 2
%p2v2^gamma=p1v1^gamma
%p2=p1*(v1/v2)^gamma
p2=p1*(cr)^gamma;
% p1v1/t1=p2v2/t2| t2=p2*v2*t1/(p1*v1)
t2 = p2*v2*t1/(p1*v1);
%state variable at state point 3
v3=v2;
%p2/t2=p3/t3 | p3= (p2*t3)/t2
p3= (p2*t3)/t2;
%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','g')
plot(v2,p2,'*','color','g')
plot(v3,p3,'*','color','g')
plot(v4,p4,'*','color','g')
This program is used for plotting the points of variable (volume,temperature and pressure) .

figure (1): points of variable
for connecting these plot points we code the plotting code,which is
figure(2)
plot([v1 v2 v3 v4],[p1 p2 p3 p4],'color','r');

figure(2) connecting the plot we get straight line forming ottocycle .
- The connection of the plot in straight line forming ottocycle.but this straight does not form p-v diagram . In p-v diagram there are rise and decrease in volume ,pressure and temperature .so this has to be changed with curved line.
- for forming the actual ottocycle a function should be introduced in the ottocycle program.
function which is introduced in ottocycle program
function [v]= engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank)
a=stroke/2;
R=con_rod/a;
v_s=(pi/4)*bore^2*stroke;
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
- when this function is used in ottocycle variable program code the required curve for p-v diagram is formed
for this function we required a formula to apply for ottocycle program
V/Vc=1+1/2(cr-1)[R+1-cos(theta)-(R^2-sin(theta)^2)^1/2]
these formulae are separated into three terms which are known as term 1,2 and 3.
- After apply the formulae in the code .In command box type the variables of (bore,stroke,con_rod,cr,start_crank,end_crank)
In the form ,V_cmpression=engine_kinematics(0.1,0.1,0.15,12,0,180) . we get the array of values .that values are plotted by typing plot(v_compression)in the command box.
figure(3): curve formed by changing the valves of theta
By changing the values of the satr_crank and end_crank in theta using linespace command.
theta=linespace(0,start_crank,end_crank) and theta=linspace(start_crank,end_crank,100)
After applying changes in the function .Apply the code in variable ottocycle program
clear all
close all
clc
%inputs
gamma=1.4;
t3=2300;
%state variable
p1= 101325;
t1= 500;
%engine geomentric parameters
bore = 0.1;
stroke=0.1;
con_rod=0.15;
cr=12;
%calculating the swept volume and the clearence volume
v_swept=(pi/4)*bore^2*stroke;
v_clearence=v_swept/(cr-1);
v1=v_swept+v_clearence;
v2=v_clearence;
%state variable at state point 2
%p2v2^gamma=p1v1^gamma
%p2=p1*(v1/v2)^gamma
p2=p1*(cr)^gamma;
constant_c = p1*v1^gamma;
v_compression = engine_kinematics(bore,stroke,con_rod,cr,180,0);
p_compression= constant_c./v_compression.^gamma;
% p1v1/t1=p2v2/t2| t2=p2*v2*t1/(p1*v1)
t2 = p2*v2*t1/(p1*v1);
%state variable at state point 3
v3=v2;
%p2/t2=p3/t3 | 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','g')
plot(v_expansion, p_expansion)
%plot(v2,p2,'*','color','g')
%plot(v3,p3,'*','color','g')
plot(v_compression, p_compression)
%plot(v4,p4,'*','color','g')
plot([v2 v3],[p2 p3],'color','r');
plot([v4 v1],[p4 p1],'color','r');
This function differentiate the ideal ottocycle to actual ottocycle in p-v diagram.byrunning this function the actual ottocycle of p-v diagram is created.

figure(4): p-v diagram of ottocycle
thermal efficiencyof the ottocycle-
thermal_effe =(1-(1/cr^(gamma-1)))*100;
thermal efficiency of engine is 62.9893.