rinikerlab/Ensembler

Verlocity Verlet does not work for 2D potential

linkerst opened this issue · 1 comments

Execution of velocity verlet as well as leapfrog integration with 2D potentials leads to error: TypeError: can't multiply sequence by non-int of type 'float'. See example

`import os, sys
my_path = os.getcwd()+"/.."
print(my_path)
sys.path.append(my_path)

import numpy as np
from matplotlib import pyplot as plt

from ensembler.potentials.TwoD import wavePotential

from ensembler.integrator.newtonian import positionVerletIntegrator, velocityVerletIntegrator, leapFrogIntegrator
from ensembler.system import system

##Visualisation
from ensembler.visualisation.plotSimulations import static_sim_plots

sim_steps = 1000

#Simulation Setup
origpot = wavePotential(multiplicity=[2,2])

integrator = velocityVerletIntegrator()

sys=system(potential=origpot, integrator=integrator, position=np.array([20,70]), temperature=3)

#simulate
cur_state = sys.simulate(sim_steps, withdrawTraj=True, initSystem=False)

print("Trajectory length: ",len(sys.trajectory))
print()
print("last_state: ", cur_state)
print(len(sys.trajectory))
sys.trajectory.head()`

This problem should be solved by now. Please see examples/BaicSimulations.ipynb