private void TestDistribution(float T) { int divs = 10000; StringBuilder sb = new StringBuilder(); float prev_value = 1f; float next_value = 100f; for (int i = 0; i < divs; i++) { string[] output = new string[1]; float frac = MaxwellBoltzmannSpeeds.ProbabilityLowerToUpper(prev_value, next_value, T, 4 * 1.67E-27f); //Debug.Log("Frac = " + frac); output[0] = frac.ToString("F6"); data.Add(output); prev_value = next_value; next_value += 10f; } for (int j = 0; j < divs; j++) { sb.AppendLine(string.Join(",", data[j])); } StreamWriter outStream = System.IO.File.CreateText("C:/Users/dpryd/Desktop/TESTDATA/" + "MaxBoltzDist" + T.ToString("F1") + ".csv"); outStream.WriteLine(sb); outStream.Close(); }