bmad-sim / bmad-ecosystem

Bmad simulation ecosystem for simulating high energy storage rings.
https://www.classe.cornell.edu/bmad/
7 stars 13 forks source link

`MATCH` with `delta_time = 1, matrix=identity` causes a error #998

Closed ChristopherMayes closed 1 month ago

ChristopherMayes commented 1 month ago

I would like to mimic a physical time shift. The manual says:

_The delta_time parameter adds a constant to the particle’s time. This will also affect the z phase space coordinate through Eq. (15.28) and the transfer map though the element. If delta_time is zero, the transfer map through the element will be the M matrix as discussed above. With a finite delta_time, the transfer map will be different from M. The order of operations, is the effect of delta_time is applied first and the linear transformation above is applied afterwards. Since using match_twiss or match_orbit with a finite deltatime can be confusing, such a situation is not allowed. Use two separate match elements if needed.

so matrix=identity should be clear.

lat.bmad:

beginning[beta_a] = 10
beginning[beta_b] = 10

beginning[e_tot] = 100e6
parameter[geometry] = open

match1: match, delta_time = 1, matrix=identity

lat: line = (match1)

use, lat
tao -lat lat.bmad
[MESSAGE | 2024-JUN-05 20:20:30] tao_init:
  OpenMP active with number of threads: 12
[FATAL | 2024-JUN-05 20:20:30] lat_sanity_check:
  ELEMENT: MATCH1 (1)
  WHICH IS A MATCH ELEMENT HAS A BETA_A1 OR BETA_B1 THAT IS NOT POSITIVE.
[FATAL | 2024-JUN-05 20:20:30] lat_sanity_check:
  ELEMENT: MATCH1 (1)
  WHICH IS A MATCH ELEMENT HAS A BETA_A0 OR BETA_B0 THAT IS NOT POSITIVE.
[FATAL | 2024-JUN-05 20:20:30] tao_init_lattice:
  PARSER ERROR DETECTED FOR UNIVERSE: 1
  EXITING...
DavidSagan commented 1 month ago

Fixed.