当前位置:文档之家› 水力学计算程序代码

水力学计算程序代码

降低护坦式消力池水力计算
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
End Sub
Public Function F(ByVal x0, d1)
Dim q, H0, p2, ht, z
q = Val(Text1.Text)
H0 = Val(Text5.Text)
p2 = V al(Text2.Text)
z = Val(Text3.Text)
F = q / (z * Sqr(19.6 * (H0 + p2 + (q / (19.6 * (H0 + p2))) ^ 2 + d1 - x0))) End Function
Public Sub diedai(ByVal x0, d1, y)
Dim e1
e1 = V al(Text6.Text)
Do
x0 = F(x0, d1)
Loop Until Abs(F(x0, d1) - x0) <= e1
y = x0
End Sub
Private Function d2(ByVal y)
q = Val(Text1.Text)
m = y * (Sqr(1 + 8 * q ^ 2 / (9.8 * y ^ 3)) - 1) / 2
ht = Val(Text4.Text)
Δz = q ^ 2 / 19.6 * (1 / ((0.95 * ht) ^ 2) - 1 / ((1.05 * m) ^ 2))
d2 = 1.05 * m - ht - Δz
End Function
Private Sub Command1_Click()
Dim e2, d1
e2 = V al(Text7.Text)
d1 = V al(Text10.Text)
Do
x0 = 0
Call diedai(x0, d1, y)
Loop Until Abs(d1 - d2(y)) <= e2
d = d1
q = Val(Text1.Text)
l = 8.1 * y * ((q / y / (Sqr(9.8 * y))) - 1) ^ 0.93 Text8.Text = d
Text9.Text = l
End Sub
梯形断面明渠临界水深计算程序
Dim b, m, Q, e, α, R, h0 As Single
Private Sub Command1_Click()
b = Val(Text1.Text)
m = Val(Text2.Text)
Q = Val(Text3.Text)
e = Val(Text4.Text)
α= Val(Text5.Text)
h0 = V al(Text7.Text)
Call waiwai
End Sub
Private Sub waiwai()
Do
h1 = h0 - f1(h0) / f2(h0)
If Abs(h1 - h0) < e Then Exit Do
h0 = h1
Loop
Text6.Text = h1
End Sub
Public Function f1(ByVal h)
R = b + 2 * m * h
f1 = 1 - α* Q * Q * R / (9.8 * A * A * A)
End Function
Public Function f2(ByVal h)
A = (b + m * h) * h
X = b + 2 * m * h
f2 = -α* Q ^ 2 * (2 * m * A - 3 * R ^ 2) / (9.8 * A ^ 4) End Function
Private Sub Command2_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text7.Text = ""
End Sub
梯形断面明渠正常水深计算
Public Sub erfen(ByVal x, ByVal y, ByVal e, z) z = (x + y) / 2
Do Until Abs(F(z)) <= e
If F(x) * F(z) < 0 Then
y = z
Else
x = z
End If
z = (x + y) / 2
Loop
End Sub
Public Function F(ByVal h)
Dim q, b, m, n, i
q = Val(Text5.Text)
b = Val(Text1.Text)
m = Val(Text2.Text)
n = Val(Text3.Text)
i = Val(Text4.Text)
F = q - (b + m * h) * h * 1 / n * ((b + m * h) * h / (b + 2 * h * Sqr(1 + m ^ 2))) ^ (1 / 6) * Sqr((b + m * h) * h * i / (b + 2 * h * Sqr(1 + m ^ 2)))
End Function
Private Sub Command1_Click()
Text1.Text = ""
Text2.Text = ""
Text3.Text = ""
Text4.Text = ""
Text5.Text = ""
Text6.Text = ""
Text8.Text = ""
Text9.Text = ""
Text10.Text = ""
End Sub
Private Sub 计算_Click()
Dim x, y, h
x = Val(Text9.Text)
y = Val(Text8.Text)
Call erfen(x, y, Val(Text6.Text), h)
Text10.Text = h
End Sub。

相关主题