Air Standard Cycle
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 the efficiency of the Otto-Cycle.
- The workflow of the project.
- Collect the given data.
- Calculate the swept volume and clearance volume from the given data using formulas 1&2.
- Using Vs & Vc calculate the volume conditions at each stage i.e. V1, V2, V3, V4 by using formulas 3&4.
- Using formula 5 calculate the pressure at each stage i.e. P1, P2, P3, P4.
- Using formula 6 calculate the pressure at each stage i.e. T1, T2, T3, T4.
- Since from stage 2-3 & stage 4-1 volume remains constant, so it gets a straight line on the P-V graph
- As stage 1-2 & stage 3-4 are adiabatic compression & adiabatic expansion its volume changes continuously. And its volume is calculated using form 7.
- Now using formula 8, the pressure is calculated for stage 1-2 i.e. adiabatic compression, and also for stage 3-4 i.e. adiabatic expansion.
- Now the process of stage 1-2 and stage 3-4 can plot on a P-V graph.
- And finally using formula 9 the efficiency of the given Otto-Cycle is calculated.
4.BODY OF THE CONTENT:
- Matlab Programming language is used.
- Main Program is attached below.
-
%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 Program to calculate Instantaneous Volume
-
%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 - Results

5.CONCLUSION:
- Output Results of the Air-Standard-Cycle Program

- Graph Of Otto-Cycle.
