Поможем написать учебную работу
Если у вас возникли сложности с курсовой, контрольной, дипломной, рефератом, отчетом по практике, научно-исследовательской и любой другой работой - мы готовы помочь.
Если у вас возникли сложности с курсовой, контрольной, дипломной, рефератом, отчетом по практике, научно-исследовательской и любой другой работой - мы готовы помочь.
Sub PrRas(P, H0, S0, noi, Ht, Hd, Sd, Td)
Tsk = TNAS(P)
Call HSVpar(P, Tsk, H2s, S2s, V, Cp): T = Tsk
S = S2s: H = H2s
ds = S0 - S2s
If Abs(ds) < 0.0005 Then Ht = H2s
If ds < 0.0005 Then Ht = H2s - Tsk * (S2s - S0)
If ds > 0.0005 Then
'If p <= 4 Then
'T = Tfps2(p, S0): Call HSVpar(p, T, H, S, V, Cp): Ht = H
'End If
'If p > 4 Then
Do
dt = (S0 - S) * T / Cp: If Abs(dt) <= 0.1 Then Ht = H: Exit Do
T = T + dt: Call HSVpar(P, T, H, S, V, Cp)
Loop
'End If
End If
Hd = H0 - noi * (H0 - Ht):
dh = H2s - Hd
If Abs(dh) < 0.1 Then Sd = S2s: T = Tsk
If dh > 0.1 Then Sd = S2s - (H2s - Hd) / Tsk: T = Tsk
If dh < -0.1 Then
Do
dth = (H - Hd) / Cp: If Abs(dth) <= 0.01 Then Sd = S: Exit Do
T = T - dth: Call HSVpar(P, T, H, S, V, Cp)
Loop
'T = TFPH(p, Hd): Call HSVpar(p, T, H, Sd, V, Cp)
'T = TFPH(p, Hd): Call HSVpar(p, T, H, Sd, V, Cp)
End If
Td = T - 273.15
End Sub
Sub HSVpar(P, T, H, S, V, Cp)
Dim nO(9) As Double
Dim JO(9) As Double
Dim n(43) As Double
Dim I1(43) As Double
Dim J1(43) As Double
'p = 3
'T = 1010
pb = P / 1
Tb = 540 / T
r = 0.461526
zb0 = Log(pb)
zb0t = 0
zb0tt = 0
With Worksheets("Лист2")
For i = 1 To 9
nO(i) = .Cells(i, 8)
JO(i) = .Cells(i, 9)
Next i
For i = 1 To 9
zb01 = nO(i) * Tb ^ (JO(i))
zb0 = zb0 + zb01
zb0t1 = nO(i) * JO(i) * Tb ^ (JO(i) - 1)
zb0t = zb0t + zb0t1
zb0tt1 = nO(i) * JO(i) * (JO(i) - 1) * Tb ^ (JO(i) - 2)
zb0tt = zb0tt + zb0tt1
Next i
For i = 1 To 43
n(i) = .Cells(i, 7)
I1(i) = .Cells(i, 5)
J1(i) = .Cells(i, 6)
Next i
End With
zbr = 0
zbrt = 0
zbrtt = 0
zbrp = 0
For i = 1 To 43
zbr1 = n(i) * pb ^ (I1(i)) * (Tb - 0.5) ^ (J1(i))
zbr = zbr + zbr1
zbrp1 = n(i) * I1(i) * pb ^ (I1(i) - 1) * (Tb - 0.5) ^ (J1(i))
zbrp = zbrp + zbrp1
zbrt1 = n(i) * pb ^ (I1(i)) * J1(i) * (Tb - 0.5) ^ (J1(i) - 1)
zbrt = zbrt + zbrt1
zbrtt1 = (n(i) * pb ^ I1(i) * J1(i) * (Tb - 0.5) ^ (J1(i) - 2)) * (J1(i) - 1)
zbrtt = zbrtt + zbrtt1
Next i
zb = zb0 + zbr
zb0p = 1 / pb
V = (pb * (zb0p + zbrp) * r * T / P) / 1000
H = Tb * (zb0t + zbrt) * r * T
S = (Tb * (zb0t + zbrt) - (zb0 + zbr)) * r
Cp = (-Tb ^ 2 * r * (zb0tt + zbrtt))
End Sub
Sub HSVwat(P, T, H, S, V, Cp)
Dim n(34) As Double
Dim I1(34), J1(34)
r = 0.461526
Tb = 1386 / T
pb = P / 16.53
With Worksheets("Лист2")
For i = 1 To 34
n(i) = .Cells(i, 10)
I1(i) = .Cells(i, 11)
J1(i) = .Cells(i, 12)
Next i
End With
zb = 0
For i = 1 To 34
zb = zb + n(i) * (7.1 - pb) ^ (I1(i)) * (Tb - 1.222) ^ (J1(i))
Next i
zbt = 0
For i = 1 To 34
zbt = zbt + n(i) * (7.1 - pb) ^ (I1(i)) * J1(i) * (Tb - 1.222) ^ (J1(i) - 1)
Next i
zbp = 0
For i = 1 To 34
zbp = zbp - n(i) * I1(i) * (7.1 - pb) ^ (I1(i) - 1) * (Tb - 1.222) ^ (J1(i))
Next i
zbt2 = 0
For i = 1 To 34
zbt2 = zbt2 + n(i) * (7.1 - pb) ^ (I1(i)) * J1(i) * (J1(i) - 1) * (Tb - 1.222) ^ (J1(i) - 2)
Next i
H = Tb * zbt * r * T
S = (Tb * zbt - zb) * r
V = pb * zbp * r * T / P * 0.001
Cp = -Tb ^ 2 * zbt2 * r
End Sub