Project

Plotting the Air standard cycle (Otto cycle) using MATLAB.

AIM - To plot the Pressure v/s Volume diagram of Air standard cycle (Otto cycle) and to calculate the thermal efficiency of Air standard cycle (Otto cycle)

Theory -

The Otto cycle is a cycle of engine operation which requires four strokes of the piston: for induction, compression, ignition, and exhaust. The fuel and air mixture is compressed before combustion is started by an electrical spark or other means. Named after German engineer Nikolaus Otto.


The processes involved in Ideal Otto cycle are as follows :-

  1. Process 1–2 is an adiabatic (isentropic) compression of the charge as the piston moves from bottom dead centre (BDC) to top dead centre (TDC).
  2. Process 2–3 is a constant-volume heat transfer to the working gas from an external source while the piston is at top dead centre. This process is intended to represent the ignition of the fuel-air mixture and the subsequent rapid burning.
  3. Process 3–4 is an adiabatic (isentropic) expansion (power stroke).
  4. Process 4–1 completes the cycle by a constant-volume process in which heat is rejected from the air while the piston is at bottom dead centre.
  • Governing Equations -

For Isentropic processes 1-2 and 3-4

P1∗V1γ=P2∗V2γ and P1 * V1/T1 = P2 *V2/T2P1∗V1/T1=P2∗V2/T2

For Volume trace -

`V/(V_c) = 1+1/2(cr-1)[R+1-costheta-(R^2-(sintheta)^2)^(1/2)`

where θ is the crank angle

Thermal Efficiency = `eta_(th) = 1-(1/(cr)^(gamma-1))`

cr = compression ratio

Assumption-

Bore = 0.1 metre

Stroke = 0.1 metrem

Connecting rod = 0.15 metre

Compression Ratio = 12

Objectives -

1. To plot the air standard cycle (otto cycle) for P v/s V in MATLAB.

2. To find out the thermal efficiency of the Air standard cycle.

Procedure -

Inputs -

MATLAB code file -

1.Function code made to trace the volume profile using MATLAB -

function [v] = engine_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);

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

Code explanation - Here we created the function called 'Engine kinematics' to simplify the usage in main function. It is the function to trace the volume while compression and expansion. We can recall this function to the main function which would result in the correct graph and neat code.

2. Main function Code -

clear all
close all
clc

%Inputs
gamma = 1.4
t3 = 2300

%state variable at state point 1
p1 = 101325
t1 = 500

% Engine geometric parameters
bore = 0.1;
stroke = 0.1;
con_rod = 0.15;
cr = 12;

%Calculating 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

% state variable in state point 2
%p2v2^gamma = p1v1^gamma
%p2 = p1(v1/v2)^gamma = p1*cr^gamma
p2 = p1*cr^gamma

%p1*v1/t1 = p2*v2/t2 
%t2 = p2*v2*t1/(p1*v1)
t2 = p2*v2*t1/(p1*v1)

constant_c = p1*v1^gamma;
v_compression = engine_kinematics(bore,stroke,con_rod,cr,180,0)
p_compression = constant_c./v_compression.^gamma

%state variable at state pont 3
v3 = v2

%p3/t3 = p2/t2 (p3 = p2*t3/t2)
p3 = p2*t3/t2

constant_c = p3*v3^gamma;
v_expansion = engine_kinematics(bore,stroke,con_rod,cr,0,180)
p_expansion = constant_c./v_expansion.^gamma

%state variable at state point 4
v4 = v1
%p3*v3^gamma = p4*v4^gamma=> p4 = p3*(v3/v4)^gamma
p4 = p3*(v3/v4)^gamma

%thermal efficiency
Thermal_efficiency = 1 - (1/(cr^(gamma-1)))
final_efficiency = Thermal_efficiency * 100+"%"

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],'color','r')
plot([v4 v1],[p4 p1],'color','r')
xlabel('Volume')
ylabel('Pressure')
grid on

Code Explanation -

1.First we assumed the bore, stroke, compression ratio , connecting rod length.

2.Then we assume the specific heat ratio and temperature after combustion.

3.Now we calculated the swept volume and clearance volume by the known formulas.

4.We can calculate the state point variables at point 2 through the governing equations as 1-2 is a isentropic compression.

5.Now we can call the function named as ' engine_kinematics' to trace the volume profile during compression.

6.Same way we can calculate for process 3-4 as it is a isentropic expansion process.

7.By putting the formula of thermal efficiency we can calculate the thermal efficiency of the cycle.

8.Now by running the result we can see the P-V plot for Otto Cycle.

Results -

Outputs -

P-V plot of Otto cycle according to the input.

Thermal Efficiency found to be 62.9893%

Conclusion -

1. The Pressure v/s Volume plotting has been done using the MATLAB.

2. The Thermal efficiency is calculated as 62.9893%.

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.