Project

otto cycle pv diagram and efficiancy

% pv diagram for otto cycle

clear all

close all

clc

% inputs

gamma = 1.4 ;

% Engine Geometric parameters

bore = .1;

stroke = .1;

r = 12 ;

con_rod = .15 ;

% calculating the swept volume and clearance volume

v_s = (pi/4)*bore^2*stroke ;

v_c = v_s/(r-1);

%state Variable at point 1

display(\'input state variable for point 1\');

p1 = input(\'pressure\');

t1 = input(\'temperature\');

T1 = t1+273.15;

v1= v_s+v_c;

% state Variable at point 2

v2 = v_c;

p2 = p1*r^gamma;

T2 = r^(gamma-1)*T1;

constant_c= p1*v1^gamma;

v_compression = engine_kinematics(bore,stroke,con_rod,r,0,180)

P_compression= constant_c./v_comression^gamma;

% state variables at point 3

v3=v2

t3 = input(\'Temperature at the end of constant volume combustion\');

T3 = t3+ 273.15;

p3 = p2*T3/T2;

P_heat = linspace (p2,p3,100);

V_heat = linspace(v2,v3,100);

constant_c = p3*v3^gamma;

V_expansion = engine_kinematics(bore ,stroke,con_rod,r,0,180);

P_expansion = constant_c/V_expansion^gamma;

% state variables at point 4

v4= v1;

p4=p3*r^(gamma);

P_cool= linspace(p1,p4,100);

V_cool= linspace(v4,v1,100);

hold on

plot(v1,p1,\'*\');

plot(v2,p2,\'*\');

plot(V_compression,P_compression);

plot(V_heat,P_heat);

plot(v3,P3,\'*\');

plot(V_expansion,P_expansion);

plot(v4,p4,\'*\');

plot(V_cool,P_cool);

xlabel(\'volume\')

ylabel(\'pressure\')

% program for thermal efficiancy of otto cycle

% Function for engine kinematics

function[V]= engine _kinematics(bore,stroke,con_rod,r,start_crank,end_crank)

a= stroke/2;

R =con_rod/a;

v_s=(pi/4)*(bore^2)*stroke;

v_c= v_s/(r-1);

theta =linspace(start_crank,end_crank,abs(end_crank-state_crank));

term1=.5*(r-1);

term2=R+1 -cosd(theta);

term3=(R^2-(sind(theta))^2)^.5;

V=(1 +term1*(term2-term3))*v_c;

end

% thermal efficiancy

n=1-(r)^(1-9);

display(\'Efficiancy of the cycle\');

display(n);

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.