You are on page 1of 8

%% Cac thong so ban dau

S = 0.81; % S/D=1, don vi dm


D = 0.93 ;
R = S/2; %dm
lambda = 0.25; %thong so ket cau
% rho = 1;
Fp = (pi*(D^2))/4;
Va = 0.4753640055; %Don vi the tich: lit
Vc = 0.05797122019;
Vz = Vc; %Vc.*rho, rho=1;
Vb = Va;
Vr = Vc;
n1 = 1.37387507; %Chi so nen da bien trung binh
n2 = 1.2; %Chi so dan no da bien trung binh
P0 = 0.1; %Don vi ap suat: MN/m^2
Pa = 0.09;
Pc = 1.44;
Pz = 4.733358483;
Pb = 0.3789594787;
Pr = 0.105;
n = 2600; %vong/phut
w = (pi*n)/30; %rad/s
mnp = 15; %don vi g/cm2
mtt = 20;
mk = 20;
ma = 0.3 * mtt;
mb = 0.7 * mtt;
mj = ma + mnp;
mr = mb + mk;
%% ve do thi cong chi thi
% hieu chinh rr'
a1hc = linspace (0,10,100); % dong muon xupap thai =
x1hc = R.*((1-cosd(a1hc))+(lambda/4).*(1-
cosd(2.*a1hc)));
V1hc = x1hc*Fp + Vc;
Vr1 = max (V1hc);
Prr1 = linspace (Pr,Pa,100); % khoang ap suat trong
Vrr1 = linspace (Vc,Vr1,100); % khoang the tich trong
P1hc = interp1 (Vrr1,Prr1,V1hc,'spline');
% qua trinh nap
a1 = linspace (10,180,100);
x1 = R.*((1-cosd(a1))+(lambda/4).*(1-cosd(2.*a1)));
Fp = (pi*(D^2))/4;
V1 = x1*Fp + Vc;
P1 = linspace (Pa,Pa,100);
% qua trinh nen (goc danh lua som = 15)
% doan 1
a2 = linspace (180,345,100);
x2 = R.*((1-cosd(a2))+(lambda/4).*(1-cosd(2.*a2)));
V2 = x2*Fp + Vc;
P2 = Pa.*(Va./V2).^n1;
% qua trinh chay - gian no
% hieu chinh doan c'-c"
a2hc = linspace (345,360,100);
x2hc = R.*((1-cosd(a2hc))+(lambda/4).*(1-
cosd(2.*a2hc)));
V2hc = x2hc*Fp + Vc;
Pchc = Pa.*(Va./V2hc).^n1;
% xac dinh toa do diem c'
Vc1 = max (V2hc);
Pc1 = min (Pchc);
% xac dinh toa do diem c"
Pz1 = 0.85*Pz; % z1 la diem z'
Pcz1 = Pz1 - Pc;
Pc2 = Pcz1/3 + Pc;
Vc2 = Vc;
% ve doan c'-c"
Vc1c2 = linspace (Vc1,Vc2,100);
Pc1c2 = linspace (Pc1,Pc2,100);
P2hc = interp1(Vc1c2,Pc1c2,V2hc,'spline');
% hieu chinh c"-z"
a3hc = linspace(360,375,100);
x3hc = R.*((1-cosd(a3hc))+(lambda/4).*(1-
cosd(2.*a3hc)));
VZ = x3hc*Fp + Vc;
PZ= Pz.*(Vz./VZ).^n2;
% xac dinh diem z"
Vz2 = max (VZ);
Pz2 = min (PZ);
% xac dih diem zhc
azhc = 374;
xzhc = R.*((1-cosd(azhc))+(lambda/4).*(1-
cosd(2.*azhc)));
Vzhc = xzhc*Fp + Vc;
Pzhc = Pz.*( Vz./Vzhc).^n2;
% ve doan c"-z"
Vz1z2 = [Vc2,Vzhc,Vz2];
Pz1z2 = [Pc2,Pzhc,Pz2];
V3hc = linspace(Vc2,Vz2,100);
P3hc = interp1(Vz1z2,Pz1z2,V3hc,'spline');
% gian no
a3 = linspace (375,488,100);
x3 = R.*((1-cosd(a3)+(lambda/4).*(1-cosd(2.*a3))));
V3 = x3*Fp + Vc;
P3 = Pz.*(Vz./V3).^n2;
% qua trinh thai
% hieu chinh b'b"
a4hc = linspace (485,540,100); %mo som xupap thai = 50
x4hc = R.*((1-cosd(a4hc))+(lambda/4).*(1-
cosd(2.*a4hc)));
V1b = x4hc*Fp + Vc;
P1b = Pz.*(Vz./V1b).^n2;
% xac dinh diem b'
Vb1 = min (V1b);
Pb1 = max (P1b);
% xac dinh diem b"
Pb2 = ((Pb-Pr)/3)+Pr;
Vb2 = Va;
% xac dinh bhc1
abhc1 = 500;
xbhc1 = R.*((1-cosd(abhc1))+(lambda/4).*(1-
cosd(2.*abhc1)));
Vbhc1 = xbhc1*Fp + Vc;
Pbhc1 = Pz.*(Vz./Vbhc1).^n2;
% ve doan b'b"
Vb1b2 = [Vb1,Vbhc1,Vb2];
Pb1b2 = [Pb1,Pbhc1,Pb2];
V4hc = linspace(Vb1,Va,100);
P4hc = interp1(Vb1b2,Pb1b2,V4hc,'spline');
% hieu chinh b"
a5hc = linspace(540,570,100);
x5hc = R.*((1-cosd(a5hc))+(lambda/4).*(1-
cosd(2.*a5hc)));
V2b = x5hc*Fp + Vc;
%xac dinh diem b'''
Pb3 = Pr;
Vb3 = min(V2b);
%xac dinh diem bhc2
abhc2 = 550;
xbhc2 = R.*((1-cosd(abhc2))+(lambda/4).*(1-
cosd(2.*abhc2)));
Vbhc2 = xbhc2*Fp + Vc;
Pbhc2 = 0.225;
% ve doan cong sau b"
Vb2b4 = [Vb2,Vbhc2,Vb3];
Pb2b4 = [Pb2,Pbhc2,Pb3];
V5hc = linspace(Vb2,Vb3,100);
P5hc = interp1(Vb2b4,Pb2b4,V5hc,'spline');
% doan cuoi
a4 = linspace (570,720,100);
x4 = R.*((1-cosd(a4))+(lambda/4).*(1-cosd(2.*a4)));
V4 = x4*Fp + Vc;
P4 = linspace (Pr,Pr,100);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% do thi cong P-V
atong = [a1hc,a1,a2,a2hc,a3hc,a3,a4hc,a5hc,a4];
jtong = R*(w^2).*(cosd(atong)+lambda.*cosd(2.*atong));
Vtong = [V1hc,V1,V2,V2hc,VZ,V3,V1b,V2b,V4];
Ptong = [P1hc,P1,P2,P2hc,P3hc,P3,P4hc,P5hc,P4];
% ve do thi P-V
figure(1);
plot (Vtong,Ptong,'k','linewidth',2);
title('DO THI CONG CHI THI P-V');
xlabel('The tich V (lit)');
ylabel('Ap suat P (MN/m2)');
grid on;%% do thi P-phi Pj P1
figure(2);
plot(atong,Ptong);
title('DO THI P-phi');
xlabel('Goc quay truc khuyu (do)');
ylabel('P');
grid on;
%% do thi P-phi Pj P1
figure(3);
Pj = (-mj.*jtong)*(10^-6);%
Pkt = (Ptong);
plot (atong,Pj,'r','linewidth',1.5);
hold on
plot (atong,Pkt,'b','linewidth',1.5);
P1 = Pkt + Pj;
plot (atong,P1,'k','linewidth',1.5);
axis([0 720 -8 10]);
grid on;
title('DO THI Pkt Pj P1');
xlabel('Goc quay truc khuyu (do)');
ylabel('Pkt (MN/m2) Pj (MN/m2) P1 (MN/m2)');
legend('Pj','Pkt','P1');
%% do thi dong hoc
adh = [a1hc,a1,a2,a2hc];
%chuyen vi cua piston
SpI = 0.1*R.*(1-cosd(adh));
SpII = 0.1*R.*((lambda/4).*(1-cosd(2.*adh)));
Sp = SpI + SpII;
figure(4);
plot (adh,SpI,'r','linewidth',1.5);
hold on;
plot (adh,SpII,'b','linewidth',1.5);
hold on;
plot (adh,Sp,'k','linewidth',1.5);
axis([0 360 0 0.11]);
title('DO THI CHUYEN VI CUA PISTON - Sp');
xlabel('Goc quay truc khuyu (do)');
ylabel('Chuyen vi cua piston (m)');
legend('SpI','SpII','Sp');
grid on;
%van toc cua piston
VpI = 0.1*R*w.*(sind(adh));
VpII = 0.1*R*w.*((lambda/2).*sind(2*adh));
Vp = VpI + VpII;
figure(5);
plot (adh,VpI,'r','linewidth',1.5);
hold on;
plot (adh,VpII,'b','linewidth',1.5);
hold on;
plot (adh,Vp,'k','linewidth',1.5);
axis([0 360 -30 30]);
title('DO THI VAN TOC CUA PISTON - Vp');
xlabel('Goc quay truc khuyu (do)');
ylabel('Van toc cua piston (m/s2)');
legend('VpI','VpII','Vp');
grid on;
%gia toc cua piston
jI = 0.1*R*(w^2).*(cosd(adh));
jII = 0.1*R*(w^2).*(lambda.*cosd(2.*adh));
Jp = jI + jII;
figure(6);
plot (adh,jI,'r','linewidth',1.5);
hold on;
plot (adh,jII,'b','linewidth',1.5);
hold on;
plot (adh,Jp,'k','linewidth',1.5);
axis([0 360 -20000 50000]);
title('DO THI GIA TOC CUA PISTON - Jp');
xlabel('Goc quay truc khuyu (do)');
ylabel('Gia toc cua piston (m/s2)');
legend('JpI','JpII','Jp');
grid on;
%% xuat bang excel
%%% lap bang ap suat MCCT
Vxn = (Va:-0.02:Vc);
Pxn = Pa.*(Va./Vxn).^n1;
Vxg = (Vz:0.02:Vb);
Pxg = Pz.*(Vz./Vxg).^n2;
xlswrite('nen.xlsx',[Vxn(:),Pxn(:)]);
xlswrite('gian no.xlsx',[Vxg(:),Pxg(:)]);
%%% lap bang gia tri ket qua tinh toan dong luc hoc
xlswrite('dongluchoc.xlsx',
[atong(:),Pkt(:),Pj(:),P1(:)]);
%%% lap bang gia tri ket qua tinh toan dong hoc
xlswrite('donghoc.xlsx',[adh(:),Sp(:),Vp(:),Jp(:)]);
%%
clc

You might also like