Generation of the bunch

Moderators: cyao, michael_borland

Post Reply
simona.bettoni
Posts: 42
Joined: 06 Jul 2011, 03:14

Generation of the bunch

Post by simona.bettoni » 10 Mar 2022, 08:36

Dear all,
I did some tracking simulations along a linac using bunched_beam. My line is a FODO with some RF cavities, so I computed the optics to have periodic beta and alfa, and all was working.
Now I would like to simulate the same line, but using sdds_beam, because I can have a better representation of the beam longitudinal phase space.
For the optics I used sddsmatchtwiss from the distribution at the entrance of my line:
sddsmatchtwiss elegant_distr.sdds distr_matched.sdds -xPlane=beta=2.398316000894728e+00,alpha=5.018045512606445e-01 -yPlane=beta=1.230486994429303e+01,alpha=-2.328639432567440e+00
This worked, because if I check with:
sddsprintout output.txt -col=betax -col=betay -col=alphax -col=alphay
I obtain:
betax betay alphax alphay
m m
--------------------------------------------------------------------------------
2.398587e+00 1.230482e+01 5.016243e-01 -2.328620e+00

My .ele file is (for the parts where I have the beam definition):
&sdds_beam
input = "distr_matched.sdds",
input_type = "elegant",
fiducialization_bunch = 1,
center_arrival_time = 1,
sample_interval = 5,
reuse_bunch = 0,
&end

The problem is that the Twiss parameters are not what I expect.

The questions are:
- Is there a simple way to match also the emittance of the distribution like it is done for the Twiss functions, or should I do a script to do it taking the particles? (I have a smaller emittance now that before, because some margin was added for the emittance);
- Any idea of why I see this strange behaviour of the optics? Did I misunderstand anything?

Thanks in advance for any feed-back, and have a nice day,
Simona.
Attachments
Capture_ok.PNG
Matched optics
Capture.PNG
Optics obtained with the procedure I described

michael_borland
Posts: 1796
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Generation of the bunch

Post by michael_borland » 15 Mar 2022, 16:46

Simona,

What beam distribution did you use as input to the sddsmatchtwiss command? In particular, since rf cavities are involved, does it have the right energy, energy spread, and duration for input into your beamline?

--Michael

simona.bettoni
Posts: 42
Joined: 06 Jul 2011, 03:14

Re: Generation of the bunch

Post by simona.bettoni » 17 Mar 2022, 10:38

Dear Michael,
I changed the distribution I applied the matchtwiss, and I repeated the full chain.

Now I used the command:
sddsmatchtwiss Linac1.out distr_matched.sdds -xPlane=beta=2.398316e+00,alpha=5.018045512606445e-01 -yPlane=beta=1.230487e+01,alpha=-2.328639e+00

When I analize the obtained beam:
sddsanalyzebeam distr_matched.sdds dd.txt
sddsprintout dd.txt -col=betax -col=betay -col=alphax -col=alphay
I obtain:
betax betay alphax alphay
m m
------------------------------------------------------------
2.396964e+00 1.229089e+01 5.015092e-01 -2.326002e+00

The numbers are slightly different. To be sure, I changed them in the file where I use bunched_beam to start from the same conditions, and verify that this was not the problem, and this is not. I still have different plots of the beta. I attach also this file: FCC_Linac2_bunch_0.ele.

I attach the distribution:
- Starting distribution: Linac1.out
- Obtained distribution: distr_matched.sdds
and the relevant file to do the run:
FCC_Linac2_bunch.ele, FCC_Linac2.lat, and the wake files: case using the distribution from the file
FCC_Linac2_bunch_0.ele, FCC_Linac2.lat, and the wake files: case using the .ele file to generate the distribution
Attachments
Files.7z
(2.47 MiB) Downloaded 90 times

michael_borland
Posts: 1796
Joined: 19 May 2008, 09:33
Location: Argonne National Laboratory
Contact:

Re: Generation of the bunch

Post by michael_borland » 18 Mar 2022, 12:35

Simona,

The problem seems to be some confusion about filenames from several different runs. I made a few modification to your files and it works as expected. There is a mismatch that develops further down the beamline, but I suspect that is due to energy spread and chromatic effects.
betax.png
betay.png
Another small issue is that sddsanalyzebeam by default does not remove energy-betatron correlations when computing the beam beta functions. Adding the -correctedOnly option forces it to do that, showing that the sddsmatchtwiss operation works as expected.

Code: Select all

Nominal starting twiss functions
     betax          betay          alphax         alphay    
       m              m                                     
------------------------------------------------------------
  2.396964e+00   1.229089e+01   5.015092e-01  -2.326002e+00 
Beam starting twiss functions
     betax          betay          alphax         alphay    
       m              m                                     
------------------------------------------------------------
  2.396964e+00   1.229089e+01   5.015092e-01  -2.326002e+00 
--Michael
Attachments
example.tar
(10 KiB) Downloaded 88 times

simona.bettoni
Posts: 42
Joined: 06 Jul 2011, 03:14

Re: Generation of the bunch

Post by simona.bettoni » 23 Mar 2022, 04:03

Many thanks for your reply!
Have a nice day,
Simona.

Post Reply