The code block computes two values for speeds; Vsf and Vro using their corresponding parameter values: Angle, Super-elevation and Radius for each iteration of the for- loop statement. During each loop, it selects the minimum of both speed values. In some scenario's, Angle, super-elevation but most of all, Radius are all null values, leading to Vsf and Vro values of null and hence Vmin of null. I want to eliminate these scenarios and produce just non-zero values for Vmin hence my question.
For i = 1 To CInt(txtNumSections.Text) ReDim Preserve Vsf(i) ReDim Preserve Vro(i) ReDim Preserve Vmin(i) Vsf(i) = (((0.91544 - 0.00166 * Angle(i) - 0.000002 * W - 0.054248 * Superelevation(i) - Sidefrictionfactor) / 0.013939) * Radius(i)) ^ 0.5 Vro(i) = (((1.05653 - 0.004861 * Angle(i) - 0.000004 * W - 0.314653 * Superelevation(i) - rolloverthreshold) / 0.012729) * Radius(i)) ^ 0.5 Vmin(i) = Math.Min(Vsf(i), Vro(i)) If Vmin(i) <= "0" Then Vmin(i) = "0" End If Next Dim myList = New List(Of Double) For Each s In Vmin If Not String.IsNullOrWhiteSpace(s) Then myList.Add(s) End If Next Vmin = myList.ToArray()
Vmin(i) = "0".