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

Unexpected behavior with "show lattice -attribute rho" #286

Closed jsberg-bnl closed 2 years ago

jsberg-bnl commented 2 years ago
Tao> sho lat sbend::* -at rho -at g
# Universe 2. Values shown are for the Exit End of each Element:
# Index  name     key                      s       l         rho           g
      7  B0PF     Sbend                7.001   1.200  2.4254E+02 -0.0000E+00
     11  B0APF    Sbend                8.502   0.600  2.4254E+02 -0.0000E+00
     25  B1PF     Sbend               20.077   3.000  2.4254E+02 -0.0000E+00
     29  B1APF    Sbend               22.078   1.500  2.4254E+02  0.0000E+00
     40  B2PF     Sbend               42.977   4.400  2.4254E+02  5.6285E-03
     60  YO5_DH5  Sbend               82.398   8.698  2.4254E+02  4.1230E-03
     74  B3PF     Sbend               93.226   4.400  2.4254E+02  5.0621E-03
    105  YO5_DH8  Sbend              139.128   9.441  2.4254E+02  4.1230E-03
    117  YO5_DH9  Sbend              153.954   2.949  2.4254E+02  4.1230E-03
    131  YO5_DH10 Sbend              168.773   9.441  2.4254E+02  4.1230E-03
    145  YO5_DH11 Sbend              183.601   9.441  2.4254E+02  4.1230E-03
# Index  name     key                      s       l         rho           g
# Universe 2. Values shown are for the Exit End of each Element:
Tao> sho value ele::b2pf[rho]
     1.7766843393137583E+02
DavidSagan commented 2 years ago

@jsberg-bnl I'm not seeing this but I am only using one universe. Can you send me your input files? Thanks.

jsberg-bnl commented 2 years ago

Easiest is to grab and unpack a tarball of https://github.com/jsberg-bnl/EIC-HSR/releases/tag/220921a, run tao, then sho lat -uni 2 sbend::* -at g -at rho

jsberg-bnl commented 2 years ago

Ah, I just figured out what was going on. I use symbol_import, and there's a rho symbol in the file. Feel free to call it "user deserves what they get."

jsberg-bnl commented 2 years ago

And there's an easy workaround

Tao> sho lat -uni 2 sbend::* -at g -at ele::#[rho]
# Universe 2. Values shown are for the Exit End of each Element:
# Index  name     key                      s       l           g ele::#[rho]
      7  B0PF     Sbend                7.001   1.200 -0.0000E+00  0.0000E+00
     11  B0APF    Sbend                8.502   0.600 -0.0000E+00  0.0000E+00
     25  B1PF     Sbend               20.077   3.000 -0.0000E+00  0.0000E+00
     29  B1APF    Sbend               22.078   1.500  0.0000E+00  0.0000E+00
     40  B2PF     Sbend               42.977   4.400  5.6285E-03  1.7767E+02
     60  YO5_DH5  Sbend               82.398   8.698  4.1230E-03  2.4254E+02
     74  B3PF     Sbend               93.226   4.400  5.0621E-03  1.9754E+02
    105  YO5_DH8  Sbend              139.128   9.441  4.1230E-03  2.4254E+02
    117  YO5_DH9  Sbend              153.954   2.949  4.1230E-03  2.4254E+02
    131  YO5_DH10 Sbend              168.773   9.441  4.1230E-03  2.4254E+02
    145  YO5_DH11 Sbend              183.601   9.441  4.1230E-03  2.4254E+02