fixed assymetry in momentum-overflow handling

This commit is contained in:
Daniel Knüttel 2019-07-12 22:28:39 +02:00
parent fca61cd47a
commit 2475186d79

View File

@ -38,8 +38,10 @@ class BrownIterator(object):
return self.x, self.y return self.x, self.y
self.px, self.py = self._interaction(self.x, self.y, self.px, self.py) self.px, self.py = self._interaction(self.x, self.y, self.px, self.py)
self.px[np.isnan(self.px)] = self.speed_of_light # XXX: We need the (-1)**i to make the problem
self.py[np.isnan(self.py)] = self.speed_of_light # symmetric.
self.px[np.isnan(self.px)] = self.speed_of_light * (-1)**self._i
self.py[np.isnan(self.py)] = self.speed_of_light * (-1)**self._i
self._reflect_at_borders() self._reflect_at_borders()
self.x += self.dt * self.px self.x += self.dt * self.px