Поможем написать учебную работу
Если у вас возникли сложности с курсовой, контрольной, дипломной, рефератом, отчетом по практике, научно-исследовательской и любой другой работой - мы готовы помочь.
Если у вас возникли сложности с курсовой, контрольной, дипломной, рефератом, отчетом по практике, научно-исследовательской и любой другой работой - мы готовы помочь.
ДОДАТОК Б
Текст програми розрахунку пропускної здатності газопроводу з лупінгом
мовою MicrosoftOfficeWord 2007 з використанням Visual Basic
Перше наблищення
Private Sub CommandButton1_Click()
10 L12 = Worksheets(1).Cells(4, 4)
20 L25 = Worksheets(1).Cells(2, 4)
30 Q1 = Worksheets(1).Cells(9, 4)
40 D = Worksheets(1).Cells(5, 4)
50 P1 = Worksheets(1).Cells(3, 6)
60 PK = Worksheets(1).Cells(4, 6)
70 TG = Worksheets(1).Cells(5, 6)
80 T1 = Worksheets(1).Cells(6, 6)
90 Delta = Worksheets(1).Cells(2, 6)
100 Re12 = 17.75 * Q1 * Delta / (D / 1000) / 1.25 / 10 ^ -5: Worksheets(1).Cells(12, 3) = Re12
110 lambda12 = 0.067 * (158 / Re12 + 2 * 0.03 / D) ^ 0.2
120 a12 = 0.225 * 1.9 * 1420 / (2700 * Q1 * Delta)
130 T2 = TG + (T1 - TG) * Exp(-a12 * L12)
140 Tcr12 = TG + (T1 - T2) / (a12 * L12)
150 P2 = (P1 ^ 2 - Q1 ^ 2 * Tcr12 * Delta * 0.9 * lambda12 * L12 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5
160 Pcer12 = 2 / 3 * (P1 + P2 ^ 2 / (P2 + P1)): Zcer12 = 1 - 5.5 * 10 ^ 6 * Pcer12 * Delta ^ 1.3 / Tcr12 ^ 3.3
170 P22 = (P1 ^ 2 - Q1 ^ 2 * Tcr12 * Delta * Zcer12 * lambda12 * L12 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5
180 Q23 = Q1 / 2: Re23 = 17.75 * Q23 * Delta / (D / 1000) / 1.25 / 10 ^ -5: Worksheets(1).Cells(12, 6) = Q23: Worksheets(1).Cells(12, 7) = Re23
190 lambda23 = 0.067 * (158 / Re23 + 2 * 0.03 / D) ^ 0.2: Worksheets(1).Cells(13, 6) = lambda23
200 a23 = 0.225 * 1.9 * 1420 / (2700 * Q23 * Delta): Worksheets(1).Cells(14, 6) = a23
210 T3 = TG + (T2 - TG) * Exp(-a23 * L25): Worksheets(1).Cells(15, 6) = T3
220 Tcr23 = TG + (T2 - T3) / (a23 * L25): Worksheets(1).Cells(16, 6) = Tcr23
230 P3 = (P22 ^ 2 - Q23 ^ 2 * Tcr23 * Delta * 0.9 * lambda23 * L25 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5: Worksheets(1).Cells(17, 6) = P3
240 Pcer23 = 2 / 3 * (P22 + P3 ^ 2 / (P3 + P22)): Zcer23 = 1 - 5.5 * 10 ^ 6 * Pcer23 * Delta ^ 1.3 / Tcr23 ^ 3.3: Worksheets(1).Cells(18, 6) = Pcer23
250 P33 = (P22 ^ 2 - Q23 ^ 2 * Tcr23 * Delta * Zcer23 * lambda23 * L25 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5: Worksheets(1).Cells(19, 6) = P33
260 Q24 = Q1 / 2: Re24 = 17.75 * Q24 * Delta / (D / 1000) / 1.25 / 10 ^ -5: Worksheets(1).Cells(20, 6) = Q24: Worksheets(1).Cells(20, 7) = Re24
270 lambda24 = 0.067 * (158 / Re24 + 2 * 0.03 / D) ^ 0.2: Worksheets(1).Cells(21, 6) = lambda24
280 a24 = 0.225 * 1.9 * 1420 / (2700 * Q24 * Delta): Worksheets(1).Cells(22, 6) = a24
290 T4 = TG + (T2 - TG) * Exp(-a24 * L25): Worksheets(1).Cells(23, 6) = T4
300 Tcr24 = TG + (T2 - T4) / (a24 * L25): Worksheets(1).Cells(24, 6) = Tcr24
310 P4 = (P22 ^ 2 - Q24 ^ 2 * Tcr24 * Delta * 0.9 * lambda24 * L25 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5: Worksheets(1).Cells(25, 6) = P4
320 Pcer24 = 2 / 3 * (P22 + P4 ^ 2 / (P4 + P22)): Zcer24 = 1 - 5.5 * 10 ^ 6 * Pcer24 * Delta ^ 1.3 / Tcr24 ^ 3.3: Worksheets(1).Cells(26, 6) = Pcer24
330 P44 = (P22 ^ 2 - Q24 ^ 2 * Tcr24 * Delta * Zcer24 * lambda24 * L25 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5: Worksheets(1).Cells(27, 6) = P44
340 T5 = (T3 * Q23 + T4 * Q24) / Q1: Worksheets(1).Cells(28, 6) = T5: Worksheets(1).Cells(26, 6) = Pcer24
350 P5 = (P33 * Q23 + P44 * Q24) / Q1
360 Worksheets(1).Cells(25, 2) = P5: Worksheets(1).Cells(26, 2) = Q1: GoTo 370
370 End Sub
Кінцевий розрахунок
Private Sub CommandButton1_Click()
10 L12 = Worksheets(1).Cells(4, 4)
20 L25 = Worksheets(1).Cells(2, 4)
30 Q1 = Worksheets(1).Cells(9, 4)
40 D = Worksheets(1).Cells(5, 4)
50 P1 = Worksheets(1).Cells(3, 6)
60 PK = Worksheets(1).Cells(4, 6)
70 TG = Worksheets(1).Cells(5, 6)
80 T1 = Worksheets(1).Cells(6, 6)
90 Delta = Worksheets(1).Cells(2, 6)
100 Re12 = 17.75 * Q1 * Delta / (D / 1000) / 1.25 / 10 ^ -5: Worksheets(1).Cells(12, 3) = Re12
110 lambda12 = 0.067 * (158 / Re12 + 2 * 0.03 / D) ^ 0.2
120 a12 = 0.225 * 1.9 * 1420 / (2700 * Q1 * Delta)
130 T2 = TG + (T1 - TG) * Exp(-a12 * L12)
140 Tcr12 = TG + (T1 - T2) / (a12 * L12)
150 P2 = (P1 ^ 2 - Q1 ^ 2 * Tcr12 * Delta * 0.9 * lambda12 * L12 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5
160 Pcer12 = 2 / 3 * (P1 + P2 ^ 2 / (P2 + P1)): Zcer12 = 1 - 5.5 * 10 ^ 6 * Pcer12 * Delta ^ 1.3 / Tcr12 ^ 3.3
170 P22 = (P1 ^ 2 - Q1 ^ 2 * Tcr12 * Delta * Zcer12 * lambda12 * L12 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5
180 Q23 = Q1 / 2: Re23 = 17.75 * Q23 * Delta / (D / 1000) / 1.25 / 10 ^ -5: Worksheets(1).Cells(12, 6) = Q23
190 lambda23 = 0.067 * (158 / Re23 + 2 * 0.03 / D) ^ 0.2
200 a23 = 0.225 * 1.9 * 1420 / (2700 * Q23 * Delta)
210 T3 = TG + (T2 - TG) * Exp(-a23 * L25)
220 Tcr23 = TG + (T2 - T3) / (a23 * L25)
230 P3 = (P22 ^ 2 - Q23 ^ 2 * Tcr23 * Delta * 0.9 * lambda23 * L25 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5
240 Pcer23 = 2 / 3 * (P22 + P3 ^ 2 / (P3 + P22)): Zcer23 = 1 - 5.5 * 10 ^ 6 * Pcer23 * Delta ^ 1.3 / Tcr23 ^ 3.3
250 P33 = (P22 ^ 2 - Q23 ^ 2 * Tcr23 * Delta * Zcer23 * lambda23 * L25 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5
260 Q24 = Q1 / 2: Re24 = 17.75 * Q24 * Delta / (D / 1000) / 1.25 / 10 ^ -5
270 lambda24 = 0.067 * (158 / Re24 + 2 * 0.03 / D) ^ 0.2
280 a24 = 0.225 * 1.9 * 1420 / (2700 * Q24 * Delta)
290 T4 = TG + (T2 - TG) * Exp(-a24 * L25)
300 Tcr24 = TG + (T2 - T4) / (a24 * L25)
310 P4 = (P22 ^ 2 - Q24 ^ 2 * Tcr24 * Delta * 0.9 * lambda24 * L25 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5
320 Pcer24 = 2 / 3 * (P22 + P4 ^ 2 / (P4 + P22)): Zcer24 = 1 - 5.5 * 10 ^ 6 * Pcer24 * Delta ^ 1.3 / Tcr24 ^ 3.3
330 P44 = (P22 ^ 2 - Q24 ^ 2 * Tcr24 * Delta * Zcer24 * lambda24 * L25 / (105.087 ^ 2 * 0.92 ^ 2 * 1.3778 ^ 5)) ^ 0.5
340 T5 = (T3 * Q23 + T4 * Q24) / Q1: Worksheets(1).Cells(28, 6) = T5
350 P5 = (P33 * Q23 + P44 * Q24) / Q1
360 If Abs(P5 - PK) > 0.05 Then GoTo 370 Else Worksheets(1).Cells(25, 2) = P5: Worksheets(1).Cells(26, 2) = Q1: GoTo 390
370 If P5 - PK > 0 Then Q1 = Q1 + 0.5 Else Q1 = Q1 - 0.5
380 GoTo 100
390 End Sub