Chương trình tính.

Một phần của tài liệu Đồ án tốt nghiệp cơ khí đóng tàu nghiên cứu ma sát và mài mòn của xi lanh động cơ ở các chế độ chuyển tiếp (Trang 83 - 104)

V = , TH tốc độ tàu tương ứng với chế độ

3. Phân tích ảnh hưởng của chế độ chuyển tiếp đến sự mài mòn xilanh của động cơ Diesel.

2.3. Chương trình tính.

' CHUONG TRINH - thay doi tai

'L2t#0 co the tinh cho cac truong hop khi thay doi dieu kien ngoai:dong tai '(fid=0,hp=0,ntk=22000,ga=.21,va thay cac phu tai)-tang toc(thay cac gia tri 'cua cac thong so dong tai o thoi diem 10 giay vao thong so ban dau ntk,ga, 'fid,hp,nd,fizad)

' - Thay doi dieu kien moi truong voi cac phuong an khac nhau :

' + Khi giu nguyen ap suat,thay doi nhiet do moi truong P0=95000pa,T0 = 0 ' 20,43 do c

' +Khi giu nguyen nhiet do,thay doi ap suat moi truong T0 = 0 hoac 20,40 'va thay doi P0 = 95000,101300,102000.

' - Phu tai thay doi theo chu ky : Tn = .5 + .5*sin(a*tim)

' a=1.58 - tan so 0,25 Hz ; 3.18 - tan so 0,5 Hz ; 6.28 - tan so 1 Hz ' - Phu tai khong thay doi : Tn = A ; A= .5 ; .75 ; .9 ; 1

' Tr = .5 ; 1 ; 3 ;

' Momen quan tinh tuabin-may nen : J = .027 ; .04 ' Tang ap cao (nn;pitn;picn;pefn;gan;bn):

' - tang ap xung (cac he so k1,k2,k3,k4 >0) ' - tang ap dang ap (cac he so k1=k2=k3=k4 =0)

' Thay doi luong nhien lieu cap vao de thay doi he so alfa va cac thong so ' khac hpm = .73 + .07 * tim va hpm = .8 , hpm=1.1

DECLARE SUB koeffimp (pd!, p0!, kn!) DECLARE SUB ghidia (tim!, n!, alf!, ei!) DECLARE SUB dothi (x1!, y1!, x2!, y2!, col!)

DECLARE SUB form (t$, x!, y!, a!, b!, c!, d!, e!, f!, g!, H!, v!, n!, j!, z!, o!, p!, i!, u!, m!, s!)

'DECLARE SUB turbina (gg!, ggn!, nras!, rr!, ff!, mfen!, p2n!, p0!, n!, ucopt!, ucn!, etn!, flag!, pd!, tg!, nt!)

'DECLARE SUB koeffimp (pd!, p0!, kn!)

DECLARE SUB timgraf (lm!, rm!, um!, dm!, col!, tbeg!, tend!, parbeg!, parend!, t!, par!)

DECLARE SUB comp (T0, p0, pic!(), ec!(), n!, gac!, by!, ay!, bx!, ax!, pic!, ec!) 'DECLARE SUB Mexn (a1!, b!, s!, ndn!, aa!, pefn!, cm!)

' TUA BIN - MAY NEN

' TINH TOAN CHE DO KHONG ON DINH 'Cac hang so

CONST k = 1.41, pi = 3.1415, r = 287

CONST lo = 14.3, tatm = 273, patm = 101300 CONST kg = 1.35, Rg = 285, khr = 1123 'Dieu kien ngoai

T0 = 293 p0 = 103000

'Cac ham cong thuc tinh

DEF fni (a, b, c, d) = a + (b - a) * (c - d)

DEF fnras (rr, pp, ff) = (1 - rr / 2 * (pp - 1)) ^ 2 + ff ^ 2

DEF fnri (a) = 1.065 - .426 / a ^ (3 / 2)

DEF fntm (nd, pint) = (a1 + b1 * nd) / aa * (pint / pintn) ^ .1 * (km - 1) '*******

fmt1$ = "tim= ##.## ntk= ##### Nt=##### Nk=##### wc=#.#### alfc=#.#### eic=#.####"

fmt2$ = " Pint ###### Pa P1=Pg=###### Pa tr= #.# jtk=#.### hpmax=#.## fimax=#.######"

'fmt2$ = " alfa ##.### ’g = ####.#, eta= #.### pik= #.###"

fmt4$ = "nd ###.## ttq= #.### bco= #.#### bsum= #.#### hp #.### ro=#.### be=#.###"

'*******

' So lieu ban dau ' Dong co CONST d = .18, s = .22, e = 11, z = 6 CONST vsz = pi * d * d / 4 * s * (1 + 1 / e) * z CONST tdies = 4'3.4 CONST tr = .5 CONST kr = 50

alfm = 2: eim = .4: dei1 = .0536: dei2 = .133: df = .214 falfn = .145: falf = .564 ac = .533: dc = .048: dc1 = .023: dc2 = .012 gc1 = .0024: gc2 = .00413 aw = .785: bw = .0215: bw1 = .011: bw2 = .006 gw1 = .00115: gw2 = .0016 m1 = .42: m2 = .058 ee = 0 '******

' Ton that co gioi a1 = 120000: bp = 16000' b1 = bp * s / 30

ndn = 750: pefn = 753000

'CALL Mexn(a1, bp, s, ndn, aa, pefn, km) aa = a1 + bp * s * ndn / 30

etmn = 1 / (1 + aa / pefn)'hieu suat co gioi etm km = 1 / etmn

'****** 't = T0

'Bau lam mat khong khi tawng ap tw = 293 etcool = .67: etgxn = .97 '****** 'Tua bin nn = 32000 p2n = p0: pitn = 1.364 p1n = pitn * p2n pitx = 1.07: p2x = p0 p1x = pitx * p2x '******

'CHE DO DINH MUC tgn = 623

ein = .867 * .42: ecn = .72

gan = .337'thay lai Pint=1,46;Pitn=1.3;gan=0,337 bn = .0139'bn=Ge/3600=50/3600=0,0139

ggn = gan + bn '****** 'May nen picn = 1.54 pdn = picn * p0 tdn = T0 * (1 + (picn ^ ((k - 1) / k) - 1) / ecn) dpcooln = (1 - etgxn) * pdn

ksicool = dpcooln * pdn / gan ^ 2 / tdn tintn = tdn - (tdn - tw) * etcool

pintn = pdn - dpcooln rointn = pintn / r / tintn sprn = SQR(pintn * rointn) pspn = fnpsipr(p1n / pdn)

fin = gan / (fcn * (rointn * ndn * vsz / 30 / 4)) alfn = gan / lo / bn / fin

dgpn = (fin - 1) * gan '*******

'CHE DO KHONG TAI

tgx = 473: ndx = 750: ecx = .6 gax = .21: bco = .108: bx = .0026: fcx = fcn 'May nen pdx = 106300 picx = pdx / p0 tdx = T0 * (1 + (picx ^ ((k - 1) / k) - 1) / ecx) tintx = tdx - (tdx - tw) * etcool

dpcoolx = (gax / gan) ^ 2 * ((tdx / tdn) / (pdx / pdn)) * dpcooln pintx = pdx - dpcoolx

fipx = gax / (fcx * (pintx / tintx / r * ndx * vsz / 30 / 4)) alfx = gax / lo / bx / fipx

eixo = fnri(alfx) / fnri(alfn) dgzx = (1 - fcn) * gax tmx = fntm(ndx, pintx) bcxo = tmx / km / eixo 'He so tinh xung tang ap CONST mega = 1000000 k1i = 0' .005

k2i = 0' .0015 k3i = 0' .033 k4i = 0' .012

rr = .4'Muc do phan kich ff = .82

nras = fnras(rr, pitn, ff)

w = (1 / pitn) ^ (2 / kg) - (1 / pitn) ^ ((kg + 1) / kg) psi = SQR(2 * (kg / (kg - 1)) * w) mfen = ggn / SQR(p1n ^ 2 / Rg / tgn) / psi CONST jtk = .04, rk = .07 CONST ku = pi * rk / 30 un = ku * nn hrn = khr * tgn * (1 - (p2n / p1n) ^ ((kg - 1) / kg)) cn = SQR(2 * hrn) ucopt = .42 + .28 / .6 * rr ucn = un / cn / ucopt: etn = .72 'Nap dac tinh may nen vao chuong trinh CLS

namf$ = "c:fi2.dat"

'INPUT "Dua vao ten fai so lieu ", namf$: namf$ = namf$ + ".dat" PRINT "Fai dang nap"; namf$

OPEN namf$ FOR INPUT AS #1 INPUT #1, ng, nv, ay, by, ax, bx DIM ec(ng, nv), pic(ng, nv) FOR y = 0 TO nv

' Tren xuong

n = ay * y + by: PRINT n ' trai sang phai

FOR x = 0 TO ng ga = ax * x + bx

INPUT #1, pic(x, y), ec(x, y) NEXT

NEXT CLOSE #1

CLS : SCREEN 2

LOCATE 25, 1: PRINT " Ve dac tinh khong (Y/N) ?" GOSUB os:

IF q$ = "Y" OR q$ = "y" THEN GOSUB figraf: GOSUB osq:

CLS

p$ = " Ket thuc tinh (Y/N) ? "

DIM tim(1200), ei(1200), pint(1200), tg(1200), nd(1200), alf(1200), npr(1200), b(1200), be(1200), tint(1200), ttq(1200), Ge(1200), etm(1200), ete(1200), Ne(1200)

n = 22000

tint = tintx: ga = .21: gad = ga pitr = pitx: pit = pitr: pic = picx pc = p0 * pic: p1 = p1x fid = 0: hp = 0

ws = (pi * n / 30) ^ 2 nd = 750: wd = nd / ndn H = .01

tim(0) = 0: bsum = 0: fimax = 0: alfmin = 0: ndmin = 250: fimin = 0 hr = .00001

grafinterval = .1: timg = 0 alfint = 0'chi so khoi tich phan

alfdop = 1.45'gia tri alfa xuat hien khoi

wyc = 78: wn = 0: eis = 0: kozs = 0: boss = 0 i = 0

'beep '*******

DO'Bat dau chu trinh tim = tim + H

'IF tim >= .01 THEN H = .02 Esc$ = INKEY$

IF Esc$ = CHR$(27) THEN LOCATE 25, 1: PRINT p$; : GOSUB os: IF q$ = "Y" OR q$ = "y" THEN EXIT DO

DO'tim kiem diem lam viec dong thoi IF ga >= .2 AND n >= 20300 THEN

CALL comp(T0, p0, pic(), ec(), n, ga, by, ay, bx, ax, pic, ec) td = T0 * (1 + (pic ^ ((k - 1) / k) - 1) / ec)

pd = pic * p0 + 10 ELSE

flag = 1: td = T0: pd = p0 END IF

'Dong co

'Bau lam mat khong khi tang ap 'td, pd - ap suat, nhiet do sau may nen

'tint, pint - ap suat, nhiet do sau bau lam mat tint = td - (td - tw) * etcool

dpcool = ksicool * gad ^ 2 * td / pd pint = pd - dpcools

'Dac tinh suat tieu hao qua dong co nd = 750

roint = pint / r / tint

gad1 = roint * nd * vsz / 30 / 4 spro = SQR(pint * roint) / sprn IF pspn = 0 THEN pspn = 1 IF (pint - p1) > 0 THEN

dg = spro * fnpsipr(p1 / pint) / pspn * wd * dgpn ELSEIF (pint - p1) < 0 THEN

dg = -spro * fnpsipr(pint / p1) / pspn * wd * dgzx END IF

gad = (gad1 + dg)

gadpr = gad * patm / p0 * SQR(T0 / tatm) IF dg > 0 THEN fipr = gad / gad1 ELSE fipr = 1 delg = gad - ga

'IF 7.32 >= tim >= 7.2 THEN LPRINT USING " pic =#.### Ga=#.### dg=#.###"; pic; ga; dg;

LOCATE 23, 2: PRINT USING " Gd =#.### Ga=#.### dg=#.###"; gad; ga; dg; IF ABS(gad - ga) < (.05 * ga) THEN EXIT DO

ga = (ga + gad) / 2 LOOP

gad = ga' Ket thuc tinh gan dung '********

'Giai phuong trinh vi phan dong co va bo dieu toc

'IF tim <= 1 THEN tn = tim ^ .5 ELSE tn = tim ^ 1.3 / (tim ^ 1.29 + tim ^ .4 - 1) 'IF tim < 10 THEN tn = .9 ELSE tn = .5

tn = .9

dfid = (ti - tn - tm) / tdies

dhp = (-33 * (fid - fizad) - hp) / tr fid = fid + dfid * H

wd = 1 + fid

IF wd > 1 THEN wd = 1 nd = wd * ndn

wnd = .1047 * nd

IF wnd <= wyc THEN delwnd = (wyc - wnd) * H / wyc wn = wn + delwnd

wc = wn / tim'chi so chat luong chu trinh IF ABS(fid) > ABS(fimax) THEN fimax = fid ndmin = (ndn + (fimax * ndn))

IF ABS(fid) < ABS(fimin) THEN tpr = tim hp = (hp + (dhp * H))

hpmax = 1.1

IF hp < 0 THEN hp = 0

IF hp < -bcxo THEN hp = -bcxo bco = (bcxo + hp) / (bcxo + 1) bc = bco * bcn b = bc * nd * z / 120 Ge = b * 3600 bsum = bsum + b * H dee = .1047 * nd * (ti - tm) * H Ne = .1047 * nd * (ti - tm) ee = ee + dee IF ee = 0 THEN ee = .00001 bm = bsum / ee

alf = gad / (lo * b)

IF alf > alfmin THEN alfmin = alf IF bco > 1 THEN bco = 1

IF alf <= 1.4 THEN dc = 0

IF alf <= alfdop THEN delalf = (alfdop - alf) * H ELSE delalf = 0 alfint = alfint + delalf

alfd = alfint

alfdc = alfint / tim 'chi so khoi 'Dac tinh kinh te cua dong co

ei = .267 * (alf - .1) ^ (1 / (alf + .2)): eio = ei / ein eis = eis + ei * H

eic = eis / tim 'Dac tinh nhiet do

falf = falfn + df * (alf - alfn) IF falf > .35 THEN falf = .35

tg = (.8 * tint) + 2450 * (1 - enst - ei - .1) / (1.25 * alf) 'Ton that co khi

tm = fntm(nd, pint) ti = km * bco * eio etm = 1 - tm / ti ete = ei * etm ttq = (ti - tm) * 2012 Ne = (ttq * nd / 9550) be = Ge / Ne IF tim = .01 THEN

CALL form("tim=.01", 3, 62, nd, (ti - tm), fid, hp, bco, alf, tg, pint, ei, bsum, nn, pitn, picn, pefn, gan, bn, T0, p0)

END IF IF flag <> 1 THEN lc = 1005 * (td - T0) nc = gad * lc ELSE nc = 5E-10 * n ^ 3 * roint END IF

vtur: 'Tua bin gg = gad + b DO

'Dac tinh suat tieu hao, p2

mfe = SQR(nras / fnras(rr, pit, ff)) * mfen p2 = (gg / ggn) ^ 2 * (p2n - p0) + p0

'Tinh Pit

a = (gg / p2 / mfe) ^ 2 * Rg * tg / 2 / (kg / (kg - 1)) x = .5 + SQR(a + .25)

pitr = x ^ (kg / (kg - 1)) dpit = ABS(pit - pitr) IF dpit < .005 THEN EXIT DO pit = (pit + pitr) / 2:

LOOP pit = pitr

p1 = pit * p2

'Cong doan nhiet tren canh tua bin

hr = khr * tg * (1 - (1 / pit) ^ ((kg - 1) / kg)) 'Hieu suat tua bin

u = ku * n: cad = SQR(2 * hr) uc = (u / cad) / ucopt

et = (uc / ucn) * ((2 - uc) / (2 - ucn)) * etn IF et <= 0 THEN et = 0 IF flag = 1 THEN kn = 1.3 ELSE pdiz = (pd - p0) / mega kh = 1 + k1i / pdiz kgi = 1 + k2i / pdiz

etpop = 1 + k3i * (1 + k4i / pdiz) kn = kh * kgi * etpop

'CALL koeffimp(pd, p0, kn) END IF

'Cong suat tua bin

nt = hr * gg * et * kn

IF ABS(nt - nc) < .5 THEN EXIT DO 'Can bang cong suat TBMN

dw = (nt - nc) / jtk * 2 ws = ws + dw * H n = 30 / pi * SQR(ws) npr = n * SQR(tatm / T0) 'IF tim > 9.05 THEN GOTO gh:

LOCATE 1, 1: PRINT USING fmt1$; tim; n; nt; nc; wc; alfc; eic LOCATE 23, 33: PRINT USING "tn=#.#### pit #.### "; tn; pit 'LOCATE 22, 9: PRINT "0 3 6 9 12 15 18 21 24 27 t" LOCATE 22, 9: PRINT "0 2 4 6 8 10 12 14 16 18 t" 'LOCATE 22, 9: PRINT "0 1 2 3 4 5 6 7 8 9 t" LOCATE 3, 1: PRINT "750 1600" LOCATE 4, 1: PRINT "nd tg" LOCATE 7, 1: PRINT "650 300" LOCATE 9, 1: PRINT " 40 20 " LOCATE 10, 1: PRINT "ntk p1" LOCATE 13, 1: PRINT " 21 10" LOCATE 15, 1: PRINT "5.2 .47" LOCATE 16, 1: PRINT "alf ei" LOCATE 20, 1: PRINT " 1 .15"

LOCATE 2, 1: PRINT USING fmt2$; pint; p1; tr; jtk; hpmax; fimax;

LOCATE 24, 1: PRINT USING fmt4$; nd; ti - tm; bco; bsum; hp; roint; be;

LOCATE 25, 1: PRINT USING "ei #.### alf ##.### tg ####.# pic #.### kn #.## bm #.###### Ne=###.#"; ei; alf; tg; pic; kn; bm; Ne;

IF tim >= timg THEN

timg = timg + grafinterval CALL dothi(30, 20, 30, 60, 3) CALL dothi(30, 65, 30, 105, 3) CALL dothi(30, 110, 30, 160, 3)

'CALL timgraf(70, 470, 65, 105, 3, 0, 20, 0, 1.2, tim, bco) 'CALL timgraf(70, 470, 65, 105, 3, 0, 20, -.004, .085, tim, dg) 'CALL timgraf(70, 470, 65, 105, 3, 0, 20, .1, 1.2, tim, bc) 'CALL timgraf(70, 470, 65, 105, 3, 0, 20, .1, .6, tim, falf) CALL timgraf(70, 470, 20, 60, 3, 0, 20, 0, 1.6, tim, hp)

'CALL timgraf(70, 470, 65, 105, 3, 0, 20, 21000, 41000, tim, n) CALL timgraf(70, 470, 65, 105, 4, 0, 20, 100000, 200000, tim, pint) CALL timgraf(70, 470, 65, 105, 3, 0, 20, 100000, 200000, tim, p1) CALL timgraf(70, 470, 110, 160, 3, 0, 20, 0, 1.2, tim, ti - tm) 'CALL timgraf(70, 470, 20, 60, 3, 0, 20, 1.12, 1.8, tim, pic) 'CALL timgraf(70, 470, 20, 60, 3, 0, 20, .24, .356, tim, ga) CALL timgraf(70, 470, 20, 60, 3, 0, 20, 650, 750, tim, nd) 'CALL timgraf(70, 470, 20, 60, 3, 0, 20, .2, .9, tim, gad) 'CALL timgraf(70, 470, 20, 60, 3, 0, 20, 0!, .03, tim, b) CALL timgraf(70, 470, 110, 160, 3, 0, 20, 1, 10, tim, alf) 'CALL timgraf(70, 470, 20, 60, 3, 0, 20, 300, 2000, tim, tg) CALL timgraf(70, 470, 20, 60, 3, 0, 20, 0, .01, tim, alfd) CALL timgraf(70, 470, 20, 60, 3, 0, 20, 0, .01, tim, alfdc) CALL timgraf(70, 470, 110, 160, 3, 0, 20, .25, .57, tim, ei) CALL timgraf(70, 470, 110, 160, 3, 0, 20, 0, 1.2, tim, tn) END IF

'y = i kon:

alfint = alfint / tim'Chi so tich phan trung binh khoi trong qua trinh chuyen tiep bt = bn / tim * bsum * 3600

LOCATE 23, 2: PRINT "Suat tieu hao nhien lieu trung binh"; PRINT USING "Gtb = #.##### kg/s"; bt

PRINT " Do thay doi vong quay cuc dai";

PRINT USING "### 1/ph (##.# %)"; fimax * ndn; fimax * 100; 'GOSUB dia:

LOCATE 25, 1: PRINT "Goi lai - [ Enter ], Thoat - [ Esc ]"; DO

q$ = INKEY$

IF q$ = CHR$(27) THEN END IF q$ = CHR$(13) GOTO vcom: LOOP

' Chuong trinh con figraf:

SCREEN 2

VIEW (150, 20)-(450, 160)' Dac tinh may nen WINDOW (.2, 1!)-(.6, 2)

FOR o = .2 TO .6 STEP .1: LINE (o, 1)-(o, 1.1): NEXT FOR o = 1 TO 2 STEP .25: LINE (.2, o)-(.21, o): NEXT FOR y = 0 TO nv

FOR x = 0 TO ng ga = ax * x + bx PSET (ga, pic(x, y)) NEXT: NEXT

RETURN fgraf:

PSET (ga, pic): RETURN fipset:

IF fgr = 1 THEN PSET (ga, pic) RETURN

gh:

LPRINT USING "tim ##.## n=###.# pic=#.### tn=#.# be=#.### Ge=###.# ec=#.### P0=######"; tim; nd; pic; tn; be; Ge; ec; p0

LPRINT USING "Ne=###.# ee=### bm=#.####### ga=#.### tg=#### gd=#.## ei=#.### T0=###"; Ne; ee; bm; ga; tg; gad; ei; T0

LPRINT USING "ntk=##### Nk=###### P1=###### Pint=###### hp=#.## alf=#.### b=#.##### "; n; nc; p1; pint; hp; alf; b

LPRINT USING "kr=##.# tr=#.## hpmax=#.## jtk=#.### Nt=#####.# kn=#.## ndm = ###.##"; kr; tr; hpmax; jtk; nt; kn; ndmin

LPRINT USING "alfc=#.### eic=#.### wc=#.#### kozs=####.# tint=###.# ro=#.###"; alfc; eic; wc; kozs; tint; roint

LPRINT USING "######"; fimax 'RETURN

GOTO os: RETURN osq:

'LOCATE 25, 1: PRINT "An phim bat ky de tiep tuc"; os:

DO

q$ = INKEY$

LOCATE 25, 1: PRINT STRING$(80, " "); : RETURN END

SUB comp (T0, p0, pic(), ec(), n, gac, by, ay, bx, ax, pic, ec) npr = n * SQR(tatm / T0)

gacpr = gac * patm / p0 * SQR(T0 / tatm) ' May nen

' Xac dinh he toa do

y = (npr - by) / ay: x = (gacpr - bx) / ax ' Xac dinh cac diem noi suy

yd = INT(y): xl = INT(x): yu = CINT(y): xr = CINT(x) ' Tinh pic

picl = fni(pic(xl, yd), pic(xl, yu), y, yd) picr = fni(pic(xr, yd), pic(xr, yu), y, yd) pic = fni(picl, picr, y, yd)

' Kiem tra mat on dinh

IF pic(xl, yd) * pic(xl, yu) * pic(xr, yd) * pic(xr, yu) = 0 THEN LOCATE 24, 2: PRINT " * * *Mat on dinh* * *"; SPC(30); ': BEEP END IF

' Tinh hieu suat may nen

ecu = fni(ec(xl, yu), ec(xr, yu), x, xl) ecd = fni(ec(xl, yd), ec(xr, yd), x, xl) ec = fni(ecd, ecu, x, xl)

END SUB

SUB dothi (x1, y1, x2, y2, l) LINE (x1, y1)-(x2, y2), l END SUB

LOCATE x, y: PRINT t$;

LOCATE x + 1, y: PRINT USING "Ttq =##.###"; b; LOCATE x + 2, y: PRINT USING "fi =##.###"; c; LOCATE x + 3, y: PRINT USING "hp =##.###"; d; LOCATE x + 4, y: PRINT USING "bco =#.######"; e; LOCATE x + 5, y: PRINT USING "alf=##.###"; f; LOCATE x + 6, y: PRINT USING "Tg1=####.###"; g; LOCATE x + 7, y: PRINT USING "n =###.###"; a; LOCATE x + 8, y: PRINT USING "pint=######"; H; LOCATE x + 9, y: PRINT USING "ei=.###"; v;

LOCATE x + 10, y: PRINT USING "bsum=.######"; n; LOCATE x + 11, y: PRINT USING "nn=#####"; j; LOCATE x + 12, y: PRINT USING "pitn=#.##"; z; LOCATE x + 13, y: PRINT USING "picn=#.##"; o; LOCATE x + 14, y: PRINT USING "pefn=#######"; p; LOCATE x + 15, y: PRINT USING "gan=.#"; i;

LOCATE x + 16, y: PRINT USING "bn=.####"; u; LOCATE x + 17, y: PRINT USING "T0=###"; m; LOCATE x + 18, y: PRINT USING "p0=######"; s; END SUB

SUB ghidia (tim, n, alf, ei) CLS

ten$ = "f:f3.bas"

PRINT " cho fai vao"; ten$; "cho ..." OPEN ten$ FOR OUTPUT AS #3

DIM tim(1200), n(1200), alf(1200), ei(1200) WRITE #3, tim, n, alf, ei

CLOSE #3 END SUB

SUB in (n, nt, nk, pint, p1, bsum, pit, pic, tg, ei, alf, bm) IF tim = .05 THEN

LPRINT USING " #####.# #####.# #####.# ###### ###### #.####"; n; nt; nk; pint; p1; bsum

LPRINT USING " #.### #.### #####.# #.### #.### #.######"; pit; pic; tg; ei; alf; bm END IF END SUB SUB koeffimp (pd, p0, kn) ' He so xung pdiz = (pd - p0) / mega kh = 1 + k1i / pdiz kgi = 1 + k2i / pdiz

etpop = 1 + k3i * (1 + k4i / pdiz) kn = kh * kgi * etpop

END SUB

SUB timgraf (lm, rm, um, dm, col, tbeg, tend, parbeg, parend, t, par) VIEW (lm, um)-(rm, dm), , col

WINDOW (tbeg, parbeg)-(tend, parend)

'FOR y = 0 TO 30 STEP 3: LINE (y, parbeg)-(y, parbeg): NEXT FOR y = 0 TO 20 STEP 2: LINE (y, parbeg)-(y, parbeg): NEXT

FOR x = parbeg TO parend STEP (parend - parbeg) / 2: LINE ((tbeg - 1), x)-((tbeg - 1), x): NEXT

LINE (460, 110)-(460, 160), 7 PSET (t, par)

END SUB

SUB turbina (gg, ggn, nras, rr, ff, mfen, p2n, p0, n, ucopt, ucn, etn, flag, pd, tg, nt) DO

' Dac tinh suat tieu hao khi, p2

mfe = SQR(nras / fnras(rr, pit, ff)) * mfen p2 = (gg / ggn) ^ 2 * (p2n - p0) + p0 ' Ty so giam ap trong tua bin

a = (gg / p2 / mfe) ^ 2 * Rg * tg / 2 / (kg / (kg - 1)) x = .5 + SQR(a + .25)

pitr = x ^ (kg / (kg - 1)) dpit = ABS(pit - pitr)

IF dpit < .05 THEN EXIT DO pit = (pit + pitr) / 2:

LOOP pit = pitr p1 = pit * p2

' Cong doan nhiet trong tua bin

hr = khr * tg * (1 - (1 / pit) ^ ((kg - 1) / kg)) ' Hieu suat tua bin

u = ku * n: cad = SQR(2 * hr) uc = (u / cad) / ucopt

Một phần của tài liệu Đồ án tốt nghiệp cơ khí đóng tàu nghiên cứu ma sát và mài mòn của xi lanh động cơ ở các chế độ chuyển tiếp (Trang 83 - 104)

Tải bản đầy đủ (DOC)

(112 trang)
w