예제 #1
0
###
interps = ["LinLinLog", "LogLogLog", "LinLinLin"]
methods = ["Simplified Union", "One D Union", "Two D Union"]

interps = ["LogLogLog", "LinLinLin"]
methods = ["Two D Union"]
for interp in interps:
    print "\n-----", interp, "-----"
    for method in methods:
        coupled_dist = Collision.createLinLinLogCorrelatedCoupledElasticDistribution(
            pb_data, method, 1e-15)
        if interp == "LogLogLog":
            coupled_dist = Collision.createLogLogLogCorrelatedCoupledElasticDistribution(
                pb_data, method, 1e-15)
        elif interp == "LinLinLin":
            coupled_dist = Collision.createLinLinLinCorrelatedCoupledElasticDistribution(
                pb_data, method, 1e-15)

        print "\n----- ", method, " -----\n"

        print "\t -- evaluateLegendreExpandedRutherford --\n"
        etas = [
            2.51317958942017e3, 2.68213671998009, 4.14887699806239e-14,
            2.51317958942017e3
        ]
        angles = [[0.999999], [1.0, 1.0, 1.0], [0.999999], [1.0]]
        energies = [[1.0e-5], [1.0e-4, 5.5e-4, 1.0e-3], [1.0e5], [1.0e-5]]
        for i in range(0, len(etas)):
            print "Eta = ", etas[i]
            for j in range(0, len(angles[i])):
                cutoff_pdf = coupled_dist.evaluatePDFAtCutoff(energies[i][j])
                pdf = coupled_dist.evaluateScreenedRutherfordPDF(
예제 #2
0
            if interpolation == "LogLogLog":
              labels.append(schemes[n] + " - log")
              if schemes[n] == "Unit-base":
                dist = Collision.createLogLogLogUnitBaseCoupledElasticDistribution(native_data, "One D Union", tol)
              if schemes[n] == "Unit-base Correlated":
                dist = Collision.createLogLogLogUnitBaseCorrelatedCoupledElasticDistribution(native_data, "Two D Union", tol)
              if schemes[n] == "Correlated":
                dist = Collision.createLogLogLogCorrelatedCoupledElasticDistribution(native_data, "Two D Union", tol)
            elif interpolation == "LinLinLin":
              labels.append(schemes[n] + " - lin")
              if schemes[n] == "Unit-base":
                dist = Collision.createLinLinLinUnitBaseCoupledElasticDistribution(native_data, "Two D Union", tol)
              if schemes[n] == "Unit-base Correlated":
                dist = Collision.createLinLinLinUnitBaseCorrelatedCoupledElasticDistribution(native_data, "Two D Union", tol)
              if schemes[n] == "Correlated":
                dist = Collision.createLinLinLinCorrelatedCoupledElasticDistribution(native_data, "Two D Union", tol)

            for i in range(0, length):
              pdfs[n, i] = dist.evaluatePDF(energy, angles[i])
              cdfs[n, i] = dist.evaluateCDF(energy, angles[i])

            if schemes[n] == "Unit-base":
              labels[n] = "Lower " + schemes[n] + " - log"
              upper_samples = numpy.zeros(len(random_numbers))
              Num = n

              # Sample both upper and lower distrbutions
              lower_random_numbers = numpy.zeros((len(random_numbers)*2))
              upper_random_numbers = numpy.zeros((len(random_numbers)*2))
              lower_random_numbers[0::2] = random_numbers
              upper_random_numbers[0::2] = random_numbers