MATLAB program to solve Otto Cycle and plotting it's P-V characteristics and Calculating Thermal Efficiency
To create MATLAB program for Otto Cycle.
OBJECTIVE
- To draw PV characteristics.
- To calculate Thermal Efficiency.
BODY OF CONTENT
An Otto cycle is one of the basic Air Standard cycle on which the I.C engine works. Petrol engine is practical implementation of Otto cycle.
The variation between stages is as follows:
1-2 Isentropic Compression.
2-3 Constant Volume Heat Addition.
3-4 Isentropic Expansion.
4-1 Constant Volume Heat Rejection.
Given Geometric Parameters of engine:
Bore (d) = 0.1 m;
Stroke(L) =0.1 m;
Connecting Rod Length(l) = 0.15 m;
Compression Ratio (r) = 12;
CODE TO PLOTE STATES
clear all
close all
clc
%engine geometry
d = 0.1;
L = 0.1;
l = 0.15;
r = 12;
%inputs
gamma = 1.4;
p1 = 101325;
t1 = 300;
t3 = 2000;
%swept and clearance vol
v_s = pi*d^2*L/4;
v_c = v_s/(r-1);
%state1
v1 = v_s + v_c;
%state2
v2 = v_c;
p2 = p1*r^gamma;
t2 = p2*v2*t1/p1*v1;
%state3
v3 = v2;
p3 = t3*p2/t2;
%state4
v4 = v1;
p4 = p3/r^gamma;
t4 = p4*v4*t3/(p3*v3);
%plotting
figure(1)
hold on
plot(v1,p1,'*','color','r')
plot(v2,p2,'*','color','r')
plot(v3,p3,'*','color','r')
plot(v4,p4,'*','color','r')
xlabel('V')
ylabel('P')
figure(2)
plot([v1 v2 v3 v4],[p1 p2 p3 p4],'color','b')