def start():
    draw_vac = DrawVacancies()
    d = DistributionElectricPotential()
    dt = DistributionTempInVolume()
    df = DistributionElectricField()
    probgen = ProbabilityGeneration()
    current = Current()

    U_FORM = 30

    # Формовка
    d.calc_wm(POTENTIAL_O_VAC=U_FORM)
    dt.calc_wm()
    massiv_field = df.calc(massiv_potential=d.massiv_potential)
    coord_o_vac = probgen.calc_formattion_wom(massiv_temp=dt.massiv_temp,
                                              massiv_field=massiv_field)
    draw_vac.draw(coord_o_vac, legend=str(U_FORM / 10))

    copy_massive_for_check_vacancies = copy.deepcopy(
        probgen.massive_for_check_vacancies)

    # Рекомбинация
    for _U in range(U_FORM, 0, -1):
        d.calc_wm(POTENTIAL_O_VAC=(_U / 10),
                  massive_for_check_vacancies=copy_massive_for_check_vacancies)
        dt.calc_wm(
            massive_for_check_vacancies=copy_massive_for_check_vacancies)
        massiv_field = df.calc(massiv_potential=d.massiv_potential)
        coord_o_vac = probgen.calc_reset_wm(
            massiv_temp=dt.massiv_temp,
            massiv_field=massiv_field,
            massive_for_check_vacancies=copy_massive_for_check_vacancies)
        draw_vac.draw(coord_o_vac, legend=str(_U / 10))

    draw_vac.create_animation()
    plt.show()
Ejemplo n.º 2
0
def start():
    draw_set_reset = DrawSetReset(num_plots=4)
    d = DistributionElectricPotential()
    dt = DistributionTempInVolume()
    df = DistributionElectricField()
    probgen = ProbabilityGeneration()
    current = Current()
    dv = DrawVAH()

    # Рекомбинация. Первая часть
    for _U in range(START_U_FORM - STEP_U_FORM, -(MAX_U_FORM + STEP_U_FORM),
                    -STEP_U_FORM):
        print('U:', _U / 1000)

        # if _U < -2200:
        #     raise Exception

        if _U == START_U_FORM - STEP_U_FORM:
            d.calc_wom(POTENTIAL_O_VAC=_U / 1000)
            dt.calc_wom()

            coord_o_vac = probgen.generate_full_vac()
        else:
            coord_o_vac = probgen.calc_reset_wm(
                massiv_temp=dt.massiv_temp,
                massiv_field=massiv_field,
                massive_for_check_vacancies=probgen.massive_for_check_vacancies
            )

        d.calc_wm(
            POTENTIAL_O_VAC=_U / 1000,
            massive_for_check_vacancies=probgen.massive_for_check_vacancies,
            massiv_potential=d.massiv_potential)
        dt.calc_wm(
            massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(
            massive_for_check_vacancies=probgen.massive_for_check_vacancies,
            POTENTIAL_O_VAC=_U / 1000)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(
            massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(
            potential=d.massiv_potential)
        draw_set_reset.snap()
        dv.add_point_2(potencial=_U / 1000,
                       current=current.calc_density_current_hrs(
                           massive_field=massiv_field,
                           massive_for_check_vacancies=probgen.
                           massive_for_check_vacancies,
                           massive_temp=dt.massiv_temp))

    # Вторая часть
    for _U in range(-MAX_U_FORM, START_U_FORM - STEP_U_FORM, STEP_U_FORM):
        print('U:', _U / 1000)
        coord_o_vac = probgen.calc_reset_wm(
            massiv_temp=dt.massiv_temp,
            massiv_field=massiv_field,
            massive_for_check_vacancies=probgen.massive_for_check_vacancies)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(
            massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(
            potential=d.massiv_potential)
        draw_set_reset.snap()

        d.calc_wm(
            POTENTIAL_O_VAC=(_U / 1000),
            massive_for_check_vacancies=probgen.massive_for_check_vacancies,
            massiv_potential=d.massiv_potential)
        dt.calc_wm(
            massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(
            massive_for_check_vacancies=probgen.massive_for_check_vacancies,
            POTENTIAL_O_VAC=_U / 1000)
        dv.add_point_2(potencial=_U / 1000,
                       current=current.calc_density_current_hrs(
                           massive_field=massiv_field,
                           massive_for_check_vacancies=probgen.
                           massive_for_check_vacancies,
                           massive_temp=dt.massiv_temp))

    # draw_set_reset.create_animation()
    # plt.show()
    dv.draw()
Ejemplo n.º 3
0
"""

from modelling.distribution_electric_field import DistributionElectricPotential, DistributionElectricField
from modelling.distribution_temp_in_volume import DistributionTempInVolume
from modelling.time_generation import TimeGeneration
from draw.draw_set_reset import DrawSetReset
from modelling.probability_generation import ProbabilityGeneration
from modelling.current import Current
import copy
import numpy as np
from modelling.const_variable import *
import matplotlib.pyplot as plt
import time

draw_set_reset = DrawSetReset(num_plots=3)
d = DistributionElectricPotential()
dt = DistributionTempInVolume()
df = DistributionElectricField()
probgen = ProbabilityGeneration()
current = Current()

massive_for_check_vacancies = np.zeros((SIZE_X, SIZE_Y))
for U_ in range(40, 200, 10):
    print('U:', U_ / 10)
    d.calc_wm(POTENTIAL_O_VAC=U_ / 10,
              massive_for_check_vacancies=massive_for_check_vacancies)
    dt.calc_wm(massive_for_check_vacancies=massive_for_check_vacancies)

    massiv_field = df.calc(massiv_potential=d.massiv_potential)
    coord_o_vac = probgen.calc_formattion_wm(
        massiv_temp=dt.massiv_temp,
Ejemplo n.º 4
0
"""

from modelling.distribution_electric_field import DistributionElectricPotential, DistributionElectricField
from modelling.distribution_temp_in_volume import DistributionTempInVolume
from modelling.time_generation import TimeGeneration
from draw.draw_set_reset import DrawVacancies
from modelling.probability_generation import ProbabilityGeneration
from modelling.current import Current
import copy
import numpy as np
from modelling.const_variable import *
import matplotlib.pyplot as plt
import time

draw_vac = DrawVacancies()
d = DistributionElectricPotential()
dt = DistributionTempInVolume()
df = DistributionElectricField()
probgen = ProbabilityGeneration()
current = Current()

for U_ in range(200, 700, 10):
    d.calc_wom(POTENTIAL_O_VAC=U_ / 100)
    dt.calc_wom()

    massiv_field = df.calc(massiv_potential=d.massiv_potential)
    coord_o_vac = probgen.calc_formattion_wom(massiv_temp=dt.massiv_temp,
                                              massiv_field=massiv_field)
    # massive_for_check_vacancies = probgen.massive_for_check_vacancies

    draw_vac.draw(coord_o_vac, legend=U_ / 100)
from modelling.distribution_electric_field import DistributionElectricPotential, DistributionElectricField
from modelling.distribution_temp_in_volume import DistributionTempInVolume
from modelling.time_generation import TimeGeneration
from draw.draw_set_reset import DrawVacancies
from modelling.probability_generation import ProbabilityGeneration
from modelling.current import Current
import copy
import matplotlib.pyplot as plt

draw_vac = DrawVacancies()
d = DistributionElectricPotential()
dt = DistributionTempInVolume()
df = DistributionElectricField()
probgen = ProbabilityGeneration()
current = Current()

U_FORM = 3
U_REC = 2

# Формовка
d.calc(POTENTIAL_O_VAC=U_FORM)
dt.calc()
massiv_field = df.calc(massiv_potential=d.massiv_potential)
coord_o_vac = probgen.calc_formattion_wom(massiv_temp=dt.massiv_temp, massiv_field=massiv_field)
draw_vac.draw(coord_o_vac)
copy_massive_for_check_vacancies = copy.deepcopy(probgen.massive_for_check_vacancies)

# Рекомбинация
d.calc(POTENTIAL_O_VAC=U_REC, massive_for_check_vacancies=copy_massive_for_check_vacancies)
dt.calc(massive_for_check_vacancies=copy_massive_for_check_vacancies)
massiv_field = df.calc(massiv_potential=d.massiv_potential)
Ejemplo n.º 6
0
def start():
    draw_set_reset = DrawSetReset(num_plots=4)
    d = DistributionElectricPotential()
    dt = DistributionTempInVolume()
    df = DistributionElectricField()
    probgen = ProbabilityGeneration()
    current = Current()
    dv = DrawVAH()

    # Формовка 1 в значениях близких к нулю
    for _U in range(SMALL_STEP_FOR_ZERO, STEP_U_FORM, SMALL_STEP_FOR_ZERO):
        print('U:', _U / 1000)

        if _U == SMALL_STEP_FOR_ZERO:
            d.calc_wom(POTENTIAL_O_VAC=_U / 1000)
            dt.calc_wom()

            coord_o_vac = probgen.generate_random_vac()
        else:
            coord_o_vac = probgen.calc_formattion_wm(
                massiv_temp=dt.massiv_temp,
                massiv_field=massiv_field,
                massive_for_check_vacancies=probgen.massive_for_check_vacancies
            )

        d.calc_wm(POTENTIAL_O_VAC=_U / 1000, massive_for_check_vacancies=probgen.massive_for_check_vacancies, massiv_potential=d.massiv_potential)
        dt.calc_wm(massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(massive_for_check_vacancies=probgen.massive_for_check_vacancies, POTENTIAL_O_VAC=_U / 1000)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(potential=d.massiv_potential)
        draw_set_reset.snap()
        draw_set_reset.clear_plt()
        dv.add_point_1(potencial=_U / 1000, current=current.calc_density_current_hrs(massive_field=massiv_field,
                                                                                    massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                                                                                    massive_temp=dt.massiv_temp
                                                                                    )
                       )

    # Формовка 1
    for _U in range(STEP_U_FORM, MAX_U_FORM+STEP_U_FORM, STEP_U_FORM):
        print('U:', _U / 1000)

        coord_o_vac = probgen.calc_formattion_wm(
            massiv_temp=dt.massiv_temp,
            massiv_field=massiv_field,
            massive_for_check_vacancies=probgen.massive_for_check_vacancies
        )

        d.calc_wm(POTENTIAL_O_VAC=_U / 1000, massive_for_check_vacancies=probgen.massive_for_check_vacancies, massiv_potential=d.massiv_potential)
        dt.calc_wm(massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(massive_for_check_vacancies=probgen.massive_for_check_vacancies, POTENTIAL_O_VAC=_U / 1000)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(potential=d.massiv_potential)
        draw_set_reset.snap()
        draw_set_reset.clear_plt()
        dv.add_point_1(potencial=_U / 1000, current=current.calc_density_current_hrs(massive_field=massiv_field,
                                                                                    massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                                                                                    massive_temp=dt.massiv_temp
                                                                                    )
                       )

    # Формовка 2
    for _U in range(MAX_U_FORM, START_U_FORM, -STEP_U_FORM):
        print('U:', _U / 1000)
        coord_o_vac = probgen.calc_formattion_wm(massiv_temp=dt.massiv_temp, massiv_field=massiv_field, massive_for_check_vacancies=probgen.massive_for_check_vacancies)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(potential=d.massiv_potential)
        draw_set_reset.snap()
        draw_set_reset.clear_plt()

        d.calc_wm(POTENTIAL_O_VAC=(_U / 1000), massive_for_check_vacancies=probgen.massive_for_check_vacancies, massiv_potential=d.massiv_potential)
        dt.calc_wm(massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(massive_for_check_vacancies=probgen.massive_for_check_vacancies, POTENTIAL_O_VAC=_U / 1000)
        dv.add_point_1(potencial=_U / 1000, current=current.calc_density_current_hrs(massive_field=massiv_field,
                                                                                   massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                                                                                   massive_temp=dt.massiv_temp
                                                                                   )
                       )

    # Формовка 2 в значениях близких к нулю
    for _U in range(START_U_FORM+STEP_U_FORM, START_U_FORM-SMALL_STEP_FOR_ZERO, -SMALL_STEP_FOR_ZERO):
        print('U:', _U / 1000)
        coord_o_vac = probgen.calc_formattion_wm(massiv_temp=dt.massiv_temp, massiv_field=massiv_field, massive_for_check_vacancies=probgen.massive_for_check_vacancies)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(potential=d.massiv_potential)
        draw_set_reset.snap()
        draw_set_reset.clear_plt()

        d.calc_wm(POTENTIAL_O_VAC=(_U / 1000), massive_for_check_vacancies=probgen.massive_for_check_vacancies, massiv_potential=d.massiv_potential)
        dt.calc_wm(massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(massive_for_check_vacancies=probgen.massive_for_check_vacancies, POTENTIAL_O_VAC=_U / 1000)
        dv.add_point_1(potencial=_U / 1000, current=current.calc_density_current_hrs(massive_field=massiv_field,
                                                                                   massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                                                                                   massive_temp=dt.massiv_temp
                                                                                   )
                       )


    # Рекомбинация 1 в значениях близких к нулю
    for _U in range(START_U_FORM - SMALL_STEP_FOR_ZERO, START_U_FORM - STEP_U_FORM, -SMALL_STEP_FOR_ZERO):
        print('U:', _U / 1000)

        coord_o_vac = probgen.calc_reset_wm(
            massiv_temp=dt.massiv_temp,
            massiv_field=massiv_field,
            massive_for_check_vacancies=probgen.massive_for_check_vacancies
        )

        d.calc_wm(POTENTIAL_O_VAC=_U / 1000, massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                  massiv_potential=d.massiv_potential)
        dt.calc_wm(massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                               POTENTIAL_O_VAC=_U / 1000)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(potential=d.massiv_potential)
        draw_set_reset.snap()
        draw_set_reset.clear_plt()
        dv.add_point_1(potencial=_U / 1000, current=current.calc_density_current_hrs(massive_field=massiv_field,
                                                                                     massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                                                                                     massive_temp=dt.massiv_temp
                                                                                     )
                       )

    # Рекомбинация 1
    for _U in range(START_U_FORM - STEP_U_FORM, -(MAX_U_FORM + STEP_U_FORM), -STEP_U_FORM):
        print('U:', _U / 1000)

        coord_o_vac = probgen.calc_reset_wm(
            massiv_temp=dt.massiv_temp,
            massiv_field=massiv_field,
            massive_for_check_vacancies=probgen.massive_for_check_vacancies
        )

        d.calc_wm(POTENTIAL_O_VAC=_U / 1000, massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                  massiv_potential=d.massiv_potential)
        dt.calc_wm(massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                               POTENTIAL_O_VAC=_U / 1000)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(potential=d.massiv_potential)
        draw_set_reset.snap()
        draw_set_reset.clear_plt()
        dv.add_point_1(potencial=_U / 1000, current=current.calc_density_current_hrs(massive_field=massiv_field,
                                                                                     massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                                                                                     massive_temp=dt.massiv_temp
                                                                                     )
                       )

    # Рекомбинация 2
    for _U in range(-MAX_U_FORM, START_U_FORM, STEP_U_FORM):
        print('U:', _U / 1000)
        coord_o_vac = probgen.calc_reset_wm(massiv_temp=dt.massiv_temp, massiv_field=massiv_field,
                                            massive_for_check_vacancies=probgen.massive_for_check_vacancies)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(potential=d.massiv_potential)
        draw_set_reset.snap()
        draw_set_reset.clear_plt()

        d.calc_wm(POTENTIAL_O_VAC=(_U / 1000), massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                  massiv_potential=d.massiv_potential)
        dt.calc_wm(massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                               POTENTIAL_O_VAC=_U / 1000)
        dv.add_point_1(potencial=_U / 1000, current=current.calc_density_current_hrs(massive_field=massiv_field,
                                                                                     massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                                                                                     massive_temp=dt.massiv_temp
                                                                                     )
                       )

    # Рекомбинация 2 в значениях близких к нулю
    for _U in range(START_U_FORM-STEP_U_FORM, START_U_FORM + SMALL_STEP_FOR_ZERO, SMALL_STEP_FOR_ZERO):
        print('U:', _U / 1000)
        coord_o_vac = probgen.calc_reset_wm(massiv_temp=dt.massiv_temp, massiv_field=massiv_field,
                                            massive_for_check_vacancies=probgen.massive_for_check_vacancies)

        draw_set_reset.draw_vacancies(coord_o_vac, legend=_U / 1000)
        draw_set_reset.draw_temp_distribution(massive_temp=dt.massiv_temp)
        draw_set_reset.draw_electric_field_distribution(massive_field=df.massiv_field)
        draw_set_reset.draw_potential_distribution(potential=d.massiv_potential)
        draw_set_reset.snap()
        draw_set_reset.clear_plt()

        d.calc_wm(POTENTIAL_O_VAC=(_U / 1000), massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                  massiv_potential=d.massiv_potential)
        dt.calc_wm(massive_for_check_vacancies=probgen.massive_for_check_vacancies)
        massiv_field = df.calc(massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                               POTENTIAL_O_VAC=_U / 1000)
        dv.add_point_1(potencial=_U / 1000, current=current.calc_density_current_hrs(massive_field=massiv_field,
                                                                                     massive_for_check_vacancies=probgen.massive_for_check_vacancies,
                                                                                     massive_temp=dt.massiv_temp
                                                                                     )
                       )

    draw_set_reset.create_animation()
    plt.show()
    dv.draw()
Ejemplo n.º 7
0
"""
Тест формовки при одном заданном напряжение
"""

from modelling.distribution_electric_field import DistributionElectricPotential, DistributionElectricField
from modelling.distribution_temp_in_volume import DistributionTempInVolume
from modelling.time_generation import TimeGeneration
from draw.draw_set_reset import DrawVacancies
from modelling.probability_generation import ProbabilityGeneration
from modelling.current import Current
import copy
import matplotlib.pyplot as plt

draw_vac = DrawVacancies()
d = DistributionElectricPotential()
dt = DistributionTempInVolume()
df = DistributionElectricField()
probgen = ProbabilityGeneration()
current = Current()

d.calc(POTENTIAL_O_VAC=3)
dt.calc()
massiv_field = df.calc(massiv_potential=d.massiv_potential)
coord_o_vac = probgen.calc_formattion_wom(massiv_temp=dt.massiv_temp,
                                          massiv_field=massiv_field)
draw_vac.draw(coord_o_vac)
plt.show()
copy_massive_for_check_vacancies = copy.deepcopy(
    probgen.massive_for_check_vacancies)