moved from float16 to float32

This commit is contained in:
Daniel Knüttel 2019-07-30 09:45:28 +02:00
parent a99b3ff253
commit 3555cc13bb

View File

@ -28,13 +28,13 @@ dt = 0.1
c[-1] = dt c[-1] = dt
# Initial positions. # Initial positions.
x_coords = np.random.uniform(borders_x[0] / spawn_restriction, borders_x[1] / spawn_restriction, n_particles).astype(np.float16) x_coords = np.random.uniform(borders_x[0] / spawn_restriction, borders_x[1] / spawn_restriction, n_particles).astype(np.float32)
y_coords = np.random.uniform(borders_y[0] / spawn_restriction, borders_y[1] / spawn_restriction, n_particles).astype(np.float16) y_coords = np.random.uniform(borders_y[0] / spawn_restriction, borders_y[1] / spawn_restriction, n_particles).astype(np.float32)
# Initial momenta are 0. # Initial momenta are 0.
x_momenta = np.zeros(n_particles, dtype=np.float16) x_momenta = np.zeros(n_particles, dtype=np.float32)
y_momenta = np.zeros(n_particles, dtype=np.float16) y_momenta = np.zeros(n_particles, dtype=np.float32)
@ -57,9 +57,9 @@ brown = BrownIterator(-1, c # Max iterations, simulation parameters.
, x_coords, y_coords , x_coords, y_coords
, y_momenta, y_momenta , y_momenta, y_momenta
# The boundary condition: reflect at the borders, # The boundary condition: reflect at the borders,
, borders_x, borders_y #, borders_x, borders_y
# or just let propagate to infinity. # or just let propagate to infinity.
#, [], [] , [], []
# Let the border dampen the system, border_dampening < 1 => energy is absorbed. # Let the border dampen the system, border_dampening < 1 => energy is absorbed.
, border_dampening=1 , border_dampening=1
, dt=dt) , dt=dt)