new text documentdd
DESCRIPTION
asdfsTRANSCRIPT
-
New Text Document.txtFunction Get_x_position_HLL(ByVal x As Double, ByVal s As Double, ByVal L_span AsDouble, ByVal H As Double, ByVal l1_0 As Double, ByVal l2_0 As Double, ByVal k1 As Double, ByVal k2 As Double)
Dim x2, l1, l2 As Double
Dim v1, v2, a1, a2, b1, b2 As DoubleDim diff1, diff2, diff3, tol As Doublediff = 1tol = 1
Dim t1 As Double, t2 As DoubleDim m1 As Double, m2 As DoubleDim n1 As Double, n2 As Double
If (l1_0 < s) Thent1 = 0t2 = L_spanElseIf (l2_0 < s + H) Thent1 = L_spant2 = 0Elset1 = Sqr(l1_0 ^ 2 - s ^ 2)t2 = L_span - Sqr(l2_0 ^ 2 - (s + H) ^ 2)End If
't1 = x - L_span / 100't2 = x + L_span / 100
While tol > 0.000001x = (t1 + t2) * 0.5x2 = L_span - x
l1 = Sqr(s ^ 2 + x ^ 2)l2 = Sqr((H + s) ^ 2 + x2 ^ 2)
m1 = Sqr(s ^ 2 + t1 ^ 2)m2 = Sqr((H + s) ^ 2 + (L_span - t1) ^ 2)n1 = Sqr(s ^ 2 + t2 ^ 2)n2 = Sqr((H + s) ^ 2 + (L_span - t2) ^ 2)
v1 = (l1 - l1_0) * k1 * x / l1v2 = (l2 - l2_0) * k2 * x2 / l2a1 = (m1 - l1_0) * k1 * t1 / m1a2 = (m2 - l2_0) * k2 * (L_span - t1) / m2b1 = (n1 - l1_0) * k1 * t2 / n1b2 = (n2 - l2_0) * k2 * (L_span - t2) / n2
diff1 = v1 - v2diff2 = a1 - a2diff3 = b1 - b2tol = Abs(diff1) If (diff1 > 0 And diff2 > 0 And diff3 < 0) Thent1 = xt2 = t2End IfIf (diff1 < 0 And diff2 > 0 And diff3 < 0) Thent1 = t1t2 = xEnd IfIf (diff1 > 0 And diff2 < 0 And diff3 > 0) Thent1 = t1t2 = xEnd IfIf (diff1 < 0 And diff2 < 0 And diff3 > 0) Thent1 = xt2 = t2
Page 1
-
New Text Document.txtEnd IfIf (diff2 > 0 And diff3 > 0) Thentol = 0#End IfIf (diff2 < 0 And diff3 < 0) Thentol = 0#End If Wend
Get_x_position_HLL = x'End If
End Function
Page 2