Esempio n. 1
0
for f in i.getFluxes():
    folder = "flux3.5e" + str(i)
    print(folder)
    try:
        p = i.getInputParameters(glob.glob(f + "/*/output*")[0])
        os.chdir(f)
        temperatures = i.getTemperatures()
        meanValues = mk.getIslandDistribution(temperatures, False, False)
    except (OSError, IndexError):
        print("error changing to flux {}".format(f))
        continue
    os.chdir(workingPath)
    vs = meanValues.getGrowthSlope()
    s = (0.3 * 400 * 400) / meanValues.getIslandsAmount()
    vg = meanValues.getGyradiusSlope()
    rtt = mk.getRtt(temperatures)
    d = fun.fractalD(rtt / p.flux)
    rg = meanValues.getLastGyradius()
    print(len(d), len(s), len(rg))
    command = "d * ((s*vs)/rg**2)"
    y = eval(command)
    x = meanValues.getTotalRatio()
    print(len(x), len(y))
    try:
        plt.ylabel(command)
        plt.loglog(x, y, label=f)
        plt.loglog(x, x / 6e10, label="total ratio {}".format(f))
        plt.legend(loc='upper left', prop={'size': 6})
        plt.savefig("dSVsRgVsRate.png")
    except ValueError:
        plt.close()
Esempio n. 2
0
        meanValues = mk.getIslandDistribution(temperatures,
                                              sqrt=False,
                                              interval=False,
                                              growth=False)
    except OSError:
        print("error changing to {}".format(folder))
        a = 0  #do nothing
    os.chdir(workingPath)

    islands = meanValues.getIslandsAmount()
    indexes = np.where(islands > 0)
    islands = islands[indexes]
    v = (0.7 * flux * 400 * 400 / (islands)) / (flux**0.77)
    t = np.array(temperatures)[indexes]
    n = (flux**0.23) / (islands)
    r = np.array(mk.getRtt(t)) / (flux**0.33)
    plt.loglog(r, v, ".", label="N " + folder)
    if (i == -1):
        indexes = np.array(range(0, 13))
        x = r[indexes]
        y = v[indexes]
        popt = curve_fit(f.power, x, y)
        a = popt[0][0]
        b = popt[0][1]
        label = "{}x^{}".format(a, b)
        y = f.power(x, a, b)
        plt.loglog(x, y, label=label)

    if (i == -1):
        indexes = np.array(range(len(islands) - 15, len(islands) - 2))
        x = r[indexes]
Esempio n. 3
0
temperatures = list(range(120, 221, 5))

for i in range(-6, 1):
    folder = "flux3.5e" + str(i)
    flux = float("3.5e" + str(i))
    print(folder)
    try:
        os.chdir(folder)
        meanValues = mk.getIslandDistribution(temperatures, False, False)
    except OSError:
        print("error changing to {}".format(folder))
        a = 0  #do nothing
    os.chdir(workingPath)

    mtt = meanValues.getAeRatioTimesPossible()  #/flux**.063
    r = np.array(mk.getRtt(temperatures))  #/flux**0.5
    plt.loglog(mtt, r, "-", label="N " + folder)
    if (i < -7):
        popt = curve_fit(f.power, r, mtt)
        a = popt[0][0]
        b = popt[0][1]
        x = r
        a = 2e2
        b = 2 / 3
        label = "{}x^{}".format(a, b)
        y = f.power(x, a, b)
        plt.loglog(x, y, label=label)
    plt.legend(loc='lower right', prop={'size': 6})
    plt.savefig("aeRatioVsRate.png")

plt.close()
Esempio n. 4
0
    temperatures = list(range(120, 501, 5))
    initFlux = -6
    endFlux = 0

for i in range(initFlux, endFlux):
    folder = "flux3.5e" + str(i)
    flux = float("3.5e" + str(i))
    print(folder)
    try:
        os.chdir(folder)
        meanValues = mk.getIslandDistribution(temperatures, False)
    except OSError:
        print("error changing to {}".format(folder))
        a = 0  #do nothing
    os.chdir(workingPath)

    plt.title("Average island growth")
    plt.loglog(1 / (np.array(temperatures) * 8.62e-5),
               4e4 * meanValues.getGrowthSlope(),
               label="4e4*area " + folder)
    plt.loglog(1 / (np.array(temperatures) * 8.62e-5),
               np.array(mk.getRtt(temperatures)),
               "--",
               label="rate " + folder)
    plt.legend(loc='lower left', prop={'size': 6})
    plt.savefig("rateRttVsTemperature.png")

plt.close()

print("Good bye!")
Esempio n. 5
0
coverage = int(sys.argv[1])
for f in i.getFluxes():
    try:
        p = i.getInputParameters(glob.glob(f+"/*/output*")[0])
        os.chdir(f)
        temperatures = i.getTemperatures()
        meanValues = mk.getIslandDistribution(temperatures, sqrt=False, interval=False, growth=False, verbose = False, flux=-1, maxCoverage=coverage)
    except (OSError, IndexError):
        print ("error changing to {}".format(f))
        continue
    os.chdir(workingPath)

    v = 0.82*400*400/meanValues.getIslandsAmount()*(p.flux**0.21)
    n = meanValues.getIslandsAmount()/(p.flux**0.23)
    r = np.array(mk.getRtt(temperatures))/(p.flux**0.33)
    plt.loglog(r, n, "-", label="N "+f+" "+str(coverage))
    if (i == 0):
        x = r
        c = []
        exponent = []
        for i in temperatures:
            if (i > 250):
                c.append(220)
                exponent.append(-0.666)
            else:
                c.append(0.25)
                exponent.append(-0.333)
        y = c * r ** exponent
        plt.loglog(x, y, "*", label="fit")
    if (i == -1000):
Esempio n. 6
0
yPower = 0.3
xPower = 0

#plt.title("Average island growth")
plt.grid(True)
plt.xlabel(r"$\frac{{ r_{{tt}} }} {{ F^{{ {} }} }}$".format(xPower))
plt.ylabel(r'Average radius growth rate/flux $\frac{{ \sqrt{{ \dot{{r}} }} }}{{F^{{ {} }} }} }}$'.format(yPower))

workingPath = os.getcwd()
temperatures = list(range(120,221,5))
for i in range(-6,5):
    folder = "flux3.5e"+str(i)
    flux = float("3.5e"+str(i))
    print(folder)
    try:
        os.chdir(folder)
        meanValues = mk.getIslandDistribution(temperatures)
    except OSError:
        print ("error changing to {}".format(folder))
        a = 0 #do nothing
    os.chdir(workingPath)
    plt.loglog(np.array(mk.getRtt(temperatures))/flux**xPower, meanValues.getGrowthSlope()/(flux**yPower), label=folder)
    plt.legend(loc='upper left', prop={'size':6})
    plt.savefig("radiusVsRtt.png")
    
plt.close()


print("Good bye!")
          
Esempio n. 7
0
    print(folder)
    verbose = False
    sqrt = False
    growth = False
    try:
        os.chdir(folder)
        resultsFractal.append(mk.getAllFractalDimensions(
            temperatures, verbose))
    except OSError:
        print("ERROR changing to {}".format(folder))
        continue
    os.chdir(workingPath)

    while (len(temperatures) > len(resultsFractal[-1])):
        resultsFractal[-1].append(float('nan'))
    rttFlux = np.log(mk.getRtt(temperatures) / flux**0.333)
    x = np.concatenate((x, rttFlux))
    filename = "fractalD" + '{:E}'.format(flux) + ".txt"
    with open(filename, 'w', newline='') as csvfile:
        outwriter = csv.writer(csvfile,
                               delimiter=' ',
                               quotechar='|',
                               quoting=csv.QUOTE_MINIMAL)
        outwriter.writerow(["%index", "temp", "flux", "shapeF"])
        for index, temp in enumerate(temperatures):
            outwriter.writerow([index, temp, flux, resultsFractal[-1][index]])

    plt.plot(np.log(rttFlux), np.array(resultsFractal[-1]), ".-", label=folder)
    #plt.ylim(1,2.1)
    #plt.plot(temperatures, np.array(resultsFractal[-1]), ".-", label=folder)
    plt.legend(loc='upper left', prop={'size': 6})
Esempio n. 8
0
    flux = float("3.5e"+str(i))
    print(folder)
    try:
        os.chdir(folder)
        meanValues = mk.getIslandDistribution(temperatures, False, False)
    except OSError:
        print ("error changing to {}".format(folder))
        a = 0 #do nothing
    os.chdir(workingPath)

    totalRatio = (meanValues.getTotalRatio()/(flux**0.81))**(1)
    x = totalRatio
    y = f.fractalD(x)
    gyradius = 4e7*(meanValues.getGyradiusSlope()/(flux**0.88))**(3/4*(np.array(y)-1))
    gyradius = 1.3e5*(meanValues.getGyradiusSlope()/(flux**0.88))**(3*(np.array(y)-1))
    r = mk.getRtt(temperatures)/flux**0.36
    inverseTemperature = 1/(kb*np.array(temperatures))
    plt.semilogy(inverseTemperature, gyradius, "-", label="gyradius "+folder)
    plt.semilogy(inverseTemperature, totalRatio, "--", label="total ratio "+folder)
    if (i < -7):
        popt = curve_fit(f.power, r, totalRatio)
        a = popt[0][0]
        b = popt[0][1]
        a = 8e-11
        b = 1.33
        label = "{}x^{}".format(a, b)
        x = r
        y = f.power(x, a, b)
        plt.loglog(x, y, label=label)
    plt.legend(loc='lower left', prop={'size':6})
    plt.savefig("gyradiusVsTemperature.png")