Пример #1
0
def external_field_log_plot():
    file2 = FileOperations('Time_5000_117_from0,04to1,2.txt')

    file = FileOperations('Field_0,1_2000_16_from1,0to16,0.txt')
    _, x1, y1 = file.reading()
    y_0 = file2.searching(0.1)
    x1 = [i**2 for i in x1]
    y1 = [np.log(i / y_0) for i in y1]
    plt.plot(x1, y1, 'y')

    file = FileOperations('Field_0,2_2000_16_from1,0to16,0.txt')
    _, x2, y2 = file.reading()
    y_0 = file2.searching(0.2)
    x2 = [i**2 for i in x2]
    y2 = [np.log(i / y_0) for i in y2]
    plt.plot(x2, y2, 'r')

    file = FileOperations('Field_0,3_2000_16_from1,0to16,0.txt')
    _, x3, y3 = file.reading()
    y_0 = file2.searching(0.3)
    x3 = [i**2 for i in x3]
    y3 = [np.log(i / y_0) for i in y3]
    plt.plot(x3, y3, 'b')

    file = FileOperations('Field_0,4_2000_16_from1,0to16,0.txt')
    _, x4, y4 = file.reading()
    y_0 = file2.searching(0.4)
    x4 = [i**2 for i in x4]
    y4 = [np.log(i / y_0) for i in y4]
    plt.plot(x4, y4, 'g')

    plt.xlim(0, 260)
    plt.ylim(0, 7)

    plt.title('Spin relaxation time dependence on the external magnetic field',
              fontsize=26)
    plt.xlabel('(Ωτ)^2', fontsize=20)
    plt.ylabel('Logarithm of ratio of relaxation times', fontsize=20)

    plt.legend(['0.1', '0.2', '0.3', '0.4'],
               title='ωτ =',
               fontsize=20,
               title_fontsize=20,
               loc='upper left')

    plt.tick_params(axis='both', which='major', labelsize=18)

    plt.plot(x1, y1, 'yo')
    plt.plot(x2, y2, 'ro')
    plt.plot(x3, y3, 'bo')
    plt.plot(x4, y4, 'go')

    plt.savefig(r'image_files\external_field_log_plot.png')
    plt.show()
Пример #2
0
default_title_size = 26

y_0 = 0
y_theor = []

if plot_type == 'T':
    y_theor = time_theor()
    plt.title('Spin relaxation time dependence on time between collisions',
              fontsize=default_title_size)
    plt.xlabel('Time between collisions ( 1/Ω )', fontsize=default_label_size)
    plt.ylabel('Spin relaxation time ( 1/Ω )', fontsize=default_label_size)

elif plot_type == 'F':
    omega_tau = float(inf[1])
    file = FileOperations('Time_5000_117_from0,04to1,2.txt')
    y_0 = file.searching(omega_tau)
    y_theor = field_theor()
    plt.title(
        'Spin relaxation time dependence on the external magnetic field , Ωτ = '
        + str(omega_tau),
        fontsize=default_title_size)
    plt.xlabel('Time between collisions ( 1/Ω )', fontsize=default_label_size)
    plt.ylabel('Spin relaxation time ( 1/Ω )', fontsize=default_label_size)

elif plot_type == 'FF':
    omega_tau = float(inf[1])
    file = FileOperations('Time_5000_117_from0,04to1,2.txt')
    y_0 = file.searching(omega_tau)
    y_theor = field_theor()

    def fun_y(a):