Project

To plot P-V diagram of Otto cycle using Matlab programming and find efficiency of the otto cycle

The Internal combustion engine working on otto cycle is called Spark Ignition(SI) engines or we can say otto cycle is the working cycle for SI Engine

The Otto cycle consists of four processes,

1 – 2 isentropic compression from V1 to V2

-Piston moves from BDC to TDC without exchanging the heat and no mechanical loss due to friction

2 – 3 addition of heat Q23 at constant volume

-Piston is momentarily at rest at TDC this phase is known as Ignition phase.

3 – 4 isentropic expansion to the original volume

-The increased high pressure exerts a force on piston and piston moves toward BDC.

4 – 1 rejection of heat Q41 at constant volume

-Piston is momentarily at rest at BDC and the heat is removed by heat sink

INPUTS (Main program)

Bore length =0.1m

Stroke length=0.1m

Length of connecting rod=0.15m

Compression Ratio= 12

(MAIN PROGRAM)

clear all
close all
clc
%program to draw otto cycle

gamma=1.4;
t3=2300;
%state variable

p1=101325;
t1=500;

%Engine geometric parameters

bore=0.1;
stroke=0.1;
con_rod=0.15;
cr=12;

%calculate the swept volume and clearance volume
v_swept=(pi/4)*bore^2*stroke;
v_clearance=v_swept/(cr-1);
v1=v_swept+v_clearance;
v2=v_clearance;
%For isentropic reaction
constant_c=p1*v1^gamma;
V_compression=piston_Kinematics(bore, stroke, con_rod, cr,180, 0);
P_compression=constant_c./V_compression.^gamma;
%State variable of state point 2
%p2v2^gamma=p1v1^gamma

p2=p1*cr.^gamma;
%p1v1/t1=p2v2/t2
t2=p2*v2*t1/(p1*v1);

%state point 3
v3=v2;
%p3v3/t1=p2v2/t2
p3=p2*t3/t2;
constant_c=p3*v3^gamma;
V_expansion=piston_Kinematics(bore, stroke, con_rod, cr,0, 180);
P_expansion=constant_c./V_expansion.^gamma;


%State variable 4
v4=v1;

%p3v3^gamma=p4v4^gamma
p4=p3*(v3/v4)^gamma;
n=1-(1/cr^gamma-1)                  

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')

plot([v2,v3],[p2,p3])
plot([v1,v4],[p1,p4])
title('Otto Cycle')
xlabel('Volume')
ylabel('Pressure')
grid on


Steps for programming main program

Step 1- Provide all the input parameters such as: bore, stroke, connecting rod,compression ratio,gamma and t3.

Step 2- Calculate Clearance Volume,Swept volume.

Step 3-Calculate state variables At point 1,2,3,4 of PV Diagram

For point 1- P1=101325

V1=Swept volume + Clearance Volume

T1= 500 (assumed)

For point 2-`p2=p1*cr.^gamma` ,`(V_1)/V_2=c, P_2V_2^gamma=P_1V_1^gamma` ,(for isentropic process)

V2=Clearance volume

`T_2=(P_2V_2T_1)/(P_1V_1), ((P_1V_1)/T_1=(P_2V_2)/T_2)`

For point 3-

V3=V2

`P_3=(P_2T_3)/T_2, ((P_3V_3)/T_3=(P_2V_2)/T_2)`

T3=2300 (Input)

Step 4: Calculate V_compression and V_expansion from the function program.

Step 5:Calculate

P_compression=`(c)/(V__compression^gamma` `(c=P_1V_1^gamma)`

P_expansion= `(C)/(V__expansion)` `(C=P_3V_3^gamma)`

Step 6: Plot the all 4 state point and plot (V_Compression,P_Compression),(V_expansion,P_expansion)

(Function Program)

function [V]=piston_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

Steps for programming function program

Step 1: Name of the function program shoud be same as file name “piston_Kinematics” and Parameters as (Bore ,Stroke,connecting rod,compression ratio, Start angle and end angle)

Step 2: Put the Formulas

  • a ( Crank Radius) =`(Stroke)/2`
  • R =`(Con-rod)/(Crank -Radius`
  • Formula for Volume Trace
  • `V/V^c=1+1/2(rc-1)[R+1+costheta-(R^2-sin^2theta)^0.5` (To find the volume trace)
  • The term is divided for our ease in term1,term2,term3.

OUTPUT : P-V Plot of Otto cycle

Fig 1: P-V plot of Otto cycle Fig 2: Output Window

Results: Sucessfully plot the graph of P-V Diagram using matlab programming and find the efficency of otto cycle

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.