Project

OTTO CYCLE

clear all
close all
clc

% pv diagram of otto cycle
% given
p1=101325
t3=2000
bore=0.1
stroke=0.1
con_rod=0.15
cr=12
gamma=1.4
t1=500
%state 1
swept_vol=3.14/4*bore^2*stroke;
clearance_vol=swept_vol/cr-1;
v1=swept_vol+clearance_vol;

%state 2
v2=clearance_vol;
p2=p1*cr^gamma;
t2=p2*v2*t1/(p1*v1);
c=p1*v1^gamma;
V_compression=engine_kinematics(bore,stroke,con_rod,cr,0,180);
P_compression=c./V_compression;

%state 3
v3=v2;
p3=p2*(t3/t2);

%state 4
v4=v1;
p4=p3*(v3/v4)^gamma;
t4=t3*(v3/v4)^gamma-1;
c=p3*v3^gamma;
V_expansion=engine_kinematics(bore,stroke,con_rod,cr,180,360);
P_expansion=c./V_expansion;

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)


function [V] =engine_kinematics(bore,stroke,con_rod,cr,start_crank,end_crank)

x=stroke/2;
R=con_rod/x;
swept_vol=3.14/4*bore^2*stroke;
clearance_vol=swept_vol/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)).*clearance_vol;
end

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.