bmad-sim / bmad-ecosystem

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

Large discrepancy for r56 in WIGGLER elements for different tracking methods #677

Closed ChristopherMayes closed 10 months ago

ChristopherMayes commented 11 months ago

With this lattice, I see large differences in r56 for various mat6_calc_methods.

It seems that bmad_standard does not consider b_max.

lat.bmad:


no_digested
beginning[beta_a] = 10
beginning[beta_b] = 10
parameter[e_tot] = 100e6
parameter[geometry] = open

n_period = 87
L_period = 0.039
w1: wiggler,
        L_period = L_period,
        n_period = n_period,
        b_max = 1,
        L = n_period * L_period

lat: line = (w1)

use, lat
Tao: set ele * mat6_calc_method = bmad_standard
[INFO] tao_set_elements_cmd:
    Note: 2 elements (out of 3) set.

Tao: sho mat
From: BEGINNING
To:   END
Symplectic Error:  8.93E-14

     1.00000000     3.39300000     0.00000000     0.00000000     0.00000000     0.00000000   :  0.00000000E+00
     0.00000000     1.00000000     0.00000000     0.00000000     0.00000000     0.00000000   :  0.00000000E+00
     0.00000000     0.00000000     0.61408585     0.37230365     0.00000000     0.00000000   :  0.00000000E+00
     0.00000000     0.00000000    -1.67309285     0.61408585     0.00000000     0.00000000   :  0.00000000E+00
     0.00000000     0.00000000     0.00000000     0.00000000     1.00000000     0.00008860   :  0.00000000E+00
     0.00000000     0.00000000     0.00000000     0.00000000     0.00000000     1.00000000   :  0.00000000E+00

Tao: set ele * mat6_calc_method = symp_lie_ptc
[INFO] tao_set_elements_cmd:
    Note: 2 elements (out of 3) set.

Tao: sho mat
From: BEGINNING
To:   END
Symplectic Error:  4.88E-15

     1.00000000     3.39388876     0.00000000     0.00000000     0.00000000     0.00000000   : -3.53477521E-15
     0.00000000     1.00000000     0.00000000     0.00000000     0.00000000     0.00000000   : -1.36609474E-15
     0.00000000     0.00000000     0.58966736     0.37937367     0.00000000     0.00000000   :  0.00000000E+00
     0.00000000     0.00000000    -1.71939292     0.58966736     0.00000000     0.00000000   :  0.00000000E+00
     0.00000000     0.00000000     0.00000000     0.00000000     1.00000000     0.00068115   : -2.48596482E-06
     0.00000000     0.00000000     0.00000000     0.00000000     0.00000000     1.00000000   :  0.00000000E+00

Tao: set ele * mat6_calc_method = symp_lie_bmad
[INFO] tao_set_elements_cmd:
    Note: 1 elements (out of 3) set.

Tao: sho mat
From: BEGINNING
To:   END
Symplectic Error:  7.22E-15

     1.00000000     3.39300000     0.00000000     0.00000000     0.00000000    -0.00000000   :  3.33567555E-15
     0.00000000     1.00000000     0.00000000     0.00000000     0.00000000     0.00000000   : -4.56165377E-13
     0.00000000     0.00000000     0.59030389     0.37916351     0.00000000     0.00000000   :  0.00000000E+00
     0.00000000     0.00000000    -1.71836503     0.59030389     0.00000000     0.00000000   :  0.00000000E+00
     0.00000000    -0.00000000     0.00000000     0.00000000     1.00000000     0.00068092   : -2.42778855E-06
     0.00000000     0.00000000     0.00000000     0.00000000     0.00000000     1.00000000   :  0.00000000E+00
DavidSagan commented 10 months ago

Problem is in the bmad_standard tracking. Working on a fix...

DavidSagan commented 10 months ago

Fixed.