| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 570 人关注过本帖
标题:为什么运行不出结果
取消只看楼主 加入收藏
wst907339357
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-4-28
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
为什么运行不出结果
α = 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
搜索更多相关主题的帖子: Text1 Text2 
2015-04-28 21:05
wst907339357
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-4-28
收藏
得分:0 
回复 2楼 renxiaoyao36
大神,求指教啊!
2015-04-28 21:41
wst907339357
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2015-4-28
收藏
得分:0 
回复 3楼 wst907339357
跪求啊,有急用!
2015-04-28 21:42
快速回复:为什么运行不出结果
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028940 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved