All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
AIM To plot a PV diagram and calculate the thermal efficiency of otto cycle by using MATLAB EXPLANATION OF OTTO CYCLE The Otto cycle is the theoretical cycle of interest when one is considering reciprocating SI engines. The four-stroke Otto cycle is made up of the following four internally reversible processes.…
Harish Ragavendran S
updated on 05 Jun 2021
AIM
To plot a PV diagram and calculate the thermal efficiency of otto cycle by using MATLAB
EXPLANATION OF OTTO CYCLE
The Otto cycle is the theoretical cycle of interest when one is considering reciprocating SI engines. The four-stroke Otto cycle is made up of the following four internally reversible processes.
1–2, isentropic compression;
2–3, constant-volume heat addition;
3–4, isentropic expansion;
4–1, constant-volume heat rejection.
MATLAB PROGRAM
%QUESTION
clear all %used to clear all function and variables in workspace and system memory
close all %used to close all plots
clc %used to clear all text in command window
%INPUTS
%Pressure in an otto cycle(N/m2)
p1=101325;
%Temperature in an otto cycle (k)
t1=500;
t3=2300;
%Engine Paramters in (m)
bore=0.1;
stroke=0.1;
connecting_rod=0.15;
%Connecting Ratio
compression_ratio=12;
%Gamma for air
gamma=1.4;
%To find swept volume and clearance volume in (m^3)
swept_voulume=(pi/4)*bore^2*stroke; %swept volume is the difference between the tdc and bdc
clearance_volume=swept_voulume/(compression_ratio-1); %clearance volume is the volume between the cylinder head to piston when piston at tdc
%TO FIND PRESSURE AND VOLUME AT ALL POINTS
%ISENTROPIC COMPRESSION PROCESS 1-2
%t2/t1=(v1/v2)^gamma-1=cr^gamma-1 eq(1)
%p1v1^gamma=p2v2^gamma=constant eq(2)
%cr=v1/v2 eq(3)
%To find volume 1
v2=clearance_volume; %Clearance is also known as v2
v1=compression_ratio*v2; %from eq(3)
%To find pressure 2
p2=(p1*(v1^gamma))/(v2^gamma); %from eq(2)
%CONSTAN VOLUME HEAT ADDITION 2-3
%p2/t2=p3/t3 eq(5)
%cr=v1/v2=v4/v3 eq(6) %expansion ration is equal to cr
%To find pressure 3
t2=t1*compression_ratio^(gamma-1); %from eq(1) and eq(4)
p3=p2*t3/t2; %from eq(5)
%To find volume3
v3=v2; %from eq(6) %
%ISENTROPHIC EXPANSION PROCESS 3-4
%p3v3^gamma=p4v4^gamma %eq(7)
%To find volume 4
v4=v1; %from eq(6)
%To find pressure 4
p4=(p3*(v3^gamma))/(v4^gamma); %from eq(7)
%TO FIND VOULME OF COMPRESSION
volume_of_compression=engine_kinematics(bore,stroke,connecting_rod,compression_ratio,180,0);
constant=p1*v1^gamma; %from eq(2)
pressure_0f_compression=constant./(volume_of_compression.^gamma); %from eq(2
volume_of_expansion=engine_kinematics(bore,stroke,connecting_rod,compression_ratio,0,180);
constant=p3*v3^gamma; %from eq(7)
pressure_of_expansion=constant./(volume_of_expansion.^gamma); %from eq(7
%PLOTTING PRESSURE AND VOLUME AT ALL POINTS
hold on
plot(v1,p1,'x','color','r','linewidth',1.5) %plot used to create a 2D line plot by values of x and y
plot(v2,p2,'x','color','r','linewidth',1.5) %linewidth used to increase or decrease the line width
plot(v3,p3,'x','color','r','linewidth',1.5)
plot(v4,p4,'x','color','r','linewidth',1.5)
plot(volume_of_compression,pressure_0f_compression,'color','r','linewidth',1)
plot(volume_of_expansion,pressure_of_expansion,'color','r','linewidth',1)
plot([v2 v3],[p2 p3],'color','r','linewidth',1)
plot([v4 v1],[p4 p1],'color','r','linewidth',1)
xlabel('V') %Used to denote x-axis
ylabel('P') %Used to denote y-axis
grid on
title('PV DIAGRAM OF OTTO CYCLE')
%QUESTION 2
%THERMAL EFFICIENCY OF OTTOCYCLE
N=(1-(1/(compression_ratio^(gamma-1))))*100
%To obtained Compression and expansion of volume
%function is used to accepts inputs and return outputs
function [v]= engine_kinematics(bore,stroke,connecting_rod,compression_ratio,start,end_crank)
%INPUTS
%Pin_radius of piston in(m)
crank_pin=stroke/2;
%crank radius of piston in (m)
crank_radius=connecting_rod/crank_pin;
theta=linspace(start,end_crank,180); %linspace used to divide the matrix equally
%To find swept volume and clearance volume in (m^3)
swept_voulume=(pi/4)*bore^2*stroke; %swept volume is the difference between the tdc and bdc
clearance_volume=swept_voulume/(compression_ratio-1); %clearance volume is the volume between the cylinder head to piston when piston at tdc
%forumula of compression and expansion volume
v=(1+(0.5*(compression_ratio-1))*((crank_radius+1-cosd(theta))-((crank_radius^2-sind(theta).^2).^0.5))).*clearance_volume;
end
ERROR FACED WHILE PROGRAMMING
Error=Variable is not assigned properly
Steps taken to overcome=Assigned the variable correctly
Error= ‘end’ variblae assigned in MATLAB
Steps taken to overcome=end variable is used to close the functions,loop.So Changed the name of the variable ‘end’ into “end_crank”
Error= Not followed the BODMAS Rule
Steps taken to overcome=Re checked all the inputs,forumulas
OUTPUT:
GRAPH PV DIAGRAM
Pressure and outputs of all points are plotted
THERMAL EFFICIENCY
Thermal efficiency of otto cycle has been calculated
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...
Design of Hood
AIM To create and assemble the hood inner panel and outer panel and their reinforcements by following the design rules and master section. SOFTWARE USEDSIEMENS NX CAD 12 OBJECTIVES Design Hood outer panel, inner panel and the necessary reinforcements by following the Master section mentioned with the design parameter …
11 Feb 2022 01:31 PM IST
Radar Mast & Final Assembly of Yacht
DESIGN AND ASSEMBLY OF YACHT OBJECTIVE The main objective of this designing of yacht is to understand the function and usage of all commands, tools and shortcuts of toolbars in solid works By creating the individual parts of Yacht. By assembling all the parts of Yacht By applying and using decals, lights, camera and scenes…
29 Oct 2021 12:38 PM IST
Photo Realistic Rendering
DESIGN AND ASSEMBLY OF AMERICAN CHOPPER OBJECTIVE The main objective of this designing is to understand the function and usage of all commands, tools and shortcuts of toolbars in solid works By creating the individual parts of American chopper. By assembling all the parts of American chopper By applying and using decals,…
27 Sep 2021 02:24 PM IST
Design of backdoor
AIM To create and assemble the backdoor inner panel and outer panel and their reinforcements by following the design rules. SOFTWARE USED SIEMENS NX CAD 12 INPUT DATA The styling surface of backdoor has given. BACKDOOR Backdoor is also called has an tailgate and trunks or boots. Backdoor is also one of the door in…
31 Aug 2021 02:18 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.