All Courses
All Courses
Courses by Software
Courses by Semester
Courses by Domain
Tool-focused Courses
Machine learning
POPULAR COURSES
Success Stories
1.AIM: Write a program that can solve an OTTO-Cycle and to make a plot of Pressure VS Volume during the Otto-cycle and also to calculate the thermal efficiency of the OTTO-Cycle. 2.GOVERNING EQUATIONS IF ANY: 3.OBJECTIVES OF THE PROJECT: To solve the Otto-Cycle. Plot the P-V graph of the cycle. Calculate…
Amit Chilap
updated on 15 Feb 2021
1.AIM:
2.GOVERNING EQUATIONS IF ANY:
3.OBJECTIVES OF THE PROJECT:
4.BODY OF THE CONTENT:
%Write code that can solve an otto cycle and make plots for it.
%Here are the requirements
%Your code should create a PV diagram
%You should output the thermal efficiency of the engine.
%Given Data.
% P1=0.1MPa, T1=35 Degree Celcius, T3= 1100 Degree Celcius
% Bore=12cm, Stroke=10cm, Connecting Rod=15cm, Compression Ratio=9, Gamma=1.4
close all
clear all
clc
%Given Data/Conditions
p1=0.1; %in MegaPascals %Pressure at Stage 1.
t1=308; %in kelvin %Temperature at Stage 1.
t3=1373; %in kelvin %Temperature at Stage 3.
bore = 0.12; %in m
stroke = 0.1; %in m
con_rod = 0.15; %in m
cr = 9;
gamma=1.4;
%calculatig v1,v2,v3,v4
v_swept = (pi/4)*bore^2*stroke; %in m^3 %Swept Volume by piston.
v_clearance = v_swept/(cr-1); %in m^3 %&Clearance Volume.
v1 = v_swept + v_clearance; %in m^3 %Volume at Stage 1.
v2 = v_clearance; %in m^3 %Volume at Stage 2.
v3=v2; %in m^3 %Volume at Stage 3.
v4=v1; %in m^3 %Volume at Stage 4.
%Calculating State Variables at 2
%p1v1^gamma=p2v2^gamma
p2=p1*(v1/v2)^gamma; %in MPa %Pressure at Stage 2.
%p1v1/t1=p2v2/t2
t2=(p2*v2)/(p1*v1)*t1; %in kelvin %Temperature at Stage 2.
%Supplementary programs: Function(engine_kinematics) is created in the MatLab to calculate the instantaneous Volume.
%and by calling the function volume change is calculated from stage 1-2.
V_com=engine_kinematics(bore,stroke,con_rod,cr,180,0); %in m^3 %Volume change from stage 1-2.
P_com=p1*v1^gamma./V_com.^gamma; %in MPa %Pressure change from stage 1-2.
%Calculating State Variables at 3
%p3v3/t3=p2v2/t2
p3 =p2*v2/t2*t3/v3; %in MPa %Pressure at Stage 3.
%Calculating State Variables at 4
%p1v1^gamma=p2v2^gamma
p4=p3*(v3/v4)^gamma; %in MPa %Pressure at Stage 4.
%p3v3/t3=p4v4/t4
t4=(p4*v4)/(p3*v3)*t3; %in kelvin %Temperature at Stage 4.
%Supplementary programs: Function(engine_kinematics) is created in the MatLab to calculate the instantaneous Volume.
%and by calling the function volume change is calculated from stage 3-4.
V_exp=engine_kinematics(bore,stroke,con_rod,cr,0,180); %in m^3 %Volume change from stage 3-4.
P_exp=p3*v3^gamma./V_exp.^gamma; %in MPa %Pressure change from stage 3-4.
%efficiency=1-1/(cr)^(gamma-1)
efficiency=1-1/(cr)^(gamma-1); %Efficiency Of the Air-Standard_Cycle.
%Displaying the Conditions of Pressure, Volume and Temperature at each stage.
disp('Conditions at State 1')
disp(['P1=' num2str(p1) ' MPa ; V1=' num2str(v1) ' m^3 ; T1=' num2str(t1) ' k'])
disp(' ')
disp('Conditions at State 2')
disp(['P2=' num2str(p2) ' MPa ; V2=' num2str(v2) ' m^3 ; T2=' num2str(t2) ' k'])
disp(' ')
disp('Conditions at State 3')
disp(['P3=' num2str(p3) ' MPa ; V3=' num2str(v3) ' m^3 ; T3=' num2str(t3) ' k'])
disp(' ')
disp('Conditions at State 4')
disp(['P4=' num2str(p4) ' MPa ; V4=' num2str(v4) ' m^3 ; T4=' num2str(t4) ' k'])
disp(' ')
disp(['Efficiency=' num2str(efficiency*100) '%'])
%Ploting the Otto-Cycle.
figure(1)
hold on
plot(v1,p1,'*','color','r')%Ploting the Conditions of Pressure and Volume stage 1.
plot(v2,p2,'*','color','r')%Ploting the Conditions of Pressure and Volume stage 2.
plot(v3,p3,'*','color','r')%Ploting the Conditions of Pressure and Volume stage 3.
plot(v4,p4,'*','color','r')%Ploting the Conditions of Pressure and Volume stage 4.
plot(V_com,P_com,'linewidth',3,'color','r') %Ploting the Process change of Pressure and Volume from stage 1-2.
plot([v2,v3],[p2,p3],'linewidth',3,'color','g') %Ploting the Process change of Pressure and Volume from stage 2-3.
plot(V_exp,P_exp,'linewidth',3,'color','r') %Ploting the Process change of Pressure and Volume from stage 3-4.
plot([v4,v1],[p4,p1],'linewidth',3,'color','g') %Ploting the Process change of Pressure and Volume from stage 4-1.
xlabel('Volume in m^3') %Labeling the X-Axis.
ylabel('Pressure in MPa') %Labeling the Y-Axis.
%Supplementary programs:Function(engine_kinematics) is to calculate the instantaneous Volume.
function [V] = engine_kinematics(bore,stroke,con_rod,cr,crank_start,crank_end)
a=stroke/2; %Crank-Pin Radius.
R=con_rod/a;
v_s=(pi/4)*bore^2*stroke; %Swept Volume.
v_c= v_s/(cr-1); %Clearance Volume.
theta=linspace(crank_start,crank_end,100); %Range and no. of outputs to be calculated.
%Formula to calculate instantaneous Volume during movement of the piston.
% V/v_c=1+(cr-1)./2.*(1+R-cosd(theta)-(R^2-sind(theta).^2).^0.5)
V=v_c.*(1+(cr-1)./2.*(1+R-cosd(theta)-(R^2-sind(theta).^2).^0.5));
end
5.CONCLUSION:
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...
Week-3 Challenge: ADVISOR Tool
Introduction to HEV using MATLAB & Simulink Week-3 Challenge: ADVISOR Tool AIM: To simulate the given data and conditions for an EV using Advisor Tool in MATLAB. About ADVISOR ADVISOR, NREL’s Advanced Vehicle Simulator, is a set of model, data, and script text files for use with MATLAB and Simulink. It…
04 Jul 2022 11:04 AM IST
Project -BAJA All Terrain Vehicle (ATV) model
Simulink for Mechanical & Electrical Engineers - Challenges Final Project Aim To study, analyze and make a detailed report on BAJA All Terrain Vehicle (ATV) model using Simulink & compare between its different modes. Objective Prepare a technical report explaining the model properties & comments on the results.…
03 Jun 2021 03:25 AM IST
Week - 4
Simulink for Mechanical & Electrical Engineers Challenges = Week 4 Aim To Make a Simulink model using State-Flow for given questions. Questions & Solution Q1. Implement control logic of a “washing machine” using Stateflow as per given sequence: If the power supply is available, the system gets activated. If the Water supply…
21 May 2021 06:29 PM IST
Week -2
Simulink for Mechanical & Electrical Engineers Challenges = Week 2 Aim To Make a Simulink model of Doorbell using solenoid block. To Use a thermistor to sense the temperature of a heater & turn on or turn off the fan according to temperature. Questions & Solution Q1. Make a Simulink model of Doorbell using…
14 May 2021 12:30 AM IST
Related Courses
0 Hours of Content
Skill-Lync offers industry relevant advanced engineering courses for engineering students by partnering with industry experts.
© 2025 Skill-Lync Inc. All Rights Reserved.