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

Backwards time tracking needed #331

Open DavidSagan opened 1 year ago

DavidSagan commented 1 year ago

For the space charge calc, to track a bunch from constant t to constant s or vice versa requires backwards time tracking.

DavidSagan commented 1 year ago

Problem areas at this point in time:

"SAD_MULT2: Bmad_Standard-Merit"             ABS 1E-13  7.5848320000E-04
"SBEND1: Bmad_Standard-Merit"             ABS 1E-13  1.2946305773E-06
"LCAVITY1: Bmad_Standard-Merit"             ABS 1E-13  1.2381885501E-06
DavidSagan commented 1 year ago

@ColwynGulliford: Attached is a modified space_charge_mod.f90 file. If you want to test if this solves your problem, update to the latest bmad and use the attached file in place of the one in bmad/space_charge. Otherwise this will wait until Ningdong gets back.

@ChristopherMayes

space_charge_mod.zip

ColwynGulliford commented 1 year ago

Will report shortly.

ColwynGulliford commented 1 year ago

I tried this but get thousands of errors, all of the form:

[ERROR | 2023-MAR-21 12:01:30] track1:
    STARTING ORBIT NOT PROPERLY INITIALIZED! [NEEDS AN INIT_COORD CALL?]
    TRACKING THROUGH ELEMENT: MG.PIP03#2 (22)
[ERROR | 2023-MAR-21 12:01:30] track1:
    STARTING ORBIT NOT PROPERLY INITIALIZED! [NEEDS AN INIT_COORD CALL?]
    TRACKING THROUGH ELEMENT: MG.MAR.END (23)
[ERROR | 2023-MAR-21 12:01:30] track1:
    STARTING ORBIT NOT PROPERLY INITIALIZED! [NEEDS AN INIT_COORD CALL?]

This happens after going to my bmad directory, doing "svn update *", and then replacing the file with the one you provide. I then compile.

DavidSagan commented 1 year ago

@ColwynGulliford Please post your input files. Thanks.

ColwynGulliford commented 1 year ago

mwe.tgz

ColwynGulliford commented 1 year ago

Btw, I just came back to the machine I was testing that on, and I had a warning about "Out of Memory", I think due to the above issue. In order to get back to normal I had to force quit the terminal Tao was running in (it was till printing those error messages).

DavidSagan commented 1 year ago

@ColwynGulliford Fixed these problems. Please update to the latest code and test.