Project

P-V Diagram of Otto cycle

AIM

To create P-V diagram of otto cycle and findout its efficiency.

THEORY

In otto cycle there are four process as described in below diagram.

OBJECTIVE

To draw PV diagram of otto cycle using Matlab.

BODY

Codes

clear all;
clc;
close all

%input

d=0.05; %diameter of bore in metre
l=0.05; %legth of stroke in metre
r=12;   %compression ratio
t1=600; %initial/minimum temperature in Kelvin
t3=3000;%maximum temperature in kelvin
R=8.31; %gas constant J/kg k
gm=1.4; %gamma of air

%Formula At point 1

vs=(pi*d^2*l)/4;
v2=vs/(r-1);
v1=vs+v2;
p1=(R*t1)/v1;

%Formula at point 2

t2=t1*r^(gm-1);
p2=(R*t2)/v2;

%Formula at point 3

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

%Formula at point 4

v4=v1;
p4=p3*(1/r^gm);
t4=t3*(1/r^(gm-1));

%For point 1 to 2

V1=linspace(v1,v2,100);
P1=(p1*v1^gm)./V1.^gm;

%For point 2 to 3

V2=v2.*ones(1,100);
T2=linspace(t2,t3,100);
P2=R.*(T2./V2);

%For point 3 to 4

V3=linspace(v3,v4,100);
P3=(p3*v3^gm)./V3.^gm;

%For point 4 to 1

V4=v4.*ones(1,100);
T4=linspace(t4,t1,100);
P4=R.*(T4./V4);

%Efficieny of engine
eff=1-(1/r)^(gm-1);
txt=['Effciency= ' num2str(eff) ''];

%plotting

plot(V1,P1,'b--',V2,P2,'g-',V3,P3,'r:',V4,P4,'linewidth',2)
xlabel('Volume(in cubic metre)');
ylabel('Pressure(in N/m^2)');
title('P-V diagram of standard otto cycle');
text(v3+2*v3,p3,txt,'FontSize',13)

Output

EXPLANATION

In otto cycle first I find out swept volume(vs) with the help of bore diameter and stroke length.Then with the help of compression ratio I find out clearance vol(v2) and then v1. Now, with the help of gas equation [pV=mRT] and adiabetic equation[].I find out pressure, volume and temperature at different point.

Now for plotting, I divide the volume between point 1 and 2 into 100 parts and then using adiabatic eqn. I find out pressure at corresponding volume which are divided between point 1 and 2 and then I plot the graph between volume and pressure.I did this with all other points and i plot them. For Efficiency, I use formula . For displaying efficiency on figure window, I used TEXT command.

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.