Skip to content

Commit

Permalink
Small fixes: update time simulation parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
fuodorov committed Aug 7, 2024
1 parent c8d1888 commit f802a12
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions redpic/solver/red.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,10 @@ def _track(self, *, n_files: int = cfg.DEFAULT_TRACK_SAVE_N_FILES) -> None:
z_start = self.acc.z_start
z_stop = self.acc.z_stop
dz = self.acc.dz
dt = dz / const.c
t_max = (z_stop - z_start) / const.c

min_beta = min(beam.beta for beam in self.beams)
dt = dz / min_beta / const.c
t_max = (z_stop - z_start) / min_beta / const.c

Y = np.transpose(np.concatenate([beam.df.to_numpy() for beam in self.beams]))
Y[2] = Y[2] + z_start - max(Y[2]) # set initial beam position
Expand Down

0 comments on commit f802a12

Please sign in to comment.