为什么运行不出结果
α = Text8 / 180 * Piφ = Text9 / 180 * Pi
Kmin = 50
For i = 0.01 To α Step 0.01
K = Tan(φ) / Tan(i)
If Kmin > K Then
Kmin = K
Open "c:\users\administrator\desktop\1.txt" For Output As #1
Text1 = Kmin
Text2 = i / Pi * 180
Print #1, "Kmin=", Text1
Print #1, "最危险滑动面夹角:", Text2
Close #1
End If
Next i
H = Text10
h0 = Text11
a = Text12
i0 = Text13
b = H + h0
x0 = -b / i0
y0 = -(H + h0)
P1.Line (0, 0)-(a, 0), QBColor(1)
P1.Line (x0, -b)-(x0 - 10, -b), QBColor(1)
P1.Line (0, 0)-(x0, -b), QBColor(1)
x = Sin(α - i) * Sqr(x0 ^ 2 + b ^ 2) / Sin(i)
P1.Line (x0, -b)-(x, 0), QBColor(4)
ElseIf Option2.Value = ture Then
H = Text15
h0 = Text7
b = Text16
t = Text14
n = Text6
a = H + Text7
γ = Text5
φ = Text3
c = Text4
P1.Line (0, 0)-(b, 0), QBColor(1)
P1.Line (-a / t, -a)-(-a / t - 10, -a), QBColor(1)
P1.Line (0, 0)-(-a / t, -a), QBColor(1)
P1.Line (0, 0)-(-30, 30 * Tan(36 / 180 * Pi)), QBColor(2)
For x = -70 To -1000 Step -0.5
R1 = Sqr((x + a / t) ^ 2 + (x * Tan(36 / 180 * Pi) + a) ^ 2)
X1 = -(x - Sqr(R1 ^ 2 - (x * Tan(36 / 180 * Pi))))
l = 2 * R1 * Atn(1 / 2 * (Sqr(X1 + a / t) ^ 2 + a ^ 2)) / Sqr(R1 ^ 2 - 1 / 4 * (((X1 + a / t) ^ 2 + a ^ 2)))
If (x < 0) And ((X1 - l / (2 * n) - x) > R1) Then
D = -2 * x
E = 2 * Tan(36 / 180 * Pi)
Select Case x
Case x < -a / t
Gsinai = 0
Gcosai = 0
For j = -a / t To 0 Step l / n
Gsinai = Gsinai + (((t * j + Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + E / 2) + t * (j + l / n) + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2)) * l / n / 2 * ((j + l / (2 * n) - x) / R1)
Gcosai = Gcosai + (((t * j + Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + E / 2) + t * (j + l / n) + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2)) * l / n / 2 * Sqr(1 - ((j + l / (2 * n) - x) / R1) ^ 2)
Next j
For j = 0 To X1 Step l / n
Gsinai = Gsinai + (((Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + E / 2) + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2)) * l / n / 2 * ((j + l / (2 * n) - x) / R1)
Gcosai = Gcosai + (((Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + E / 2) + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2)) * l / n / 2 * Sqr(1 - ((j + l / (2 * n) - x) / R1) ^ 2)
Next j
K = (Tan(φ / 180 * Pi) * Gcosai * γ + c * l) / Gsinai * γ
Case x > (-a / t)
Gsinai = 0
Gcosai = 0
For j = x To 0 Step l / n
Gsinai = Gsinai + (t * (j + l / n) + Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + t * (j + l / n) + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2) * l / n / 2 * ((j - x + l / (2 * n)) / R1)
Gcosai = Gcosai + (t * (j + l / n) + Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + t * (j + l / n) + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2) * l / n / 2 * Sqr(1 - ((j - x + l / (2 * n)) / R1) ^ 2)
Next j
For j = 0 To X1 Step l / n
Gsinai = Gsinai + ((Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + E / 2 + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2)) * (l / n) / 2 * ((j + l / (2 * n) - x) / R1)
Gcosai = Gcosai + ((Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + E / 2 + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2)) * (l / n) / 2 * Sqr(1 - ((j + l / (2 * n) - x) / R1) ^ 2)
Next j
Gsinam = 0
Gcosam = 0
For j = x To -a / t Step -l / n
Gsinam = Gsinam + (t * j + Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + E / 2 + t * (j + l / n) + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2) * l / n / 2 * ((j - x + l / (2 * n)) / R1)
Gcosam = Gcosam + (t * j + Sqr(R1 ^ 2 - (j + D / 2) ^ 2)) + E / 2 + t * (j + l / n) + Sqr(R1 ^ 2 - (j + l / n + D / 2) ^ 2) * l / n / 2 * Sqr(1 - ((j - x + l / (2 * n)) / R1) ^ 2)
K = (Tan(φ / 180 * Pi) * (Gcosai + Gsinam) * γ + c * l) / γ * (Gsinai - Gsinam)
Next j
End Select
Kmin = 50
If Kmin > K Then
Kmin = K
Text1 = Kmin
End If
End If
Next x
End If
End Sub