12
Acceleration issue in PTC-Orbit debugged E.Benedetto Space Charge meeting, 29/8/2013

Acceleration issue in PTC-Orbit debugged

  • Upload
    nariko

  • View
    34

  • Download
    0

Embed Size (px)

DESCRIPTION

Acceleration issue in PTC-Orbit debugged. E.Benedetto Space Charge meeting, 29/8/2013. Outline. The issue The proposed solution Examples Influence on our (PSB) simulations. The issue. - PowerPoint PPT Presentation

Citation preview

Page 1: Acceleration issue in PTC-Orbit debugged

Acceleration issue in PTC-Orbit debugged

E.BenedettoSpace Charge meeting, 29/8/2013

Page 2: Acceleration issue in PTC-Orbit debugged

Outline

• The issue• The proposed solution• Examples• Influence on our (PSB) simulations

Page 3: Acceleration issue in PTC-Orbit debugged

The issue

• PTC was not communicating to ORBIT the increase of energy (momentum, beta, gamma, etc..) imposed through the PTC RF tables.

– How we noticed it ( Vincenzo’s presentation 18/7/2013):• showAccelerate(fio) (pure Orbit command) output not showing

increase of Energy and Beta– Still had the doubt (=hope) it was just a wrong output…

Page 4: Acceleration issue in PTC-Orbit debugged

PTC-ORBIT issues for PSB simulations - V. Forte – E. Benedetto – M. Martini - S.c. meeting (18/07/2013)

• Acceleration issues: Orbit seems to not recognize the acceleration imposed through PTC RF tables

showaccelerate(fio)

Page 5: Acceleration issue in PTC-Orbit debugged

The proposed solution

• Changes in the PTC source file Sq_orbit_ptc.f90 two subroutines:– ORBIT_up_grade_mag: called every turn before entering the RF

cavity to update the RF freq. (for the new BETA0) and where the new revolution freq. is passed to Orbit.

– energize_ORBIT_lattice: called at the very beginning to set the correct RF cavity freq. (and revolution freq.)

• The proposal is to modify at these 2 location and pass to Orbit not only the new revolution frequency, but also the new energy, momentum, beta, gamma, etc..

Page 6: Acceleration issue in PTC-Orbit debugged

subroutine energize_ORBIT_lattice(t) implicit none real(dp), optional :: t type(fibre), pointer :: p type(work) werk,travail real(dp) e_in,t0,freqs integer i logical found

found=.false. freqs=1.e38_dp werk=0 travail=0 t0=x_orbit_sync(6) ! read from the initial_settings file and multiplied by clight if(present(t)) t0=t if(fill_patch) then write(6,*) " filling patches with t= x0 from main program " t0=t0_main endif write(6,*) "energize at time ", t0,t0/clight write(6,*) "Initial Frequency of First Cavity", paccfirst%mag%c4%freq

call find_acc_energy(paccfirst,t0,e_in,my_true) ! new ! call find_acc_energy(paccfirst,x_orbit_sync(6),e_in,.false.) call find_energy(werk,kinetic=e_in)

p=>paccfirst%parent_layout%start do i=1,paccfirst%parent_layout%n travail=p if(p%mag%kind==kind4) then p%mag%c4%freq = p%mag%c4%freq*werk%beta0/travail%beta0 p%magp%c4%freq = p%mag%c4%freq

if(p%mag%c4%freq<freqs)then

freqs=p%mag%c4%freq found=.true. endif call find_acc_energy(paccfirst,t0,e_in,my_true) !new endif p=werk p=>p%next enddo if(freqs/=0.and.found) then my_ORBIT_LATTICE%ORBIT_OMEGA=twopi*freqs/CLIGHT

! EB beginning - added by Elena Benedetto - to have correct energy already at the beginning my_ORBIT_LATTICE%ORBIT_P0C=werk%P0C my_ORBIT_LATTICE%ORBIT_kinetic=werk%kinetic my_ORBIT_LATTICE%orbit_beta0=werk%beta0 my_ORBIT_LATTICE%orbit_brho=werk%brho my_ORBIT_LATTICE%orbit_energy=werk%energy my_ORBIT_LATTICE%orbit_gamma=1.0_dp/werk%gamma0i! EB end - added by Elena Benedetto

else write(6,*) " cavity with frequency problems ", freqs,found stop endif write(6,*) "Final Frequency of First Cavity", paccfirst%mag%c4%freq write(6,*) "Initial and Final beta0 ",travail%beta0,werk%beta0 write(6,*) "Starting time of simulations =",t0/clight ," and kinetic energy =",my_ORBIT_LATTICE%ORBIT_kinetic

end subroutine energize_ORBIT_lattice

The same is done in the ORBIT_up_grade_mag subroutine

Page 7: Acceleration issue in PTC-Orbit debugged

Test #1: showAccelerate(fio) output

New: - Energy, beta0

are updated- Elepsed time

takes into account the beta0 increase

Old: - Energy, beta0

stay constant- Elapsed time

increases linearly with #turns

Same job, with the new compiled version, vs. the old one, i.e. PTC11012012-ORBIT10

Page 8: Acceleration issue in PTC-Orbit debugged

Test #2: SpaceCharge diagnosticsSame job, with the new compiled version, vs. the old one, i.e. PTC11012012-ORBIT10

New: - Perveance/l

decreasing

Old: - Perveance/l

constant

Perveance ~ l/(b2 g3) ~ It can be seen as the “coefficient” of the space charge force

Page 9: Acceleration issue in PTC-Orbit debugged

Implications for PSB simulations

• d(Brho)/dt=10 Tm/s

0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.020.16

0.165

0.17

0.175

0.18

0.185

0.19

0.195

Ctime [s]

Ene

rgy

[GeV

]

0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.020.7

0.72

0.74

0.76

0.78

0.8

0.82

Ctime [s]

bg2

PTC-ORBIT issues for PSB simulations - V. Forte – E. Benedetto – M. Martini - S.c. meeting (18/07/2013)

Page 10: Acceleration issue in PTC-Orbit debugged

Same job, with the new compiled version, vs. the old one, i.e. PTC11012012-ORBIT10

Horizontal emittance Vertical emittance

# turns # turns

Implications for PSB simulations

• In 7000 turns (d(Brho)/dt=10 Tm/s):– Energy: 160MeV 170.9 MeV– Beta: 0.5197 0.533– Perveance/l/rp ~A*1/(b2 g3): 1.064 1.154

Page 11: Acceleration issue in PTC-Orbit debugged

FINAL_SETTINGS issue

• Small differences (with acceleration) between:1) Elapsed time in Orbit diagnostics (e.g. showAccelerate(fio))2) FINAL_SETTINGS.txt file if only 1 long simulation3) FINAL_SETTINGS.txt file resulting from “continuous tracking”

• Differences between 1) and 2,3) understood: “Orbit time” is simply the sum over #turns of (2pR/bc)

• But 2) and 3) should be exactly the same!!!– 3) getting closer to 1) for jobs of 1turn each– See example next page

Page 12: Acceleration issue in PTC-Orbit debugged

FINAL_SETTINGS issue