All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM : To write a MATLAB program to solve an otto cycle and make plots for it. OBJECTIVES : To create a PV diagram. To find out the thermal efficiency of an engine. THEORY : The Otto cycle is one of the most common thermodynamic cycles found in automobile engines. One of the key parameters of such an engine is the change…
Abhinav Mahto
updated on 03 Apr 2022
AIM :
To write a MATLAB program to solve an otto cycle and make plots for it.
OBJECTIVES :
THEORY :
The Otto cycle is one of the most common thermodynamic cycles found in automobile engines. One of the key parameters of such an engine is the change in volume from the top dead centre (TDC) to the bottom dead centre (BDC). The ratio of these volumes [v1v2] is known as the compression ratio.
The processes are described by:
FORMULA :
[vvc]=1+(12)(cr−1)[R+1−cosθ−(R2−(sinθ)2)12]
Terms used during this MATLAB Program
v = volume
v_s = swept volume
v_c = clearance volume
t = temperature
p = pressure
cr = compression ratio
R = ratio of connecting rod length to the crankpin radius
a = crankpin radius
PROGRAM :
FUNCTION -
function [Volume] = engine_kinematics_function(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;
Volume = (1+term1*(term2 - term3)).*v_c;
end
FINAL PROGRAM -
% A Program to solve an Air Standard Cycle
clear all
close all
clc
% Step I : Inputs
gamma = 1.4;
t3 = 2300;
% State Variables at Point 1
p1 = 101325;
t1 = 500;
% Engine geometric parameters
bore = 0.1;
stroke = 0.1;
con_rod = 0.15;
cr = 12;
% Step II : Calculating the swept volume and the clearance volume
v_swept = (pi/4)*bore^2*stroke;
v_clearance = v_swept/(cr-1);
v1 = v_swept + v_clearance;
v2 = v_clearance;
% Step III : State variables at Point 2
% p2v2^gamma = p1v1^gamma
% p2 = p1*(v1/v2)^gamma = p1*cr^gamma
p2 = p1*cr^gamma;
% p1v1/t1 = p2v2/t2 | t2 = p2*v2*t1/(p1*v1)
t2 = p2*v2*t1/(p1*v1);
constant_c = p1*v1^gamma;
v_compression = engine_kinematics_function(bore, stroke, con_rod, cr, 0, 180);
p_compression = constant_c./v_compression.^gamma;
% Step IV : State varaiable at Point 3
v3 = v2;
% p3v3/t3 = p2v2/t2
p3 = p2*t3/t2;
constant_c = p3*v3^gamma;
v_expansion = engine_kinematics_function(bore, stroke, con_rod, cr, 180, 360);
p_expansion = constant_c./v_expansion.^gamma;
% Step V : State variable at point 4
v4 = v1;
% p3v3^gamma = p4v4^gamma | p4 = p3 (v3/v4)^gamma
p4 = p3*(v3/v4)^gamma;
t4 = (p3*v3*t3)/(p4*v3);
% Step V : Plotting
hold on
plot (v1,p1, '*', 'Color', 'r')
plot (v_compression, p_compression)
plot (v2,p2, '*', 'Color', 'r')
plot ([v2 v3], [p2 p3], 'color', 'b')
plot (v3,p3, '*', 'Color', 'r')
plot (v_expansion, p_expansion)
plot (v4,p4, '*', 'Color', 'r')
plot ([v4 v1], [p4 p1], 'color', 'b')
xlabel ('Volume')
ylabel ('Pressure')
title ('Air Standard Cycle')
grid on
% Step VI : Thermal Efficiency
thermal_efficiency = theta*100;
CONCLUSION :
Hence, the thermal efficiency of an engine and PV diagram for the Air Standard cycle is obtained with the help of the MATLAB program.
Leave a comment
Thanks for choosing to leave a comment. Please keep in mind that all the comments are moderated as per our comment policy, and your email will not be published for privacy reasons. Please leave a personal & meaningful conversation.
Other comments...
MATLAB Project based on NASA's Thermodynamic Data
AIM : To write a MATLAB Program that helps Parsing NASA's thermodynamic data. OBJECTIVES : To write a function that extracts the 14 coefficients and calculates Specific Heat, Enthalpy & Entropy. Plot the Cp, Enthalpy and Entropy for each species. To calculate the molecular weight of each species. THEORY : Parsing…
03 Apr 2022 01:57 PM IST
MATLAB Project based on Rankine Cycle Simulator
AIM : To create a MATLAB Program that calculate the state points of the Rankine Cycle. OBJECTIVES : To create a Rankine Cycle Simulator using MATLAB. To determine its state points including (i) Net work output & (ii) Back work ratio. Plot its T-S and h-S diagram from the given data. Explain its working. THEORY…
03 Apr 2022 01:56 PM IST
MATLAB Program based on Curve fitting
AIM : To write a MATLAB code to fit a linear and cubic polynomial for the cp data. OBJECTIVES : Write code to fit a linear and cubic polynomial for the Cp data. Plot the linear and cubic fit curves along with the raw data points. Write a code to show splitwise method. Explain the parameters used to measure…
03 Apr 2022 01:47 PM IST
MATLAB Program to calculate Drag Force against a Cyclist
AIM: To create a Matlab program to calculate drag force against a cyclist. OBJECTIVES: To understand the flow of air while cycling and calculate the drag force which is acting opposite to it with respect to velocity and drag coefficient. Plot graph of Velocity vs Drag force & Drag Co-efficient vs Drag…
03 Apr 2022 01:43 PM IST
Related Courses
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.