Beispiel #1
0
def main():
    global current_time
    for i in range(0, int_n_times):
        print("run %d at time=%f " % (i, system.time))
        integrate.integrate(int_steps)
        energies[i] = (system.time, system.analysis.energy()['total'])
        current_time = i
        update_plot()
def main_loop():
    global energies
    print("run %d at time=%f " % (i, system.time))

    integrate.integrate(int_steps)
    visualizer.update()

    energies = system.analysis.energy()
    print(energies)
    plot.set_xdata(numpy.append(plot.get_xdata(), system.time))
    plot.set_ydata(numpy.append(plot.get_ydata(), energies['total']))
    obs_file.write('{ time %s } %s\n' % (system.time, energies))
    linear_momentum = system.analysis.analyze_linear_momentum()
    print(linear_momentum)
Beispiel #3
0
def main_loop():
    global energies
    print("run %d at time=%f " % (i, system.time))

    integrate.integrate(int_steps)
    mayavi.update()

    energies = analyze.energy(system=system)
    print(energies)
    plot.set_xdata(numpy.append(plot.get_xdata(), system.time))
    plot.set_ydata(numpy.append(plot.get_ydata(), energies['total']))
    obs_file.write('{ time %s } %s\n' % (system.time, energies))
    linear_momentum = analyze.analyze_linear_momentum(system=system)
    print(linear_momentum)
Beispiel #4
0
        def test(self):
            # Set to true if you need a new
            # comparison configuration

            new_configuration = False

            boxl = 12
            sampsteps = 2000
            tstep = 0.01
            temp = 0.0

            S = espressomd.System()

            if (S.n_nodes > 1):
                print("NOTE: Ignoring testcase for n_nodes > 1")
                return

            S.box_l = [boxl, boxl, boxl]
            S.skin = 0.1
            S.time_step = tstep

            S.part.add(id=0, pos=[6.0,3.0,2.0],
                       swimming={"mode": "pusher", "v_swim": 0.10, "dipole_length": 1.0, "rotational_friction":  2.0},
                       quat=[np.sqrt(.5),np.sqrt(.5),          0,          0])
            S.part.add(id=1, pos=[2.0,3.0,6.0],
                       swimming={"mode": "pusher", "f_swim": 0.03, "dipole_length": 2.0, "rotational_friction": 20.0},
                       quat=[np.sqrt(.5),          0,np.sqrt(.5),          0])
            S.part.add(id=2, pos=[3.0,2.0,6.0],
                       swimming={"mode": "puller", "v_swim": 0.15, "dipole_length": 0.5, "rotational_friction": 15.0},
                       quat=[np.sqrt(.5),          0,          0,np.sqrt(.5)])
            S.part.add(id=3, pos=[3.0,6.0,2.0],
                       swimming={"mode": "puller", "f_swim": 0.05, "dipole_length": 1.5, "rotational_friction":  6.0},
                       quat=[          0,          0,np.sqrt(.5),np.sqrt(.5)])

            lbm = lb.LBFluid(agrid=1.0, tau=tstep, fric=0.5, visc=1.0, dens=1.0)
            S.actors.add(lbm)

            #thermostat lb $temp

            integrate.integrate(sampsteps)

            if new_configuration:
                lbm.print_vtk_velocity("engine_lb.vtk")
                self.assertTrue( True )
            else:
                lbm.print_vtk_velocity("engine_lb_tmp.vtk")
                different, difference = tests_common.calculate_vtk_max_pointwise_difference("engine_lb.vtk", "engine_lb_tmp.vtk",tol=2.0e-7)
                os.remove("engine_lb_tmp.vtk")
                print("Maximum deviation to the reference point is: {}".format(difference))
                self.assertTrue( different )
def main():
    system.time_step = 0.00001
    system.skin = 0.4
    box_l = 10
    system.box_l = [box_l, box_l, box_l]

    for i in range(10):
        rpos=numpy.random.random(3) * box_l
        system.part.add(id=i, pos=rpos)
                                        
    system.thermostat.set_langevin(kT=1.0, gamma=1.0)

    while True: 
        integrate.integrate(1)
        #Update particle information safely here
        visualizer.update()
Beispiel #6
0
def main():
    system.time_step = 0.00001
    system.skin = 0.4
    box_l = 10
    system.box_l = [box_l, box_l, box_l]

    for i in range(10):
        rpos = numpy.random.random(3) * box_l
        system.part.add(id=i, pos=rpos)

    system.thermostat.set_langevin(kT=1.0, gamma=1.0)

    while True:
        integrate.integrate(1)
        #Update particle information safely here
        visualizer.update()
Beispiel #7
0
        def test(self):
            boxl = 12
            sampsteps = 2000
            tstep = 0.01

            v_swim = 0.3
            f_swim = 0.1
            temp = 0.0
            gamma = 1.0

            pos_0 = np.array([boxl / 2., boxl / 2., 1. * boxl / 3.])
            pos_1 = np.array([boxl / 2., boxl / 2., 2. * boxl / 3.])

            def z_f(t, z0):
                return f_swim / gamma * (
                    -1. / gamma + t + (1. / gamma) * np.exp(-gamma * t)) + z0

            def z_v(t, z0):
                return v_swim * (-1. / gamma + t +
                                 (1. / gamma) * np.exp(-gamma * t)) + z0

            S = espressomd.System()

            S.box_l = [boxl, boxl, boxl]
            S.skin = 0.1
            S.time_step = tstep

            S.part.add(id=0, pos=pos_0, swimming={"v_swim": v_swim})
            S.part.add(id=1, pos=pos_1, swimming={"f_swim": f_swim})

            S.thermostat.set_langevin(kT=temp, gamma=gamma)

            integrate.integrate(sampsteps)

            pos_0[2] = z_v(S.time, pos_0[2])
            pos_1[2] = z_f(S.time, pos_1[2])

            delta_pos_0 = np.linalg.norm(S.part[0].pos - pos_0)
            delta_pos_1 = np.linalg.norm(S.part[1].pos - pos_1)

            self.assertTrue(1.4e-3 < delta_pos_0 and delta_pos_0 < 1.6e-3)
            self.assertTrue(4.9e-4 < delta_pos_1 and delta_pos_1 < 5.1e-4)
Beispiel #8
0
        def test(self):
            boxl = 12
            sampsteps = 2000
            tstep = 0.01

            v_swim = 0.3
            f_swim = 0.1
            temp = 0.0
            gamma = 1.0

            pos_0 = np.array([boxl/2., boxl/2., 1.*boxl/3.])
            pos_1 = np.array([boxl/2., boxl/2., 2.*boxl/3.])

            def z_f(t,z0):
                return f_swim/gamma*(-1./gamma + t + (1./gamma)*np.exp(-gamma*t))+z0

            def z_v(t,z0):
                return v_swim*(-1./gamma + t + (1./gamma)*np.exp(-gamma*t))+z0

            S = espressomd.System()

            S.box_l = [boxl, boxl, boxl]
            S.skin = 0.1
            S.time_step = tstep

            S.part.add(id=0, pos=pos_0, swimming={"v_swim": v_swim})
            S.part.add(id=1, pos=pos_1, swimming={"f_swim": f_swim})

            S.thermostat.set_langevin(kT=temp, gamma=gamma)

            integrate.integrate(sampsteps)

            pos_0[2] = z_v(S.time, pos_0[2])
            pos_1[2] = z_f(S.time, pos_1[2])

            delta_pos_0 = np.linalg.norm(S.part[0].pos - pos_0)
            delta_pos_1 = np.linalg.norm(S.part[1].pos - pos_1)

            self.assertTrue(1.4e-3 < delta_pos_0 and delta_pos_0 < 1.6e-3)
            self.assertTrue(4.9e-4 < delta_pos_1 and delta_pos_1 < 5.1e-4)
Beispiel #9
0
def main_loop():
    global energies, plt1_x_data, plt1_y_data, plt2_x_data, plt2_y_data, old_pressure

    integrate.integrate(int_steps)
    mayavi.update()

    # make sure the parameters are valid
    # not sure if this is necessary after using limit_range
    if controls.volume == 0:
        controls.volume = controls.min_vol
    if controls.number_of_particles == 0:
        controls.number_of_particles = 1
    if controls.pressure == 0:
        controls.pressure = controls.min_press

    pressure = system.analysis.pressure()

    # update the parameters set in the GUI
    system.thermostat.set_langevin(kT=controls.temperature, gamma=1.0)
    if controls.ensemble == 'NPT':
        # reset Vkappa when target pressure has changed

        if old_pressure != controls.pressure:
            system.analysis.Vkappa('reset')
            old_pressure = controls.pressure

        newVkappa = system.analysis.Vkappa('read')['Vk1']
        newVkappa = newVkappa if newVkappa > 0. else 4.0 / (
            NPTGamma0 * NPTGamma0 * NPTInitPistonMass)
        pistonMass = limit_range(4.0 / (NPTGamma0 * NPTGamma0 * newVkappa),
                                 NPTMinPistonMass, NPTMaxPistonMass)
        integrate.set_integrator_isotropic_npt(controls.pressure,
                                               pistonMass,
                                               cubic_box=True)

        controls.volume = system.box_l[0]**3.

    else:
        integrate.set_integrator_nvt()
        controls.pressure = pressure['total']

        new_box = numpy.ones(3) * controls.volume**(1. / 3.)
        if numpy.any(numpy.array(system.box_l) != new_box):
            for i in range(system.n_part):
                system.part[i].pos *= new_box / system.box_l[0]
        system.box_l = new_box

    new_part = controls.number_of_particles
    if new_part > system.n_part:
        for i in range(system.n_part, new_part):
            system.part.add(id=i, pos=numpy.random.random(3) * system.box_l)
    elif new_part < system.n_part:
        for i in range(new_part, system.n_part):
            system.part[i].delete()
    # There should be no gaps in particle numbers
    assert system.n_part == system.max_part + 1

    plt1_x_data = plot1.get_xdata()
    plt1_y_data = plot1.get_ydata()
    plt2_x_data = plot2.get_xdata()
    plt2_y_data = plot2.get_ydata()

    plt1_x_data = numpy.append(plt1_x_data[-plot_max_data_len + 1:],
                               system.time)
    if show_real_system_temperature:
        plt1_y_data = numpy.append(
            plt1_y_data[-plot_max_data_len + 1:],
            2. / (3. * system.n_part) * system.analysis.energy()["ideal"])
    else:
        plt1_y_data = numpy.append(plt1_y_data[-plot_max_data_len + 1:],
                                   system.temperature)
    plt2_x_data = numpy.append(plt2_x_data[-plot_max_data_len + 1:],
                               system.time)
    plt2_y_data = numpy.append(plt2_y_data[-plot_max_data_len + 1:],
                               pressure['total'])
Beispiel #10
0
system = espressomd.System()

#if no seed is provided espresso generates a seed

system.time_step = 0.01
system.skin = 0.4
system.box_l = [100, 100, 100]
system.thermostat.set_langevin(1.0, 1.0)
system.cell_system.set_n_square(use_verlet_lists=False)

system.non_bonded_inter[0, 0].lennard_jones.set_params(epsilon=1,
                                                       sigma=1,
                                                       cutoff=2**(1. / 6),
                                                       shift="auto")

fene = interactions.FeneBond(k=10, d_r_max=2)
system.bonded_inter.add(fene)

poly = system.polymer
poly(N_P=1, bond_length=1.0, MPC=50, bond_id=0)

#############################################################
#      Integration                                          #
#############################################################

for i in range(20):
    integrate.integrate(1000)

    energies = system.analysis.energy()
    print energies
Beispiel #11
0
for key in p3m_params.keys():
    print("{} = {}".format(key, p3m_params[key]))

print(system.actors)

#############################################################
#      Integration                                          #
#############################################################
print("\nStart integration: run %d times %d steps" % (int_n_times, int_steps))

# remove force capping
lj_cap = 0
system.non_bonded_inter.set_force_cap(lj_cap)
print(system.non_bonded_inter[0, 0].lennard_jones)

# print initial energies
energies = analyze.energy(system=system)
print(energies)

j = 0
for i in range(0, int_n_times):
    print("run %d at time=%f " % (i, system.time))

    integrate.integrate(int_steps)

    energies = analyze.energy(system=system)
    print(energies)

# terminate program
print("\nFinished.")
Beispiel #12
0
for key in p3m_params.keys():
    print("{} = {}".format(key, p3m_params[key]))

print(system.actors)

#############################################################
#      Integration                                          #
#############################################################
print("\nStart integration: run %d times %d steps" % (int_n_times, int_steps))

# remove force capping
lj_cap = 0
system.non_bonded_inter.set_force_cap(lj_cap)
print(system.non_bonded_inter[0, 0].lennard_jones)

# print initial energies
energies = analyze.energy(system=system)
print(energies)

j = 0
for i in range(0, int_n_times):
    print("run %d at time=%f " % (i, system.time))

    integrate.integrate(int_steps)

    energies = analyze.energy(system=system)
    print(energies)

# terminate program
print("\nFinished.")
Beispiel #13
0
def main():
    for i in range(0, int_n_times):
        print("run %d at time=%f " % (i, system.time))
        integrate.integrate(int_steps)
def main():
    for i in range(0,int_n_times):
        print(i)
        integrate.integrate(int_steps)
        visualizer.update()
Beispiel #15
0
def main():
    for i in range(0, int_n_times):
        print("run %d at time=%f " % (i, system.time))
        integrate.integrate(int_steps)
Beispiel #16
0

# Electrostatic interaction
p3m = electrostatics.P3M(bjerrum_length=10.0, accuracy=1e-3)
system.actors.add(p3m)
print("P3M parameter:\n")
p3m_params = p3m.get_params()
for key in p3m_params.keys():
    print("{} = {}".format(key, p3m_params[key]))


# Warmup integration loop
print("\nWarmup")
for cap in xrange(20, 200, 20):
    system.non_bonded_inter.set_force_cap(cap)
    integrate.integrate(100)
system.non_bonded_inter.set_force_cap(0)


# Main integration loop
integ_steps = 200
int_n_times = 20

print("\nIntegration")
for i in xrange(int_n_times):
    temp = system.analysis.energy()['ideal'] / ((3.0 / 2.0) * n_part)
    print("t={0:.1f}, E_total={1:.2f}, E_coulomb={2:.2f}, T={3:.4f}".format(system.time,
                                       system.analysis.energy()['total'],
                                       system.analysis.energy()['coulomb'],
                                       temp))
    integrate.integrate(integ_steps)
Beispiel #17
0
system = espressomd.System()

#if no seed is provided espresso generates a seed

system.time_step = 0.01
system.skin = 0.4
system.box_l = [100, 100, 100]
system.thermostat.set_langevin(1.0, 1.0)
system.cell_system.set_n_square(use_verlet_lists=False)

system.non_bonded_inter[0, 0].lennard_jones.set_params(
    epsilon=1, sigma=1,
    cutoff=2**(1. / 6), shift="auto")

fene = interactions.FeneBond(k=10, d_r_max=2)
system.bonded_inter.add(fene)

poly = system.polymer
poly(N_P = 1, bond_length = 1.0, MPC=50, bond_id=0)


#############################################################
#      Integration                                          #
#############################################################

for i in range(20):
    integrate.integrate(1000)

    energies = analyze.energy(system=system)
    print energies
 def test_scafacos_p3m(self):
     self.S.actors.add(Scafacos(bjerrum_length=1, method_name="p3m", method_params={
                       "p3m_r_cut": 1.001, "p3m_grid": 64, "p3m_cao": 7, "p3m_alpha": 2.70746}))
     integrate(0)
     self.compare("scafacos_p3m", energy=True)
 def test_scafacos_p2nfft(self):
     self.S.actors.add(Scafacos(bjerrum_length=1, method_name="p2nfft", method_params={
                       "p2nfft_r_cut": 1.001, "tolerance_field": 1E-4}))
     integrate(0)
     self.compare("scafacos_p2nfft", energy=True)
Beispiel #20
0
def main_loop():
    global energies, plt1_x_data, plt1_y_data, plt2_x_data, plt2_y_data, old_pressure

    integrate.integrate(int_steps)
    mayavi.update()

    # make sure the parameters are valid
    # not sure if this is necessary after using limit_range
    if controls.volume == 0:
        controls.volume = controls.min_vol
    if controls.number_of_particles == 0:
        controls.number_of_particles = 1
    if controls.pressure == 0:
        controls.pressure = controls.min_press

    pressure = analyze.pressure(system)

    
    # update the parameters set in the GUI
    system.thermostat.set_langevin(kT=controls.temperature, gamma=1.0)
    if controls.ensemble == 'NPT':
        # reset Vkappa when target pressure has changed
        
        if old_pressure != controls.pressure:
            analyze.Vkappa(system, 'reset')
            old_pressure = controls.pressure
            
        newVkappa = analyze.Vkappa(system, 'read')['Vk1']
        newVkappa = newVkappa if newVkappa > 0. else 4.0/(NPTGamma0*NPTGamma0*NPTInitPistonMass)
        pistonMass = limit_range(4.0/(NPTGamma0*NPTGamma0*newVkappa), NPTMinPistonMass, NPTMaxPistonMass)
        integrate.set_integrator_isotropic_npt(controls.pressure, pistonMass, cubic_box=True)
        
        controls.volume = system.box_l[0]**3.

    else:
        integrate.set_integrator_nvt()
        controls.pressure = pressure['total']
        
        new_box = numpy.ones(3) * controls.volume**(1./3.)
        if numpy.any(numpy.array(system.box_l) != new_box):
            for i in range(system.n_part):
                system.part[i].pos *= new_box / system.box_l[0]
        system.box_l = new_box

    new_part = controls.number_of_particles
    if new_part > system.n_part:
        for i in range(system.n_part, new_part):
            system.part.add(id=i, pos=numpy.random.random(3) * system.box_l)
    elif new_part < system.n_part:
        for i in range(new_part, system.n_part):
            system.part[i].delete()
    # There should be no gaps in particle numbers
    assert system.n_part == system.max_part + 1
    
    plt1_x_data = plot1.get_xdata()
    plt1_y_data = plot1.get_ydata()
    plt2_x_data = plot2.get_xdata()
    plt2_y_data = plot2.get_ydata()
    
    plt1_x_data = numpy.append(plt1_x_data[-plot_max_data_len+1:], system.time)
    if show_real_system_temperature:
        plt1_y_data = numpy.append(plt1_y_data[-plot_max_data_len+1:], 2./(3. * system.n_part)*analyze.energy(system)["ideal"])
    else:
        plt1_y_data = numpy.append(plt1_y_data[-plot_max_data_len+1:], system.temperature)
    plt2_x_data = numpy.append(plt2_x_data[-plot_max_data_len+1:], system.time)
    plt2_y_data = numpy.append(plt2_y_data[-plot_max_data_len+1:], pressure['total'])
Beispiel #21
0
# system.part[2*n_monomers+n_ions/2:] = -np.ones(n_ions/2)

print("types:", system.part[:].type)
print("")
print("Q_tot:", np.sum(system.part[:].q))

#############################################################
#      Warmup                                               #
#############################################################

system.non_bonded_inter.set_force_cap(10)

for i in range(1000):
    sys.stdout.write("\rWarmup: %03i" % i)
    sys.stdout.flush()
    integrate.integrate(1)
    system.non_bonded_inter.set_force_cap(10 * i)

system.non_bonded_inter.set_force_cap(0)

print("\nWarmup finished!\n")

#############################################################
#      Sampling                                             #
#############################################################
#
# Activate electostatic with checkpoint example
#############################################################
read_checkpoint = False
# Load checkpointed p3m class
if os.path.isfile("p3m_checkpoint") and read_checkpoint == True:
 def test_p3m_gpu(self):
     self.S.actors.add(P3M_GPU(
         bjerrum_length=1, r_cut=1.001, mesh=64, cao=7, alpha=2.70746, tune=False))
     integrate(0)
     self.compare("p3m_gpu", energy=False)
print("types:", system.part[:].type)
print("")
print("Q_tot:", np.sum(system.part[:].q))



#############################################################
#      Warmup                                               #
#############################################################

system.non_bonded_inter.set_force_cap(10)

for i in range(1000):
    sys.stdout.write("\rWarmup: %03i"%i)
    sys.stdout.flush()
    integrate.integrate(1)
    system.non_bonded_inter.set_force_cap(10*i)

system.non_bonded_inter.set_force_cap(0)

print("\nWarmup finished!\n")

#############################################################
#      Sampling                                             #
#############################################################
#
# Activate electostatic with checkpoint example
#############################################################
read_checkpoint = False
# Load checkpointed p3m class
if os.path.isfile("p3m_checkpoint") and read_checkpoint == True:
Beispiel #24
0
print("""
Start warmup integration:
At maximum {} times {} steps
Stop if minimal distance is larger than {}
""".strip().format(warm_n_times, warm_steps, min_dist))

# set LJ cap
lj_cap = 20
system.nonBondedInter.setForceCap(lj_cap)
print(system.nonBondedInter[0, 0].lennardJones)

# Warmup Integration Loop
i = 0
while (i < warm_n_times and act_min_dist < min_dist):
    integrate.integrate(warm_steps)
    # Warmup criterion
    act_min_dist = analyze.mindist(es)
    i += 1

    #   Increase LJ cap
    lj_cap = lj_cap + 10
    system.nonBondedInter.setForceCap(lj_cap)

# Just to see what else we may get from the c code
print("""
ro variables:
cell_grid     {0.cell_grid}
cell_size     {0.cell_size} 
local_box_l   {0.local_box_l} 
max_cut       {0.max_cut}
Beispiel #25
0
    system.part.add(id=i, pos=np.random.random(3) * system.box_l)

#############################################################
#  Warmup Integration                                       #
#############################################################

print("""
Start warmup integration:
At maximum {} times {} steps
Stop if minimal distance is larger than {}
""".strip().format(warm_n_time, warm_steps, min_dist))

i = 0
act_min_dist = system.analysis.mindist()
while i < warm_n_time and act_min_dist < min_dist :
    integrate.integrate(warm_steps)
    act_min_dist = system.analysis.mindist()
    print("run {} at time = {} (LJ cap= {} ) min dist = {}".strip().format(i, system.time, lj_cap, act_min_dist))
    i+=1
    lj_cap += 1.0
    system.non_bonded_inter.set_force_cap(lj_cap)

system.non_bonded_inter.set_force_cap(0)

print("\nWarm up finished\n")

system.time_step = eq_tstep 

for i in range(equilibration_iterations):
    integrate.integrate(equilibration_interval)
    energies = system.analysis.energy()
print("""
Start warmup integration:
At maximum {} times {} steps
Stop if minimal distance is larger than {}
""".strip().format(warm_n_times, warm_steps, min_dist))

# set LJ cap
lj_cap = 20
system.non_bonded_inter.set_force_cap(lj_cap)
print(system.non_bonded_inter[0, 0].lennard_jones)

# Warmup Integration Loop
i = 0
while (i < warm_n_times and act_min_dist < min_dist):
    integrate.integrate(warm_steps)
    # Warmup criterion
    act_min_dist = system.analysis.mindist()
#  print("\rrun %d at time=%f (LJ cap=%f) min dist = %f\r" % (i,system.time,lj_cap,act_min_dist), end=' ')
    i += 1

#   Increase LJ cap
    lj_cap = lj_cap + 10
    system.non_bonded_inter.set_force_cap(lj_cap)
    visualizer.update()

# Just to see what else we may get from the c code
print("""
ro variables:
cell_grid     {0.cell_grid}
cell_size     {0.cell_size} 
Beispiel #27
0
                fix=[1, 1, 1])
# system.part.add(id=0, pos=[box_l/2.0,box_l/2.0,box_l/2.0], ext_force=[0,0,1])

lbf = lb.LBFluid(agrid=1,
                 fric=1,
                 dens=1,
                 visc=1,
                 tau=0.01,
                 ext_force=[0, 0, -1.0 / (box_l**3)])
system.actors.add(lbf)
print(system.actors)

f_list = []
for i in range(10):
    f_list.append(system.part[0].f)
    integrate.integrate(10)
    print(i)

f_list = np.array(f_list)

import matplotlib.pyplot as pp

fig1 = pp.figure()
ax = fig1.add_subplot(111)
ax.plot(f_list[:, 0], label="F_x")
ax.plot(f_list[:, 1], label="F_y")
ax.plot(f_list[:, 2], label="F_z")
ax.legend()
ax.set_xlabel("t")
ax.set_ylabel("F")
Beispiel #28
0
system.box_l =[box_l, box_l, box_l]
system.periodic = [1,1,1]

system.part.add(id=0, pos=[box_l/2.0,box_l/2.0,box_l/2.0], fix=[1,1,1])
# system.part.add(id=0, pos=[box_l/2.0,box_l/2.0,box_l/2.0], ext_force=[0,0,1])


lbf = lb.LBFluid(agrid=1, fric=1, dens=1, visc=1, tau=0.01, ext_force=[0,0,-1.0/(box_l**3)])
system.actors.add(lbf)
print(system.actors)


f_list = []
for i in range(10):
    f_list.append(system.part[0].f)
    integrate.integrate(10)
    print(i)

f_list=np.array(f_list)

import matplotlib.pyplot as pp

fig1=pp.figure()
ax=fig1.add_subplot(111)
ax.plot(f_list[:,0],label="F_x")
ax.plot(f_list[:,1],label="F_y")
ax.plot(f_list[:,2],label="F_z")
ax.legend()
ax.set_xlabel("t")
ax.set_ylabel("F")
def main():
    for i in range(0, int_n_times):
        print(i)
        integrate.integrate(int_steps)
        visualizer.update()