Representation of Air standard cycle using MATLAB
Aim:
To plot the pressure vs volume parameters of the air standard cycle using MATLAB. To establish the thermal efficiency of air standard cycle corresponding to the input datas provided.
Air standard cycle:
- The performance characteristics of the internal combustion engine is analysed by the air standard cycles.
- The air standard cycle is made up of some assumptions.
- In air standard cycle, the working fluid is considered as air.
- There are two air standard cycles for petrol engine(otto cycle) and diesel engine(diesel cycle).
Formulae used:
Swept volume = `pi/4(bore^2*stroke)`
- Clearance volume = swept volume/(cr-1)
- v1= swept volume+ clearance volume
For isentropic process:
- p2=p1*cr^gamma
- t2=p2*v2*t1/(p1*v1)
- constant= p*(v^gamma)
V/Vc ratio formula used in function calling:
- V/Vc = 1+ (1/2(cr-1))[(R+1-cos`theta`)-(R^2-sin^2`theta`)^1/2]
Procedure:
- In this project, the performance characteristic of an otto cycle (air standard cycle) is plotted on MATLAB corresponding to the given input parameters.
- The input parameters such as p1,t1, and t3 are initiated.
- Also, the input parameters such as bore,stroke,connecting rod length and compression ratio was intiated.
- The swept volume can be calculated using bore and stroke by using following formula, v_swept=(pi/4)*bore^2*stroke.
- By using the compression ratio and swept volume, the clearance volume can be calculated by the formula, v_clearance=v_swept/(cr-1).
- The summation of swept volume and clearance volume can give the value of volume in point 1.
- The values of various parameters at point 2 can be calculated by the following formulae, v2=v_clearance;
p2=p1*cr^gamma;
t2=p2*v2*t1/(p1*v1); - The compression volume can be calculated in the function calling program.
- The parameters at point 3 can be calculated by the following formulae, v3=v2;
p3=p2*t3/t2; - The expansion volume can also be calculated in the function calling program.
- The parameters at point 4 can be calculated by the following formulae, v4=v1
p4=p3*(v3/v4)^gamma. - The thermal efficiency can be calculated using the compression ratio (cr), which was given as an input.
- Thermal efficiency = [ 1-(1/(cr)^(gamma-1)]*100
- The 4 points are plotted and it was connected according to the process.
The calling function is explained below,clear all close all clc %Input gamma = 1.4 p1=101325 t1=500 t3=2300 %Input parameters on engine bore=0.4; stroke=0.4; con_rod=1; cr=12; %Swept volume calculation v_swept=(pi/4)*bore^2*stroke; %clearance volume calculation v_clearance=v_swept/(cr-1); v1=v_swept+v_clearance; %Values at point 2 v2=v_clearance; p2=p1*cr^gamma; t2=p2*v2*t1/(p1*v1); %Compression path calculation using call by function constant= p1*(v1^gamma) v_compression = kinematics(bore,stroke,con_rod,cr,180,0) p_compression = constant./(v_compression).^gamma %Values at point 3 v3=v2; p3=p2*t3/t2; %Expansion path calculation using call by function constant= p3*(v3^gamma) v_expansion = kinematics(bore,stroke,con_rod,cr,0,180) p_expansion = constant./(v_expansion).^gamma %Values at point 4 v4=v1 p4=p3*(v3/v4)^gamma %Thermal efficiency efficiency=1-(1/(cr)^(gamma-1)) Thermal_efficiency=efficiency*100 %Ploting the P-V diagram figure(1) hold on plot(v1,p1,"*","linewidth",3,"color",'b') plot(v_compression,p_compression,"color",'r') plot(v2,p2,"*","linewidth",3,"color",'b') plot(v_expansion,p_expansion,"color",'g') plot(v3,p3,"*","linewidth",3,"color",'b') plot(v4,p4,"*","linewidth",3,"color",'b') line([v2 v3],[p2 p3],"color",'r') line([v4 v1],[p4 p1],"color",'g') xlabel('Volume') ylabel('Pressure') title('Air standard cycle') figure(2) plot([v1 v2 v3 v4 v1],[p1,p2,p3,p4 p1],"color",'b') xlabel('Volume') ylabel('Pressure') title('Air standard cycle') - The function program is a sub part of the main program in which the compression and expansion path can be calculated.
- The total volume can be calculated by using the V/Vc ratio formula.
- ` V/Vc = 1+ (1/2(cr-1))[(R+1-cos`theta`)-(R^2-sin^2`theta`)^1/2`
- In the above formula, the R can be calculated by the ratio of connecting rod length to "a", where a equals to the half the value of stroke.
- Then, the function is called in the main function to do the calculations for compression and expansion paths.
function [v]= kinematics(bore,stroke,con_rod,cr,start_cranck,end_cranck) a=stroke/2 R=con_rod/a v_s=pi/4*bore^2*stroke; v_c=v_s/(cr-1); theta=linspace(start_cranck,end_cranck,100); term1=0.5*(cr-1); term2=R+1-cosd(theta); term3=(R^2-sind(theta).^2).^0.5; %Total volume calculation v=(1+term1*(term2-term3)).*v_c; end
Output:
The plot with the simple representation of cycle with the help of straight line is shown below,
The plot with actual representation of process with its own representation is shown below,
The curved path indicated the isentropic process.
The values of various parameters including the thermal efficiency for the given input is shown below,
Thermal efficiency = 62.9893%
Errors:
The multiplication factor is missed. Then, it was corrected by using the "*" operator.
Conclusion:
Thus, the P-V diagram of the air standard cycle is represented by using MATLAB.