Project

Program to solve the air standard Otto Cycle

Term1 = 5.5000
P4 = 1.7251e+005
Thermal_Efficiency = 0.62989

\"\"

Program 


%Program to simulate Air Standard Cycle (Otto Cycle)
    
    %Inputs
    Gamma=1.4;
    T3=2300;
          
    %Engine Geometric Parameters
    %Bore Diameter of cylinder
    D=0.1;
    
    %Stroke Length Of Cylinder
    L=0.1;
    
    %Length of Connecting Rod
    L_C=0.15;
    
    %Compression Ratio
    CR=12;
    
    %Swept Volume
    V_Swept=(pi/4)*D^2*L;
    
    %Clearance Volume
    V_Clearance=V_Swept/(CR-1);
    
    %State Variables
    P1=101325;
    T1=500;
    V1=V_Swept+V_Clearance;
    
    %State Variable at State 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
    V2=V_Clearance
    T2=P2*V2*T1/(P1*V1);
    % From Piston Kinematic Equation
    V_Compression=Engine_Kinematics(D,L,L_C,CR,180,0)
    constant_c=P1*V1^Gamma;
    
    P_Compression=constant_c./V_Compression.^Gamma;
    
    %State Vaariable at State Point 3
    V3=V2 % Constant Volume Heat Addition Process
    
    %P3V3/T3=P2V2/T2 |||| P3=P2*T3/T2
    P3=P2*T3/T2;
    
    %Expansion
    V_Expansion=Engine_Kinematics(D,L,L_C,CR,0,180);
    Constant_c=P3*V3^Gamma;
    
    P_Expansion=Constant_c./V_Expansion.^Gamma;
    
    
    %State Vaariable at State Point 4
    V4=V1;
    
    %P3V3^Gamma=P4V4^Gamma |||| P4=P3*(V3/V4)^Gamma
    P4=P3*(V3/V4)^Gamma
    
    %Thermal Efficiency of Otto Cycle
    Thermal_Efficiency=1-[1/(V4/V3)^(Gamma-1)]
    
    figure(1)
    hold on
    plot(V1,P1,\'*\',\'color\',\'r\')
    plot(V2,P2,\'*\',\'color\',\'r\')
    plot(V3,P3,\'*\',\'color\',\'r\') 
    plot(V4,P4,\'*\',\'color\',\'r\')
    plot(V_Compression,P_Compression)
    plot(V_Expansion,P_Expansion)
    xlabel(\'Volume\')
    ylabel(\'Presuure\')
    plot([V2 V3],[P2 P3])
    plot([V4 V1],[P4 P1])
    
    
  
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.