Project

PV Diagram of Otto Cycle

%this program is for the pv diagram generation of an otto cycle engine
%having bore=0.1m , stroke=0.1m, connecting rod length=0.4m, compression
%ratio=9, pressure at start of compression=101325 N/m^2 , temperature
%at start of compression=300k and temperature after combustion=2300k
clear all
close all
clc
%heat capacity ratio
gamma=1.4;
%given state variables
p1=101325;
t1=300;
t3=2300;
%engine parameters
bore=0.1;
stroke=0.1;
con_rod=0.4;
cr=9;
%swept and clearance volume
v_swept=(pi/4*bore*bore*stroke);
v_clearance=v_swept/(cr-1);
%volume at point 1 and 2
v1=v_swept+v_clearance;%max volume
v2=v_clearance;%min volume
%state variables at point 2
p2=p1*cr^gamma;
t2=t1*cr^(gamma-1);
%state variables at point 3
p3=p2*t3/t2;
v3=v2;
%state variables at point 4
p4=p3/(cr^gamma);
v4=v1;
%for volume and pressure at different crank angles during compression
V_comp=engine_kinematics_fn(bore,stroke,con_rod,cr,180,0);
C=p1*v1^gamma;
P_comp=C./(V_comp.^gamma);
%for volume and pressure at different crank angles during expansion
V_exp=engine_kinematics_fn(bore,stroke,con_rod,cr,0,180);
C1=p3*v3^gamma;
P_exp=C1./(V_exp.^gamma);
%plotting of pv diagram for the corresponding otto cycle
figure(1)
xlabel(\'volume\')
ylabel(\'pressure\')
hold on
plot(v1,p1,\'*\',\'color\',\'r\')
plot(V_comp,P_comp)%for isentropic compression process
plot(v2,p2,\'*\',\'color\',\'r\')
plot([v2,v3],[p2,p3])%for constant volume heat addition
plot(v3,p3,\'*\',\'color\',\'r\')
plot(V_exp,P_exp)%for isentropic expansion process
plot(v4,p4,\'*\',\'color\',\'r\')
plot([v4,v1],[p4,p1])%for constant volume heat rejection
%efficiency of otto cycle
eff=1-(1/(cr^(gamma-1)))%from thermodynamic formula
figure(2)
plot(cr,eff,\'*\',\'color\',\'b\')
xlabel(\'compression ratio\')
ylabel(\'efficiency\')
axis([8,10,0,1])

PV Diagram:

Efficiency corresponding to compression ratio of 9:

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.